Lead #3490

Company
Genix Healthcare Dental Clinic (Marske)
Website
https://genixhealthcare.com
Best Contact
Email
info@genixhealthcare.com (generic)

Override

Captured Pages

Emails:
View text

                    
View text

                    
View text

                    
Emails:
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact .header--spacing { display:none; } main > section:first-of-type > div:first-child { padding-top: calc(var(--header-height) * 1px); } Our Dentists Filter by clinic All ClinicsAlnwickBlackpoolCirencesterEast ParkGarforthGloucesterHuddersfieldHullMarket WeightonMarskeMiddlesbroughMorecambeStokeTickhillWhitley Bay Dentist Ezeldin Mohamed Dentist Fani Kampouridou Dentist Imran Afzal Dentist Jonathan Baker Dentist Kirstin Miller Dentist Mara Nikolova Dentist Mohammad Ali Malik Dentist Raquel De Lima Baker Dentist Todorov Kostadin Dentist Abdul Khaliq Dentist Todor Hristov Dentist Shazia Afzal Dentist Simona Alexandru Dentist Mustafa Almusawi Dentist Emma Paice Dentist Beata Biniek Dentist Anil Mascal Dentist Silviya Spasova Dentist Anisha Nazir Dentist Andreas Charalampous Dentist Robert Middleton Dentist Saad Osman Dentist Mohammed Hindawi Dentist Sanaa Sohail Dentist Liselle Braganza Dentist Eleanor Thomas Dentist Irina Tsepelin Dentist Iustina-Maria Vladescu Dentist Marta Treffny Dentist Syed Maududi Dentist Mitchelle Bruno Lopes Dentist Ushna Gafoor Dentist Mostafa Darwish Dentist Metaxenia Pouliou Dentist Alex Raytchev Dentist Zaineb Rahman Dentist Sarah Odanye Dentist Maria Asimakopolou Dentist Bilal Zameer Dentist Khushboo Thakore Dentist Rachel Roberts Dentist Aditi Padbidri Dentist Bavadharini Moovenden Dentist Asiya Zaman Dentist Simon Khabra Dentist Zainab Sheikh Dentist Atul Sharma Dentist Rowaida Ahmed Dentist Ameen Fairooz Dentist Santila Limbu Dentist Saleha Yasir Dentist Raquel Maza Dentist Prasaba Sharma Dentist Sharieef Mohamed Dentist Gionis Vangeli Dentist Cameron Law Dentist Diana Omar Dentist Amandeep Kaur Dentist Sophia Rizvi Dentist Sherin Varghese Dentist Risha Hussain Dentist Naveed Hussain Dentist Alexandra Dimogianni Dentist Anda Pirvan Dentist Alex Ha PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();
Emails:
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact About us We don't just treat teeth, we nurture confidence. .header--spacing { display:none; } main > section:first-of-type > div:first-child { padding-top: calc(var(--header-height) * 1px); } Our Approach At Genix Healthcare, our approach is centered around a commitment to delivering personalised, patient-focused care that goes beyond traditional healthcare. We believe in treating every patient with empathy, respect, and the highest standard of clinical excellence. Our holistic approach integrates advanced medical technologies with a compassionate, human touch, ensuring that every aspect of your health is considered and cared for. Our Clinics We are now 15-practices-strong, and our clinics are spread across the UK. Our practices are well-equipped, and we invest in technology and infrastructure updates with a long-term perspective on business sustainability. With our experience in dentistry, we know what dentists need in order to do their best for their patients: to feel in-charge of their practice. This is why, at Genix, we strive to make our clinicians feel that their surgery at their Genix Practice is their ‘own clinic within our clinic’. Now that you are with us, we would like you to know that you and we share a common objective: personal growth through provision of exceptional patient care! Find your local clinic Est. 2005 Genix Healthcare was started in 2005 with one overarching goal: to fill the gap in dentistry due to the shortage of dental care professionals on the NHS. Over the last decade-and-a-half, our understanding of the dental profession at Genix Healthcare has expanded, as has the spectrum of dental care provided at our practices. Our clinics now deliver a rich variety of dental treatments, enhancing the fundamentals of NHS Dentistry with Private services. Explore Treatments 0 Modern clinics 0 Expert Dentists 0 Patients seen daily Meet some of our dentists Dentist Todor Hristov , Alnwick Dentist Atul Sharma , Cirencester, Gloucester Dentist Risha Hussain , Garforth, Marske Dentist Emma Paice , Whitley Bay Dentist Naveed Hussain , Garforth Customer Testimonials Excellent treatment from the dentist and the Hygenist. Excelled my expectations. Thank you. TW Trevor Wright, Garforth Verfied customer Lovely and clean and receptionist very efficient .. Dentist was lovely with my daughter highly recommend. LC Laura Cousins, Gloucester Verfied customer I think these guys are great. I needed an emergency filling and they got me in as soon as they could. The staff are friendly and helpful and the dentist I saw (see) is lovely and puts me at ease. TC Tracy Carr, Market Weighton Verfied customer First-class, expert treatment from an amazing team! SS Simon SB, Tickhill Verfied customer I'm 75 years old and this is the best dentist I've ever been to the dentist maid me feel so relaxed so pleased thank you. JM John Mucklet, Blackpool Verfied customer I had a dental appointment yesterday, to start with I was welcomed and signed in by warm and friendly reception team, 2 very lovely ladies with bright smiles. Then I seen Tomas Liach. He was absolutely wonderful. EJ Emma Juggins, Cirencester Verfied customer Great service, Beata, was extremely professional and explained the procedure with care. Would strongly recommend this practice. PW Peter Whalen, Whitley Bay Verfied customer Excellent care from the staff at Genix. This is my second visit and Mustafa is so friendly and puts you at your ease. He has done an excellent job in particular on capping my deep root filling. Would recommend Genix to anyone. SH Stephen Helliwell, Whitley Bay Verfied customer As ever, always a professional and caring service. I have never had a problem and they have always been there in emergency situations. I have been with Genix for many years and would highly recommend them. GD Grantos Davide, Cirencester Verfied customer PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();
Emails: info@genixhealthcare.com
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact Contact us Select your location below to see there phone number, opening times, and address. .header--spacing { display:none; } main > section:first-of-type > div:first-child { padding-top: calc(var(--header-height) * 1px); } Alnwick Contact us 01665 606127 Unit 10, Cawledge Business Park, 10 Linnet Ct, AlnwickNE66 2GD Get Directions Opening Times Monday 8:30am – 6pm Tuesday 8:30am – 6pm Wednesday 8:30am – 6pm Thursday 8:30am – 6pm Friday 9am – 5pm Saturday Closed Sunday Closed Blackpool Contact us 01253 747427 Newton Dr, Blackpool FY3 8NX Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 5pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Cirencester Contact us 01285 654895 Dugdale Rd, Cirencester GL7 2DA Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 10am - 2pm Sunday Closed East Park Contact us 0113 248 0589 5-7 E Park Rd, Leeds LS9 9JD Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Garforth Contact us 0113 286 6133 54 Main St, Garforth, Leeds LS25 1AA Get Directions Opening Times Monday 8:45am - 5pm Tuesday 8:45am - 7:30pm Wednesday 8:45am - 7:30pm Thursday 8:45am - 5pm Friday 8:45am - 4pm Saturday 8:30am - 2pm Sunday Closed Gloucester Contact us 01452 303983 Lister House, Station Rd, Gloucester GL1 1DH Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 9am - 2pm Sunday Closed Huddersfield Contact us 01484 545466 Britannia Buildings, St George's Square, Huddersfield HD1 1LG Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 6:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Hull Contact us 01482 574940 360 Anlaby Rd, Hull HU3 6NS Get Directions Opening Times Monday 9am - 7pm Tuesday 9am - 7pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Market Weighton Contact us 01430 879171 4-6 Southgate, Market Weighton, York YO43 3AG Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 5:30pm Wednesday 8am - 8pm Thursday 8am - 8pm Friday 8:30am - 5:30pm Saturday 9:30am - 2:30pm Sunday Closed Marske Contact us 01642 484662 16 The Wynd, Marske-by-the-Sea, Redcar TS11 7LA Get Directions Opening Times Monday 8am - 6pm Tuesday 8am - 6pm Wednesday 8am - 6pm Thursday 8am - 6pm Friday 8am - 5:15pm Saturday Closed Sunday Closed Middlesbrough Contact us 01642 246207 222 Linthorpe Rd, Middlesbrough TS1 3QW Get Directions Opening Times Monday Closed Tuesday 8:30am - 6:30pm Wednesday 8:30am - 5:15pm Thursday 8:30am - 5:15pm Friday 8:30am - 5:15pm Saturday Closed Sunday Closed Morecambe Contact us 01524 239435 338 -342 Lancaster Rd, Torrisholme, MorecambeLA4 6ND Get Directions Opening Times Monday 8am - 6pm Tuesday 9am - 7pm Wednesday 8am - 6pm Thursday 9am - 6pm Friday 9am - 6pm Saturday 9am - 2pm Sunday Closed Stoke Contact us 0330 123 9134 26 Liverpool Rd, Stoke-on-Trent ST4 1AT Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 5pm Wednesday 8:30am - 5pm Thursday 8:30am - 5pm Friday 8:30am - 5pm Saturday Closed Sunday Closed Tickhill Contact us 01302 742361 12 Northgate, Tickhill, DoncasterDN11 9HY Get Directions Opening Times Monday 9am - 6pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5pm Saturday Closed Sunday Closed Whitley Bay Contact us 0191 251 0155 271, 275 Whitley Rd, Whitley Bay NE26 2SS Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 7pm Wednesday 9am - 7pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed .faq--item.accordion__item { border-color: #ddd; } .border { border: 1px solid #ddd; } Alnwick Blackpool Cirencester East Park Garforth Gloucester Huddersfield Hull Market Weighton Marske Middlesbrough Morecambe Stoke Tickhill Whitley Bay Alnwick 01665 606127 Unit 10, Cawledge Business Park, 10 Linnet Ct, AlnwickNE66 2GD Get Directions Opening Times Monday 8:30am – 6pm Tuesday 8:30am – 6pm Wednesday 8:30am – 6pm Thursday 8:30am – 6pm Friday 9am – 5pm Saturday Closed Sunday Closed Blackpool 01253 747427 Newton Dr, Blackpool FY3 8NX Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 5pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Cirencester 01285 654895 Dugdale Rd, Cirencester GL7 2DA Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 10am - 2pm Sunday Closed East Park 0113 248 0589 5-7 E Park Rd, Leeds LS9 9JD Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Garforth 0113 286 6133 54 Main St, Garforth, Leeds LS25 1AA Get Directions Opening Times Monday 8:45am - 5pm Tuesday 8:45am - 7:30pm Wednesday 8:45am - 7:30pm Thursday 8:45am - 5pm Friday 8:45am - 4pm Saturday 8:30am - 2pm Sunday Closed Gloucester 01452 303983 Lister House, Station Rd, Gloucester GL1 1DH Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 9am - 2pm Sunday Closed Huddersfield 01484 545466 Britannia Buildings, St George's Square, Huddersfield HD1 1LG Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 6:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Hull 01482 574940 360 Anlaby Rd, Hull HU3 6NS Get Directions Opening Times Monday 9am - 7pm Tuesday 9am - 7pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Market Weighton 01430 879171 4-6 Southgate, Market Weighton, York YO43 3AG Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 5:30pm Wednesday 8am - 8pm Thursday 8am - 8pm Friday 8:30am - 5:30pm Saturday 9:30am - 2:30pm Sunday Closed Marske 01642 484662 16 The Wynd, Marske-by-the-Sea, Redcar TS11 7LA Get Directions Opening Times Monday 8am - 6pm Tuesday 8am - 6pm Wednesday 8am - 6pm Thursday 8am - 6pm Friday 8am - 5:15pm Saturday Closed Sunday Closed Middlesbrough 01642 246207 222 Linthorpe Rd, Middlesbrough TS1 3QW Get Directions Opening Times Monday Closed Tuesday 8:30am - 6:30pm Wednesday 8:30am - 5:15pm Thursday 8:30am - 5:15pm Friday 8:30am - 5:15pm Saturday Closed Sunday Closed Morecambe 01524 239435 338 -342 Lancaster Rd, Torrisholme, MorecambeLA4 6ND Get Directions Opening Times Monday 8am - 6pm Tuesday 9am - 7pm Wednesday 8am - 6pm Thursday 9am - 6pm Friday 9am - 6pm Saturday 9am - 2pm Sunday Closed Stoke 0330 123 9134 26 Liverpool Rd, Stoke-on-Trent ST4 1AT Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 5pm Wednesday 8:30am - 5pm Thursday 8:30am - 5pm Friday 8:30am - 5pm Saturday Closed Sunday Closed Tickhill 01302 742361 12 Northgate, Tickhill, DoncasterDN11 9HY Get Directions Opening Times Monday 9am - 6pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5pm Saturday Closed Sunday Closed Whitley Bay 0191 251 0155 271, 275 Whitley Rd, Whitley Bay NE26 2SS Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 7pm Wednesday 9am - 7pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed We're here to help If you have any questions or queries about treatments please get in touch and our team will get back to you with answers. Or call 0330 058 4485 Your Details Name * Email * Phone * Preferred callback time *Select...Morning: 9am-12pmAfternoon: 12pm-4pmEvening: 4pm-6pmPrefer email only Patient Type *Select...Existing PatientNew Patient Local Practice *Select...Not sureAlnwickBlackpoolCirencesterEast Park (Leeds)GarforthGloucesterHuddersfieldHullMarket WeightonMarskeMiddlesbroughMorecambeStokeTickhillWhitley Bay How can we help today Subject * Enquiry * Please sign me up for news and offers Genix Healthcare Ltd Head Office 0113 2244460 info@genixhealthcare.com Address 2 College Court Gildersome Leeds LS27 7WF United Kingdom PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();
Emails:
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact .header--spacing { display:none; } main > section:first-of-type > div:first-child { padding-top: calc(var(--header-height) * 1px); } Our Dentists Filter by clinic All ClinicsAlnwickBlackpoolCirencesterEast ParkGarforthGloucesterHuddersfieldHullMarket WeightonMarskeMiddlesbroughMorecambeStokeTickhillWhitley Bay Dentist Ezeldin Mohamed Dentist Fani Kampouridou Dentist Imran Afzal Dentist Jonathan Baker Dentist Kirstin Miller Dentist Mara Nikolova Dentist Mohammad Ali Malik Dentist Raquel De Lima Baker Dentist Todorov Kostadin Dentist Abdul Khaliq Dentist Todor Hristov Dentist Shazia Afzal Dentist Simona Alexandru Dentist Mustafa Almusawi Dentist Emma Paice Dentist Beata Biniek Dentist Anil Mascal Dentist Silviya Spasova Dentist Anisha Nazir Dentist Andreas Charalampous Dentist Robert Middleton Dentist Saad Osman Dentist Mohammed Hindawi Dentist Sanaa Sohail Dentist Liselle Braganza Dentist Eleanor Thomas Dentist Irina Tsepelin Dentist Iustina-Maria Vladescu Dentist Marta Treffny Dentist Syed Maududi Dentist Mitchelle Bruno Lopes Dentist Ushna Gafoor Dentist Mostafa Darwish Dentist Metaxenia Pouliou Dentist Alex Raytchev Dentist Zaineb Rahman Dentist Sarah Odanye Dentist Maria Asimakopolou Dentist Bilal Zameer Dentist Khushboo Thakore Dentist Rachel Roberts Dentist Aditi Padbidri Dentist Bavadharini Moovenden Dentist Asiya Zaman Dentist Simon Khabra Dentist Zainab Sheikh Dentist Atul Sharma Dentist Rowaida Ahmed Dentist Ameen Fairooz Dentist Santila Limbu Dentist Saleha Yasir Dentist Raquel Maza Dentist Prasaba Sharma Dentist Sharieef Mohamed Dentist Gionis Vangeli Dentist Cameron Law Dentist Diana Omar Dentist Amandeep Kaur Dentist Sophia Rizvi Dentist Sherin Varghese Dentist Risha Hussain Dentist Naveed Hussain Dentist Alexandra Dimogianni Dentist Anda Pirvan Dentist Alex Ha PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();
Emails: info@genixhealthcare.com
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact Contact us Select your location below to see there phone number, opening times, and address. .header--spacing { display:none; } main > section:first-of-type > div:first-child { padding-top: calc(var(--header-height) * 1px); } Alnwick Contact us 01665 606127 Unit 10, Cawledge Business Park, 10 Linnet Ct, AlnwickNE66 2GD Get Directions Opening Times Monday 8:30am – 6pm Tuesday 8:30am – 6pm Wednesday 8:30am – 6pm Thursday 8:30am – 6pm Friday 9am – 5pm Saturday Closed Sunday Closed Blackpool Contact us 01253 747427 Newton Dr, Blackpool FY3 8NX Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 5pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Cirencester Contact us 01285 654895 Dugdale Rd, Cirencester GL7 2DA Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 10am - 2pm Sunday Closed East Park Contact us 0113 248 0589 5-7 E Park Rd, Leeds LS9 9JD Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Garforth Contact us 0113 286 6133 54 Main St, Garforth, Leeds LS25 1AA Get Directions Opening Times Monday 8:45am - 5pm Tuesday 8:45am - 7:30pm Wednesday 8:45am - 7:30pm Thursday 8:45am - 5pm Friday 8:45am - 4pm Saturday 8:30am - 2pm Sunday Closed Gloucester Contact us 01452 303983 Lister House, Station Rd, Gloucester GL1 1DH Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 9am - 2pm Sunday Closed Huddersfield Contact us 01484 545466 Britannia Buildings, St George's Square, Huddersfield HD1 1LG Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 6:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Hull Contact us 01482 574940 360 Anlaby Rd, Hull HU3 6NS Get Directions Opening Times Monday 9am - 7pm Tuesday 9am - 7pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Market Weighton Contact us 01430 879171 4-6 Southgate, Market Weighton, York YO43 3AG Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 5:30pm Wednesday 8am - 8pm Thursday 8am - 8pm Friday 8:30am - 5:30pm Saturday 9:30am - 2:30pm Sunday Closed Marske Contact us 01642 484662 16 The Wynd, Marske-by-the-Sea, Redcar TS11 7LA Get Directions Opening Times Monday 8am - 6pm Tuesday 8am - 6pm Wednesday 8am - 6pm Thursday 8am - 6pm Friday 8am - 5:15pm Saturday Closed Sunday Closed Middlesbrough Contact us 01642 246207 222 Linthorpe Rd, Middlesbrough TS1 3QW Get Directions Opening Times Monday Closed Tuesday 8:30am - 6:30pm Wednesday 8:30am - 5:15pm Thursday 8:30am - 5:15pm Friday 8:30am - 5:15pm Saturday Closed Sunday Closed Morecambe Contact us 01524 239435 338 -342 Lancaster Rd, Torrisholme, MorecambeLA4 6ND Get Directions Opening Times Monday 8am - 6pm Tuesday 9am - 7pm Wednesday 8am - 6pm Thursday 9am - 6pm Friday 9am - 6pm Saturday 9am - 2pm Sunday Closed Stoke Contact us 0330 123 9134 26 Liverpool Rd, Stoke-on-Trent ST4 1AT Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 5pm Wednesday 8:30am - 5pm Thursday 8:30am - 5pm Friday 8:30am - 5pm Saturday Closed Sunday Closed Tickhill Contact us 01302 742361 12 Northgate, Tickhill, DoncasterDN11 9HY Get Directions Opening Times Monday 9am - 6pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5pm Saturday Closed Sunday Closed Whitley Bay Contact us 0191 251 0155 271, 275 Whitley Rd, Whitley Bay NE26 2SS Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 7pm Wednesday 9am - 7pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed .faq--item.accordion__item { border-color: #ddd; } .border { border: 1px solid #ddd; } Alnwick Blackpool Cirencester East Park Garforth Gloucester Huddersfield Hull Market Weighton Marske Middlesbrough Morecambe Stoke Tickhill Whitley Bay Alnwick 01665 606127 Unit 10, Cawledge Business Park, 10 Linnet Ct, AlnwickNE66 2GD Get Directions Opening Times Monday 8:30am – 6pm Tuesday 8:30am – 6pm Wednesday 8:30am – 6pm Thursday 8:30am – 6pm Friday 9am – 5pm Saturday Closed Sunday Closed Blackpool 01253 747427 Newton Dr, Blackpool FY3 8NX Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 5pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Cirencester 01285 654895 Dugdale Rd, Cirencester GL7 2DA Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 10am - 2pm Sunday Closed East Park 0113 248 0589 5-7 E Park Rd, Leeds LS9 9JD Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Garforth 0113 286 6133 54 Main St, Garforth, Leeds LS25 1AA Get Directions Opening Times Monday 8:45am - 5pm Tuesday 8:45am - 7:30pm Wednesday 8:45am - 7:30pm Thursday 8:45am - 5pm Friday 8:45am - 4pm Saturday 8:30am - 2pm Sunday Closed Gloucester 01452 303983 Lister House, Station Rd, Gloucester GL1 1DH Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 7pm Wednesday 8:30am - 5:30pm Thursday 8:30am - 7pm Friday 8:30am - 5:30pm Saturday 9am - 2pm Sunday Closed Huddersfield 01484 545466 Britannia Buildings, St George's Square, Huddersfield HD1 1LG Get Directions Opening Times Monday 9am - 5:30pm Tuesday 9am - 5:30pm Wednesday 9am - 6:30pm Thursday 9am - 5:30pm Friday 9am - 5:30pm Saturday Closed Sunday Closed Hull 01482 574940 360 Anlaby Rd, Hull HU3 6NS Get Directions Opening Times Monday 9am - 7pm Tuesday 9am - 7pm Wednesday 9am - 5pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed Market Weighton 01430 879171 4-6 Southgate, Market Weighton, York YO43 3AG Get Directions Opening Times Monday 8:30am - 5:30pm Tuesday 8:30am - 5:30pm Wednesday 8am - 8pm Thursday 8am - 8pm Friday 8:30am - 5:30pm Saturday 9:30am - 2:30pm Sunday Closed Marske 01642 484662 16 The Wynd, Marske-by-the-Sea, Redcar TS11 7LA Get Directions Opening Times Monday 8am - 6pm Tuesday 8am - 6pm Wednesday 8am - 6pm Thursday 8am - 6pm Friday 8am - 5:15pm Saturday Closed Sunday Closed Middlesbrough 01642 246207 222 Linthorpe Rd, Middlesbrough TS1 3QW Get Directions Opening Times Monday Closed Tuesday 8:30am - 6:30pm Wednesday 8:30am - 5:15pm Thursday 8:30am - 5:15pm Friday 8:30am - 5:15pm Saturday Closed Sunday Closed Morecambe 01524 239435 338 -342 Lancaster Rd, Torrisholme, MorecambeLA4 6ND Get Directions Opening Times Monday 8am - 6pm Tuesday 9am - 7pm Wednesday 8am - 6pm Thursday 9am - 6pm Friday 9am - 6pm Saturday 9am - 2pm Sunday Closed Stoke 0330 123 9134 26 Liverpool Rd, Stoke-on-Trent ST4 1AT Get Directions Opening Times Monday 8:30am - 5pm Tuesday 8:30am - 5pm Wednesday 8:30am - 5pm Thursday 8:30am - 5pm Friday 8:30am - 5pm Saturday Closed Sunday Closed Tickhill 01302 742361 12 Northgate, Tickhill, DoncasterDN11 9HY Get Directions Opening Times Monday 9am - 6pm Tuesday 9am - 5:30pm Wednesday 9am - 5:30pm Thursday 9am - 5:30pm Friday 9am - 5pm Saturday Closed Sunday Closed Whitley Bay 0191 251 0155 271, 275 Whitley Rd, Whitley Bay NE26 2SS Get Directions Opening Times Monday 9am - 5pm Tuesday 9am - 7pm Wednesday 9am - 7pm Thursday 9am - 5pm Friday 9am - 5pm Saturday Closed Sunday Closed We're here to help If you have any questions or queries about treatments please get in touch and our team will get back to you with answers. Or call 0330 058 4485 Your Details Name * Email * Phone * Preferred callback time *Select...Morning: 9am-12pmAfternoon: 12pm-4pmEvening: 4pm-6pmPrefer email only Patient Type *Select...Existing PatientNew Patient Local Practice *Select...Not sureAlnwickBlackpoolCirencesterEast Park (Leeds)GarforthGloucesterHuddersfieldHullMarket WeightonMarskeMiddlesbroughMorecambeStokeTickhillWhitley Bay How can we help today Subject * Enquiry * Please sign me up for news and offers Genix Healthcare Ltd Head Office 0113 2244460 info@genixhealthcare.com Address 2 College Court Gildersome Leeds LS27 7WF United Kingdom PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact About us We don't just treat teeth, we nurture confidence. .header--spacing { display:none; } main > section:first-of-type > div:first-child { padding-top: calc(var(--header-height) * 1px); } Our Approach At Genix Healthcare, our approach is centered around a commitment to delivering personalised, patient-focused care that goes beyond traditional healthcare. We believe in treating every patient with empathy, respect, and the highest standard of clinical excellence. Our holistic approach integrates advanced medical technologies with a compassionate, human touch, ensuring that every aspect of your health is considered and cared for. Our Clinics We are now 15-practices-strong, and our clinics are spread across the UK. Our practices are well-equipped, and we invest in technology and infrastructure updates with a long-term perspective on business sustainability. With our experience in dentistry, we know what dentists need in order to do their best for their patients: to feel in-charge of their practice. This is why, at Genix, we strive to make our clinicians feel that their surgery at their Genix Practice is their ‘own clinic within our clinic’. Now that you are with us, we would like you to know that you and we share a common objective: personal growth through provision of exceptional patient care! Find your local clinic Est. 2005 Genix Healthcare was started in 2005 with one overarching goal: to fill the gap in dentistry due to the shortage of dental care professionals on the NHS. Over the last decade-and-a-half, our understanding of the dental profession at Genix Healthcare has expanded, as has the spectrum of dental care provided at our practices. Our clinics now deliver a rich variety of dental treatments, enhancing the fundamentals of NHS Dentistry with Private services. Explore Treatments 0 Modern clinics 0 Expert Dentists 0 Patients seen daily Meet some of our dentists Dentist Todor Hristov , Alnwick Dentist Atul Sharma , Cirencester, Gloucester Dentist Risha Hussain , Garforth, Marske Dentist Emma Paice , Whitley Bay Dentist Naveed Hussain , Garforth Customer Testimonials Excellent treatment from the dentist and the Hygenist. Excelled my expectations. Thank you. TW Trevor Wright, Garforth Verfied customer Lovely and clean and receptionist very efficient .. Dentist was lovely with my daughter highly recommend. LC Laura Cousins, Gloucester Verfied customer I think these guys are great. I needed an emergency filling and they got me in as soon as they could. The staff are friendly and helpful and the dentist I saw (see) is lovely and puts me at ease. TC Tracy Carr, Market Weighton Verfied customer First-class, expert treatment from an amazing team! SS Simon SB, Tickhill Verfied customer I'm 75 years old and this is the best dentist I've ever been to the dentist maid me feel so relaxed so pleased thank you. JM John Mucklet, Blackpool Verfied customer I had a dental appointment yesterday, to start with I was welcomed and signed in by warm and friendly reception team, 2 very lovely ladies with bright smiles. Then I seen Tomas Liach. He was absolutely wonderful. EJ Emma Juggins, Cirencester Verfied customer Great service, Beata, was extremely professional and explained the procedure with care. Would strongly recommend this practice. PW Peter Whalen, Whitley Bay Verfied customer Excellent care from the staff at Genix. This is my second visit and Mustafa is so friendly and puts you at your ease. He has done an excellent job in particular on capping my deep root filling. Would recommend Genix to anyone. SH Stephen Helliwell, Whitley Bay Verfied customer As ever, always a professional and caring service. I have never had a problem and they have always been there in emergency situations. I have been with Genix for many years and would highly recommend them. GD Grantos Davide, Cirencester Verfied customer PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();
Emails:
View text
↑ Back to top .scroll--to--top--container { position: fixed; padding: 30px; bottom: 0; left: 50%; z-index: 10; transform: translate(-50%, 100%); transition:all 0.3s ease; opacity:0; } .scroll--to--top--container.active { transform: translate(-50%, 0%); opacity:1; } About Clinics Treatments Results Referrals Dental Plans Contact Phone Us Book Online Search Close About Clinics Treatments Results Referrals Dental Plans Contact @media all and (min-width:1024px) {.header--spacing{display:none}} Real people. Real smile transformations. Book NowFind a clinic Excellent 2302 reviews on Spread the cost of your dental visits with our monthly membership plans Discover More Popular Treatments Discover More Clear Aligners Discover More Dental Implants Discover More Composite Bonding Discover More Smile Makeover Discover More Teeth Whitening Results Cosmetic dentists transforming smiles, improving lives Paul Dental Implants Susan BridgesClear Aligners Lewis Composite Bonding Lewis Dentures Start now Book a free consultation with our team today Book your consultation today at Genix Healthcare and start your smile makeover journey. Book Your Consultation About Genix Healthcare Genix Healthcare was started in 2005 with one overarching goal: to fill the gap in dentistry due to the shortage of dental care professionals on the NHS. Over the last decade-and-a-half, our understanding of the dental profession at Genix Healthcare has expanded, as has the spectrum of dental care provided at our practices. Our clinics now deliver a rich variety of dental treatments, enhancing the fundamentals of NHS Dentistry with Private services. About us Our Clinics 15 modern clinics Discover the 15 Genix Healthcare practices across the UK, where exceptional care, advanced treatments, and a commitment to your dental health are at the heart of everything we do. Find a clinic Start now Start your transformation today Book a Consultation PricingNHS Private Pricing Dental Plans Useful Information InformationOur Clinics Our Dentists Testimonials Referrals Blog TreatmentsAll Treatments Aesthetic Treatments General Dentistry Teeth Replacement Facial Aesthetics CompanyAbout us News Careers Acquisitions Contact us Plan terms and conditions Net Zero Policy Privacy Policy Cookies Policy Feedback Complaints Confidentiality © Genix Healthcare 2025 {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/genix\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} /* <![CDATA[ */ var relevanssi_rt_regex = /(&|\?)_(rt|rt_nonce)=(\w+)/g var newUrl = window.location.search.replace(relevanssi_rt_regex, '') history.replaceState(null, null, window.location.pathname + newUrl + window.location.hash) /* ]]> */ UTM Source: UTM Medium: UTM Campaign: UTM Term: UTM Content: UTM ID: .debug { display: none; } .admin-bar .debug { display: block; } // Retrieve the UTM user fields var userUtmSourceField = document.getElementById('user_utm_source'); var userUtmMediumField = document.getElementById('user_utm_medium'); var userUtmCampaignField = document.getElementById('user_utm_campaign'); var userUtmTermField = document.getElementById('user_utm_term'); var userUtmContentField = document.getElementById('user_utm_content'); var userUtmIdField = document.getElementById('user_utm_id'); // Select the UTM input fields that need to be populated var utmSourceField = document.getElementById('utm_source'); var utmMediumField = document.getElementById('utm_medium'); var utmCampaignField = document.getElementById('utm_campaign'); var utmTermField = document.getElementById('utm_term'); var utmContentField = document.getElementById('utm_content'); var utmIdField = document.getElementById('utm_id'); // Populate the UTM fields with values from the user input fields if (utmSourceField && userUtmSourceField) { utmSourceField.value = userUtmSourceField.value || ''; } if (utmMediumField && userUtmMediumField) { utmMediumField.value = userUtmMediumField.value || ''; } if (utmCampaignField && userUtmCampaignField) { utmCampaignField.value = userUtmCampaignField.value || ''; } if (utmTermField && userUtmTermField) { utmTermField.value = userUtmTermField.value || ''; } if (utmContentField && userUtmContentField) { utmContentField.value = userUtmContentField.value || ''; } if (utmIdField && userUtmIdField) { utmIdField.value = userUtmIdField.value || ''; } (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); /* ]]> */ /* <![CDATA[ */ var wpcf7 = { "api": { "root": "https:\/\/genixhealthcare.com\/wp-json\/", "namespace": "contact-form-7\/v1" } }; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/genixhealthcare.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ /* <![CDATA[ */ var consent_api = {"consent_type":"","waitfor_consent_hook":"","cookie_expiration":"30","cookie_prefix":"wp_consent","services":[]}; /* ]]> */ /* <![CDATA[ */ window.wc_order_attribution.params.consentCategory = "marketing"; /* ]]> */ /* MOBILE DETECT */ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ document.documentElement.className = 'touch'; }else{ document.documentElement.className = 'no-touch'; } /*! lozad.js - v1.16.0 - 2020-09-06 * https://github.com/ApoorvSaxena/lozad.js * Copyright (c) 2020 Apoorv Saxena; Licensed MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict"; /** * Detect IE browser * @const {boolean} * @private * * */ var dataSrc = 'data-src'; var g="undefined"!=typeof document&&document.documentMode,f={rootMargin:"0px",threshold:0,load:function(t){ if("picture"===t.nodeName.toLowerCase()){var e=t.querySelector("img"),r=!1;null===e&&(e=document.createElement("img"),r=!0),g&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),r&&t.append(e)} if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var a=t.children,o=void 0,i=0;i<=a.length-1;i++)(o=a[i].getAttribute("data-src"))&&(a[i].src=o);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute(dataSrc)),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var n=","; if(t.getAttribute("data-background-delimiter")&&(n=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(n).join("'),url('")+"')"; else if(t.getAttribute("data-background-image-set")){var d=t.getAttribute("data-background-image-set").split(n),u=d[0].substr(0,d[0].indexOf(" "))||d[0];// Substring before ... 1x u=-1===u.indexOf("url(")?"url("+u+")":u,1===d.length?t.style.backgroundImage=u:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+u+"; background-image: -webkit-image-set("+d+"); background-image: image-set("+d+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function A(t){t.setAttribute("data-loaded",!0)}var m=function(t){return"true"===t.getAttribute("data-loaded")},v=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)};return function(){var r,a,o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},f,t),i=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),m(t.target)||(r(t.target),A(t.target),a(t.target)))})}),{root:i,rootMargin:n,threshold:d}));for(var c,l=v(o,i),b=0;b<l.length;b++)(c=l[b]).getAttribute("data-placeholder-background")&&(c.style.background=c.getAttribute("data-placeholder-background"));return{observe:function(){for(var t=v(o,i),e=0;e<t.length;e++)m(t[e])||(s?s.observe(t[e]):(u(t[e]),A(t[e]),g(t[e])))},triggerLoad:function(t){m(t)||(u(t),A(t),g(t))},observer:s}}}); const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe(); /*! * Flickity PACKAGED v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t}); /*! * getSize v2.0.3 * measure size of elements * MIT license */ (function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p}); /*! * Unipointer v2.4.0 * base class for doing one thing with pointer event * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n}); /*! * Unidragger v2.4.0 * Draggable base class * MIT license */ (function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.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))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i}); /*! * Flickity v2.3.0 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2021 Metafizzy */ (function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e}); /** * Flickity fade v1.0.0 * Fade between Flickity slides */ /* jshint browser: true, undef: true, unused: true */ ( function( window, factory ) { // universal module definition /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'flickity/js/index', 'fizzy-ui-utils/utils', ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window.Flickity, window.fizzyUIUtils ); } }( this, function factory( Flickity, utils ) { // ---- Slide ---- // var Slide = Flickity.Slide; var slideUpdateTarget = Slide.prototype.updateTarget; Slide.prototype.updateTarget = function() { slideUpdateTarget.apply( this, arguments ); if ( !this.parent.options.fade ) { return; } // position cells at selected target var slideTargetX = this.target - this.x; var firstCellX = this.cells[0].x; this.cells.forEach( function( cell ) { var targetX = cell.x - firstCellX - slideTargetX; cell.renderPosition( targetX ); }); }; Slide.prototype.setOpacity = function( alpha ) { this.cells.forEach( function( cell ) { cell.element.style.opacity = alpha; }); }; // ---- Flickity ---- // var proto = Flickity.prototype; Flickity.createMethods.push('_createFade'); proto._createFade = function() { this.fadeIndex = this.selectedIndex; this.prevSelectedIndex = this.selectedIndex; this.on( 'select', this.onSelectFade ); this.on( 'dragEnd', this.onDragEndFade ); this.on( 'settle', this.onSettleFade ); this.on( 'activate', this.onActivateFade ); this.on( 'deactivate', this.onDeactivateFade ); }; var updateSlides = proto.updateSlides; proto.updateSlides = function() { updateSlides.apply( this, arguments ); if ( !this.options.fade ) { return; } // set initial opacity this.slides.forEach( function( slide, i ) { var alpha = i == this.selectedIndex ? 1 : 0; slide.setOpacity( alpha ); }, this ); }; /* ---- events ---- */ proto.onSelectFade = function() { // in case of resize, keep fadeIndex within current count this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); this.prevSelectedIndex = this.selectedIndex; }; proto.onSettleFade = function() { delete this.didDragEnd; if ( !this.options.fade ) { return; } // set full and 0 opacity on selected & faded slides this.selectedSlide.setOpacity( 1 ); var fadedSlide = this.slides[ this.fadeIndex ]; if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { this.slides[ this.fadeIndex ].setOpacity( 0 ); } }; proto.onDragEndFade = function() { // set flag this.didDragEnd = true; }; proto.onActivateFade = function() { if ( this.options.fade ) { this.element.classList.add('is-fade'); } }; proto.onDeactivateFade = function() { if ( !this.options.fade ) { return; } this.element.classList.remove('is-fade'); // reset opacity this.slides.forEach( function( slide ) { slide.setOpacity(''); }); }; /* ---- position & fading ---- */ var positionSlider = proto.positionSlider; proto.positionSlider = function() { if ( !this.options.fade ) { positionSlider.apply( this, arguments ); return; } this.fadeSlides(); this.dispatchScrollEvent(); }; var positionSliderAtSelected = proto.positionSliderAtSelected; proto.positionSliderAtSelected = function() { if ( this.options.fade ) { // position fade slider at origin this.setTranslateX( 0 ); } positionSliderAtSelected.apply( this, arguments ); }; proto.fadeSlides = function() { if ( this.slides.length < 2 ) { return; } // get slides to fade-in & fade-out var indexes = this.getFadeIndexes(); var fadeSlideA = this.slides[ indexes.a ]; var fadeSlideB = this.slides[ indexes.b ]; var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); var progress = this.wrapDifference( fadeSlideA.target, -this.x ); progress = progress / distance; fadeSlideA.setOpacity( 1 - progress ); fadeSlideB.setOpacity( progress ); // hide previous slide var fadeHideIndex = indexes.a; if ( this.isDragging ) { fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; } var isNewHideIndex = this.fadeHideIndex != undefined && this.fadeHideIndex != fadeHideIndex && this.fadeHideIndex != indexes.a && this.fadeHideIndex != indexes.b; if ( isNewHideIndex ) { // new fadeHideSlide set, hide previous this.slides[ this.fadeHideIndex ].setOpacity( 0 ); } this.fadeHideIndex = fadeHideIndex; }; proto.getFadeIndexes = function() { if ( !this.isDragging && !this.didDragEnd ) { return { a: this.fadeIndex, b: this.selectedIndex, }; } if ( this.options.wrapAround ) { return this.getFadeDragWrapIndexes(); } else { return this.getFadeDragLimitIndexes(); } }; proto.getFadeDragWrapIndexes = function() { var distances = this.slides.map( function( slide, i ) { return this.getSlideDistance( -this.x, i ); }, this ); var absDistances = distances.map( function( distance ) { return Math.abs( distance ); }); var minDistance = Math.min.apply( Math, absDistances ); var closestIndex = absDistances.indexOf( minDistance ); var distance = distances[ closestIndex ]; var len = this.slides.length; var delta = distance >= 0 ? 1 : -1; return { a: closestIndex, b: utils.modulo( closestIndex + delta, len ), }; }; proto.getFadeDragLimitIndexes = function() { // calculate closest previous slide var dragIndex = 0; for ( var i=0; i < this.slides.length - 1; i++ ) { var slide = this.slides[i]; if ( -this.x < slide.target ) { break; } dragIndex = i; } return { a: dragIndex, b: dragIndex + 1, }; }; proto.wrapDifference = function( a, b ) { var diff = b - a; if ( !this.options.wrapAround ) { return diff; } var diffPlus = diff + this.slideableWidth; var diffMinus = diff - this.slideableWidth; if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { diff = diffPlus; } if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { diff = diffMinus; } return diff; }; // ---- wrapAround ---- // var _getWrapShiftCells = proto._getWrapShiftCells; proto._getWrapShiftCells = function() { if ( !this.options.fade ) { _getWrapShiftCells.apply( this, arguments ); } }; var shiftWrapCells = proto.shiftWrapCells; proto.shiftWrapCells = function() { if ( !this.options.fade ) { shiftWrapCells.apply( this, arguments ); } }; return Flickity; })); /* LENIS */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Lenis=e()}(this,(function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function clamp(t,e,i){return Math.max(t,Math.min(e,i))}class Animate{advance(t){if(!this.isRunning)return;let e=!1;if(this.lerp)this.value=function damp(t,e,i,o){return function lerp(t,e,i){return(1-i)*t+i*e}(t,e,1-Math.exp(-i*o))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,e=!0);else{this.currentTime+=t;const i=clamp(0,this.currentTime/this.duration,1);e=i>=1;const o=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*o}e&&this.stop(),this.onUpdate?.(this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:o=1,easing:s=(t=>t),onStart:n,onUpdate:r}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=o,this.easing=s,this.currentTime=0,this.isRunning=!0,n?.(),this.onUpdate=r}}class Dimensions{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:o=250}={}){this.wrapper=t,this.content=e,i&&(this.debouncedResize=function debounce(t,e){let i;return function(){let o=arguments,s=this;clearTimeout(i),i=setTimeout((function(){t.apply(s,o)}),e)}}(this.resize,o),this.wrapper===window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),window.removeEventListener("resize",this.debouncedResize,!1)}resize=()=>{this.onWrapperResize(),this.onContentResize()};onWrapperResize=()=>{this.wrapper===window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)};onContentResize=()=>{this.wrapper===window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)};get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}}class Emitter{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let t=0,o=i.length;t<o;t++)i[t](...e)}on(t,e){return this.events[t]?.push(e)||(this.events[t]=[e]),()=>{this.events[t]=this.events[t]?.filter((t=>e!==t))}}off(t,e){this.events[t]=this.events[t]?.filter((t=>e!==t))}destroy(){this.events={}}}const t=100/6;class VirtualScroll{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new Emitter,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,{passive:!1}),this.element.removeEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.removeEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.removeEventListener("touchend",this.onTouchEnd,{passive:!1})}onTouchStart=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})};onTouchMove=t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,o=-(e-this.touchStart.x)*this.touchMultiplier,s=-(i-this.touchStart.y)*this.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:o,y:s},this.emitter.emit("scroll",{deltaX:o,deltaY:s,event:t})};onTouchEnd=t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})};onWheel=e=>{let{deltaX:i,deltaY:o,deltaMode:s}=e;i*=1===s?t:2===s?this.windowWidth:1,o*=1===s?t:2===s?this.windowHeight:1,i*=this.wheelMultiplier,o*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:o,event:e})};onWindowResize=()=>{this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight}}var e=function(){function Lenis(t){var e=void 0===t?{}:t,i=e.wrapper,o=void 0===i?window:i,s=e.content,n=void 0===s?document.documentElement:s,r=e.wheelEventsTarget,l=void 0===r?o:r,h=e.eventsTarget,a=void 0===h?l:h,c=e.smoothWheel,p=void 0===c||c,u=e.syncTouch,d=void 0!==u&&u,m=e.syncTouchLerp,v=void 0===m?.075:m,f=e.touchInertiaMultiplier,g=void 0===f?35:f,S=e.duration,w=e.easing,y=void 0===w?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:w,b=e.lerp,L=void 0===b?!S&&.1:b,_=e.infinite,z=void 0!==_&&_,E=e.orientation,T=void 0===E?"vertical":E,M=e.gestureOrientation,R=void 0===M?"vertical":M,O=e.touchMultiplier,W=void 0===O?1:O,x=e.wheelMultiplier,H=void 0===x?1:x,N=e.autoResize,k=void 0===N||N,C=e.__experimental__naiveDimensions,j=void 0!==C&&C,P=this;this.__isSmooth=!1,this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.onVirtualScroll=function(t){var e=t.deltaX,i=t.deltaY,o=t.event;if(!o.ctrlKey){var s=o.type.includes("touch"),n=o.type.includes("wheel");if(P.options.syncTouch&&s&&"touchstart"===o.type&&!P.isStopped&&!P.isLocked)P.reset();else{var r=0===e&&0===i,l="vertical"===P.options.gestureOrientation&&0===i||"horizontal"===P.options.gestureOrientation&&0===e;if(!r&&!l){var h=o.composedPath();if(!(h=h.slice(0,h.indexOf(P.rootElement))).find((function(t){var e,i,o,r,l;return(null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-lenis-prevent"))||s&&(null===(i=t.hasAttribute)||void 0===i?void 0:i.call(t,"data-lenis-prevent-touch"))||n&&(null===(o=t.hasAttribute)||void 0===o?void 0:o.call(t,"data-lenis-prevent-wheel"))||(null===(r=t.classList)||void 0===r?void 0:r.contains("lenis"))&&!(null===(l=t.classList)||void 0===l?void 0:l.contains("lenis-stopped"))})))if(P.isStopped||P.isLocked)o.preventDefault();else{if(P.isSmooth=P.options.syncTouch&&s||P.options.smoothWheel&&n,!P.isSmooth)return P.isScrolling=!1,void P.animate.stop();o.preventDefault();var a=i;"both"===P.options.gestureOrientation?a=Math.abs(i)>Math.abs(e)?i:e:"horizontal"===P.options.gestureOrientation&&(a=e);var c=s&&P.options.syncTouch,p=s&&"touchend"===o.type&&Math.abs(a)>5;p&&(a=P.velocity*P.options.touchInertiaMultiplier),P.scrollTo(P.targetScroll+a,__assign({programmatic:!1},c?{lerp:p?P.options.syncTouchLerp:1}:{lerp:P.options.lerp,duration:P.options.duration,easing:P.options.easing}))}}}}},this.onNativeScroll=function(){if(!P.__preventNextScrollEvent&&!P.isScrolling){var t=P.animatedScroll;P.animatedScroll=P.targetScroll=P.actualScroll,P.velocity=0,P.direction=Math.sign(P.animatedScroll-t),P.emit()}},window.lenisVersion="1.0.45",o!==document.documentElement&&o!==document.body||(o=window),this.options={wrapper:o,content:n,wheelEventsTarget:l,eventsTarget:a,smoothWheel:p,syncTouch:d,syncTouchLerp:v,touchInertiaMultiplier:g,duration:S,easing:y,lerp:L,infinite:z,gestureOrientation:R,orientation:T,touchMultiplier:W,wheelMultiplier:H,autoResize:k,__experimental__naiveDimensions:j},this.animate=new Animate,this.emitter=new Emitter,this.dimensions=new Dimensions({wrapper:o,content:n,autoResize:k}),this.toggleClassName("lenis",!0),this.velocity=0,this.isLocked=!1,this.isStopped=!1,this.isSmooth=d||p,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll=new VirtualScroll(a,{touchMultiplier:W,wheelMultiplier:H}),this.virtualScroll.on("scroll",this.onVirtualScroll)}return Lenis.prototype.destroy=function(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.toggleClassName("lenis",!1),this.toggleClassName("lenis-smooth",!1),this.toggleClassName("lenis-scrolling",!1),this.toggleClassName("lenis-stopped",!1),this.toggleClassName("lenis-locked",!1)},Lenis.prototype.on=function(t,e){return this.emitter.on(t,e)},Lenis.prototype.off=function(t,e){return this.emitter.off(t,e)},Lenis.prototype.setScroll=function(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t},Lenis.prototype.resize=function(){this.dimensions.resize()},Lenis.prototype.emit=function(){this.emitter.emit("scroll",this)},Lenis.prototype.reset=function(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.velocity=0,this.animate.stop()},Lenis.prototype.start=function(){this.isStopped&&(this.isStopped=!1,this.reset())},Lenis.prototype.stop=function(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())},Lenis.prototype.raf=function(t){var e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)},Lenis.prototype.scrollTo=function(t,e){var i=this,o=void 0===e?{}:e,s=o.offset,n=void 0===s?0:s,r=o.immediate,l=void 0!==r&&r,h=o.lock,a=void 0!==h&&h,c=o.duration,p=void 0===c?this.options.duration:c,u=o.easing,d=void 0===u?this.options.easing:u,m=o.lerp,v=void 0===m?!p&&this.options.lerp:m,f=o.onComplete,g=o.force,S=void 0!==g&&g,w=o.programmatic,y=void 0===w||w;if(!this.isStopped&&!this.isLocked||S){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var b=void 0;if("string"==typeof t?b=document.querySelector(t):(null==t?void 0:t.nodeType)&&(b=t),b){if(this.options.wrapper!==window){var L=this.options.wrapper.getBoundingClientRect();n-=this.isHorizontal?L.left:L.top}var _=b.getBoundingClientRect();t=(this.isHorizontal?_.left:_.top)+this.animatedScroll}}if("number"==typeof t){if(t+=n,t=Math.round(t),this.options.infinite?y&&(this.targetScroll=this.animatedScroll=this.scroll):t=clamp(0,t,this.limit),l)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),void(null==f||f(this));if(!y){if(t===this.targetScroll)return;this.targetScroll=t}this.animate.fromTo(this.animatedScroll,t,{duration:p,easing:d,lerp:v,onStart:function(){a&&(i.isLocked=!0),i.isScrolling=!0},onUpdate:function(t,e){i.isScrolling=!0,i.velocity=t-i.animatedScroll,i.direction=Math.sign(i.velocity),i.animatedScroll=t,i.setScroll(i.scroll),y&&(i.targetScroll=t),e||i.emit(),e&&(i.reset(),i.emit(),null==f||f(i),i.__preventNextScrollEvent=!0,requestAnimationFrame((function(){delete i.__preventNextScrollEvent})))}})}}},Object.defineProperty(Lenis.prototype,"rootElement",{get:function(){return this.options.wrapper===window?document.documentElement:this.options.wrapper},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"limit",{get:function(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isHorizontal",{get:function(){return"horizontal"===this.options.orientation},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"actualScroll",{get:function(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"scroll",{get:function(){return this.options.infinite?function modulo(t,e){return(t%e+e)%e}(this.animatedScroll,this.limit):this.animatedScroll},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"progress",{get:function(){return 0===this.limit?1:this.scroll/this.limit},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isSmooth",{get:function(){return this.__isSmooth},set:function(t){this.__isSmooth!==t&&(this.__isSmooth=t,this.toggleClassName("lenis-smooth",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isScrolling",{get:function(){return this.__isScrolling},set:function(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.toggleClassName("lenis-scrolling",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isStopped",{get:function(){return this.__isStopped},set:function(t){this.__isStopped!==t&&(this.__isStopped=t,this.toggleClassName("lenis-stopped",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"isLocked",{get:function(){return this.__isLocked},set:function(t){this.__isLocked!==t&&(this.__isLocked=t,this.toggleClassName("lenis-locked",t))},enumerable:!1,configurable:!0}),Object.defineProperty(Lenis.prototype,"className",{get:function(){var t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isSmooth&&(t+=" lenis-smooth"),t},enumerable:!1,configurable:!0}),Lenis.prototype.toggleClassName=function(t,e){this.rootElement.classList.toggle(t,e),this.emitter.emit("className change",this)},Lenis}();return e})); //# sourceMappingURL=lenis.min.js.map !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).SwupScriptsPlugin=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.apply(this,arguments)}const e=t=>String(t).split(".").map(t=>String(parseInt(t||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(t=>t()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([t,n])=>{if(!function(t,n,r){const o=function(t,e){var n;if("swup"===t)return null!=(n=e.version)?n:"";{var r;const n=e.findPlugin(t);return null!=(r=null==n?void 0:n.version)?r:""}}(t,r);return!!o&&((t,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var s,i;return((t,e)=>{const n={"":t=>0===t,">":t=>t>0,">=":t=>t>=0,"<":t=>t<0,"<=":t=>t<=0};return(n[e]||n[""])(t)})((i=o,s=e(s=t),i=e(i),s.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(o,n)}(t,n=Array.isArray(n)?n:[n],this.swup)){const e=`${t} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${e}`)}}),!0}on(t,e,n={}){var r;e=!(r=e).name.startsWith("bound ")||r.hasOwnProperty("prototype")?e.bind(this):e;const o=this.swup.hooks.on(t,e,n);return this.handlersToUnregister.push(o),o}once(e,n,r={}){return this.on(e,n,t({},r,{once:!0}))}before(e,n,r={}){return this.on(e,n,t({},r,{before:!0}))}replace(e,n,r={}){return this.on(e,n,t({},r,{replace:!0}))}off(t,e){return this.swup.hooks.off(t,e)}}return class extends n{constructor(t){void 0===t&&(t={}),super(),this.name="SwupScriptsPlugin",this.requires={swup:">=4"},this.defaults={head:!0,body:!0,optin:!1},this.options=void 0,this.options={...this.defaults,...t}}mount(){this.on("content:replace",this.runScripts)}runScripts(){const{head:t,body:e,optin:n}=this.options,r=this.getScope({head:t,body:e});if(!r)return;const o=Array.from(r.querySelectorAll(n?"script[data-swup-reload-script]":"script:not([data-swup-ignore-script])"));o.forEach(t=>this.runScript(t)),this.swup.log(`Executed ${o.length} scripts.`)}runScript(t){const e=document.createElement("script");for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r);return e.textContent=t.textContent,t.replaceWith(e),e}getScope(t){let{head:e,body:n}=t;return e&&n?document:e?document.head:n?document.body:null}}}); //# sourceMappingURL=index.umd.js.map // SWUP GTM PLUGIN !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupGtmPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const o=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!o&&((e,n)=>n.every(n=>{const[,r,o]=n.match(/^([\D]+)?(.*)$/)||[];var i,s;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((s=o,i=t(i=e),s=t(s),i.localeCompare(s,void 0,{numeric:!0})),r||">=")}))(o,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const o=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(o),o}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}return class extends n{constructor(){super(...arguments),this.name="SwupGtmPlugin"}mount(){this.on("page:view",this.trackPageview)}trackPageview(){if("object"!=typeof window.dataLayer)return void console.warn("GTM is not loaded on the page");const e=window.location.pathname+window.location.search,t=document.title;window.dataLayer.push({event:"VirtualPageview",virtualPageURL:e,virtualPageTitle:t}),this.swup.log(`GTM page view: ${e}`)}}}); //# sourceMappingURL=index.umd.js.map // =================================================== // Global Function: Show Grid // =================================================== $(document).keypress(function(e) { if(e.charCode == 103) { $("#guide").toggleClass('active'); } }); // =================================================== // SEARCH TRIGGER // =================================================== function showSearchBox() { $('#search--trigger').on('click', function(){ $(this).toggleClass('active'); $('#search--box--header').toggleClass('active'); }); $('#search--trigger:not(.active)').on('click', function(){ $('#search--box--header input').val('').focus(); }); } // =================================================== // STICKY CONTENT SLIDER // =================================================== function showHideScrollToTop() { var scrollAmount = $(window).scrollTop(); var windowHeight = window.innerHeight * 2; var documentHeight = $(document).height(); if(documentHeight > 2000) { if(scrollAmount > (documentHeight - windowHeight)) { $('.scroll--to--top--container').addClass('active'); } else { $('.scroll--to--top--container').removeClass('active'); } } else { $('.scroll--to--top--container').removeClass('active'); } } // =================================================== // Scroll to top // =================================================== function scrollToTop() { $('.scroll--to--top').on('click', function(){ $('html, body').animate({scrollTop:0}, '100'); $('.scroll--to--top--container').removeClass('active'); }); } // =================================================== // Function: Lenis Scroll // =================================================== function lenis() { const lenis = new Lenis({ duration: 1.5, easing: function(t){return (t === 1 ? 1 : 1 - Math.pow(2, -10 * t))}, direction: 'vertical', smooth: true, smoothTouch: false, touchMultiplier: 2, }) //window.lenis = lenis; lenis.on('scroll', (e) => { // console.log(e) }) function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); if($(window).scrollTop() > 60) { $('header').addClass('slideUp'); setTimeout(function() { $('body').removeClass('slideUp'); }, 300); } lenis.scrollTo(this.getAttribute('href')) }); }) requestAnimationFrame(raf) } // =================================================== // FOCUS INPUT FORM // =================================================== function focusInputForm() { $("input").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("input").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }) $("textarea").focus(function(){ $(this).closest('label').addClass("is-active is-completed"); }); $("textarea").focusout(function(){ if($(this).val() === "") $(this).closest('label').removeClass("is-completed"); $(this).closest('label').removeClass("is-active"); }); } // =================================================== // SUCCESS MESSAGE // =================================================== function customSuccess() { $('#close_success_message').on('click', function(){ $('#success_message').removeClass('active'); }); document.addEventListener( 'wpcf7mailsent', function( event ) { $('.is-completed').removeClass('is-completed'); }, false ); } // =================================================== // Stats counter // =================================================== function statsCounter() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); $(window).scroll(function() { $('.counter.incomplete').each(function () { if($(this).closest('section').hasClass('in-view')) { $(this).removeClass('incomplete'); $(this).prop('Counter', 0).animate({ Counter: $(this).data('value') }, { duration: 2000, easing: 'linear', step: function (now) { $(this).text(Math.ceil(this.Counter).toLocaleString('en')); }, complete : function(){ $(this).text(Math.ceil(this.Counter).toLocaleString('en')); } }); } }); }); } // =================================================== // Function: Category Links // =================================================== function categoryLinks() { $(".category--links a").each(function(){ if ($(this).attr("href") == window.location.href){ $(this).addClass("active"); } else { $(this).removeClass("active"); } }); } // =================================================== // Function: Pricing Table // =================================================== function pricingTable() { $('.p-table').each(function () { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _2_pricing-table // Usage: codyhouse.co/license (function() { // NOTE: you need the js code only when using the --has-switch variation of the pricing table // default version does not require js var pTable = document.getElementsByClassName('js-p-table--has-switch'); if(pTable.length > 0) { for(var i = 0; i < pTable.length; i++) { (function(i){ addPTableEvent(pTable[i]);})(i); } function addPTableEvent(element) { var pSwitch = element.getElementsByClassName('js-p-table__switch')[0]; if(pSwitch) { pSwitch.addEventListener('change', function(event) { Util.toggleClass(element, 'p-table--second', (event.target.value == 'second')); }); } } } }()); }); } // =================================================== // ACCORDIONS // =================================================== function accordions() { (function() { var Accordion = function(element) { this.element = element; this.items = getChildrenByClassName(this.element, 'js-accordion__item'); this.version = this.element.getAttribute('data-version') ? '-'+this.element.getAttribute('data-version') : ''; this.showClass = 'accordion'+this.version+'__item--is-open'; this.animateHeight = (this.element.getAttribute('data-animation') == 'on'); this.multiItems = !(this.element.getAttribute('data-multi-items') == 'off'); // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init accordion this.initAccordion(); }; Accordion.prototype.initAccordion = function() { //set initial aria attributes for( var i = 0; i < this.items.length; i++) { var button = this.items[i].getElementsByTagName('button')[0], content = this.items[i].getElementsByClassName('js-accordion__panel')[0], isOpen = this.items[i].classList.contains(this.showClass) ? 'true' : 'false'; button.setAttribute('aria-expanded', isOpen); button.setAttribute('aria-controls', 'accordion-content-'+i); button.setAttribute('id', 'accordion-header-'+i); button.classList.add('js-accordion__trigger'); content.setAttribute('aria-labelledby', 'accordion-header-'+i); content.setAttribute('id', 'accordion-content-'+i); } //listen for Accordion events this.initAccordionEvents(); // check deep linking option this.initDeepLink(); }; Accordion.prototype.initAccordionEvents = function() { var self = this; this.element.addEventListener('click', function(event) { var trigger = event.target.closest('.js-accordion__trigger'); //check index to make sure the click didn't happen inside a children accordion if( trigger && Array.prototype.indexOf.call(self.items, trigger.parentElement) >= 0) self.triggerAccordion(trigger); }); }; Accordion.prototype.triggerAccordion = function(trigger) { var bool = (trigger.getAttribute('aria-expanded') === 'true'); this.animateAccordion(trigger, bool, false); if(!bool && this.deepLinkOn) { history.replaceState(null, '', '#'+trigger.getAttribute('aria-controls')); } }; Accordion.prototype.animateAccordion = function(trigger, bool, deepLink) { var self = this; var item = trigger.closest('.js-accordion__item'), content = item.getElementsByClassName('js-accordion__panel')[0], ariaValue = bool ? 'false' : 'true'; if(!bool) item.classList.add(this.showClass); trigger.setAttribute('aria-expanded', ariaValue); self.resetContentVisibility(item, content, bool); if( !this.multiItems && !bool || deepLink) this.closeSiblings(item); }; Accordion.prototype.resetContentVisibility = function(item, content, bool) { item.classList.toggle(this.showClass, !bool); content.removeAttribute("style"); if(bool && !this.multiItems) { // accordion item has been closed -> check if there's one open to move inside viewport this.moveContent(); } }; Accordion.prototype.closeSiblings = function(item) { //if only one accordion can be open -> search if there's another one open var index = Array.prototype.indexOf.call(this.items, item); for( var i = 0; i < this.items.length; i++) { if(this.items[i].classList.contains(this.showClass) && i != index) { this.animateAccordion(this.items[i].getElementsByClassName('js-accordion__trigger')[0], true, false); return false; } } }; Accordion.prototype.moveContent = function() { // make sure title of the accordion just opened is inside the viewport var openAccordion = this.element.getElementsByClassName(this.showClass); if(openAccordion.length == 0) return; var boundingRect = openAccordion[0].getBoundingClientRect(); if(boundingRect.top < 0 || boundingRect.top > window.innerHeight) { var windowScrollTop = window.scrollY || document.documentElement.scrollTop; window.scrollTo(0, boundingRect.top + windowScrollTop); } }; Accordion.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); if(!hash || hash == '') return; var trigger = this.element.querySelector('.js-accordion__trigger[aria-controls="'+hash+'"]'); if(trigger && trigger.getAttribute('aria-expanded') !== 'true') { this.animateAccordion(trigger, false, true); setTimeout(function(){trigger.scrollIntoView(true);}); } }; function getChildrenByClassName(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (children[i].classList.contains(className)) childrenByClass.push(children[i]); } return childrenByClass; }; window.Accordion = Accordion; //initialize the Accordion objects var accordions = document.getElementsByClassName('js-accordion'); if( accordions.length > 0 ) { for( var i = 0; i < accordions.length; i++) { (function(i){new Accordion(accordions[i]);})(i); } } }()); } // =================================================== // CURRENT MENU ITEM // =================================================== function currentMenuItem() { $('.menu .current-menu-item a').addClass('active'); } // =================================================== // SCROLLED NAV // =================================================== function scrolledNav() { function checkHeaderTop() { var height = $(window).scrollTop(); if(height > 100) { $('body').addClass('scrolled--past--top'); } else { $('body').removeClass('scrolled--past--top'); } } checkHeaderTop(); $(window).scroll(function() { checkHeaderTop(); }); } // =================================================== // FLICKITY // =================================================== function carousels() { var galleryElems = document.querySelectorAll('.carousel--free--scroll'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } if ($(window).width() < 1024) { var galleryElems = document.querySelectorAll('.carousel--free--scroll--desktop'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: true, contain: true, cellAlign: 'left' }); } } var galleryElems = document.querySelectorAll('.carousel--basic'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, percentPosition: true, prevNextButtons: true, wrapAround: false, draggable: true, autoPlay: false, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.carousel--dots'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: true, percentPosition: true, prevNextButtons: false, wrapAround: true, draggable: true, autoPlay: false, groupCells: true, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } var galleryElems = document.querySelectorAll('.fade--carousel'); for ( var i=0, len = galleryElems.length; i < len; i++ ) { var galleryElem = galleryElems[i]; new Flickity( galleryElem, { pageDots: false, fade: true, percentPosition: false, prevNextButtons: false, wrapAround: true, draggable: false, autoPlay: 5000, pauseAutoPlayOnHover: false, freeScroll: false, contain: true, cellAlign: 'left' }); } } // =================================================== // SHOW/HIDE/NAV // =================================================== function showHideNav() { // utility functions if(!Util) function Util () {}; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; // File#: _3_hiding-nav // Usage: codyhouse.co/license (function() { var hidingNav = document.getElementsByClassName('js-hide-nav'); if(hidingNav.length > 0 && window.requestAnimationFrame) { var mainNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--main'); }), subNav = Array.prototype.filter.call(hidingNav, function(element) { return Util.hasClass(element, 'js-hide-nav--sub'); }); var scrolling = false, previousTop = window.scrollY, currentTop = window.scrollY, scrollDelta = 2, scrollOffset = 10, // scrollY needs to be bigger than scrollOffset to hide navigation headerHeight = 0; var navIsFixed = false; // check if main navigation is fixed if(mainNav.length > 0 && Util.hasClass(mainNav[0], 'hide-nav--fixed')) navIsFixed = true; // store button that triggers navigation on mobile var triggerMobile = getTriggerMobileMenu(); var prevElement = createPrevElement(); var mainNavTop = 0; // list of classes the hide-nav has when it is expanded -> do not hide if it has those classes var navOpenClasses = hidingNav[0].getAttribute('data-nav-target-class'), navOpenArrayClasses = []; if(navOpenClasses) navOpenArrayClasses = navOpenClasses.split(' '); getMainNavTop(); if(mainNavTop > 0) { scrollOffset = scrollOffset + mainNavTop; } // init navigation and listen to window scroll event getHeaderHeight(); initSecondaryNav(); initFixedNav(); resetHideNav(); window.addEventListener('scroll', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(resetHideNav); }); window.addEventListener('resize', function(event){ if(scrolling) return; scrolling = true; window.requestAnimationFrame(function(){ if(headerHeight > 0) { getMainNavTop(); getHeaderHeight(); initSecondaryNav(); initFixedNav(); } // reset both navigation hideNavScrollUp(); scrolling = false; }); }); function getHeaderHeight() { headerHeight = mainNav[0].offsetHeight; }; function initSecondaryNav() { // if there's a secondary nav, set its top equal to the header height if(subNav.length < 1 || mainNav.length < 1) return; subNav[0].style.top = 0; }; function initFixedNav() { if(!navIsFixed || mainNav.length < 1) return; mainNav[0].style.marginBottom = '-'+headerHeight+'px'; }; function resetHideNav() { // check if navs need to be hidden/revealed currentTop = window.scrollY; if(currentTop - previousTop > scrollDelta && currentTop > scrollOffset) { hideNavScrollDown(); } else if( previousTop - currentTop > scrollDelta || (previousTop - currentTop > 0 && currentTop < scrollOffset) ) { hideNavScrollUp(); } else if( previousTop - currentTop > 0 && subNav.length > 0 && subNav[0].getBoundingClientRect().top > 0) { setTranslate(subNav[0], '0%'); } // if primary nav is fixed -> toggle bg class if(navIsFixed) { var scrollTop = window.scrollY || window.pageYOffset; Util.toggleClass(mainNav[0], 'hide-nav--has-bg', (scrollTop > headerHeight + mainNavTop)); } previousTop = currentTop; scrolling = false; }; function hideNavScrollDown() { // if there's a secondary nav -> it has to reach the top before hiding nav if( subNav.length > 0 && subNav[0].getBoundingClientRect().top > headerHeight) return; // on mobile -> hide navigation only if dropdown is not open if(triggerMobile && triggerMobile.getAttribute('aria-expanded') == "true") return; // check if main nav has one of the following classes if( mainNav.length > 0 && (!navOpenClasses || !checkNavExpanded())) { setTranslate(mainNav[0], '-100%'); mainNav[0].addEventListener('transitionend', addOffCanvasClass); } if( subNav.length > 0 ) setTranslate(subNav[0], '-'+headerHeight+'px'); }; function hideNavScrollUp() { if( mainNav.length > 0 ) {setTranslate(mainNav[0], '0%'); Util.removeClass(mainNav[0], 'hide-nav--off-canvas');mainNav[0].removeEventListener('transitionend', addOffCanvasClass);} if( subNav.length > 0 ) setTranslate(subNav[0], '0%'); }; function addOffCanvasClass() { mainNav[0].removeEventListener('transitionend', addOffCanvasClass); Util.addClass(mainNav[0], 'hide-nav--off-canvas'); }; function setTranslate(element, val) { element.style.transform = 'translateY('+val+')'; }; function getTriggerMobileMenu() { // store trigger that toggle mobile navigation dropdown var triggerMobileClass = hidingNav[0].getAttribute('data-mobile-trigger'); if(!triggerMobileClass) return false; if(triggerMobileClass.indexOf('#') == 0) { // get trigger by ID var trigger = document.getElementById(triggerMobileClass.replace('#', '')); if(trigger) return trigger; } else { // get trigger by class name var trigger = hidingNav[0].getElementsByClassName(triggerMobileClass); if(trigger.length > 0) return trigger[0]; } return false; }; function createPrevElement() { // create element to be inserted right before the mainNav to get its top value if( mainNav.length < 1) return false; var newElement = document.createElement("div"); newElement.setAttribute('aria-hidden', 'true'); mainNav[0].parentElement.insertBefore(newElement, mainNav[0]); var prevElement = mainNav[0].previousElementSibling; prevElement.style.opacity = '0'; return prevElement; }; function getMainNavTop() { if(!prevElement) return; mainNavTop = prevElement.getBoundingClientRect().top + window.scrollY; }; function checkNavExpanded() { var navIsOpen = false; for(var i = 0; i < navOpenArrayClasses.length; i++){ if(Util.hasClass(mainNav[0], navOpenArrayClasses[i].trim())) { navIsOpen = true; break; } } return navIsOpen; }; } else { // if window requestAnimationFrame is not supported -> add bg class to fixed header var mainNav = document.getElementsByClassName('js-hide-nav--main'); if(mainNav.length < 1) return; if(Util.hasClass(mainNav[0], 'hide-nav--fixed')) Util.addClass(mainNav[0], 'hide-nav--has-bg'); } }()); } // =================================================== // Function: Add Class when in view // =================================================== function addClassinView() { const inViewport = (elem) => { let allElements = $(elem); let windowHeight = window.innerHeight * .9; const elems = () => { for (let i = 0; i < allElements.length; i++) { // loop through the sections let viewportOffset = allElements[i].getBoundingClientRect(); // returns the size of an element and its position relative to the viewport let top = viewportOffset.top; // get the offset top if(top < windowHeight){ // if the top offset is less than the window height allElements[i].classList.add('in-view'); } else{ //allElements[i].classList.remove('in-view'); // remove the class } } } elems(); window.addEventListener('scroll', elems); } //inViewport('section'); // run the function on all section elements inViewport('section'); //$('section').addClass('in-view'); } // =================================================== // Function: Add Class when resizing // =================================================== function addClasswhenResizing() { let resizeTimer; window.addEventListener("resize", () => { document.body.classList.add("resizing"); clearTimeout(resizeTimer); resizeTimer = setTimeout(() => { document.body.classList.remove("resizing"); }, 400); }); } // =================================================== // Function: Pop-up Form // =================================================== function openPopupForm() { function closeInfoPopups() { var allPopUpButtons = $('.open--info--popup'); var allPopUpWindows = $('.info--popup'); $(allPopUpButtons).removeClass('active'); $(allPopUpWindows).removeClass('active'); $('body').removeClass('overlay--active'); //lenis.start(); } $('.open--info--popup').click(function(){ closeInfoPopups(); var targetPopupWindow = '#' + $(this).data('popup'); $(this).addClass('active'); $(targetPopupWindow).addClass('active'); $('body').addClass('overlay--active'); //lenis.stop(); }); $('.close--info--popups').click(function(){ closeInfoPopups(); }); $(document).on('keydown', function(event) { if (event.key == "Escape") { closeInfoPopups(); } }); } // =================================================== // Scroll to next section // =================================================== function scrollDown() { $('.scrolldown').on('click', function(e) { e.preventDefault(); //var headerHeight = $('header').height(); var headerHeight = 0; var offset = $(this).parents('section').next('section').offset().top; var scrollAmount = offset - headerHeight; console.log(offset) $('html, body').stop().animate({ scrollTop: scrollAmount }, 400); }); } // =================================================== // Function: CUSTOM VIDEO BUTTON // =================================================== function customVideoButton() { // Get all videos var videos = document.getElementsByClassName("video__play-button"); var video_fullscreen = document.getElementsByClassName("video__fullscreen-button"); // Loop through all videos for (var i = 0; i < videos.length; i++) { // On click play button videos[i].onclick = function() { // Find video element video = this.nextElementSibling; video_wrapper = this.parentElement; console.log(video_wrapper); console.log(video); // Play video if (video.paused == true) { // Play the video video.play(); video.setAttribute('data-state','play'); video.setAttribute('data-state-reload','false'); video_wrapper.setAttribute('data-state','play'); // Update the button text to 'Pause' // this.innerHTML = "Pause"; this.setAttribute('data-button-state','play'); this.setAttribute('data-button-state-reload','false'); } else { // Pause the video video.pause(); video.setAttribute('data-state','pause'); video_wrapper.setAttribute('data-state','pause'); // Update the button text to 'Play' // this.innerHTML = "Play"; this.setAttribute('data-button-state','pause'); } // When video is ended video.onended = (event) => { // Pause the video video.setAttribute('data-state','pause'); video.setAttribute('data-state-reload','true'); // Update the button text to 'Play' this.setAttribute('data-button-state','pause'); this.setAttribute('data-button-state-reload','true'); }; } } // Loop through all videos for (var i = 0; i < video_fullscreen.length; i++) { // On click play button video_fullscreen[i].onclick = function() { // Find video element video = this.nextElementSibling.nextElementSibling; if (video.mozRequestFullScreen) { video.mozRequestFullScreen(); } else if (video.webkitRequestFullScreen) { video.webkitRequestFullScreen(); } } } } // =================================================== // HIDE HEADER // =================================================== function hideHeader() { var new_scroll_position = 0; var last_scroll_position; var header = $('header'); window.addEventListener('scroll', function(e) { last_scroll_position = window.scrollY; // Scrolling down if (new_scroll_position < last_scroll_position && last_scroll_position > 60) { header.removeClass("slideDown"); header.addClass("slideUp"); // Scrolling up } else if (new_scroll_position > last_scroll_position) { header.removeClass("slideUp"); header.addClass("slideDown"); } new_scroll_position = last_scroll_position; }); } // =================================================== // Function: AJAX LOAD MORE // =================================================== function loadPosts() { var ajax_wrapper = $('#ajax-load-more').attr('data-ran'); //console.log(ajax_wrapper) if(ajax_wrapper == 'true') { //console.log('ajax ran'); } else { var element = document.querySelector('#ajax-load-more'); ajaxloadmore.start(element); } $('#ajax-load-more').attr('data-ran', true); } // =================================================== // Fade in on scroll // =================================================== function fadeInScroll() { (function($) { $.fn.visible = function(partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); var win = $(window); var allMods = $(".ani"); allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 0); } }); win.scroll(function(event) { allMods.each(function(i, el) { var el = $(el); if (el.visible(true)) { setTimeout(function() { el.addClass("in-view"); }, 10); } }); $('.seq').each(function(i,el) { 'use strict'; $(el).delay(100*i).queue(function() { $(this).addClass('show').dequeue(); }); }); }); } // =================================================== // CLINIC SEARCH // =================================================== function clinicSearch() { $("#clinic_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#clinics').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function clinicRegionFilters() { $('.clinic--list').each(function () { var filter = $(this).find('.clinic-region-filters button'); var clinicName = $(this).find('.clinic'); $(filter).each(function() { var dataRegion = '.clinic.' + $(this).attr('data-region'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); }); } // =================================================== // CLINIC REGION FILTERS // =================================================== function searchResultsFilters() { $('.search-results').each(function () { var filter = $(this).find('.search-results-filters button'); var clinicName = $(this).find('.search--result'); $(filter).each(function() { var dataRegion = '.search--result.' + $(this).attr('data-posttype'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); console.log(dataRegion) $(clinicName).css('display', 'none'); $(dataRegion).css('display', 'block'); }); }); if($('button[data-posttype="treatment"]').length > 0) { $(filter).removeClass('active'); $('button[data-posttype="treatment"]').addClass('active'); $(clinicName).css('display', 'none'); $('.search--result.treatment').css('display', 'block'); } else { $('button.active--replacement').addClass('active'); $('.search--result.active--replacement').css('display', 'block'); } }); } // =================================================== // DENTIST SEARCH // =================================================== function dentistSearch() { $("#dentist_search").on('keyup', function(){ console.log('keyup'); var matcher = new RegExp($(this).val(), 'gi'); $('#dentists').children().hide().filter(function(){ return matcher.test($(this).attr('data-name')) }).show(); }); } // =================================================== // DENTIST CLINIC FILTERS // =================================================== function dentistClinicFilters() { $('.dentist--list').each(function () { var filter = $(this).find('.dentist-clinic-filters button'); var dentistName = $(this).find('.dentist'); $(filter).each(function() { var dataLocation = '.dentist.' + $(this).attr('data-location'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(dentistName).css('display', 'none'); $(dataLocation).css('display', 'block'); }); }); }); } // =================================================== // BEFORE AFTER FILTERS // =================================================== function beforeAfterFilters() { $('.before-after-list').each(function () { var filter = $(this).find('.before-after-filters button'); var beforeType = $(this).find('.before-after'); var loadMore = $(this).closest('section').find('.load-more-parent'); $(filter).each(function() { var dataTreatments = '.before-after.' + $(this).attr('data-treatment'); $(this).on('click', function() { $(filter).removeClass('active'); $(this).addClass('active'); $(beforeType).css('display', 'none'); $(dataTreatments).css('display', 'block'); $(loadMore).css('display', 'none'); $(beforeType).removeClass('hidden-load'); }); }); }); } // =================================================== // TABS // =================================================== function tabs() { // utility functions if(!Util) function Util () {}; Util.addClass = function(el, className) { var classList = className.split(' '); el.classList.add(classList[0]); if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); }; Util.removeClass = function(el, className) { var classList = className.split(' '); el.classList.remove(classList[0]); if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); }; Util.toggleClass = function(el, className, bool) { if(bool) Util.addClass(el, className); else Util.removeClass(el, className); }; Util.setAttributes = function(el, attrs) { for(var key in attrs) { el.setAttribute(key, attrs[key]); } }; Util.hasClass = function(el, className) { return el.classList.contains(className); }; Util.getChildrenByClassName = function(el, className) { var children = el.children, childrenByClass = []; for (var i = 0; i < children.length; i++) { if (Util.hasClass(children[i], className)) childrenByClass.push(children[i]); } return childrenByClass; }; Util.getIndexInArray = function(array, el) { return Array.prototype.indexOf.call(array, el); }; // File#: _1_tabs // Usage: codyhouse.co/license (function() { var Tab = function(element) { this.element = element; this.tabList = this.element.getElementsByClassName('js-tabs__controls')[0]; this.listItems = this.tabList.getElementsByClassName('tab-features__control-wrapper'); this.triggers = this.tabList.getElementsByTagName('a'); this.panelsList = this.element.getElementsByClassName('js-tabs__panels')[0]; this.panels = Util.getChildrenByClassName(this.panelsList, 'js-tabs__panel'); this.hideClass = this.element.getAttribute('data-hide-panel-class') ? this.element.getAttribute('data-hide-panel-class') : 'th8-hide'; this.customShowClass = this.element.getAttribute('data-show-panel-class') ? this.element.getAttribute('data-show-panel-class') : false; this.layout = this.element.getAttribute('data-tabs-layout') ? this.element.getAttribute('data-tabs-layout') : 'horizontal'; // deep linking options this.deepLinkOn = this.element.getAttribute('data-deep-link') == 'on'; // init tabs this.initTab(); }; Tab.prototype.initTab = function() { //set initial aria attributes this.tabList.setAttribute('role', 'tablist'); Util.addClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == 0), panelId = this.panels[i].getAttribute('id'); this.listItems[i].setAttribute('role', 'presentation'); Util.setAttributes(this.triggers[i], {'role': 'tab', 'aria-selected': bool, 'aria-controls': panelId, 'id': panelId}); Util.addClass(this.triggers[i], 'js-tabs__trigger'); Util.setAttributes(this.panels[i], {'role': 'tabpanel', 'aria-labelledby': panelId}); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(bool && this.customShowClass) Util.addClass(this.panels[i], this.customShowClass); if(!bool) this.triggers[i].setAttribute('tabindex', '-1'); } //listen for Tab events this.initTabEvents(); // check deep linking option this.initDeepLink(); }; Tab.prototype.initTabEvents = function() { var self = this; //click on a new tab -> select content this.tabList.addEventListener('click', function(event) { if( event.target.closest('.js-tabs__trigger') ) self.triggerTab(event.target.closest('.js-tabs__trigger'), event); }); //arrow keys to navigate through tabs this.tabList.addEventListener('keydown', function(event) { ; if( !event.target.closest('.js-tabs__trigger') ) return; if( tabNavigateNext(event, self.layout) ) { event.preventDefault(); self.selectNewTab('next'); } else if( tabNavigatePrev(event, self.layout) ) { event.preventDefault(); self.selectNewTab('prev'); } }); }; Tab.prototype.selectNewTab = function(direction) { var selectedTab = this.tabList.querySelector('[aria-selected="true"]'), index = Util.getIndexInArray(this.triggers, selectedTab); index = (direction == 'next') ? index + 1 : index - 1; //make sure index is in the correct interval //-> from last element go to first using the right arrow, from first element go to last using the left arrow if(index < 0) index = this.listItems.length - 1; if(index >= this.listItems.length) index = 0; this.triggerTab(this.triggers[index]); this.triggers[index].focus(); }; Tab.prototype.triggerTab = function(tabTrigger, event) { var self = this; event && event.preventDefault(); var index = Util.getIndexInArray(this.triggers, tabTrigger); //no need to do anything if tab was already selected if(this.triggers[index].getAttribute('aria-selected') == 'true') return; Util.removeClass(this.element, 'tabs--no-interaction'); for( var i = 0; i < this.triggers.length; i++) { var bool = (i == index); Util.toggleClass(this.panels[i], this.hideClass, !bool); if(this.customShowClass) Util.toggleClass(this.panels[i], this.customShowClass, bool); this.triggers[i].setAttribute('aria-selected', bool); bool ? this.triggers[i].setAttribute('tabindex', '0') : this.triggers[i].setAttribute('tabindex', '-1'); } // update url if deepLink is on if(this.deepLinkOn) { history.replaceState(null, '', '#'+tabTrigger.getAttribute('aria-controls')); } }; Tab.prototype.initDeepLink = function() { if(!this.deepLinkOn) return; var hash = window.location.hash.substr(1); var self = this; if(!hash || hash == '') return; for(var i = 0; i < this.panels.length; i++) { if(this.panels[i].getAttribute('id') == hash) { this.triggerTab(this.triggers[i], false); setTimeout(function(){self.panels[i].scrollIntoView(true);}); break; } }; }; function tabNavigateNext(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 39 || event.key && event.key == 'ArrowRight')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 40 || event.key && event.key == 'ArrowDown')) {return true;} else {return false;} }; function tabNavigatePrev(event, layout) { if(layout == 'horizontal' && (event.keyCode && event.keyCode == 37 || event.key && event.key == 'ArrowLeft')) {return true;} else if(layout == 'vertical' && (event.keyCode && event.keyCode == 38 || event.key && event.key == 'ArrowUp')) {return true;} else {return false;} }; window.Tab = Tab; //initialize the Tab objects var tabs = document.getElementsByClassName('js-tabs'); if( tabs.length > 0 ) { for( var i = 0; i < tabs.length; i++) { (function(i){new Tab(tabs[i]);})(i); } } }()); // $('.tab-features__control').on('click', function(e) { // e.preventDefault(); // var headerHeight = $('header').height(); // var offset = $(this).parents('.tab-features').offset().top; // var scrollAmount = offset - headerHeight; // setTimeout(function() { // $('html, body').stop().animate({ // scrollTop: scrollAmount // }, 400); // }, 300); // }); } // =================================================== // VIDEO TESTIMONIALS // =================================================== function videoTestimonials() { $('.video-testimonial-video').each(function () { var playButton = $(this).find('.video__play-button'); var poster = $(this).find('.poster'); $(this).on('click', function() { $(poster).fadeOut("slow"); }); }); } // =================================================== // AVATAR COLOURS // =================================================== function reviewAvatar() { $('.avatar--color').each(function () { var x = Math.floor((Math.random() * 120) + 136); var y = Math.floor((Math.random() * 120) + 136); var z = Math.floor((Math.random() * 120) + 136); var bgColor = "rgb(" + x + "," + y + "," + z + ")"; $(this).css('background-color', bgColor); }); } // =================================================== // CUSTOM MAP // =================================================== function customMap() { $('.custom-map').each(function(){ // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); var coordinates = $(mapElement).attr('data-coordinates'); var coordinatesArr = coordinates.split(','); var latitude = coordinatesArr[0]; var longitude = coordinatesArr[1]; if(coordinates == '') { } else { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 13, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(latitude, longitude), // New York }; // Create the Google Map using our element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Let's also add a marker while we're at it // var marker = new google.maps.Marker({ // position: new google.maps.LatLng(coordinates), // map: map, // title: 'CITU' // }); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#21211e", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 15 } var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map, // icon: icon }); } }); } // =================================================== // LOAD MORE // =================================================== function loadMore() { $('.load-more').click(function(){ $(this).closest('section').find('.hidden-load').removeClass('hidden-load'); $(this).parent().remove(); }); } // =================================================== // MENU BUTTON // =================================================== function menuButton() { $('.toggle-menu').click (function(){ $(this).toggleClass('active'); $('body').toggleClass('menu--active'); $('#menu').toggleClass('open'); }); $('header a').click (function(){ $('.toggle-menu').removeClass('active'); $('body').removeClass('menu--active'); $('#menu').removeClass('open'); }); } // =================================================== // ARCHIVE MAP // =================================================== function clincsMap() { var mapElement = document.getElementById('clinics-map'); var mapOptions = { zoom: 4, center: new google.maps.LatLng('15.331230236048114','114.40044685455678'), disableDefaultUI: true, styles: [ {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20},{ visibility: "off" }]}, { featureType: "administrative.country", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "administrative.province", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] }, {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2},{ "visibility": "off" }]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21},{ "visibility": "off" }]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16},{ "visibility": "off" }]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40},{ "visibility": "off" }]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19},{ "visibility": "off" }]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2},{ "visibility": "off" }]}] }; var map = new google.maps.Map(mapElement, mapOptions); var icon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "#0000FF", fillOpacity: 1, strokeColor: "blue", strokeOpacity: 1, strokeWeight: 0, scale: 8 } } // =================================================== // STRIPE FORM // =================================================== function stripeForm() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i <ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } (function($) { 'use strict'; $("form.cf7sa :input").change(function() { var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if($(this).attr('type')=='checkbox'){ if( $(this).closest('.wpcf7-checkbox').hasClass('wpcf7-validates-as-required') && $(this).prop('checked') != true ) { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } } else if ( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( getCookie("wp-sfrom")==1 && flag == 'valid' ) { jQuery('.wpcf7-submit').prop("disabled",false); } else { jQuery('.wpcf7-submit').prop("disabled",true); } }); if (typeof wpcf7 === 'undefined' || wpcf7 === null) { return } if (typeof wpcf7_cf7sa === 'undefined' || wpcf7_cf7sa === null) { var wpcf7_cf7sa = '' } wpcf7_cf7sa = $.extend({ cached: 0, inputs: [] }, wpcf7); $(function() { wpcf7_cf7sa.supportHtml5 = (function() { var features = {}; var input = document.createElement('input'); features.placeholder = 'placeholder' in input; var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date']; $.each(inputTypes, function(index, value) { input.setAttribute('type', value); features[value] = input.type !== 'text' }); return features })(); $('div.wpcf7 > form.cf7sa').each(function() { var $form = $(this); wpcf7_cf7sa.initForm($form); if (wpcf7_cf7sa.cached) { wpcf7_cf7sa.refill($form) } }) }); wpcf7_cf7sa.getId = function(form) { return parseInt($('input[name="_wpcf7"]', form).val(), 10) }; wpcf7_cf7sa.stripeTokenHandler = function(token, form) { $('input[name="stripeClientSecret"]', form).val(token) } wpcf7_cf7sa.initForm = function(form) { var enablePostalCode = cf7sa_object.enablePostalCode; if(enablePostalCode == 1){ var enablePostalCodecf7 = true; }else{ var enablePostalCodecf7 = false; } jQuery('.wpcf7-submit').prop("disabled",true); var $form = $(form); var form_id = wpcf7_cf7sa.getId($form); var stripe; var elements; var cardElement; var paymentForm; if (cf7sa_object.cf7sa_stripe.hasOwnProperty(form_id)) { stripe = Stripe(cf7sa_object.cf7sa_stripe[form_id]); elements = stripe.elements(); cardElement = elements.create('card', { style: JSON.parse(cf7sa_object.cf7sa_stripe_style[form_id]), hidePostalCode: enablePostalCodecf7, }); cardElement.mount('#card-element-' + form_id); cardElement.addEventListener('change', function(event) { setCookie("wp-sfrom", 0, 1); jQuery('.wpcf7-submit').prop("disabled",true); var displayError = document.getElementById('card-errors-' + form_id); if (event.error) { jQuery('.wpcf7-submit').prop("disabled",true); displayError.textContent = event.error.message; } else { displayError.textContent = ''; } if (event.complete) { setCookie("wp-sfrom", 1, 1); var flag = 'valid'; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { flag = 'invalid'; jQuery('.wpcf7-submit').prop("disabled",true); } }); if( flag == 'invalid' ) { jQuery('.wpcf7-submit').prop("disabled",true); } else { jQuery('.wpcf7-submit').prop("disabled",false); } } }) } $form.submit(function(event) { if( getCookie("wp-sfrom")!=1 ) { return false; } $('.ajax-loader', $form).addClass('is-active'); document.addEventListener('wpcf7invalid', function(event) { return !1 }, !1); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder].placeheld', $form).each(function(i, n) { $(n).val('').removeClass('placeheld') }) } document.addEventListener('submit', async (e) => { if( getCookie("wp-sfrom")!=1 ) { return false; } e.preventDefault(); var formData = new FormData($form.get(0)); var $message = $('.wpcf7-response-output', $form); var form_id = wpcf7_cf7sa.getId($form); var intentresponse = ""; $.ajax({ type: 'POST', url: cf7sa_object.ajax_url, data: formData, processData: !1, contentType: !1, beforeSend: function() { $('.ajax-loader', $form).addClass('is-active'); $('.wpcf7-form').addClass('payment-submitting'); jQuery('.wpcf7-submit').prop("disabled",true); var flag = 0; $('form.wpcf7-form input').each( function(i) { if( $(this).hasClass('wpcf7-validates-as-required') && $(this).val() == '') { $('.wpcf7-spinner').hide(); $('.wpcf7-response-output').show(); flag = 1; } }); if( flag == 0 ) { $('.wpcf7-spinner').show(); $('.wpcf7-response-output').hide(); } }, success: function(response) { if (response!='0') { jQuery('.wpcf7-submit').prop("disabled",true); setCookie("wp-sfrom", 0, 1); const IntentsResponse = stripe.confirmCardPayment(response, { payment_method: { card: cardElement, }, }) IntentsResponse.then(function(result) { if (result.paymentIntent) { if (typeof(result.paymentIntent) !== 'undefined') { if (result.paymentIntent.status == "succeeded") { $('input[name="stripeClientSecret"]').val(result.paymentIntent.id); wpcf7_cf7sa.submit($form, result, elements, cardElement) } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>'+ frontend_msg_object.undefined +'</span>').slideDown('fast'); $("#please-wait").hide(); } } else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } }) }else { $('.wpcf7-form').removeClass('payment-submitting'); $message.html('').append('<span>Payment is faild</span>').slideDown('fast'); $("#please-wait").hide(); } jQuery('.wpcf7-submit').prop("disabled",false); } }); event.preventDefault() }) }); if ($($form).find('.ajax-loader').length < 1) { $('.wpcf7-submit', $form).after('<span class="ajax-loader"></span>') } //wpcf7_cf7sa.toggleSubmit($form); // $form.on('click', '.wpcf7-acceptance', function() { // wpcf7_cf7sa.toggleSubmit($form) // }); $('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function() { var name = $(this).attr('name'); $form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', !1) }); $('.wpcf7-list-item.has-free-text', $form).each(function() { var $freetext = $(':input.wpcf7-free-text', this); var $wrap = $(this).closest('.wpcf7-form-control'); if ($(':checkbox, :radio', this).is(':checked')) { $freetext.prop('disabled', !1) } else { $freetext.prop('disabled', !0) } $wrap.on('change', ':checkbox, :radio', function() { var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio'); if ($cb.is(':checked')) { $freetext.prop('disabled', !1).focus() } else { $freetext.prop('disabled', !0) } }) }); if (!wpcf7_cf7sa.supportHtml5.placeholder) { $('[placeholder]', $form).each(function() { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld'); $(this).focus(function() { if ($(this).hasClass('placeheld')) { $(this).val('').removeClass('placeheld') } }); $(this).blur(function() { if ('' === $(this).val()) { $(this).val($(this).attr('placeholder')); $(this).addClass('placeheld') } }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.date) { $form.find('input.wpcf7-date[type="date"]').each(function() { $(this).datepicker({ dateFormat: 'yy-mm-dd', minDate: new Date($(this).attr('min')), maxDate: new Date($(this).attr('max')) }) }) } if (wpcf7_cf7sa.jqueryUi && !wpcf7_cf7sa.supportHtml5.number) { $form.find('input.wpcf7-number[type="number"]').each(function() { $(this).spinner({ min: $(this).attr('min'), max: $(this).attr('max'), step: $(this).attr('step') }) }) } $('.wpcf7-character-count', $form).each(function() { var $count = $(this); var name = $count.attr('data-target-name'); var down = $count.hasClass('down'); var starting = parseInt($count.attr('data-starting-value'), 10); var maximum = parseInt($count.attr('data-maximum-value'), 10); var minimum = parseInt($count.attr('data-minimum-value'), 10); var updateCount = function(target) { var $target = $(target); var length = $target.val().length; var count = down ? starting - length : length; $count.attr('data-current-value', count); $count.text(count); if (maximum && maximum < length) { $count.addClass('too-long') } else { $count.removeClass('too-long') } if (minimum && length < minimum) { $count.addClass('too-short') } else { $count.removeClass('too-short') } }; $(':input[name="' + name + '"]', $form).each(function() { updateCount(this); $(this).keyup(function() { updateCount(this) }) }) }); $form.on('change', '.wpcf7-validates-as-url', function() { var val = $.trim($(this).val()); if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i) && -1 !== val.indexOf('.')) { val = val.replace(/^\/+/, ''); val = 'http://' + val } $(this).val(val) }) }; wpcf7_cf7sa.submit = function(form, stripe, elements, card) { if (typeof window.FormData !== 'function') { return } var $form = $(form); $('.ajax-loader', $form).addClass('is-active'); wpcf7_cf7sa.clearResponse($form); var formData = new FormData($form.get(0)); var detail = { id: $form.closest('div.wpcf7').attr('id'), status: 'init', inputs: [], formData: formData }; $.each($form.serializeArray(), function(i, field) { if ('_wpcf7' == field.name) { detail.contactFormId = field.value } else if ('_wpcf7_version' == field.name) { detail.pluginVersion = field.value } else if ('_wpcf7_locale' == field.name) { detail.contactFormLocale = field.value } else if ('_wpcf7_unit_tag' == field.name) { detail.unitTag = field.value } else if ('_wpcf7_container_post' == field.name) { detail.containerPostId = field.value } else if (field.name.match(/^_wpcf7_\w+_free_text_/)) { var owner = field.name.replace(/^_wpcf7_\w+_free_text_/, ''); detail.inputs.push({ name: owner + '-free-text', value: field.value }) } else if (field.name.match(/^_/)) {} else { detail.inputs.push(field) } }); wpcf7_cf7sa.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail); var ajaxSuccess = function(data, status, xhr, $form) { detail.id = $(data.into).attr('id'); detail.status = data.status; detail.apiResponse = data; var $message = $('.wpcf7-response-output', $form); switch (data.status) { case 'validation_failed': $.each(data.invalidFields, function(i, n) { $(n.into, $form).each(function() { wpcf7_cf7sa.notValidTip(this, n.message); $('.wpcf7-form-control', this).addClass('wpcf7-not-valid'); $('[aria-invalid]', this).attr('aria-invalid', 'true') }) }); $message.addClass('wpcf7-validation-errors'); $form.addClass('invalid'); wpcf7_cf7sa.triggerEvent(data.into, 'invalid', detail); break; case 'acceptance_missing': $message.addClass('wpcf7-acceptance-missing'); $form.addClass('unaccepted'); wpcf7_cf7sa.triggerEvent(data.into, 'unaccepted', detail); break; case 'spam': $message.addClass('wpcf7-spam-blocked'); $form.addClass('spam'); wpcf7_cf7sa.triggerEvent(data.into, 'spam', detail); break; case 'aborted': $message.addClass('wpcf7-aborted'); $form.addClass('aborted'); wpcf7_cf7sa.triggerEvent(data.into, 'aborted', detail); break; case 'mail_sent': $message.addClass('wpcf7-mail-sent-ok'); $form.addClass('sent'); wpcf7_cf7sa.triggerEvent(data.into, 'mailsent', detail); break; case 'mail_failed': $message.addClass('wpcf7-mail-sent-ng'); $form.addClass('failed'); wpcf7_cf7sa.triggerEvent(data.into, 'mailfailed', detail); break; default: var customStatusClass = 'custom-' + data.status.replace(/[^0-9a-z]+/i, '-'); $message.addClass('wpcf7-' + customStatusClass); $form.addClass(customStatusClass) } wpcf7_cf7sa.refill($form, data); wpcf7_cf7sa.triggerEvent(data.into, 'submit', detail); if ( $form.hasClass('sent') ) { $form.each(function() { this.reset() }); //wpcf7_cf7sa.toggleSubmit($form) } if (!wpcf7_cf7sa.supportHtml5.placeholder) { $form.find('[placeholder].placeheld').each(function(i, n) { $(n).val($(n).attr('placeholder')) }) } $message.html('').append(data.message).slideDown('fast'); $message.attr('role', 'alert'); $('.screen-reader-response', $form.closest('.wpcf7')).each(function() { var $response = $(this); $response.html('').attr('role', '').append(data.message); if (data.invalidFields) { var $invalids = $('<ul></ul>'); $.each(data.invalidFields, function(i, n) { if (n.idref) { var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message)) } else { var $li = $('<li></li>').append(n.message) } $invalids.append($li) }); $response.append($invalids) } $response.attr('role', 'alert').focus() }) }; $.ajax({ type: 'POST', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: !1, contentType: !1 }).done(function(data, status, xhr) { ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); $("#please-wait").hide(); $('.wpcf7-form').removeClass('payment-submitting') }).fail(function(xhr, status, error) { var $e = $('<div class="ajax-error"></div>').text(error.message); $form.after($e) }) }; wpcf7_cf7sa.triggerEvent = function(target, name, detail) { var $target = $(target); var event = new CustomEvent('wpcf7' + name, { bubbles: !0, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail) }; /*wpcf7_cf7sa.toggleSubmit = function(form, state) { var $form = $(form); var $submit = $('input:submit', $form); if (typeof state !== 'undefined') { $submit.prop('disabled', !state); return } if ($form.hasClass('wpcf7-acceptance-as-validation')) { return } $submit.prop('disabled', !1); $('.wpcf7-acceptance', $form).each(function() { var $span = $(this); var $input = $('input:checkbox', $span); if (!$span.hasClass('optional')) { if ($span.hasClass('invert') && $input.is(':checked') || !$span.hasClass('invert') && !$input.is(':checked')) { $submit.prop('disabled', !0); return !1 } } }) };*/ wpcf7_cf7sa.notValidTip = function(target, message) { var $target = $(target); $('.wpcf7-not-valid-tip', $target).remove(); $('<span role="alert" class="wpcf7-not-valid-tip"></span>').text(message).appendTo($target); if ($target.is('.use-floating-validation-tip *')) { var fadeOut = function(target) { $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function() { $(this).css({ 'z-index': -100 }) }) }; $target.on('mouseover', '.wpcf7-not-valid-tip', function() { fadeOut(this) }); $target.on('focus', ':input', function() { fadeOut($('.wpcf7-not-valid-tip', $target)) }) } }; wpcf7_cf7sa.refill = function(form, data) { var $form = $(form); var refillCaptcha = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]) }) }; var refillQuiz = function($form, items) { $.each(items, function(i, n) { $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]) }) }; if (typeof data === 'undefined') { $.ajax({ type: 'GET', url: wpcf7_cf7sa.api.getRoute('/contact-forms/' + wpcf7_cf7sa.getId($form) + '/refill'), beforeSend: function(xhr) { var nonce = $form.find(':input[name="_wpnonce"]').val(); if (nonce) { xhr.setRequestHeader('X-WP-Nonce', nonce) } }, dataType: 'json' }).done(function(data, status, xhr) { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } }) } else { if (data.captcha) { refillCaptcha($form, data.captcha) } if (data.quiz) { refillQuiz($form, data.quiz) } } }; wpcf7_cf7sa.clearResponse = function(form) { var $form = $(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form).hide().empty().removeAttr('role').removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked') }; wpcf7_cf7sa.api.getRoute = function(path) { var url = wpcf7_cf7sa.api.root + wpcf7_cf7sa.api.namespace + path; return url } })(jQuery); (function() { if (typeof window.CustomEvent === "function") return !1; function CustomEvent(event, params) { params = params || { bubbles: !1, cancelable: !1, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent })() } // =================================================== // INITIALISE // =================================================== function initialLoad() { //document.body.scrollTop = document.documentElement.scrollTop = 0; $('body').addClass('initial-load'); $('#ajax-load-more').attr('data-ran', true); menuButton(); scrolledNav(); showHideNav(); //init(); showSearchBox(); scrollToTop(); showHideScrollToTop(); $(window).scroll(function() { showHideScrollToTop(); }); } function init() { window.dataLayer.push({ event: 'VirtualPageview', virtualPageURL: window.location.pathname + window.location.search, virtualPageTitle: document.title }); observer.observe(); hideHeader(); focusInputForm(); customSuccess(); addClassinView(); //if (document.querySelector('.ani')) { fadeInScroll(); } if (document.querySelector('.cf7sa-form-code')) { stripeForm(); } if (document.querySelector('#clinics-map')) { clincsMap(); } if (document.querySelector('.scrolldown')) { scrollDown(); } if (document.querySelector('.js-tabs')) { tabs(); } if (document.querySelector('.load-more')) { loadMore(); } if (document.querySelector('.custom-map')) { customMap(); } if (document.querySelector('.avatar--color')) { reviewAvatar(); } if (document.querySelector('.video-testimonial-video')) { videoTestimonials(); } if (document.querySelector('.before-after-filters')) { beforeAfterFilters(); } if (document.querySelector('.dentist-clinic-filters')) { dentistClinicFilters(); } if (document.querySelector('#dentist_search')) { dentistSearch(); } if (document.querySelector('.clinic-region-filters')) { clinicRegionFilters(); } if (document.querySelector('.search-results-filters')) { searchResultsFilters(); } if (document.querySelector('#clinic_search')) { clinicSearch(); } if (document.querySelector('.category--links')) { categoryLinks(); } if (document.querySelector('.counter')) { statsCounter(); } if (document.querySelector('.p-table')) { pricingTable(); } if (document.querySelector('#ajax-load-more')) { loadPosts(); } if (document.querySelector('.accordion')) { accordions(); } if (document.querySelector('.open--info--popup')) { openPopupForm(); } if (document.querySelector('.carousel')) { carousels(); } if (document.querySelector('video')) { customVideoButton(); } var alm_ran = false; } initialLoad(); init();