var _extends=Object.assign||function(t){for(var e=1;e-1&&(N(t,e),I(t,o.class_loading)),E(t,e),a(t),C(o.callback_set,t))}var e={elements_selector:"img",container:document,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,callback_load:null,callback_error:null,callback_set:null,callback_enter:null,callback_finish:null,to_webp:!1},n=function(t){return _extends({},e,t)},o=function(t,e){return t.getAttribute("data-"+e)},r=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},a=function(t){return r(t,"was-processed","true")},i=function(t){return"true"===o(t,"was-processed")},s=function(t,e){return r(t,"ll-timeout",e)},c=function(t){return o(t,"ll-timeout")},l=function(t){return t.filter(function(t){return!i(t)})},u=function(t,e){return t.filter(function(t){return t!==e})},d=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)},f=function(t,e){return e?t.replace(/\.(jpe?g|png)/gi,".webp"):t},_="undefined"!=typeof window,v=_&&!("onscroll"in window)||/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),g=_&&"IntersectionObserver"in window,h=_&&"classList"in document.createElement("p"),b=_&&function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))&&0===t.toDataURL("image/webp").indexOf("data:image/webp")}(),m=function(t,e,n,r){for(var a,i=0;a=t.children[i];i+=1)if("SOURCE"===a.tagName){var s=o(a,n);p(a,e,s,r)}},p=function(t,e,n,o){n&&t.setAttribute(e,f(n,o))},y=function(t,e){var n=b&&e.to_webp,r=o(t,e.data_src),a=o(t,e.data_bg);if(r){var i=f(r,n);t.style.backgroundImage='url("'+i+'")'}if(a){var s=f(a,n);t.style.backgroundImage=s}},w={IMG:function(t,e){var n=b&&e.to_webp,r=e.data_srcset,a=t.parentNode;a&&"PICTURE"===a.tagName&&m(a,"srcset",r,n);var i=o(t,e.data_sizes);p(t,"sizes",i);var s=o(t,r);p(t,"srcset",s,n);var c=o(t,e.data_src);p(t,"src",c,n)},IFRAME:function(t,e){var n=o(t,e.data_src);p(t,"src",n)},VIDEO:function(t,e){var n=e.data_src,r=o(t,n);m(t,"src",n),p(t,"src",r),t.load()}},E=function(t,e){var n=e._settings,o=t.tagName,r=w[o];if(r)return r(t,n),e._updateLoadingCount(1),void(e._elements=u(e._elements,t));y(t,n)},I=function(t,e){h?t.classList.add(e):t.className+=(t.className?" ":"")+e},L=function(t,e){h?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},C=function(t,e){t&&t(e)},O=function(t,e,n){t.addEventListener(e,n)},k=function(t,e,n){t.removeEventListener(e,n)},x=function(t,e,n){O(t,"load",e),O(t,"loadeddata",e),O(t,"error",n)},A=function(t,e,n){k(t,"load",e),k(t,"loadeddata",e),k(t,"error",n)},z=function(t,e,n){var o=n._settings,r=e?o.class_loaded:o.class_error,a=e?o.callback_load:o.callback_error,i=t.target;L(i,o.class_loading),I(i,r),C(a,i),n._updateLoadingCount(-1)},N=function(t,e){var n=function n(r){z(r,!0,e),A(t,n,o)},o=function o(r){z(r,!1,e),A(t,n,o)};x(t,n,o)},R=["IMG","IFRAME","VIDEO"],S=function(e,n,o){t(e,o),n.unobserve(e)},M=function(t){var e=c(t);e&&(clearTimeout(e),s(t,null))},j=function(t,e,n){var o=n._settings.load_delay,r=c(t);r||(r=setTimeout(function(){S(t,e,n),M(t)},o),s(t,r))},D=function(t){return t.isIntersecting||t.intersectionRatio>0},T=function(t){return{root:t.container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}},U=function(t,e){this._settings=n(t),this._setObserver(),this._loadingCount=0,this.update(e)};return U.prototype={_manageIntersection:function(t){var e=this._observer,n=this._settings.load_delay,o=t.target;n?D(t)?j(o,e,this):M(o):D(t)&&S(o,e,this)},_onIntersection:function(t){t.forEach(this._manageIntersection.bind(this))},_setObserver:function(){g&&(this._observer=new IntersectionObserver(this._onIntersection.bind(this),T(this._settings)))},_updateLoadingCount:function(t){this._loadingCount+=t,0===this._elements.length&&0===this._loadingCount&&C(this._settings.callback_finish)},update:function(t){var e=this,n=this._settings,o=t||n.container.querySelectorAll(n.elements_selector);this._elements=l(Array.prototype.slice.call(o)),!v&&this._observer?this._elements.forEach(function(t){e._observer.observe(t)}):this.loadAll()},destroy:function(){var t=this;this._observer&&(this._elements.forEach(function(e){t._observer.unobserve(e)}),this._observer=null),this._elements=null,this._settings=null},load:function(e,n){t(e,this,n)},loadAll:function(){var t=this;this._elements.forEach(function(e){t.load(e)})}},_&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)d(t,n);else d(t,e)}(U,window.lazyLoadOptions),U}); "use strict";function _classCallCheck(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,a){for(var o=0;o0&&(this.hasCozyVideoGalleries=!0),this.czVideos.length>0&&(this.hasCozyVideos=!0),this.events()}catch(e){return s.handleCatch(e)}}return _createClass(s,[{key:"findUrl",value:function(){var a=e("[src*='".concat("cziframeagent","']")).attr("src");this.myshopify_domain=a.split("shop=")[1];var o=a.split("/embed/")[0];this.assets_domain="https://cozyvideogalleries.addons.business",o.includes("localhost")&&(this.assets_domain=o)}},{key:"getUrlParameter",value:function(e){var a,o,t=decodeURIComponent(window.location.search.substring(1)).split("&");for(o=0;o").attr({allow:"autoplay",allowTransparency:!0,frameBorder:0,scrolling:"no",allowfullscreen:"allowfullscreen",mozallowfullscreen:"mozallowfullscreen",msallowfullscreen:"msallowfullscreen",oallowfullscreen:"oallowfullscreen",webkitallowfullscreen:"webkitallowfullscreen",class:"fitvidsignore"})}},{key:"createFancyLightboxIframe",value:function(a){if(e("#czvdo-global-style").length<1&&this.head.append(''),0===e("#cozy-video-gallery-popup-iframe").length){var o=e('');this.body.addClass("contains_cozy_gallery").append(o);var t=e("#cozy-video-gallery-popup-div"),i=this.iframeFactory();i.attr({id:"cozy-video-gallery-popup-iframe",allow:"autoplay",style:"width:100%;position:fixed;height:100%!important;top:0;bottom:0;left:0;z-index:2147483647",src:"".concat(this.assets_domain,"/apousr/gallery/modal/").concat(a,"?shop=").concat(this.myshopify_domain,"&width=").concat(s.getX())}),t.append(i),e("#cozy-video-gallery-popup-div").removeClass("lbx-iframe-show").addClass("lbx-iframe-hide").hide()}}},{key:"createLightboxIframe",value:function(a){if(0===e("#czy-gallery-65-ltbx-iframe-".concat(a)).length){var o=e('
'));this.body.append(o);var t=e("#cz-embed-glr-lbx".concat(a)),i=this.iframeFactory();i.attr({id:"czy-gallery-65-ltbx-iframe-".concat(a),style:"width:100%;position:fixed;height:100%!important;top:0;bottom:0;z-index:2147483647",src:"".concat(this.assets_domain,"/apousr/lbx/").concat(a,"?shop=").concat(this.myshopify_domain,"&width=").concat(s.getX())}),t.append(i)}}},{key:"createIframe",value:function(a){var o="",t=1;e(".cozy-video-gallery").each(function(){e(this).attr("id")=="cozy-video-gallery"+a&&(e(this).addClass("cozy-video-gallery"+a+"-"+t),t+=1)});var i=e(".cozy-video-gallery".concat(a));0==i.length&&(i=e("#cozy-video-gallery".concat(a)));var l=i.hasClass("czvdo-lazy-load"),n="czvdo-iframe",r=null,c=null,d="".concat(this.assets_domain,"/apousr/glry/").concat(a,"?shop=").concat(this.myshopify_domain,"&width=").concat(s.getX());e("#czvdo-global-style").length<1&&this.head.append('');var y=this.iframeFactory(),h=1;e(".cozy-video-gallery").each(function(){if(e(this).attr("id")=="cozy-video-gallery"+a){if(o="cozy-video-gallery"+a+"-"+h,e(this).addClass(o),d+="&iframeid="+o,l?(c=d,n="czvdo-iframe-lazy-load"):r=d,0===e(".iframe-".concat(o)).length){y.attr({class:n+" iframe-".concat(o," fitvidsignore cozy-video-gallery-iframe-").concat(a),id:"cozy-video-gallery-iframe-".concat(a),style:"width:100%;max-width:100%!important;position:relative;height:100%!important;border:0;margin:0;padding:0;","data-src":c,src:r});var t=e(".cozy-video-gallery"+a+"-"+h);y.appendTo(t)}h+=1}})}},{key:"getMsgOfChild",value:function(a){var o=a.data;if(o.length>0&&0===o.indexOf("cozyvideogallery_setheight")){var t=o.replace("cozyvideogallery_setheight","");t=t.split("_");var i=e(".".concat(t[2]));if(0==i.length&&(i=e("#cozy-video-gallery".concat(t[0]))),t[0]>0&&t[1]>0)e(".iframe-".concat(t[2])).css("height",t[1]+"px"),i.attr("style","height:".concat(t[1],"px"))}else if(o.length>0&&0===o.indexOf("cz_lbx_show_")){var l=o.replace("cz_lbx_show_",""),s=l.split("_"),n=s[0];e("#cz-embed-glr-lbx".concat(s[0])).removeClass("lbx-iframe-hide").addClass("lbx-iframe-show"),e("#czy-gallery-65-ltbx-iframe-".concat(n))[0].contentWindow.postMessage("cz_slide_lbx_show_".concat(l),"*")}else if(o.length>0&&0===o.indexOf("close-lbx-iframe"))e(".lbx-iframe-show").removeClass("lbx-iframe-show").addClass("lbx-iframe-hide");else if(o.length>0&&0===o.indexOf("cozyvideogallery_closepopup"))e(".lbx-iframe-show").removeClass("lbx-iframe-show").addClass("lbx-iframe-hide").hide();else if("cozyvideogallery_setpopupchannel"==o.msg){var r=o.images,c={msg:"cozyvideogallery_openpopup",cz_user_gallery_id:o.cz_user_gallery_id,cz_user_store_id:o.cz_user_store_id,cz_user_store_name:o.cz_user_store_name,cz_video_autoplay:o.cz_video_autoplay,czvdoUserCustom_css:o.czvdoUserCustom_css,images:r};e("#cozy-video-gallery-popup-div").removeClass("lbx-iframe-hide").addClass("lbx-iframe-show").show(),e("#cozy-video-gallery-popup-iframe")[0].contentWindow.postMessage(c,"*")}}},{key:"sendMsgToIframe",value:function(a){var o=this;e(".cozy-video-gallery").each(function(t,i){var l=e(i);if(l.attr("id")=="cozy-video-gallery"+a){var n=l.find("iframe");n.length>0?n[0].contentWindow.postMessage("cozy_video_screen_width_msg"+a+"_"+s.getX(),"*"):(o.createIframe(a),o.createFancyLightboxIframe(a)),1}})}},{key:"eachGallery",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null===a)return!1;this.galleries.each(function(o,t){var i=e(t).attr("id");return void 0===i||(i=i.replace("cozy-video-gallery",""),a(i),!0)})}},{key:"events",value:function(){(this.hasCozyVideoGalleries||this.hasCozyVideos)&&!0!==window.cozyVideoGalleryAgentCache.msgListening&&(window.cozyVideoGalleryAgentCache.msgListening=!0,window.addEventListener?window.addEventListener("message",this.getMsgOfChild,!1):window.attachEvent("onmessage",this.getMsgOfChild),window.addEventListener("resize",this.sendMessage))}},{key:"sendMessage",value:function(){var e=new s;e.eachGallery(function(a){e.sendMsgToIframe(a)})}}],[{key:"handleCatch",value:function(){s.console.apply(s,arguments)}},{key:"console",value:function(e){function a(){return e.apply(this,arguments)}return a.toString=function(){return e.toString()},a}(function(){var e;a.debug&&(e=console).log.apply(e,arguments)})},{key:"getX",value:function(){var e=window,a=document,o=a.documentElement,t=a.getElementsByTagName("body")[0];return e.innerWidth||o.clientWidth||t.clientWidth}}]),s}(),n=0,r=function(){n++,s.console("In videoPinger ".concat(n)),window.CozyVideoGalleryAgent=new s,window.CozyVideoGalleryAgent.createAgent()},c=setInterval(function(){try{r()}catch(e){s.handleCatch(e)}},1e3);setTimeout(function(){clearInterval(c)},5e3),setInterval(function(){try{window.CozyVideoGalleryAgent.sendMessage()}catch(e){s.handleCatch(e)}},1e3),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?r():document.addEventListener("DOMContentLoaded",r)};!function(e){if("undefined"==typeof document)throw new Error("document-ready only runs in the browser");var a=document.readyState;if("complete"===a||"interactive"===a)return setTimeout(e,0);document.addEventListener("DOMContentLoaded",function(){e()})}(function(){if(window.jQuery)e();else{var a=document.createElement("script");document.head.appendChild(a),a.type="text/javascript",a.src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js",a.onload=e}$("#czvdo-global-style").length<1&&document.head.append(''),CozyVideoGalleryAgent.czVideos.on("click",function(e){e.preventDefault();var a=$(this).data("videoid"),o=$(this).data("params"),t=$(this).data("provider"),i=$(this).data("title"),l="https://www.youtube.com/embed/"+a+"?"+o;"vimeo"===t&&(l="https://player.vimeo.com/video/"+a+"?"+o);var s=[];s.push({href:l,src:l,title:i,caption:i});var n={msg:"cozyvideogallery_openpopup",cz_user_gallery_id:"0000",cz_user_store_id:"0000",cz_user_store_name:CozyVideoGalleryAgent.myshopify_domain,cz_video_autoplay:0,czvdoUserCustom_css:"",images:s};$("#cozy-video-gallery-popup-div").removeClass("lbx-iframe-hide").addClass("lbx-iframe-show").show(),$("#cozy-video-gallery-popup-iframe")[0].contentWindow.postMessage(n,"*")})})}();