PageSourceSearch

https://www.go-thassos.gr/sites/default/files/js/js_qtQoBs8MMCG-l0cpSh2MWEOlkZK9D493-Vk0AvFuGb4.js

js go-thassos.gr collected 2026-09-25 00:19:50 UTC 123,306 bytes, 1,593 lines download raw bytes

1/*! lazysizes - v3.0.0-rc4 */
2!function(a,b,c){"use strict";function d(b,c){var d,e,f,g,h=a.getComputedStyle(b);e=b.parentNode,g={isPicture:!(!e||!m.test(e.nodeName||""))},f=function(a,c){var d=b.getAttribute("data-"+a);if(!d){var e=h.getPropertyValue("--ls-"+a);e&&(d=e.trim())}if(d){if("true"==d)d=!0;else if("false"==d)d=!1;else if(l.test(d))d=parseFloat(d);else if("function"==typeof j[a])d=j[a](b,d);else if(q.test(d))try{d=JSON.parse(d)}catch(f){}g[a]=d}else a in j&&"function"!=typeof j[a]?g[a]=j[a]:c&&"function"==typeof j[a]&&(g[a]=j[a](b,d))};for(d in j)f(d);return c.replace(p,function(a,b){b in g||f(b,!0)}),g}function e(a,b){var c=[],d=function(a,c){return k[typeof b[c]]?b[c]:a};return c.srcset=[],b.absUrl&&(s.setAttribute("href",a),a=s.href),a=((b.prefix||"")+a+(b.postfix||"")).replace(p,d),b.widths.forEach(function(d){var e=b.widthmap[d]||d,f={u:a.replace(n,e).replace(o,b.ratio?Math.round(d*b.ratio):""),w:d};c.push(f),c.srcset.push(f.c=f.u+" "+d+"w")}),c}function f(a,c,d){var f=0,g=0,h=d;if(a){if("container"===c.ratio){for(f=h.scrollWidth,g=h.scrollHeight;!(f&&g||h===b);)h=h.parentNode,f=h.scrollWidth,g=h.scrollHeight;f&&g&&(c.ratio=g/f)}a=e(a,c),a.isPicture=c.isPicture,u&&"IMG"==d.nodeName.toUpperCase()?d.removeAttribute(i.srcsetAttr):d.setAttribute(i.srcsetAttr,a.srcset.join(", ")),Object.defineProperty(d,"_lazyrias",{value:a,writable:!0})}}function g(a,b){var c=d(a,b);return j.modifyOptions.call(a,{target:a,details:c,detail:c}),lazySizes.fire(a,"lazyriasmodifyoptions",c),c}function h(a){return a.getAttribute(a.getAttribute("data-srcattr")||j.srcAttr)||a.getAttribute(i.srcsetAttr)||a.getAttribute(i.srcAttr)||a.getAttribute("data-pfsrcset")||""}if(b.addEventListener){var i,j,k={string:1,number:1},l=/^\-*\+*\d+\.*\d*$/,m=/^picture$/i,n=/\s*\{\s*width\s*\}\s*/i,o=/\s*\{\s*height\s*\}\s*/i,p=/\s*\{\s*([a-z0-9]+)\s*\}\s*/gi,q=/^\[.*\]|\{.*\}$/,r=/^(?:auto|\d+(px)?)$/,s=b.createElement("a"),t=b.createElement("img"),u="srcset"in t&&!("sizes"in t),v=!!a.HTMLPictureElement&&!u;!function(){var b,c=function(){},d={prefix:"",postfix:"",srcAttr:"data-src",absUrl:!1,modifyOptions:c,widthmap:{},ratio:!1};i=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,i||(i={},a.lazySizesConfig=i),i.supportsType||(i.supportsType=function(a){return!a}),i.rias||(i.rias={}),j=i.rias,"widths"in j||(j.widths=[],function(a){for(var b,c=0;!b||3e3>b;)c+=5,c>30&&(c+=1),b=36*c,a.push(b)}(j.widths));for(b in d)b in j||(j[b]=d[b])}(),addEventListener("lazybeforesizes",function(a){var b,c,d,e,k,l,m,o,p,q,s,t,u;if(b=a.target,a.detail.dataAttr&&!a.defaultPrevented&&!j.disabled&&(p=b.getAttribute(i.sizesAttr)||b.getAttribute("sizes"))&&r.test(p)){if(c=h(b),d=g(b,c),s=n.test(d.prefix)||n.test(d.postfix),d.isPicture&&(e=b.parentNode))for(k=e.getElementsByTagName("source"),l=0,m=k.length;m>l;l++)(s||n.test(o=h(k[l])))&&(f(o,d,k[l]),t=!0);s||n.test(c)?(f(c,d,b),t=!0):t&&(u=[],u.srcset=[],u.isPicture=!0,Object.defineProperty(b,"_lazyrias",{value:u,writable:!0})),t&&(v?b.removeAttribute(i.srcAttr):"auto"!=p&&(q={width:parseInt(p,10)},w({target:b,detail:q})))}},!0);var w=function(){var c=function(a,b){return a.w-b.w},d=function(a){var b,c,d=a.length,e=a[d-1],f=0;for(f;d>f;f++)if(e=a[f],e.d=e.w/a.w,e.d>=a.d){!e.cached&&(b=a[f-1])&&b.d>a.d-.13*Math.pow(a.d,2.2)&&(c=Math.pow(b.d-.6,1.6),b.cached&&(b.d+=.15*c),b.d+(e.d-a.d)*c>a.d&&(e=b));break}return e},e=function(a,b){var c;return!a._lazyrias&&lazySizes.pWS&&(c=lazySizes.pWS(a.getAttribute(i.srcsetAttr||""))).length&&(Object.defineProperty(a,"_lazyrias",{value:c,writable:!0}),b&&a.parentNode&&(c.isPicture="PICTURE"==a.parentNode.nodeName.toUpperCase())),a._lazyrias},f=function(b){var c=a.devicePixelRatio||1,d=lazySizes.getX&&lazySizes.getX(b);return Math.min(d||c,2.4,c)},g=function(b,g){var h,i,j,k,l,m;if(l=b._lazyrias,l.isPicture&&a.matchMedia)for(i=0,h=b.parentNode.getElementsByTagName("source"),j=h.length;j>i;i++)if(e(h[i])&&!h[i].getAttribute("type")&&(!(k=h[i].getAttribute("media"))||(matchMedia(k)||{}).matches)){l=h[i]._lazyrias;break}return(!l.w||l.w<g)&&(l.w=g,l.d=f(b),m=d(l.sort(c))),m},h=function(c){var d,f=c.target;return!u&&(a.respimage||a.picturefill||lazySizesConfig.pf)?void b.removeEventListener("lazybeforesizes",h):void(("_lazyrias"in f||c.detail.dataAttr&&e(f,!0))&&(d=g(f,c.detail.width),d&&d.u&&f._lazyrias.cur!=d.u&&(f._lazyrias.cur=d.u,d.cached=!0,lazySizes.rAF(function(){f.setAttribute(i.srcAttr,d.u),f.setAttribute("src",d.u)}))))};return v?h=function(){}:addEventListener("lazybeforesizes",h),h}()}}(window,document);;
3/*! lazysizes - v3.0.0-rc4 */
4!function(a,b){var c=b(a,a.document);a.lazySizes=c,"object"==typeof module&&module.exports&&(module.exports=c)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d=b.documentElement,e=a.Date,f=a.HTMLPictureElement,g="addEventListener",h="getAttribute",i=a[g],j=a.setTimeout,k=a.requestAnimationFrame||j,l=a.requestIdleCallback,m=/^picture$/i,n=["load","error","lazyincluded","_lazyloaded"],o={},p=Array.prototype.forEach,q=function(a,b){return o[b]||(o[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),o[b].test(a[h]("class")||"")&&o[b]}
4,r=function(a,b){q(a,b)||a.setAttribute("class",(a[h]("class")||"").trim()+" "+b)},s=function(a,b){var c;(c=q(a,b))&&a.setAttribute("class",(a[h]("class")||"").replace(c," "))},t=function(a,b,c){var d=c?g:"removeEventListener";c&&t(a,b),n.forEach(function(c){a[d](c,b)})},u=function(a,c,d,e,f){var g=b.createEvent("CustomEvent");return g.initCustomEvent(c,!e,!f,d||{}),a.dispatchEvent(g),g},v=function(b,d){var e;!f&&(e=a.picturefill||c.pf)?e({reevaluate:!0,elements:[b]}):d&&d.src&&(b.src=d.src)},w=function(a,b){return(getComputedStyle(a,null)||{})[b]},x=function(a,b,d){for(d=d||a.offsetWidth;d<c.minSize&&b&&!a._lazysizesWidth;)d=b.offsetWidth,b=b.parentNode;return d},y=function(){var a,c,d=[],e=[],f=d,g=function(){var b=f;for(f=d.length?e:d,a=!0,c=!1;b.length;)b.shift()();a=!1},h=function(d,e){a&&!e?d.apply(this,arguments):(f.push(d),c||(c=!0,(b.hidden?j:k)(g)))};return h._lsFlush=g,h}(),z=function(a,b){return b?function(){y(a)}:function(){var b=this,c=arguments;y(function(){a.apply(b,c)})}},A=function(a){var b,c=0,d=125,f=666,g=f,h=function(){b=!1,c=e.now(),a()},i=l?function(){l(h,{timeout:g}),g!==f&&(g=f)}:z(function(){j(h)},!0);return function(a){var f;(a=a===!0)&&(g=44),b||(b=!0,f=d-(e.now()-c),0>f&&(f=0),a||9>f&&l?i():j(i,f))}},B=function(a){var b,c,d=99,f=function(){b=null,a()},g=function(){var a=e.now()-c;d>a?j(g,d-a):(l||f)(f)};return function(){c=e.now(),b||(b=j(g,d))}},C=function(){var f,k,l,n,o,x,C,E,F,G,H,I,J,K,L,M=/^img$/i,N=/^iframe$/i,O="onscroll"in a&&!/glebot/.test(navigator.userAgent),P=0,Q=0,R=0,S=-1,T=function(a){R--,a&&a.target&&t(a.target,T),(!a||0>R||!a.target)&&(R=0)},U=function(a,c){var e,f=a,g="hidden"==w(b.body,"visibility")||"hidden"!=w(a,"visibility");for(F-=c,I+=c,G-=c,H+=c;g&&(f=f.offsetParent)&&f!=b.body&&f!=d;)g=(w(f,"opacity")||1)>0,g&&"visible"!=w(f,"overflow")&&(e=f.getBoundingClientRect(),g=H>e.left&&G<e.right&&I>e.top-1&&F<e.bottom+1);return g},V=function(){var a,e,g,i,j,m,n,p,q;if((o=c.loadMode)&&8>R&&(a=f.length)){e=0,S++,null==K&&("expand"in c||(c.expand=d.clientHeight>500&&d.clientWidth>500?500:370),J=c.expand,K=J*c.expFactor),K>Q&&1>R&&S>2&&o>2&&!b.hidden?(Q=K,S=0):Q=o>1&&S>1&&6>R?J:P;for(;a>e;e++)if(f[e]&&!f[e]._lazyRace)if(O)if((p=f[e][h]("data-expand"))&&(m=1*p)||(m=Q),q!==m&&(C=innerWidth+m*L,E=innerHeight+m,n=-1*m,q=m),g=f[e].getBoundingClientRect(),(I=g.bottom)>=n&&(F=g.top)<=E&&(H=g.right)>=n*L&&(G=g.left)<=C&&(I||H||G||F)&&(l&&3>R&&!p&&(3>o||4>S)||U(f[e],m))){if(ba(f[e]),j=!0,R>9)break}else!j&&l&&!i&&4>R&&4>S&&o>2&&(k[0]||c.preloadAfterLoad)&&(k[0]||!p&&(I||H||G||F||"auto"!=f[e][h](c.sizesAttr)))&&(i=k[0]||f[e]);else ba(f[e]);i&&!j&&ba(i)}},W=A(V),X=function(a){r(a.target,c.loadedClass),s(a.target,c.loadingClass),t(a.target,Z)},Y=z(X),Z=function(a){Y({target:a.target})},$=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},_=function(a){var b,d,e=a[h](c.srcsetAttr);(b=c.customMedia[a[h]("data-media")||a[h]("media")])&&a.setAttribute("media",b),e&&a.setAttribute("srcset",e),b&&(d=a.parentNode,d.insertBefore(a.cloneNode(),a),d.removeChild(a))},aa=z(function(a,b,d,e,f){var g,i,k,l,o,q;(o=u(a,"lazybeforeunveil",b)).defaultPrevented||(e&&(d?r(a,c.autosizesClass):a.setAttribute("sizes",e)),i=a[h](c.srcsetAttr),g=a[h](c.srcAttr),f&&(k=a.parentNode,l=k&&m.test(k.nodeName||"")),q=b.firesLoad||"src"in a&&(i||g||l),o={target:a},q&&(t(a,T,!0),clearTimeout(n),n=j(T,2500),r(a,c.loadingClass),t(a,Z,!0)),l&&p.call(k.getElementsByTagName("source"),_),i?a.setAttribute("srcset",i):g&&!l&&(N.test(a.nodeName)?$(a,g):a.src=g),(i||l)&&v(a,{src:g})),a._lazyRace&&delete a._lazyRace,s(a,c.lazyClass),y(function(){(!q||a.complete&&a.naturalWidth>1)&&(q?T(o):R--,X(o))},!0)}),ba=function(a){var b,d=M.test(a.nodeName),e=d&&(a[h](c.sizesAttr)||a[h]("sizes")),f="auto"==e;(!f&&l||!d||!a.src&&!a.srcset||a.complete||q(a,c.errorClass))&&(b=u(a,"lazyunveilread").detail,f&&D.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,R++,aa(a,b,f,e,d))},ca=function(){if(!l){if(e.now()-x<999)return void j(ca,999);var a=B(function(){c.loadMode=3,W()});l=!0,c.loadMode=3,W(),i("scroll",function(){3==c.loadMode&&(c.loadMode=2),a()},!0)}};return{_:function(){x=e.now(),f=b.getElementsByClassName(c.lazyClass),
4k=b.getElementsByClassName(c.lazyClass+" "+c.preloadClass),L=c.hFac,i("scroll",W,!0),i("resize",W,!0),a.MutationObserver?new MutationObserver(W).observe(d,{childList:!0,subtree:!0,attributes:!0}):(d[g]("DOMNodeInserted",W,!0),d[g]("DOMAttrModified",W,!0),setInterval(W,999)),i("hashchange",W,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a){b[g](a,W,!0)}),/d$|^c/.test(b.readyState)?ca():(i("load",ca),b[g]("DOMContentLoaded",W),j(ca,2e4)),f.length?(V(),y._lsFlush()):W()},checkElems:W,unveil:ba}}(),D=function(){var a,d=z(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),m.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;g>f;f++)e[f].setAttribute("sizes",d);c.detail.dataAttr||v(a,c.detail)}),e=function(a,b,c){var e,f=a.parentNode;f&&(c=x(a,f,c),e=u(a,"lazybeforesizes",{width:c,dataAttr:!!b}),e.defaultPrevented||(c=e.detail.width,c&&c!==a._lazysizesWidth&&d(a,f,e,c)))},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)e(a[b])},g=B(f);return{_:function(){a=b.getElementsByClassName(c.autosizesClass),i("resize",g)},checkElems:g,updateElem:e}}(),E=function(){E.i||(E.i=!0,D._(),C._())};return function(){var b,d={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2};c=a.lazySizesConfig||a.lazysizesConfig||{};for(b in d)b in c||(c[b]=d[b]);a.lazySizesConfig=c,j(function(){c.init&&E()})}(),{cfg:c,autoSizer:D,loader:C,init:E,uP:v,aC:r,rC:s,hC:q,fire:u,gW:x,rAF:y}}});;
5/*!
6 * Flickity PACKAGED v2.3.0
7 * Touch, responsive, flickable carousels
8 *
9 * Licensed GPLv3 for open source use
10 * or Flickity Commercial License for commercial use
11 *
12 * https://flickity.metafizzy.co
13 * Copyright 2015-2021 Metafizzy
14 */
15(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});
16/*!
17 * getSize v2.0.3
18 * measure size of elements
19 * MIT license
20 */
21(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",["de
21sandro-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]};
21i.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("./sli
21de"),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);
21t=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();
21this.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});
22/*!
23 * Unipointer v2.4.0
24 * base class for doing one thing with pointer event
25 * MIT license
26 */
27(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});
28/*!
29 * Unidragger v2.4.0
30 * Draggable base class
31 * MIT license
32 */
33(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;
33if(!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;
33setTimeout(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};
33s._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,
33i){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);
33this.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});
34/*!
35 * Flickity v2.3.0
36 * Touch, responsive, flickable carousels
37 *
38 * Licensed GPLv3 for open source use
39 * or Flickity Commercial License for commercial use
40 *
41 * https://flickity.metafizzy.co
42 * Copyright 2015-2021 Metafizzy
43 */
44(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});
45/*!
46 * Flickity asNavFor v2.0.2
47 * enable asNavFor for Flickity
48 */
49(function(t,e){if(typeof define=="function"&&define.amd){define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("flickity"),require("fizzy-ui-utils"))}else{t.Flickity=e(t.Flickity,t.fizzyUIUtils)}})(window,function t(n,s){n.createMethods.push("_createAsNavFor");var e=n.prototype;e._createAsNavFor=function(){this.on("activate",this.activateAsNavFor);this.on("deactivate",this.deactivateAsNavFor);this.on("destroy",this.destroyAsNavFor);var e=this.options.asNavFor;if(!e){return}var i=this;setTimeout(function t(){i.setNavCompanion(e)})};e.setNavCompanion=function(t){t=s.getQueryElement(t);var e=n.data(t);
49if(!e||e==this){return}this.navCompanion=e;var i=this;this.onNavCompanionSelect=function(){i.navCompanionSelect()};e.on("select",this.onNavCompanionSelect);this.on("staticClick",this.onNavStaticClick);this.navCompanionSelect(true)};e.navCompanionSelect=function(t){var e=this.navCompanion&&this.navCompanion.selectedCells;if(!e){return}var i=e[0];var n=this.navCompanion.cells.indexOf(i);var s=n+e.length-1;var r=Math.floor(a(n,s,this.navCompanion.cellAlign));this.selectCell(r,false,t);this.removeNavSelectedElements();if(r>=this.cells.length){return}var o=this.cells.slice(n,s+1);this.navSelectedElements=o.map(function(t){return t.element});this.changeNavSelectedClass("add")};function a(t,e,i){return(e-t)*i+t}e.changeNavSelectedClass=function(e){this.navSelectedElements.forEach(function(t){t.classList[e]("is-nav-selected")})};e.activateAsNavFor=function(){this.navCompanionSelect(true)};e.removeNavSelectedElements=function(){if(!this.navSelectedElements){return}this.changeNavSelectedClass("remove");delete this.navSelectedElements};e.onNavStaticClick=function(t,e,i,n){if(typeof n=="number"){this.navCompanion.selectCell(n)}};e.deactivateAsNavFor=function(){this.removeNavSelectedElements()};e.destroyAsNavFor=function(){if(!this.navCompanion){return}this.navCompanion.off("select",this.onNavCompanionSelect);this.off("staticClick",this.onNavStaticClick);delete this.navCompanion};return n});
50/*!
51 * imagesLoaded v4.1.4
52 * JavaScript is all like "You images are done yet or what?"
53 * MIT License
54 */
55(function(e,i){"use strict";if(typeof define=="function"&&define.amd){define("imagesloaded/imagesloaded",["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.imagesLoaded=i(e,e.EvEmitter)}})(typeof window!=="undefined"?window:this,function t(e,i){var s=e.jQuery;var r=e.console;function o(t,e){for(var i in e){t[i]=e[i]}return t}var n=Array.prototype.slice;function a(t){if(Array.isArray(t)){return t}var e=typeof t=="object"&&typeof t.length=="number";if(e){return n.call(t)}return[t]}function l(t,e,i){if(!(this instanceof l)){return new l(t,e,i)}var n=t;if(typeof t=="string"){n=document.querySelectorAll(t)}if(!n){r.error("Bad element for imagesLoaded "+(n||t));return}this.elements=a(n);this.options=o({},this.options);if(typeof e=="function"){i=e}else{o(this.options,e)}if(i){this.on("always",i)}this.getImages();if(s){this.jqDeferred=new s.Deferred}setTimeout(this.check.bind(this))}l.prototype=Object.create(i.prototype);l.prototype.options={};l.prototype.getImages=function(){this.images=[];this.elements.forEach(this.addElementImages,this)};l.prototype.addElementImages=function(t){if(t.nodeName=="IMG"){this.addImage(t)}if(this.options.background===true){this.addElementBackgroundImages(t)}var e=t.nodeType;if(!e||!h[e]){return}var i=t.querySelectorAll("img");for(var n=0;n<i.length;n++){var s=i[n];this.addImage(s)}if(typeof this.options.background=="string"){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var o=r[n];this.addElementBackgroundImages(o)}}};var h={1:true,9:true,11:true};l.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(!e){return}var i=/url\((['"])?(.*?)\1\)/gi;var n=i.exec(e.backgroundImage);while(n!==null){var s=n&&n[2];if(s){this.addBackground(s,t)}n=i.exec(e.backgroundImage)}};l.prototype.addImage=function(t){var e=new c(t);this.images.push(e)};l.prototype.addBackground=function(t,e){var i=new u(t,e);this.images.push(i)};l.prototype.check=function(){var n=this;this.progressedCount=0;this.hasAnyBroken=false;if(!this.images.length){this.complete();return}function e(t,e,i){setTimeout(function(){n.progress(t,e,i)})}this.images.forEach(function(t){t.once("progress",e);t.check()})};l.prototype.progress=function(t,e,i){this.progressedCount++;this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded;this.emitEvent("progress",[this,t,e]);if(this.jqDeferred&&this.jqDeferred.notify){this.jqDeferred.notify(this,t)}if(this.progressedCount==this.images.length){this.complete()}if(this.options.debug&&r){r.log("progress: "+i,t,e)}};l.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";this.isComplete=true;this.emitEvent(t,[this]);this.emitEvent("always",[this]);if(this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}};function c(t){this.img=t}c.prototype=Object.create(i.prototype);c.prototype.check=function(){var t=this.getIsImageComplete();
55if(t){this.confirm(this.img.naturalWidth!==0,"naturalWidth");return}this.proxyImage=new Image;this.proxyImage.addEventListener("load",this);this.proxyImage.addEventListener("error",this);this.img.addEventListener("load",this);this.img.addEventListener("error",this);this.proxyImage.src=this.img.src};c.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth};c.prototype.confirm=function(t,e){this.isLoaded=t;this.emitEvent("progress",[this,this.img,e])};c.prototype.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.prototype.onload=function(){this.confirm(true,"onload");this.unbindEvents()};c.prototype.onerror=function(){this.confirm(false,"onerror");this.unbindEvents()};c.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this);this.proxyImage.removeEventListener("error",this);this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)};function u(t,e){this.url=t;this.element=e;this.img=new Image}u.prototype=Object.create(c.prototype);u.prototype.check=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);this.img.src=this.url;var t=this.getIsImageComplete();if(t){this.confirm(this.img.naturalWidth!==0,"naturalWidth");this.unbindEvents()}};u.prototype.unbindEvents=function(){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)};u.prototype.confirm=function(t,e){this.isLoaded=t;this.emitEvent("progress",[this,this.element,e])};l.makeJQueryPlugin=function(t){t=t||e.jQuery;if(!t){return}s=t;s.fn.imagesLoaded=function(t,e){var i=new l(this,t,e);return i.jqDeferred.promise(s(this))}};l.makeJQueryPlugin();return l});
56/*!
57 * Flickity imagesLoaded v2.0.0
58 * enables imagesLoaded option for Flickity
59 */
60(function(i,n){if(typeof define=="function"&&define.amd){define(["flickity/js/index","imagesloaded/imagesloaded"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("flickity"),require("imagesloaded"))}else{i.Flickity=n(i,i.Flickity,i.imagesLoaded)}})(window,function t(e,i,s){"use strict";i.createMethods.push("_createImagesLoaded");var n=i.prototype;n._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)};n.imagesLoaded=function(){if(!this.options.imagesLoaded){return}var n=this;function t(t,e){var i=n.getParentCell(e.img);n.cellSizeChange(i&&i.element);if(!n.options.freeScroll){n.positionSliderAtSelected()}}s(this.slider).on("progress",t)};return i});;
61/*jshint strict:true, browser:true, curly:true, eqeqeq:true, expr:true, forin:true, latedef:true, newcap:true, noarg:true, trailing: true, undef:true, unused:true */
62/**
63 * File:        clientside_validation.ie8.js
64 * Version:     7.x-1.x
65 * Description: ECMA-262, 5th edition support for IE <= 8
66 * Language:    Javascript
67 * Project:     clientside_validation
68 * @module clientside_validation
69 */
70(function(){
71"use strict";
72
73/*
74 * Support for String.trim
75 * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim#Compatibility
76 */
77if(!String.prototype.trim) {
78  String.prototype.trim = function () {
79    return this.replace(/^\s+|\s+$/g,'');
80  };
81}
82
83/*
84 * Support for Array.indexOf
85 * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf#Compatibility
86 */
87if (!Array.prototype.indexOf) {
88    Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
89        if (this === null) {
90            throw new TypeError();
91        }
92        var t = Object(this);
93        var len = t.length >>> 0;
94        if (len === 0) {
95            return -1;
96        }
97        var n = 0;
98        if (arguments.length > 0) {
99            n = Number(arguments[1]);
100            if (n !== n) { // shortcut for verifying if it's NaN
101                n = 0;
102            } else if (n !== 0 && n !== Infinity && n !== -Infinity) {
103                n = (n > 0 || -1) * Math.floor(Math.abs(n));
104            }
105        }
106        if (n >= len) {
107            return -1;
108        }
109        var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
110        for (; k < len; k++) {
111            if (k in t && t[k] === searchElement) {
112                return k;
113            }
114        }
115        return -1;
116    };
117}
118
119/*
120 * Support for Array.lastIndexOf
121 * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf#Compatibility
122 */
123if (!Array.prototype.lastIndexOf)
124{
125  Array.prototype.lastIndexOf = function(searchElement /*, fromIndex*/)
126  {
127
128    if (this === null) {
129      throw new TypeError();
130    }
131
132    var t = Object(this);
133    var len = t.length >>> 0;
134    if (len === 0) {
135      return -1;
136    }
137
138    var n = len;
139    if (arguments.length > 1)
140    {
141      n = Number(arguments[1]);
142      if (n !== n) {
143        n = 0;
144      }
145      else if (n !== 0 && n !== Infinity && n !== -Infinity) {
146        n = (n > 0 || -1) * Math.floor(Math.abs(n));
147      }
148    }
149
150    var k = n >= 0
151          ? Math.min(n, len - 1)
152          : len - Math.abs(n);
153
154    for (; k >= 0; k--)
155    {
156      if (k in t && t[k] === searchElement) {
157        return k;
158      }
159    }
160    return -1;
161  };
162}
163
164/*
165 * Support for Array.filter
166 * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter#Compatibility
167 */
168if (!Array.prototype.filter)
169{
170  Array.prototype.filter = function(fun /*, thisp */)
171  {
172
173    if (this === null) {
174      throw new TypeError();
175    }
176
177    var t = Object(this);
178    var len = t.length >>> 0;
179    if (typeof fun !== "function") {
180      throw new TypeError();
181    }
182
183    var res = [];
184    var thisp = arguments[1];
185    for (var i = 0; i < len; i++)
186    {
187      if (i in t)
188      {
189        var val = t[i]; // in case fun mutates this
190        if (fun.call(thisp, val, i, t)) {
191          res.push(val);
192        }
193      }
194    }
195
196    return res;
197  };
198}
199
200/*
201 * Support for Array.map
202 * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map#Browser_compatibility
203 */
204// Production steps of ECMA-262, Edition 5, 15.4.4.19
205// Reference: http://es5.github.com/#x15.4.4.19
206if (!Array.prototype.map) {
207  Array.prototype.map = function(callback, thisArg) {
208
209    var T, A, k;
210
211    if (this === null) {
212      throw new TypeError(" this is null or not defined");
213    }
214
215    // 1. Let O be the result of calling ToObject passing the |this| value as the argument.
216    var O = Object(this);
217
218    // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
219    // 3. Let len be ToUint32(lenValue).
220    var len = O.length >>> 0;
221
222    // 4. If IsCallable(callback) is false, throw a TypeError exception.
223    // See: http://es5.github.com/#x9.11
224    if ({}.toString.call(callback) !== "[object Function]") {
225      throw new TypeError(callback + " is not a function");
226    }
227
228    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
229    if (thisArg) {
230      T = thisArg;
231    }
232
233    // 6. Let A be a new array created as if by the expression new Array(len) where Array is
234    // the standard built-in constructor with that name and len is the value of len.
235    A = new Array(len);
236
237    // 7. Let k be 0
238    k = 0;
239
240    // 8. Repeat, while k < len
241    while(k < len) {
242
243      var kValue, mappedValue;
244
245      // a. Let Pk be ToString(k).
246      //   This is implicit for LHS operands of the in operator
247      // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
248      //   This step can be combined with c
249      // c. If kPresent is true, then
250      if (k in O) {
251
252        // i. Let kValue be the result of calling the Get internal method of O with argument Pk.
253        kValue = O[ k ];
254
255        // ii. Let mappedValue be the result of calling the Call internal method of callback
256        // with T as the this value and argument list containing kValue, k, and O.
257        mappedValue = callback.call(T, kValue, k, O);
258
259        // iii. Call the DefineOwnProperty internal method of A with arguments
260        // Pk, Property Descriptor {Value: mappedValue, Writable: true, Enumerable: true, Configurable: true},
261        // and false.
262
263        // In browsers that support Object.defineProperty, use the following:
264        // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true });
265
266        // For best browser support, use the following:
267        A[ k ] = mappedValue;
268      }
269      // d. Increase k by 1.
270      k++;
271    }
272
273    // 9. return A
274    return A;
275  };
276}
277})();;
278/*jshint strict:true, browser:true, curly:true, eqeqeq:true, expr:true, forin:true, latedef:true, newcap:true, noarg:true, trailing: true, undef:true, unused:true */
279/*global Drupal: true, jQuery: true, XRegExp:true*/
280/**
281 * File:        clientside_validation.js
282 * Version:     7.x-1.x
283 * Description: Add clientside validation rules
284 * Author:      Attiks
285 * Language:    Javascript
286 * Project:     clientside_validation
287 * @module clientside_validation
288 */
289
290
291(/** @lends Drupal */function ($) {
292  /**
293   * Drupal.behaviors.clientsideValidation.
294   *
295   * Attach clientside validation to the page or rebind the rules in case of AJAX calls.
296   * @extends Drupal.behaviors
297   * @fires clientsideValidationInitialized
298   */
299  "use strict";
300  Drupal.behaviors.clientsideValidation = {
301    attach: function (context) {
302      if (!Drupal.myClientsideValidation) {
303        if (Drupal.settings.clientsideValidation) {
304          Drupal.myClientsideValidation = new Drupal.clientsideValidation();
305        }
306      }
307      else {
308        var update = false;
309        jQuery.each(Drupal.settings.clientsideValidation.forms, function (f) {
310          if ($(context).find('#' + f).length || $(context).is('#' + f)) {
311            update = true;
312          }
313        });
314        //update settings
315        if (update) {
316          Drupal.myClientsideValidation.data = Drupal.settings.clientsideValidation;
317          Drupal.myClientsideValidation.forms = Drupal.myClientsideValidation.data.forms;
318          Drupal.myClientsideValidation.groups = Drupal.myClientsideValidation.data.groups;
319          Drupal.myClientsideValidation.bindForms();
320        }
321      }
322
323      // Set validation for ajax forms
324      for (var ajax_el in Drupal.settings.ajax) {
325        if (typeof Drupal.ajax[ajax_el] !== 'undefined' && Drupal.ajax[ajax_el].validate_first) {
326          var origBeforeSubmit = Drupal.ajax[ajax_el].options.beforeSubmit;
327          Drupal.ajax[ajax_el].options.beforeSubmit = function (form_values, element, options) {
328            var ret = origBeforeSubmit(form_values, element, options);
329            // If this function didn't return anything, just set the return value to true.
330            // If it did return something, allow it to prevent submit if necessary.
331            if (typeof ret === 'undefined') {
332              ret = true;
333            }
334            ret = ret && Drupal.myClientsideValidation.validators[element.attr('id')].form();
335            if (!ret) {
336              Drupal.ajax[ajax_el].ajaxing = false;
337            }
338            return ret;
339          };
340        }
341      }
342
343      /**
344       * Let other modules know we are ready.
345       * @event clientsideValidationInitialized
346       * @name clientsideValidationInitialized
347       * @memberof Drupal.clientsideValidation
348       */
349      jQuery.event.trigger('clientsideValidationInitialized');
350    }
351  };
352
353  /**
354   * Drupal.clientsideValidation.
355   * This module adds clientside validation for all forms and webforms using jquery.validate
356   * Don't forget to read the README
357   *
358   * @class Drupal.clientsideValidation
359   * @see https://github.com/jzaefferer/jquery-validation
360   * @fires clientsideValidationAddCustomRules
361   */
362  Drupal.clientsideValidation = function() {
363    var self = this;
364    if (typeof window.time !== 'undefined') {
365      // activate by setting clientside_validation_add_js_timing
366      self.time = window.time;
367    }
368    else {
369      self.time = {
370        start: function() {},
371        stop: function() {},
372        report: function() {}
373      };
374    }
375    self.time.start('1. clientsideValidation');
376
377    /**
378     * prefix to use
379     * @memberof Drupal.clientsideValidation
380     * @type string
381     * @readonly
382     * @private
383     */
384    this.prefix = 'clientsidevalidation-';
385
386    /**
387     * local copy of settings
388     * @memberof Drupal.clientsideValidation
389     * @type array
390     * @readonly
391     * @private
392     */
393    this.data = Drupal.settings.clientsideValidation;
394
395    /**
396     * local copy of all defined forms
397     * @memberof Drupal.clientsideValidation
398     * @type array
399     * @readonly
400     */
401    this.forms = this.data.forms;
402
403    /**
404     * list of all defined validators
405     * @memberof Drupal.clientsideValidation
406     * @type array
407     * @readonly
408     */
409    this.validators = {};
410
411    /**
412     * groups used for radios/checkboxes
413     * @memberof Drupal.clientsideValidation
414     * @type array
415     * @readonly
416     * @private
417     */
418    this.groups = this.data.groups;
419
420    // disable class and attribute rules defined by jquery.validate
421    $.validator.classRules = function() {
422      return {};
423    };
424    $.validator.attributeRules = function() {
425      return {};
426    };
427
428    /**
429     * add extra rules not defined in jquery.validate
430     * @see jquery.validate
431     */
432    this.addExtraRules();
433
434    /**
435     * bind all rules to all forms
436     * @see Drupal.clientsideValidation.prototype.bindForms
437     */
438    this.bindForms();
439    self.time.stop('1. clientsideValidation');
440    self.time.report();
441  };
442
443  /**
444   * findVerticalTab helper.
445   * @memberof Drupal.clientsideValidation
446   * @private
447   */
448  Drupal.clientsideValidation.prototype.findVerticalTab = function(element) {
449    element = $(element);
450
451    // Check for the vertical tabs fieldset and the verticalTab data
452    var fieldset = element.parents('fieldset.vertical-tabs-pane');
453    if ((fieldset.size() > 0) && (typeof(fieldset.data('verticalTab')) !== 'undefined')) {
454      var tab = $(fieldset.data('verticalTab').item[0]).find('a');
455      if (tab.size()) {
456        return tab;
457      }
458    }
459
460    // Return null by default
461    return null;
462  };
463
464  /**
465   * findHorizontalTab helper.
466   * @memberof Drupal.clientsideValidation
467   * @private
468   */
469  Drupal.clientsideValidation.prototype.findHorizontalTab = function(element) {
470    element = $(element);
471
472    // Check for the vertical tabs fieldset and the verticalTab data
473    var fieldset = element.parents('fieldset.horizontal-tabs-pane');
474    if ((fieldset.size() > 0) && (typeof(fieldset.data('horizontalTab')) !== 'undefined')) {
475      var tab = $(fieldset.data('horizontalTab').item[0]).find('a');
476      if (tab.size()) {
477        return tab;
478      }
479    }
480
481    // Return null by default
482    return null;
483  };
484
485  /**
486   * Bind all forms.
487   * @memberof Drupal.clientsideValidation
488   * @public
489   */
490  Drupal.clientsideValidation.prototype.bindForms = function(){
491    var self = this;
492    var groupkey;
493    self.time.start('2. bindForms');
494    // unset invalid forms
495    jQuery.each (self.forms, function (f) {
496      if ($('#' + f).length < 1) {
497        delete self.forms[f];
498      }
499    });
500    jQuery.each (self.forms, function(f) {
501      var errorel = self.prefix + f + '-errors';
502      // Remove any existing validation stuff
503      if (self.validators[f]) {
504        // Doesn't work :: $('#' + f).rules('remove');
505        var form = $('#' + f).get(0);
506        if (typeof(form) !== 'undefined') {
507          jQuery.removeData(form, 'validator');
508        }
509      }
510
511      if('checkboxrules' in self.forms[f]){
512        self.time.start('checkboxrules_groups');
513        groupkey = "";
514        jQuery.each (self.forms[f].checkboxrules, function(r) {
515          groupkey = r + '_group';
516          self.groups[f][groupkey] = "";
517          jQuery.each(this, function(){
518            var i = 0;
519            $(this[2]).find('input[type=checkbox]').each(function(){
520              if(i > 0){
521                self.groups[f][groupkey] += ' ';
522              }
523              self.groups[f][groupkey] += $(this).attr('name');
524              i++;
525            });
526          });
527        });
528        self.time.stop('checkboxrules_groups');
529      }
530
531      if('daterangerules' in self.forms[f]){
532        self.time.start('daterangerules');
533        groupkey = "";
534        jQuery.each (self.forms[f].daterangerules, function(r) {
535          groupkey = r + '_group';
536          self.groups[f][groupkey] = "";
537          jQuery.each(this, function(){
538            var i = 0;
539            $('#' + f + ' #' + r + ' :input').not('input[type=image]').each(function(){
540              if(i > 0){
541                self.groups[f][groupkey] += ' ';
542              }
543              self.groups[f][groupkey] += $(this).attr('name');
544              i++;
545            });
546          });
547        });
548        self.time.stop('daterangerules');
549      }
550
551      if('dateminrules' in self.forms[f]){
552        self.time.start('dateminrules');
553        groupkey = "";
554        jQuery.each (self.forms[f].dateminrules, function(r) {
555          groupkey = r + '_group';
556          self.groups[f][groupkey] = "";
557          jQuery.each(this, function(){
558            var i = 0;
559            $('#' + f + ' #' + r + ' :input').not('input[type=image]').each(function(){
560              if(i > 0){
561                self.groups[f][groupkey] += ' ';
562              }
563              self.groups[f][groupkey] += $(this).attr('name');
564              i++;
565            });
566          });
567        });
568        self.time.stop('dateminrules');
569      }
570
571      if('datemaxrules' in self.forms[f]){
572        self.time.start('datemaxrules');
573        groupkey = "";
574        jQuery.each (self.forms[f].datemaxrules, function(r) {
575          groupkey = r + '_group';
576          self.groups[f][groupkey] = "";
577          jQuery.each(this, function(){
578            var i = 0;
579            $('#' + f + ' #' + r + ' :input').not('input[type=image]').each(function(){
580              if(i > 0){
581                self.groups[f][groupkey] += ' ';
582              }
583              self.groups[f][groupkey] += $(this).attr('name');
584              i++;
585            });
586          });
587        });
588        self.time.stop('datemaxrules');
589      }
590
591
592      // Add basic settings
593      // todo: find cleaner fix
594      // ugly fix for nodes in colorbox
595      if(typeof $('#' + f).validate === 'function') {
596        var validate_options = {
597          errorClass: 'error',
598          groups: self.groups[f],
599          errorElement: self.forms[f].general.errorElement,
600          unhighlight: function(element, errorClass, validClass) {
601            var tab;
602            // Default behavior
603            $(element).removeClass(errorClass).addClass(validClass);
604
605            // Sort the classes out for the tabs - we only want to remove the
606            // highlight if there are no inputs with errors...
607            var fieldset = $(element).parents('fieldset.vertical-tabs-pane');
608            if (fieldset.size() && fieldset.find('.' + errorClass).not('label').size() === 0) {
609              tab = self.findVerticalTab(element);
610              if (tab) {
611                tab.removeClass(errorClass).addClass(validClass);
612              }
613            }
614
615            // Same for horizontal tabs
616            fieldset = $(element).parents('fieldset.horizontal-tabs-pane');
617            if (fieldset.size() && fieldset.find('.' + errorClass).not('label').size() === 0) {
618              tab = self.findHorizontalTab(element);
619              if (tab) {
620                tab.removeClass(errorClass).addClass(validClass);
621              }
622            }
623          },
624          highlight: function(element, errorClass, validClass) {
625            // Default behavior
626            $(element).addClass(errorClass).removeClass(validClass);
627
628            // Sort the classes out for the tabs
629            var tab = self.findVerticalTab(element);
630            if (tab) {
631              tab.addClass(errorClass).removeClass(validClass);
632            }
633            tab = self.findHorizontalTab(element);
634            if (tab) {
635              tab.addClass(errorClass).removeClass(validClass);
636            }
637          },
638          invalidHandler: function(form, validator) {
639            var tab;
640            if (validator.errorList.length > 0) {
641              // Check if any of the errors are in the selected tab
642              var errors_in_selected = false;
643              for (var i = 0; i < validator.errorList.length; i++) {
644                tab = self.findVerticalTab(validator.errorList[i].element);
645                if (tab && tab.parent().hasClass('selected')) {
646                  errors_in_selected = true;
647                  break;
648                }
649              }
650
651              // Only focus the first tab with errors if the selected tab doesn't have
652              // errors itself. We shouldn't hide a tab that contains errors!
653              if (!errors_in_selected) {
654                tab = self.findVerticalTab(validator.errorList[0].element);
655                if (tab) {
656                  tab.click();
657                }
658              }
659
660              // Same for vertical tabs
661              // Check if any of the errors are in the selected tab
662              errors_in_selected = false;
663              for (i = 0; i < validator.errorList.length; i++) {
664                tab = self.findHorizontalTab(validator.errorList[i].element);
665                if (tab && tab.parent().hasClass('selected')) {
666                  errors_in_selected = true;
667                  break;
668                }
669              }
670
671              // Only focus the first tab with errors if the selected tab doesn't have
672              // errors itself. We shouldn't hide a tab that contains errors!
673              if (!errors_in_selected) {
674                tab = self.findHorizontalTab(validator.errorList[0].element);
675                if (tab) {
676                  tab.click();
677                }
678              }
679              if (self.forms[f].general.scrollTo) {
680                var x;
681                if ($("#" + errorel).length) {
682                  $("#" + errorel).show();
683                  x = $("#" + errorel).offset().top - $("#" + errorel).height() - 100; // provides buffer in viewport
684                }
685                else {
686                  x = $(validator.errorList[0].element).offset().top - $(validator.errorList[0].element).height() - 100;
687                }
688                $('html, body').animate({scrollTop: x}, self.forms[f].general.scrollSpeed);
689                $('.wysiwyg-toggle-wrapper a').each(function() {
690                  $(this).click();
691                  $(this).click();
692                });
693              }
694            }
695          }
696        };
697
698        switch (parseInt(self.forms[f].errorPlacement, 10)) {
699          case 0: // CLIENTSIDE_VALIDATION_JQUERY_SELECTOR
700            if ($(self.forms[f].errorJquerySelector).length) {
701              if (!$(self.forms[f].errorJquerySelector + ' #' + errorel).length) {
702                $('<div id="' + errorel + '" class="messages error clientside-error"><ul></ul></div>').prependTo(self.forms[f].errorJquerySelector).hide();
703              }
704            }
705            else if (!$('#' + errorel).length) {
706              $('<div id="' + errorel + '" class="messages error clientside-error"><ul></ul></div>').insertBefore('#' + f).hide();
707            }
708            validate_options.errorContainer = '#' + errorel;
709            validate_options.errorLabelContainer = '#' + errorel + ' ul';
710            validate_options.wrapper = 'li';
711            break;
712          case 1: // CLIENTSIDE_VALIDATION_TOP_OF_FORM
713            if (!$('#' + errorel).length) {
714              $('<div id="' + errorel + '" class="messages error clientside-error"><ul></ul></div>').insertBefore('#' + f).hide();
715            }
716            validate_options.errorContainer = '#' + errorel;
717            validate_options.errorLabelContainer = '#' + errorel + ' ul';
718            validate_options.wrapper = 'li';
719            break;
720          case 2: // CLIENTSIDE_VALIDATION_BEFORE_LABEL
721            validate_options.errorPlacement = function(error, element) {
722              var parents;
723              if (element.is(":radio")) {
724                parents = element.parents(".form-type-checkbox-tree");
725                if(parents.length) {
726                  error.insertBefore(parents.find("label").first());
727                }
728                else {
729                  parents = element.parents('.form-radios').prev('label');
730                  if (!parents.length) {
731                    parents = 'label[for="'+ element.attr('id') +'"]';
732                  }
733                  error.insertBefore(parents);
734                }
735              }
736              else if (element.is(":checkbox")) {
737                parents = element.parents(".form-type-checkbox-tree");
738                if(parents.length) {
739                  error.insertBefore(parents.find("label").first());
740                }
741                else {
742                  parents = element.parents('.form-radios').prev('label');
743                  if (!parents.length) {
744                    parents = 'label[for="'+ element.attr('id') +'"]';
745                  }
746                  error.insertBefore(parents);
747                }
748              }
749              else {
750                error.insertBefore('label[for="'+ element.attr('id') +'"]');
751              }
752            };
753            break;
754          case 3: // CLIENTSIDE_VALIDATION_AFTER_LABEL
755            validate_options.errorPlacement = function(error, element) {
756              var parents;
757              if (element.is(":radio")) {
758                parents = element.parents(".form-type-checkbox-tree");
759                if(parents.length) {
760                  error.insertAfter(parents.find("label").first());
761                }
762                else {
763                  parents = element.parents('.form-radios').prev('label');
764                  if (!parents.length) {
765                    parents = 'label[for="'+ element.attr('id') +'"]';
766                  }
767                  error.insertAfter(parents);
768                }
769              }
770              else if (element.is(":checkbox")) {
771                parents = element.parents(".form-type-checkbox-tree");
772                if(parents.length) {
773                  error.insertAfter(parents.find("label").first());
774                }
775                else {
776                  parents = element.parents('.form-checkboxes').prev('label');
777                  if (!parents.length) {
778                    parents = 'label[for="'+ element.attr('id') +'"]';
779                  }
780                  error.insertAfter(parents);
781                }
782              }
783              else {
784                error.insertAfter('label[for="'+ element.attr('id') +'"]');
785              }
786            };
787            break;
788          case 4: // CLIENTSIDE_VALIDATION_BEFORE_INPUT
789            validate_options.errorPlacement = function(error, element) {
790              error.insertBefore(element);
791            };
792            break;
793          case 5: // CLIENTSIDE_VALIDATION_AFTER_INPUT
794            validate_options.errorPlacement = function(error, element) {
795              var parents;
796              if (element.is(":radio")) {
797                parents = element.parents(".form-type-checkbox-tree");
798                if(parents.length) {
799                  error.insertAfter(parents);
800                }
801                else {
802                  parents = element.parents('.form-radios');
803                  if (!parents.length) {
804                    parents = element;
805                  }
806                  error.insertAfter(parents);
807                }
808              }
809              else if (element.is(":checkbox")) {
810                parents = element.parents(".form-type-checkbox-tree");
811                if(parents.length) {
812                  error.insertAfter(parents);
813                }
814                else {
815                  parents = element.parents('.form-checkboxes');
816                  if (!parents.length) {
817                    parents = element;
818                  }
819                  error.insertAfter(parents);
820                }
821              }
822              else {
823                error.insertAfter(element);
824              }
825            };
826            break;
827          case 6: // CLIENTSIDE_VALIDATION_TOP_OF_FIRST_FORM
828            if ($('div.messages.error').length) {
829              if ($('div.messages.error').attr('id').length) {
830                errorel = $('div.messages.error').attr('id');
831              }
832              else {
833                $('div.messages.error').attr('id', errorel);
834              }
835            }
836            else if (!$('#' + errorel).length) {
837              $('<div id="' + errorel + '" class="messages error clientside-error"><ul></ul></div>').insertBefore('#' + f).hide();
838            }
839            validate_options.errorContainer = '#' + errorel;
840            validate_options.errorLabelContainer = '#' + errorel + ' ul';
841            validate_options.wrapper = 'li';
842            break;
843          case 7: // CLIENTSIDE_VALIDATION_CUSTOM_ERROR_FUNCTION
844            validate_options.errorPlacement = function (error, element) {
845              var func = self.forms[f].customErrorFunction;
846              Drupal.myClientsideValidation[func](error, element);
847            };
848            break;
849        }
850
851        if (!self.forms[f].includeHidden) {
852          validate_options.ignore = ':input:hidden';
853        }
854        else {
855          validate_options.ignore = '';
856        }
857        if(self.forms[f].general.validateTabs) {
858          if($('.vertical-tabs-pane input').length) {
859            validate_options.ignore += ' :not(.vertical-tabs-pane :input, .horizontal-tabs-pane :input)';
860          }
861        }
862        else {
863          validate_options.ignore += ', .horizontal-tab-hidden :input';
864        }
865        //Since we can only give boolean false to onsubmit, onfocusout and onkeyup, we need
866        //a lot of if's (boolean true can not be passed to these properties).
867        if (!Boolean(parseInt(self.forms[f].general.validateOnSubmit, 10))) {
868          validate_options.onsubmit = false;
869        }
870        if (!Boolean(parseInt(self.forms[f].general.validateOnBlur, 10))) {
871          validate_options.onfocusout = false;
872        }
873        if (Boolean(parseInt(self.forms[f].general.validateOnBlurAlways, 10))) {
874          validate_options.onfocusout = function(element) {
875            if ( !this.checkable(element) ) {
876              this.element(element);
877            }
878          };
879        }
880        if (!Boolean(parseInt(self.forms[f].general.validateOnKeyUp, 10))) {
881          validate_options.onkeyup = false;
882        }
883        // Only apply this setting if errorplacement is set to the top of the form
884        if (parseInt(self.forms[f].general.showMessages, 10) > 0 && parseInt(self.forms[f].errorPlacement, 10) === 1) {
885          var showMessages = parseInt(self.forms[f].general.showMessages, 10);
886          // Show only last message
887          if (showMessages === 2) {
888            validate_options.showErrors = function() {
889              var allErrors = this.errors();
890              var i;
891              this.toHide = allErrors;
892              $(':input.' + this.settings.errorClass).removeClass(this.settings.errorClass);
893              for ( i = this.errorList.length -1; this.errorList[i]; i++ ) {
894                var error = this.errorList[i];
895                this.settings.highlight && this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
896                this.showLabel( error.element, error.message );
897              }
898              if( this.errorList.length ) {
899                this.toShow = this.toShow.add( this.containers );
900              }
901              if (this.settings.success) {
902                for ( i = 0; this.successList[i]; i++ ) {
903                  this.showLabel( this.successList[i] );
904                }
905              }
906              if (this.settings.unhighlight) {
907                var elements;
908                for ( i = 0, elements = this.validElements(); elements[i]; i++ ) {
909                  this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
910                }
911              }
912              this.toHide = this.toHide.not( this.toShow );
913              this.hideErrors();
914              this.addWrapper( this.toShow ).show();
915            };
916          }
917          // Show only first message
918          else if(showMessages === 1) {
919            validate_options.showErrors = function() {
920              var allErrors = this.errors();
921              var i;
922              var elements;
923              if (this.settings.unhighlight) {
924                var firstErrorElement = this.clean($(allErrors[0]).attr('for'));
925                //for attr points to name or id
926                if (typeof firstErrorElement === 'undefined') {
927                  firstErrorElement = this.clean('#' + $(allErrors[0]).attr('for'));
928                }
929                for (i = 0, elements = this.elements().not($(firstErrorElement)); elements[i]; i++) {
930                  this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
931                }
932              }
933
934              for ( i = 0; this.errorList[i] && i<1; i++ ) {
935                var error = this.errorList[i];
936                this.settings.highlight && this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
937                this.showLabel( error.element, error.message );
938              }
939              if( this.errorList.length ) {
940                this.toShow = this.toShow.add( this.containers );
941              }
942              if (this.settings.success) {
943                for ( i = 0; this.successList[i]; i++ ) {
944                  this.showLabel( this.successList[i] );
945                }
946              }
947              if (this.settings.unhighlight) {
948                for ( i = 0, elements = this.validElements(); elements[i]; i++ ) {
949                  this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
950                }
951              }
952
953              this.toHide = this.toHide.not( this.toShow );
954              this.hideErrors();
955              this.addWrapper( this.toShow ).show();
956              allErrors = this.errors();
957              allErrors.splice(0,1);
958              this.toHide = allErrors;
959              this.hideErrors();
960            };
961          }
962        }
963        self.validators[f] = $('#' + f).validate(validate_options);
964
965        // Disable HTML5 validation
966        if (!Boolean(parseInt(self.forms[f].general.disableHtml5Validation, 10))) {
967          $('#' + f).removeAttr('novalidate');
968        }
969        else {
970          $('#' + f).attr('novalidate', 'novalidate');
971        }
972        // Bind all rules
973        self.bindRules(f);
974
975      }
976    });
977  self.time.stop('2. bindForms');
978  };
979
980  /**
981   * Bind all rules.
982   * @memberof Drupal.clientsideValidation
983   */
984  Drupal.clientsideValidation.prototype.bindRules = function(formid){
985    var self = this;
986    self.time.start('3. bindRules');
987    var $form = $('#' + formid);
988    var hideErrordiv = function(){
989      //wait just one milisecond until the error div is updated
990      window.setTimeout(function(){
991        var visibles = 0;
992        // @TODO: check settings
993        $("div.messages.error ul li").each(function(){
994          if($(this).is(':visible')){
995            visibles++;
996          }
997          else {
998            $(this).remove();
999          }
1000        });
1001        if(visibles < 1){
1002          $("div.messages.error").hide();
1003        }
1004      }, 1);
1005    };
1006    if('checkboxrules' in self.forms[formid]){
1007      self.time.start('checkboxrules');
1008      jQuery.each (self.forms[formid].checkboxrules, function(r) {
1009        var $checkboxes = $form.find(this.checkboxgroupminmax[2]).find('input[type="checkbox"]');
1010        if ($checkboxes.length) {
1011          $checkboxes.addClass('require-one');
1012          $checkboxes.each(function(){
1013            $(this).rules("add", self.forms[formid].checkboxrules[r]);
1014            $(this).change(hideErrordiv);
1015          });
1016        }
1017      });
1018      self.time.stop('checkboxrules');
1019    }
1020    if('daterangerules' in self.forms[formid]){
1021      self.time.start('daterangerules');
1022      jQuery.each (self.forms[formid].daterangerules, function(r) {
1023        $form.find('#' + r).find('input, select').not('input[type=image]').each(function(){
1024          $(this).rules("add", self.forms[formid].daterangerules[r]);
1025          $(this).blur(hideErrordiv);
1026        });
1027      });
1028      self.time.stop('daterangerules');
1029    }
1030
1031    if('dateminrules' in self.forms[formid]){
1032      self.time.start('dateminrules');
1033      jQuery.each (self.forms[formid].dateminrules, function(r) {
1034        $form.find('#' + r).find('input, select').not('input[type=image]').each(function(){
1035          $(this).rules("add", self.forms[formid].dateminrules[r]);
1036          $(this).blur(hideErrordiv);
1037        });
1038      });
1039      self.time.stop('dateminrules');
1040    }
1041
1042    if('datemaxrules' in self.forms[formid]){
1043      self.time.start('datemaxrules');
1044      jQuery.each (self.forms[formid].datemaxrules, function(r) {
1045        $form.find('#' + r).find('input, select').not('input[type=image]').each(function(){
1046          $(this).rules("add", self.forms[formid].datemaxrules[r]);
1047          $(this).blur(hideErrordiv);
1048        });
1049      });
1050      self.time.stop('datemaxrules');
1051    }
1052
1053    if ('rules' in self.forms[formid]) {
1054      self.time.start('rules');
1055      var rules = self.forms[formid].rules;
1056      // :input can be slow, see http://jsperf.com/input-vs-input/2
1057      $form.find('input, textarea, select').each(function(idx, elem) {
1058        var rule = rules[elem.name];
1059        if (rule) {
1060          elem = $(elem);
1061          $(elem).rules("add",rule);
1062          $(elem).change(hideErrordiv);
1063        }
1064      });
1065      self.time.stop('rules');
1066    }
1067    self.time.stop('3. bindRules');
1068  };
1069
1070  /**
1071   * Add extra rules.
1072   * @memberof Drupal.clientsideValidation
1073  */
1074  Drupal.clientsideValidation.prototype.addExtraRules = function(){
1075    var self = this;
1076
1077    jQuery.validator.addMethod("numberDE", function(value, element) {
1078      return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);
1079    });
1080
1081    // Min a and maximum b checkboxes from a group
1082    jQuery.validator.addMethod("checkboxgroupminmax", function(value, element, param) {
1083      var amountChecked = $(param[2]).find('input:checked').length;
1084      return (amountChecked >= param[0] && amountChecked <= param[1]);
1085    }, jQuery.format('Minimum {0}, maximum {1}'));
1086
1087    // Allow integers, same as digits but including a leading '-'
1088    jQuery.validator.addMethod("digits_negative", function(value, element) {
1089      return this.optional(element) || /^-?\d+$/.test(value);
1090    }, jQuery.format('Please enter only digits.'));
1091
1092    // One of the values
1093    jQuery.validator.addMethod("oneOf", function(value, element, param) {
1094      for (var p in param.values) {
1095        if (param.values[p] === value && param.caseSensitive) {
1096          return true;
1097        }
1098        else if (param.values[p].toLowerCase() === value.toLowerCase() && !param.caseSensitive) {
1099          return true;
1100        }
1101      }
1102      return false;
1103    }, jQuery.format(''));
1104
1105    jQuery.validator.addMethod("specificVals", function(value, element, param){
1106      for (var i in value) {
1107        if(param.indexOf(value[i]) === -1) {
1108            return false;
1109        }
1110      }
1111      return true;
1112    });
1113
1114    jQuery.validator.addMethod("blacklist", function(value, element, param) {
1115      if (typeof(value) !== 'object') {
1116        value = value.split(' ');
1117      }
1118      for (var i in value) {
1119        if(param.indexOf(value[i]) !== -1) {
1120            return false;
1121        }
1122      }
1123      return true;
1124    });
1125
1126    // Default regular expression support
1127    var ajaxPCREfn = function(value, element, param) {
1128      var result = false;
1129      jQuery.ajax({
1130        'url': Drupal.settings.basePath + 'clientside_validation/ajax',
1131        'type': "POST",
1132        'data': {
1133          'value': value,
1134          'param': param
1135        },
1136        'dataType': 'json',
1137        'async': false,
1138        'success': function(res){
1139          result = res;
1140        }
1141      });
1142      if (result.result === false) {
1143        if (result.message.length) {
1144          jQuery.extend(jQuery.validator.messages, {
1145            "regexMatchPCRE": result.message
1146          });
1147        }
1148      }
1149      return result.result;
1150    };
1151
1152    // Regular expression support using XRegExp
1153    var xregexPCREfn = function(value, element, param) {
1154      if (window.XRegExp && XRegExp.version ) {
1155        try {
1156          var result = true;
1157          for (var i = 0; i < param.expressions.length; i++) {
1158            var reg = param.expressions[i];
1159            var delim = reg.lastIndexOf(reg[0]);
1160            // Only allow supported modifiers
1161            var modraw = reg.substr(delim + 1) || '';
1162            var mod = '';
1163            if (mod !== '') {
1164              for (var l = 0; l < 6; l++) {
1165                if (modraw.indexOf('gimnsx'[l]) !== -1) {
1166                  mod += 'gimnsx'[l];
1167                }
1168              }
1169            }
1170            reg = reg.substring(1, delim);
1171            if (!(new XRegExp(reg, mod).test(value))) {
1172              result = false;
1173              if (param.messages[i].length) {
1174                jQuery.extend(jQuery.validator.messages, {
1175                  "regexMatchPCRE": param.messages[i]
1176                });
1177              }
1178            }
1179          }
1180          return result;
1181        }
1182        catch (e) {
1183          return ajaxPCREfn(value, element, param);
1184        }
1185      }
1186      else {
1187        return ajaxPCREfn(value, element, param);
1188      }
1189    };
1190
1191    // Decide which one to use
1192    if (self.data.general.usexregxp) {
1193      jQuery.validator.addMethod("regexMatchPCRE", xregexPCREfn, jQuery.format('The value does not match the expected format.'));
1194    }
1195    else {
1196      jQuery.validator.addMethod("regexMatchPCRE", ajaxPCREfn, jQuery.format('The value does not match the expected format.'));
1197    }
1198
1199    // Unique values
1200    jQuery.validator.addMethod("notEqualTo", function(value, element, param) {
1201      var ret = true;
1202      jQuery.each(param, function (index, selector){
1203        var $target = $(selector);
1204        $target.unbind(".validate-notEqualTo").bind("blur.validate-notEqualTo", function() {
1205          $(element).valid();
1206        });
1207        ret = ret && ($target.val() !== value);
1208      });
1209      return ret;
1210    }, jQuery.format('Please don\'t enter the same value again.'));
1211
1212    jQuery.validator.addMethod("regexMatch", function(value, element, param) {
1213      if (this.optional(element) && value === '') {
1214        return this.optional(element);
1215      }
1216      else {
1217        var regexp = new RegExp(param[0], param[1]);
1218        if(regexp.test(value)){
1219          return true;
1220        }
1221        return false;
1222      }
1223
1224    }, jQuery.format('The value does not match the expected format.'));
1225
1226    jQuery.validator.addMethod("captcha", function (value, element, param) {
1227      var result = false;
1228      var sid = $(element).closest('.captcha').find('input[name=captcha_sid]').val();
1229      jQuery.ajax({
1230        'url': Drupal.settings.basePath + 'clientside_validation/captcha',
1231        'type': "POST",
1232        'data': {
1233          'value': value,
1234          'param': [sid, param]
1235        },
1236        'dataType': 'json',
1237        'async': false,
1238        'success': function(res){
1239          result = res;
1240        }
1241      });
1242      if (result.result === false) {
1243        if (typeof result.message !== 'undefined' && result.message.length) {
1244          jQuery.extend(jQuery.validator.messages, {
1245            "captcha": result.message
1246          });
1247        }
1248      }
1249      return result.result;
1250    }, jQuery.format('Wrong answer.'));
1251
1252    jQuery.validator.addMethod("rangewords", function(value, element, param) {
1253      return this.optional(element) || (param[0] <= jQuery.trim(value).split(/\s+/).length && value.split(/\s+/).length <= param[1]);
1254    }, jQuery.format('The value must be between {0} and {1} words long'));
1255
1256    jQuery.validator.addMethod("minwords", function(value, element, param) {
1257      return this.optional(element) || param <= jQuery.trim(value).split(/\s+/).length;
1258    }, jQuery.format('The value must be more than {0} words long'));
1259
1260    jQuery.validator.addMethod("maxwords", function(value, element, param) {
1261      return this.optional(element) || jQuery.trim(value).split(/\s+/).length <= param;
1262    }, jQuery.format('The value must be fewer than {0} words long'));
1263
1264    jQuery.validator.addMethod("plaintext", function(value, element, param){
1265      return this.optional(element) || (value === strip_tags(value, param));
1266    }, jQuery.format('The value must be plaintext'));
1267
1268    jQuery.validator.addMethod("selectMinlength", function(value, element, param) {
1269      return this.optional(element) || $(element).find('option:selected').length >= param;
1270    }, jQuery.format('You must select at least {0} values'));
1271
1272    jQuery.validator.addMethod("selectMaxlength", function(value, element, param) {
1273      return this.optional(element) || $(element).find('option:selected').length <= param;
1274    }, jQuery.format('You must select a maximum of {0} values'));
1275
1276    jQuery.validator.addMethod("selectRangelength", function(value, element, param) {
1277      return this.optional(element) || ($(element).find('option:selected').length >= param[0] && $(element).find('option:selected').length <= param[1]);
1278    }, jQuery.format('You must select at between {0} and {1} values'));
1279
1280    jQuery.validator.addMethod("datemin", function(value, element, param) {
1281      //Assume [month], [day], and [year] ??
1282      var dayelem, monthelem, yearelem, name, $form, element_name;
1283      $form = $(element).closest('form');
1284      element_name = $(element).attr('name');
1285      if (element_name.indexOf('[day]') > 0) {
1286        dayelem = $(element);
1287        name = dayelem.attr('name').replace('[day]', '');
1288        monthelem = $form.find("[name='" + name + "[month]']");
1289        yearelem = $form.find("[name='" + name + "[year]']");
1290      }
1291      else if (element_name.indexOf('[month]') > 0) {
1292        monthelem = $(element);
1293        name = monthelem.attr('name').replace('[month]', '');
1294        dayelem = $form.find("[name='" + name + "[day]']");
1295        yearelem = $form.find("[name='" + name + "[year]']");
1296      }
1297      else if ($(element).attr('name').indexOf('[year]') > 0) {
1298        yearelem = $(element);
1299        name = yearelem.attr('name').replace('[year]', '');
1300        dayelem = $form.find("[name='" + name + "[day]']");
1301        monthelem = $form.find("[name='" + name + "[month]']");
1302      }
1303
1304      if (parseInt(yearelem.val(), 10) < parseInt(param[0], 10)) {
1305        return false;
1306      }
1307      else if (parseInt(yearelem.val(), 10) === parseInt(param[0], 10)){
1308        if (parseInt(monthelem.val(), 10) < parseInt(param[1], 10)){
1309          return false;
1310        }
1311        else if (parseInt(monthelem.val(), 10) === parseInt(param[1], 10)){
1312          if(parseInt(dayelem.val(), 10) < parseInt(param[2], 10)) {
1313            return false;
1314          }
1315        }
1316      }
1317      yearelem.once('daterange', function() {
1318        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1319      }).removeClass('error');
1320      monthelem.once('daterange', function() {
1321        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1322      }).removeClass('error');
1323      dayelem.once('daterange', function() {
1324        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1325      }).removeClass('error');
1326      return true;
1327    });
1328
1329    jQuery.validator.addMethod("datemax", function(value, element, param) {
1330      //Assume [month], [day], and [year] ??
1331      var dayelem, monthelem, yearelem, name, $form, element_name;
1332      $form = $(element).closest('form');
1333      element_name = $(element).attr('name');
1334      if (element_name.indexOf('[day]') > 0) {
1335        dayelem = $(element);
1336        name = dayelem.attr('name').replace('[day]', '');
1337        monthelem = $form.find("[name='" + name + "[month]']");
1338        yearelem = $form.find("[name='" + name + "[year]']");
1339      }
1340      else if (element_name.indexOf('[month]') > 0) {
1341        monthelem = $(element);
1342        name = monthelem.attr('name').replace('[month]', '');
1343        dayelem = $form.find("[name='" + name + "[day]']");
1344        yearelem = $form.find("[name='" + name + "[year]']");
1345      }
1346      else if (element_name.indexOf('[year]') > 0) {
1347        yearelem = $(element);
1348        name = yearelem.attr('name').replace('[year]', '');
1349        dayelem = $form.find("[name='" + name + "[day]']");
1350        monthelem = $form.find("[name='" + name + "[month]']");
1351
1352      }
1353
1354      if (parseInt(yearelem.val(), 10) > parseInt(param[0], 10)) {
1355        return false;
1356      }
1357      else if (parseInt(yearelem.val(), 10) === parseInt(param[0], 10)){
1358        if (parseInt(monthelem.val(), 10) > parseInt(param[1], 10)){
1359          return false;
1360        }
1361        else if (parseInt(monthelem.val(), 10) === parseInt(param[1], 10)){
1362          if(parseInt(dayelem.val(), 10) > parseInt(param[2], 10)) {
1363            return false;
1364          }
1365        }
1366      }
1367      yearelem.once('daterange', function() {
1368        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1369      }).removeClass('error');
1370      monthelem.once('daterange', function() {
1371        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1372      }).removeClass('error');
1373      dayelem.once('daterange', function() {
1374        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1375      }).removeClass('error');
1376      return true;
1377    });
1378
1379    jQuery.validator.addMethod("daterange", function(value, element, param) {
1380      //Assume [month], [day], and [year] ??
1381      var dayelem, monthelem, yearelem, name, $form, element_name;
1382      $form = $(element).closest('form');
1383      element_name = $(element).attr('name');
1384      if (element_name.indexOf('[day]') > 0) {
1385        dayelem = $(element);
1386        name = dayelem.attr('name').replace('[day]', '');
1387        monthelem = $form.find("[name='" + name + "[month]']");
1388        yearelem = $form.find("[name='" + name + "[year]']");
1389      }
1390      else if (element_name.indexOf('[month]') > 0) {
1391        monthelem = $(element);
1392        name = monthelem.attr('name').replace('[month]', '');
1393        dayelem = $form.find("[name='" + name + "[day]']");
1394        yearelem = $form.find("[name='" + name + "[year]']");
1395      }
1396      else if (element_name.indexOf('[year]') > 0) {
1397        yearelem = $(element);
1398        name = yearelem.attr('name').replace('[year]', '');
1399        dayelem = $form.find("[name='" + name + "[day]']");
1400        monthelem = $form.find("[name='" + name + "[month]']");
1401      }
1402
1403      if (parseInt(yearelem.val(), 10) < parseInt(param[0][0], 10)) {
1404        return false;
1405      }
1406      else if (parseInt(yearelem.val(), 10) === parseInt(param[0][0], 10)){
1407        if (parseInt(monthelem.val(), 10) < parseInt(param[0][1], 10)){
1408          return false;
1409        }
1410        else if (parseInt(monthelem.val(), 10) === parseInt(param[0][1], 10)){
1411          if(parseInt(dayelem.val(), 10) < parseInt(param[0][2], 10)) {
1412            return false;
1413          }
1414        }
1415      }
1416
1417      if (parseInt(yearelem.val(), 10) > parseInt(param[1][0], 10)) {
1418        return false;
1419      }
1420      else if (parseInt(yearelem.val(), 10) === parseInt(param[1][0], 10)){
1421        if (parseInt(monthelem.val(), 10) > parseInt(param[1][1], 10)){
1422          return false;
1423        }
1424        else if (parseInt(monthelem.val(), 10) === parseInt(param[1][1], 10)){
1425          if(parseInt(dayelem.val(), 10) > parseInt(param[1][2], 10)) {
1426            return false;
1427          }
1428        }
1429      }
1430      yearelem.once('daterange', function() {
1431        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1432      }).removeClass('error');
1433      monthelem.once('daterange', function() {
1434        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1435      }).removeClass('error');
1436      dayelem.once('daterange', function() {
1437        $(this).change(function(){$(this).trigger('focusout').trigger('blur');});
1438      }).removeClass('error');
1439      return true;
1440    });
1441
1442    jQuery.validator.addMethod("dateFormat", function(value, element, param) {
1443      var parts = value.split(param.splitter);
1444      var expectedpartscount = 0;
1445      var day = parseInt(parts[param.daypos], 10);
1446      var month = parseInt(parts[param.monthpos], 10);
1447      month = month - 1;
1448      var year = parseInt(parts[param.yearpos], 10);
1449      var date = new Date();
1450      var result = true;
1451      if (day.toString().length !== parts[param.daypos].length){
1452        result = false;
1453      }
1454      if (month.toString().length !== parts[param.monthpos].length){
1455        result = false;
1456      }
1457      if (year.toString().length !== parts[param.yearpos].length){
1458        result = false;
1459      }
1460      if (param.yearpos !== false){
1461        expectedpartscount++;
1462        date.setFullYear(year);
1463        if (year !== date.getFullYear()) {
1464          result = false;
1465        }
1466      }
1467      if (param.monthpos !== false) {
1468        expectedpartscount++;
1469        date.setMonth(month);
1470        if (month !== date.getMonth()) {
1471          result = false;
1472        }
1473      }
1474      if (param.daypos !== false) {
1475        expectedpartscount++;
1476        date.setDate(day);
1477        if (day !== date.getDate()) {
1478          result = false;
1479        }
1480      }
1481      if (expectedpartscount !== parts.length) {
1482        result = false;
1483      }
1484      return this.optional(element) || result;
1485    }, jQuery.format('The date is not in a valid format'));
1486
1487    // Require one of several
1488    jQuery.validator.addMethod("requireOneOf", function(value, element, param) {
1489      var ret = false;
1490      if (value === "") {
1491        jQuery.each(param, function(index, name) {
1492          // @TODO: limit to current form
1493          if (!ret && $("[name='" + name + "']").val().length) {
1494            ret = true;
1495          }
1496        });
1497      }
1498      else {
1499        $(element).removeClass("error");
1500        ret = true;
1501      }
1502      $(element).blur(function () {
1503        jQuery.each(param, function(index, name) {
1504          // @TODO: limit to current form
1505          $("[name='" + name + "']").valid();
1506        });
1507      });
1508      return ret;
1509    }, jQuery.format('Please fill in at least on of the fields'));
1510
1511    // Support for phone
1512    jQuery.validator.addMethod("phone", function(value, element, param) {
1513      var country_code = param;
1514      var result = false;
1515      jQuery.ajax({
1516        'url': Drupal.settings.basePath + 'clientside_validation/phone',
1517        'type': "POST",
1518        'data': {
1519          'value': value,
1520          'country_code': country_code
1521        },
1522        'dataType': 'json',
1523        'async': false,
1524        'success': function(res){
1525          result = res;
1526        }
1527      });
1528      return result.result;
1529
1530    }, jQuery.format('Please fill in a valid phone number'));
1531
1532    // EAN code
1533    jQuery.validator.addMethod("validEAN", function(value, element) {
1534      if (this.optional(element) && value === '') {
1535        return this.optional(element);
1536      }
1537      else {
1538        if (value.length > 13) {
1539          return false;
1540        }
1541        else if (value.length !== 13) {
1542          value = '0000000000000'.substr(0, 13 - value.length).concat(value);
1543        }
1544        if (value === '0000000000000') {
1545          return false;
1546        }
1547        if (isNaN(parseInt(value, 10)) || parseInt(value, 10) === 0) {
1548          return false;
1549        }
1550        var runningTotal = 0;
1551        for (var c = 0; c < 12; c++) {
1552          if (c % 2 === 0) {
1553            runningTotal += 3 * parseInt(value.substr(c, 1), 10);
1554          }
1555          else {
1556            runningTotal += parseInt(value.substr(c, 1), 10);
1557          }
1558        }
1559        var rem = runningTotal % 10;
1560        if (rem !== 0) {
1561          rem = 10 - rem;
1562        }
1563
1564        return rem === parseInt(value.substr(12, 1), 10);
1565
1566      }
1567    }, jQuery.format('Not a valid EAN number.'));
1568
1569    /**
1570     * Allow other modules to add more rules.
1571     * @event clientsideValidationAddCustomRules
1572     * @name clientsideValidationAddCustomRules
1573     * @memberof Drupal.clientsideValidation
1574     */
1575    jQuery.event.trigger('clientsideValidationAddCustomRules');
1576
1577
1578    /**
1579     * strip illegal tags
1580     * @memberof Drupal.clientsideValidation
1581     * @private
1582     */
1583    function strip_tags (input, allowed) {
1584      allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)
1585      var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
1586          commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
1587      return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
1588        return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
1589      });
1590    }
1591  };
1592
1593})(jQuery);;

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