!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r(n.key),n)}}function i(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(e){var i=function(e,i){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(i)?i:String(i)}var n=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"timeOut",null),i(this,"masonGrid",!1),i(this,"flicKity",!1),this.elem=e,this.styleUpdate(),this.applyLayout(),this.events()}var r,n;return r=t,(n=[{key:"events",value:function(){window.addEventListener("resize",this.onResize.bind(this)),this.masonGrid&&window.addEventListener("load",function(){this.masonGrid.setup()}.bind(this))}},{key:"styleUpdate",value:function(){var t=getComputedStyle(this.elem),e=t.paddingLeft,i=t.paddingRight,r=this.elem.clientWidth-(this.getStyleSize(e)+this.getStyleSize(i));this.elem.classList.remove("wide-wrap","tab-wrap","mob-wrap"),r>768?this.elem.classList.add("wide-wrap"):r>640?this.elem.classList.add("tab-wrap"):r>450&&this.elem.classList.add("mob-wrap")}},{key:"getStyleSize",value:function(t){var e=parseFloat(t);return-1!=t.indexOf("%")||isNaN(e)?0:e}},{key:"onResize",value:function(){var t=this;this.timeout=setTimeout((function(){t.styleUpdate(),t.timeout=null}))}},{key:"applyLayout",value:function(){if(this.addImageAttrs(this.elem),this.elem.classList.contains("dpt-mason-wrap"))this.masonGrid=new brickLayer({container:this.elem,gutter:0,waitForImages:!1,useTransform:!1,callAfter:this.addLoadedClass.bind(this,this.elem)}),this.masonGrid.init();else if(this.elem.classList.contains("dpt-slider")){var t=parseInt(this.elem.getAttribute("data-autotime")),e={cellAlign:"left",contain:!0,wrapAround:!0,prevNextButtons:!0,imagesLoaded:!0,cellSelector:".dpt-entry"};t&&(e.autoPlay=t),this.flicKity=new Flickity(this.elem,e)}}},{key:"addImageAttrs",value:function(t){Array.prototype.slice.call(t.querySelectorAll(".dpt-thumbnail")).forEach((function(t){var e=t.querySelector("img");if(e){var i=e.getAttribute("data-dpt-src"),r=e.getAttribute("data-dpt-srcset");if(i&&r){var n=t.offsetWidth;e.setAttribute("sizes","".concat(n+100,"px")),e.setAttribute("src",i),e.setAttribute("srcset",r)}}}))}},{key:"addLoadedClass",value:function(t){t.classList.add("dpt-loaded")}}])&&e(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),t}();function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function o(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,n=function(t,e){if("object"!==a(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===a(n)?n:String(n)),r)}var n}new(function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var i=this;this.elems=Array.prototype.slice.call(document.querySelectorAll(".dpt-wrapper")),this.elems.forEach((function(t){e.createdpt(t)})),document.addEventListener("animationstart",(function(t){if("dptAdded"===t.animationName){var e=t.target;e.classList.contains("dpt-wrapper")&&(e.classList.contains("dpt-added")||i.createdpt(e))}}),!1)}var e,i;return e=t,(i=[{key:"createdpt",value:function(t){t.classList.add("dpt-added"),new n(t)}}])&&o(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t}())}();