!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).$)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);var o=!1;if("undefined"!=typeof window){var a={get passive(){o=!0}};window.addEventListener("testPassive",null,a),window.removeEventListener("testPassive",null,a)}var l="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),r=[],i=!1,d=-1,u=void 0,c=void 0,f=function(e){return r.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},s=function(e){var t=e||window.event;return!!f(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},g=function(e,t){if(e){if(!r.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};r=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?s(e):e.stopPropagation())}(t,e)},i||(document.addEventListener("touchmove",s,o?{passive:!1}:void 0),i=!0)):function(e){if(void 0===c){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(c=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===u&&(u=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},v=function(e){e?(r=r.filter((function(t){return t.targetElement!==e})),l?(e.ontouchstart=null,e.ontouchmove=null,i&&0===r.length&&(document.removeEventListener("touchmove",s,o?{passive:!1}:void 0),i=!1)):r.length||(void 0!==c&&(document.body.style.paddingRight=c,c=void 0),void 0!==u&&(document.body.style.overflow=u,u=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},m={};n.default(".modal-trigger").on("click",(function(e){var t=n.default(e.currentTarget);t.data("modal")&&(m[t.data("modal")]=!0,g(n.default("."+t.data("modal"))[0]))})),n.default(".modal-closer").on("click",(function(e){var t=n.default(e.currentTarget);t.data("modal")&&(m[t.data("modal")]=!1,v(n.default("."+t.data("modal"))[0]))}));var h={},p={},w={},y=null,b=null,T=null,E=0,P=function(e){return new Promise((function(t,n){var o=new Image;o.addEventListener("load",(function(){return t(o)})),o.addEventListener("error",(function(e){return n(e)})),o.src=e}))},S=function(){var e=h[y][w[y]],t=p[b].clone();for(var o in e.templateItems)n.default("#"+o,t).html(e.templateItems[o].html());if(n.default("img",t).length>0){var a=h[y],l=w[y]>0?w[y]-1:h[y].length-1;n.default("img",a[l].item).each((function(e,t){return P(n.default(t).attr("src"))})),l=w[y]=i.length||(b=a,y=r,T=o,S())}}}})),n.default("#modal-right").on("click",(function(){if(T){var e=h[y];w[y]+1>=e.length?w[y]=0:w[y]++,1==E?E=0:E++,S()}})),n.default("#modal-left").on("click",(function(){if(T){var e=h[y];w[y]-1<=0?w[y]=e.length-1:w[y]--,0==E?E=1:E--,S()}})),n.default((function(){n.default("[data-slider-collection]").each((function(e,t){var o=n.default(t).data("slider-collection"),a=[];n.default(t).find("[data-trigger-slider]").each((function(e,t){var o=n.default(t).data(),l={},r=n.default(t).data("slider-template");for(var i in p.hasOwnProperty(r)||(p[r]=n.default("#"+r)),o){if(o.hasOwnProperty(i))if("sliderTemplate"!==i&&"triggerSlider"!==i)l[i.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))]=n.default("."+o[i],t)}a.push({item:t,templateItems:l})})),h[n.default.camelCase(o)]=a,w[n.default.camelCase(o)]=a.length})),n.default("[data-trigger-slider]").first().trigger("click")}))}));