Files
2024-12-31 18:53:46 -08:00

1 line
84 KiB
JavaScript

(()=>{"use strict";var e,t={659:()=>{const e=window.wp.blocks,t=window.wp.i18n,i=window.wp.blockEditor,s=window.React,o=window.wp.data,l=window.wp.components,n=JSON.parse('{"UU":"lcp/lcp-gallery","KR":"lcp"}');var r=function(){return r=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},a="lgUpdateSlides",g="lgPosterClick",d="lgBeforeNextSlide",h="lgBeforePrevSlide",c={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:"",startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",loadYouTubePoster:!0,defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",resetScrollPosition:!0,hideScrollbar:!1,closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,trapFocus:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",iframeMaxWidth:"100%",iframeMaxHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[],strings:{closeGallery:"Close gallery",toggleMaximize:"Toggle maximize",previousSlide:"Previous slide",nextSlide:"Next slide",download:"Download",playVideo:"Play video",mediaLoadingFailed:"Oops... Failed to load content..."}},u=function(){function e(e){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(e),this.firstElement=this._getFirstEl(),this}return e.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},e.prototype._getSelector=function(e,t){return void 0===t&&(t=document),"string"!=typeof e?e:(t=t||document,"#"===e.substring(0,1)?t.querySelector(e):t.querySelectorAll(e))},e.prototype._each=function(e){return this.selector?(void 0!==this.selector.length?[].forEach.call(this.selector,e):e(this.selector,0),this):this},e.prototype._setCssVendorPrefix=function(e,t,i){var s=t.replace(/-([a-z])/gi,(function(e,t){return t.toUpperCase()}));-1!==this.cssVenderPrefixes.indexOf(s)?(e.style[s.charAt(0).toLowerCase()+s.slice(1)]=i,e.style["webkit"+s]=i,e.style["moz"+s]=i,e.style["ms"+s]=i,e.style["o"+s]=i):e.style[s]=i},e.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},e.prototype.isEventMatched=function(e,t){var i=t.split(".");return e.split(".").filter((function(e){return e})).every((function(e){return-1!==i.indexOf(e)}))},e.prototype.attr=function(e,t){return void 0===t?this.firstElement?this.firstElement.getAttribute(e):"":(this._each((function(i){i.setAttribute(e,t)})),this)},e.prototype.find=function(e){return m(this._getSelector(e,this.selector))},e.prototype.first=function(){return this.selector&&void 0!==this.selector.length?m(this.selector[0]):m(this.selector)},e.prototype.eq=function(e){return m(this.selector[e])},e.prototype.parent=function(){return m(this.selector.parentElement)},e.prototype.get=function(){return this._getFirstEl()},e.prototype.removeAttr=function(e){var t=e.split(" ");return this._each((function(e){t.forEach((function(t){return e.removeAttribute(t)}))})),this},e.prototype.wrap=function(e){if(!this.firstElement)return this;var t=document.createElement("div");return t.className=e,this.firstElement.parentNode.insertBefore(t,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),t.appendChild(this.firstElement),this},e.prototype.addClass=function(e){return void 0===e&&(e=""),this._each((function(t){e.split(" ").forEach((function(e){e&&t.classList.add(e)}))})),this},e.prototype.removeClass=function(e){return this._each((function(t){e.split(" ").forEach((function(e){e&&t.classList.remove(e)}))})),this},e.prototype.hasClass=function(e){return!!this.firstElement&&this.firstElement.classList.contains(e)},e.prototype.hasAttribute=function(e){return!!this.firstElement&&this.firstElement.hasAttribute(e)},e.prototype.toggleClass=function(e){return this.firstElement?(this.hasClass(e)?this.removeClass(e):this.addClass(e),this):this},e.prototype.css=function(e,t){var i=this;return this._each((function(s){i._setCssVendorPrefix(s,e,t)})),this},e.prototype.on=function(t,i){var s=this;return this.selector?(t.split(" ").forEach((function(t){Array.isArray(e.eventListeners[t])||(e.eventListeners[t]=[]),e.eventListeners[t].push(i),s.selector.addEventListener(t.split(".")[0],i)})),this):this},e.prototype.once=function(e,t){var i=this;return this.on(e,(function(){i.off(e),t(e)})),this},e.prototype.off=function(t){var i=this;return this.selector?(Object.keys(e.eventListeners).forEach((function(s){i.isEventMatched(t,s)&&(e.eventListeners[s].forEach((function(e){i.selector.removeEventListener(s.split(".")[0],e)})),e.eventListeners[s]=[])})),this):this},e.prototype.trigger=function(e,t){if(!this.firstElement)return this;var i=new CustomEvent(e.split(".")[0],{detail:t||null});return this.firstElement.dispatchEvent(i),this},e.prototype.load=function(e){var t=this;return fetch(e).then((function(e){return e.text()})).then((function(e){t.selector.innerHTML=e})),this},e.prototype.html=function(e){return void 0===e?this.firstElement?this.firstElement.innerHTML:"":(this._each((function(t){t.innerHTML=e})),this)},e.prototype.append=function(e){return this._each((function(t){"string"==typeof e?t.insertAdjacentHTML("beforeend",e):t.appendChild(e)})),this},e.prototype.prepend=function(e){return this._each((function(t){"string"==typeof e?t.insertAdjacentHTML("afterbegin",e):e instanceof HTMLElement&&t.insertBefore(e.cloneNode(!0),t.firstChild)})),this},e.prototype.remove=function(){return this._each((function(e){e.parentNode.removeChild(e)})),this},e.prototype.empty=function(){return this._each((function(e){e.innerHTML=""})),this},e.prototype.scrollTop=function(e){return void 0!==e?(document.body.scrollTop=e,document.documentElement.scrollTop=e,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},e.prototype.scrollLeft=function(e){return void 0!==e?(document.body.scrollLeft=e,document.documentElement.scrollLeft=e,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},e.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var e=this.firstElement.getBoundingClientRect(),t=m("body").style().marginLeft;return{left:e.left-parseFloat(t)+this.scrollLeft(),top:e.top+this.scrollTop()}},e.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},e.prototype.width=function(){var e=this.style();return this.firstElement.clientWidth-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)},e.prototype.height=function(){var e=this.style();return this.firstElement.clientHeight-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)},e.eventListeners={},e}();function m(e){return function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),new u(e)}var p=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","download","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];function f(e){return"href"===e?"src":e=(e=(e=e.replace("data-","")).charAt(0).toLowerCase()+e.slice(1)).replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}var v=function(e,t,i){fetch(e).then((function(e){return e.text()})).then((function(e){if("append"===i){var s='<div class="lg-sub-html">'+e+"</div>";t.append(s)}else t.html(e)}))},y=function(e,t,i,s){void 0===i&&(i=0);var o=m(e).attr("data-lg-size")||s;if(o){var l=o.split(",");if(l[1])for(var n=window.innerWidth,r=0;r<l.length;r++){var a=l[r];if(parseInt(a.split("-")[2],10)>n){o=a;break}r===l.length-1&&(o=a)}var g=o.split("-"),d=parseInt(g[0],10),h=parseInt(g[1],10),c=t.width(),u=t.height()-i,p=Math.min(c,d),f=Math.min(u,h),v=Math.min(p/d,f/h);return{width:d*v,height:h*v}}},b=function(e,t,i,s,o){if(o){var l=m(e).find("img").first();if(l.get()){var n=t.get().getBoundingClientRect(),r=n.width,a=t.height()-(i+s),g=l.width(),d=l.height(),h=l.style(),c=(r-g)/2-l.offset().left+(parseFloat(h.paddingLeft)||0)+(parseFloat(h.borderLeft)||0)+m(window).scrollLeft()+n.left,u=(a-d)/2-l.offset().top+(parseFloat(h.paddingTop)||0)+(parseFloat(h.borderTop)||0)+m(window).scrollTop()+i;return"translate3d("+(c*=-1)+"px, "+(u*=-1)+"px, 0) scale3d("+g/o.width+", "+d/o.height+", 1)"}}},C=function(e,t,i,s,o,l){var n="<img "+i+" "+(s?'srcset="'+s+'"':"")+" "+(o?'sizes="'+o+'"':"")+' class="lg-object lg-image" data-index="'+e+'" src="'+t+'" />',r="";return l&&(r=("string"==typeof l?JSON.parse(l):l).map((function(e){var t="";return Object.keys(e).forEach((function(i){t+=" "+i+'="'+e[i]+'"'})),"<source "+t+"></source>"}))),""+r+n},x=0,S=function(){function e(e,t){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.bodyPaddingRight=0,this.isDummyImageRemoved=!1,this.dragOrSwipeEnabled=!1,this.mediaContainerPosition={top:0,bottom:0},!e)return this;if(x++,this.lgId=x,this.el=e,this.LGel=m(e),this.generateSettings(t),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return e.prototype.generateSettings=function(e){if(this.settings=r(r({},c),e),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){var t=r(r({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=r(r({},this.settings),t)}},e.prototype.normalizeSettings=function(){if(this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container){var e=this.settings.container;if("function"==typeof e)this.settings.container=e();else if("string"==typeof e){var t=document.querySelector(e);this.settings.container=null!=t?t:document.body}}else this.settings.container=document.body;this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},e.prototype.init=function(){var e=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger("lgInit",{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){e.enableDrag(),e.enableSwipe(),e.triggerPosterClick()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},e.prototype.openGalleryOnItemClick=function(){for(var e=this,t=function(t){var s=i.items[t],o=m(s),l=u.generateUUID();o.attr("data-lg-id",l).on("click.lgcustom-item-"+l,(function(i){i.preventDefault();var o=e.settings.index||t;e.openGallery(o,s)}))},i=this,s=0;s<this.items.length;s++)t(s)},e.prototype.buildModules=function(){var e=this;this.settings.plugins.forEach((function(t){e.plugins.push(new t(e,m))}))},e.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},e.prototype.getSlideItem=function(e){return m(this.getSlideItemId(e))},e.prototype.getSlideItemId=function(e){return"#lg-item-"+this.lgId+"-"+e},e.prototype.getIdName=function(e){return e+"-"+this.lgId},e.prototype.getElementById=function(e){return m("#"+this.getIdName(e))},e.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},e.prototype.buildStructure=function(){var e=this;if(!this.$container||!this.$container.get()){var t="",i="";this.settings.controls&&(t='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="'+this.settings.strings.previousSlide+'" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="'+this.settings.strings.nextSlide+'" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-item"!==this.settings.appendSubHtmlTo&&(i='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var s="";this.settings.allowMediaOverlap&&(s+="lg-media-overlap ");var o=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",l=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",n="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),r=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="'+this.settings.strings.closeGallery+'" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",a=this.settings.showMaximizeIcon?'<button type="button" aria-label="'+this.settings.strings.toggleMaximize+'" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",g='\n <div class="'+n+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+o+" "+l+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+s+' ">\n\n <div id="'+this.getIdName("lg-content")+'" class="lg-content">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner">\n </div>\n '+t+'\n </div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+a+"\n "+r+"\n </div>\n "+(".lg-outer"===this.settings.appendSubHtmlTo?i:"")+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+(".lg-sub-html"===this.settings.appendSubHtmlTo?i:"")+"\n </div>\n </div>\n </div>\n ";m(this.settings.container).append(g),document.body!==this.settings.container&&m(this.settings.container).css("position","relative"),this.outer=this.getElementById("lg-outer"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$content=this.getElementById("lg-content"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var d=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(d+="lg-grab "),this.outer.addClass(d),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" rel="noopener" aria-label="'+this.settings.strings.download+'" download class="lg-download lg-icon"></a>'),this.counter(),m(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){e.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},e.prototype.refreshOnResize=function(){if(this.lgOpened){var e=this.galleryItems[this.index].__slideVideoInfo;this.mediaContainerPosition=this.getMediaContainerPosition();var t=this.mediaContainerPosition,i=t.top,s=t.bottom;if(this.currentImageSize=y(this.items[this.index],this.outer,i+s,e&&this.settings.videoMaxSize),e&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var o=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",o)}this.LGel.trigger("lgContainerResize")}},e.prototype.resizeVideoSlide=function(e,t){var i=this.getVideoContStyle(t);this.getSlideItem(e).find(".lg-video-cont").attr("style",i)},e.prototype.updateSlides=function(e,t){if(this.index>e.length-1&&(this.index=e.length-1),1===e.length&&(this.index=0),e.length){var i=this.galleryItems[t].src;this.galleryItems=e,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var s=0;this.galleryItems.some((function(e,t){return e.src===i&&(s=t,!0)})),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.LGel.trigger(a)}else this.closeGallery()},e.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var e=m(this.settings.selectWithin);this.items=e.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return t=this.items,i=this.settings.extraProps,s=this.settings.getCaptionFromTitleOrAlt,o=this.settings.exThumbImage,l=[],n=function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=Array(e),o=0;for(t=0;t<i;t++)for(var l=arguments[t],n=0,r=l.length;n<r;n++,o++)s[o]=l[n];return s}(p,i),[].forEach.call(t,(function(e){for(var t={},i=0;i<e.attributes.length;i++){var r=e.attributes[i];if(r.specified){var a=f(r.name),g="";n.indexOf(a)>-1&&(g=a),g&&(t[g]=r.value)}}var d=m(e),h=d.find("img").first().attr("alt"),c=d.attr("title"),u=o?d.attr(o):d.find("img").first().attr("src");t.thumb=u,s&&!t.subHtml&&(t.subHtml=c||h||""),t.alt=h||c||"",l.push(t)})),console.log(l,"dynamicElements"),l;var t,i,s,o,l,n},e.prototype.shouldHideScrollbar=function(){return this.settings.hideScrollbar&&document.body===this.settings.container},e.prototype.hideScrollbar=function(){if(this.shouldHideScrollbar()){this.bodyPaddingRight=parseFloat(m("body").style().paddingRight);var e=document.documentElement.getBoundingClientRect(),t=window.innerWidth-e.width;m(document.body).css("padding-right",t+this.bodyPaddingRight+"px"),m(document.body).addClass("lg-overlay-open")}},e.prototype.resetScrollBar=function(){this.shouldHideScrollbar()&&(m(document.body).css("padding-right",this.bodyPaddingRight+"px"),m(document.body).removeClass("lg-overlay-open"))},e.prototype.openGallery=function(e,t){var i=this;if(void 0===e&&(e=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.removeClass("lg-hide-items"),this.hideScrollbar(),this.$container.addClass("lg-show");var s=this.getItemsToBeInsertedToDom(e,e);this.currentItemsInDom=s;var o="";s.forEach((function(e){o=o+'<div id="'+e+'" class="lg-item"></div>'})),this.$inner.append(o),this.addHtml(e);var l="";this.mediaContainerPosition=this.getMediaContainerPosition();var n=this.mediaContainerPosition,r=n.top,a=n.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(r,a);var g=this.galleryItems[e].__slideVideoInfo;this.zoomFromOrigin&&t&&(this.currentImageSize=y(t,this.outer,r+a,g&&this.settings.videoMaxSize),l=b(t,this.outer,r,a,this.currentImageSize)),this.zoomFromOrigin&&l||(this.outer.addClass(this.settings.startClass),this.getSlideItem(e).removeClass("lg-complete"));var d=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){i.outer.addClass("lg-components-open")}),d),this.index=e,this.LGel.trigger("lgBeforeOpen"),this.getSlideItem(e).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=m(window).scrollTop(),setTimeout((function(){if(i.zoomFromOrigin&&l){var t=i.getSlideItem(e);t.css("transform",l),setTimeout((function(){t.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",i.settings.startAnimationDuration+"ms"),i.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){t.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){i.$backdrop.addClass("in"),i.$container.addClass("lg-show-in")}),10),setTimeout((function(){i.settings.trapFocus&&document.body===i.settings.container&&i.trapFocus()}),i.settings.backdropDuration+50),i.zoomFromOrigin&&l||setTimeout((function(){i.outer.addClass("lg-visible")}),i.settings.backdropDuration),i.slide(e,!1,!1,!1),i.LGel.trigger("lgAfterOpen")})),document.body===this.settings.container&&m("html").addClass("lg-on")}},e.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var e=this.$toolbar.get().clientHeight||0,t=this.outer.find(".lg-components .lg-sub-html").get(),i=this.settings.defaultCaptionHeight||t&&t.clientHeight||0,s=this.outer.find(".lg-thumb-outer").get();return{top:e,bottom:(s?s.clientHeight:0)+i}},e.prototype.setMediaContainerPosition=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.$content.css("top",e+"px").css("bottom",t+"px")},e.prototype.hideBars=function(){var e=this;setTimeout((function(){e.outer.removeClass("lg-hide-items"),e.settings.hideBarsDelay>0&&(e.outer.on("mousemove.lg click.lg touchstart.lg",(function(){e.outer.removeClass("lg-hide-items"),clearTimeout(e.hideBarTimeout),e.hideBarTimeout=setTimeout((function(){e.outer.addClass("lg-hide-items")}),e.settings.hideBarsDelay)})),e.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},e.prototype.initPictureFill=function(e){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[e.get()]})}catch(e){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},e.prototype.counter=function(){if(this.settings.counter){var e='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> /\n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>";this.outer.find(this.settings.appendCounterTo).append(e)}},e.prototype.addHtml=function(e){var t,i;if(this.galleryItems[e].subHtmlUrl?i=this.galleryItems[e].subHtmlUrl:t=this.galleryItems[e].subHtml,!i)if(t){var s=t.substring(0,1);"."!==s&&"#"!==s||(t=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?m(this.items).eq(e).find(t).first().html():m(t).first().html())}else t="";if(".lg-item"!==this.settings.appendSubHtmlTo)i?v(i,this.outer.find(".lg-sub-html"),"replace"):this.outer.find(".lg-sub-html").html(t);else{var o=m(this.getSlideItemId(e));i?v(i,o,"append"):o.append('<div class="lg-sub-html">'+t+"</div>")}null!=t&&(""===t?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger("lgAfterAppendSubHtml",{index:e})},e.prototype.preload=function(e){for(var t=1;t<=this.settings.preload&&!(t>=this.galleryItems.length-e);t++)this.loadContent(e+t,!1);for(var i=1;i<=this.settings.preload&&!(e-i<0);i++)this.loadContent(e-i,!1)},e.prototype.getDummyImgStyles=function(e){return e?"width:"+e.width+"px;\n margin-left: -"+e.width/2+"px;\n margin-top: -"+e.height/2+"px;\n height:"+e.height+"px":""},e.prototype.getVideoContStyle=function(e){return e?"width:"+e.width+"px;\n height:"+e.height+"px":""},e.prototype.getDummyImageContent=function(e,t,i){var s;if(this.settings.dynamic||(s=m(this.items).eq(t)),s){var o;if(!(o=this.settings.exThumbImage?s.attr(this.settings.exThumbImage):s.find("img").first().attr("src")))return"";var l=this.getDummyImgStyles(this.currentImageSize),n=document.createElement("img");return n.alt=i||"",n.src=o,n.className="lg-dummy-img",n.style.cssText=l,e.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),n}return""},e.prototype.setImgMarkup=function(e,t,i){var s,o=this.galleryItems[i],l=o.alt,n=o.srcset,r=o.sizes,a=o.sources,g=l?'alt="'+l+'"':"";s=this.isFirstSlideWithZoomAnimation()?this.getDummyImageContent(t,i,g):C(i,e,g,n,r,a);var d=document.createElement("picture");d.className="lg-img-wrap",m(d).append(s),t.prepend(d)},e.prototype.onSlideObjectLoad=function(e,t,i,s){var o,l=e.find(".lg-object").first();(o=l.get())&&o.complete&&0!==o.naturalWidth||t?i():(l.on("load.lg error.lg",(function(){i&&i()})),l.on("error.lg",(function(){s&&s()})))},e.prototype.onLgObjectLoad=function(e,t,i,s,o,l){var n=this;this.onSlideObjectLoad(e,l,(function(){n.triggerSlideItemLoad(e,t,i,s,o)}),(function(){e.addClass("lg-complete lg-complete_"),e.html('<span class="lg-error-msg">'+n.settings.strings.mediaLoadingFailed+"</span>")}))},e.prototype.triggerSlideItemLoad=function(e,t,i,s,o){var l=this,n=this.galleryItems[t],r=o&&"video"===this.getSlideType(n)&&!n.poster?s:0;setTimeout((function(){e.addClass("lg-complete lg-complete_"),l.LGel.trigger("lgSlideItemLoad",{index:t,delay:i||0,isFirstSlide:o})}),r)},e.prototype.isFirstSlideWithZoomAnimation=function(){return!(this.lGalleryOn||!this.zoomFromOrigin||!this.currentImageSize)},e.prototype.addSlideVideoInfo=function(e){var t=this;e.forEach((function(e,i){e.__slideVideoInfo=function(e,t,i){if(!e)return t?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=e.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)([\&|?][\S]*)*/i),o=e.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)(.*)?/i),l=e.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:o?{vimeo:o}:l?{wistia:l}:void 0}(e.src,!!e.video,i),e.__slideVideoInfo&&t.settings.loadYouTubePoster&&!e.poster&&e.__slideVideoInfo.youtube&&(e.poster="//img.youtube.com/vi/"+e.__slideVideoInfo.youtube[1]+"/maxresdefault.jpg")}))},e.prototype.loadContent=function(e,t){var i=this,s=this.galleryItems[e],o=m(this.getSlideItemId(e)),l=s.poster,n=s.srcset,r=s.sizes,a=s.sources,g=s.src,d=s.video,h=d&&"string"==typeof d?JSON.parse(d):d;if(s.responsive){var c=s.responsive.split(",");g=function(e){for(var t=[],i=[],s="",o=0;o<e.length;o++){var l=e[o].split(" ");""===l[0]&&l.splice(0,1),i.push(l[0]),t.push(l[1])}for(var n=window.innerWidth,r=0;r<t.length;r++)if(parseInt(t[r],10)>n){s=i[r];break}return s}(c)||g}var u=s.__slideVideoInfo,p="",f=!!s.iframe,v=!this.lGalleryOn,b=0;if(v&&(b=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),!o.hasClass("lg-loaded")){if(u){var x=this.mediaContainerPosition,S=x.top,w=x.bottom,I=y(this.items[e],this.outer,S+w,u&&this.settings.videoMaxSize);p=this.getVideoContStyle(I)}if(f){var _=function(e,t,i,s,o,l){return'<div class="lg-media-cont lg-has-iframe" style="width:'+e+"; max-width:"+i+"; height: "+t+"; max-height:"+s+'">\n <iframe class="lg-object" frameborder="0" '+(l?'title="'+l+'"':"")+' src="'+o+'" allowfullscreen="true"></iframe>\n </div>'}(this.settings.iframeWidth,this.settings.iframeHeight,this.settings.iframeMaxWidth,this.settings.iframeMaxHeight,g,s.iframeTitle);o.prepend(_)}else if(l){var z="";v&&this.zoomFromOrigin&&this.currentImageSize&&(z=this.getDummyImageContent(o,e,"")),_=function(e,t,i,s,o){var l;l=o&&o.youtube?"lg-has-youtube":o&&o.vimeo?"lg-has-vimeo":"lg-has-html5";var n=t;return"string"!=typeof t&&(n=t.outerHTML),'<div class="lg-video-cont '+l+'" style="'+i+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="'+s+'"\n role="img"\n class="lg-video-play-icon"\n >\n <title>'+s+'</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+n+'\n <img class="lg-object lg-video-poster" src="'+e+'" />\n </div>'}(l,z||"",p,this.settings.strings.playVideo,u),o.prepend(_)}else if(u)_='<div class="lg-video-cont " style="'+p+'"></div>',o.prepend(_);else if(this.setImgMarkup(g,o,e),n||a){var T=o.find(".lg-object");this.initPictureFill(T)}(l||u)&&this.LGel.trigger("lgHasVideo",{index:e,src:g,html5Video:h,hasPoster:!!l}),this.LGel.trigger("lgAfterAppendSlide",{index:e}),this.lGalleryOn&&".lg-item"===this.settings.appendSubHtmlTo&&this.addHtml(e)}var L=0;b&&!m(document.body).hasClass("lg-from-hash")&&(L=b),this.isFirstSlideWithZoomAnimation()&&(setTimeout((function(){o.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),o.hasClass("lg-loaded")||setTimeout((function(){if("image"===i.getSlideType(s)){var t=s.alt,d=t?'alt="'+t+'"':"";if(o.find(".lg-img-wrap").append(C(e,g,d,n,r,s.sources)),n||a){var h=o.find(".lg-object");i.initPictureFill(h)}}("image"===i.getSlideType(s)||"video"===i.getSlideType(s)&&l)&&(i.onLgObjectLoad(o,e,b,L,!0,!1),i.onSlideObjectLoad(o,!(!u||!u.html5||l),(function(){i.loadContentOnFirstSlideLoad(e,o,L)}),(function(){i.loadContentOnFirstSlideLoad(e,o,L)})))}),this.settings.startAnimationDuration+100)),o.addClass("lg-loaded"),this.isFirstSlideWithZoomAnimation()&&("video"!==this.getSlideType(s)||l)||this.onLgObjectLoad(o,e,b,L,v,!(!u||!u.html5||l)),this.zoomFromOrigin&&this.currentImageSize||!o.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){o.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===t&&(o.hasClass("lg-complete_")?this.preload(e):o.find(".lg-object").first().on("load.lg error.lg",(function(){i.preload(e)})))},e.prototype.loadContentOnFirstSlideLoad=function(e,t,i){var s=this;setTimeout((function(){t.find(".lg-dummy-img").remove(),t.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(e)}),i+300)},e.prototype.getItemsToBeInsertedToDom=function(e,t,i){var s=this;void 0===i&&(i=0);var o=[],l=Math.max(i,3);l=Math.min(l,this.galleryItems.length);var n="lg-item-"+this.lgId+"-"+t;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(e,t){o.push("lg-item-"+s.lgId+"-"+t)})),o;if(e<(this.galleryItems.length-1)/2){for(var r=e;r>e-l/2&&r>=0;r--)o.push("lg-item-"+this.lgId+"-"+r);var a=o.length;for(r=0;r<l-a;r++)o.push("lg-item-"+this.lgId+"-"+(e+r+1))}else{for(r=e;r<=this.galleryItems.length-1&&r<e+l/2;r++)o.push("lg-item-"+this.lgId+"-"+r);for(a=o.length,r=0;r<l-a;r++)o.push("lg-item-"+this.lgId+"-"+(e-r-1))}return this.settings.loop&&(e===this.galleryItems.length-1?o.push("lg-item-"+this.lgId+"-0"):0===e&&o.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===o.indexOf(n)&&o.push("lg-item-"+this.lgId+"-"+t),o},e.prototype.organizeSlideItems=function(e,t){var i=this,s=this.getItemsToBeInsertedToDom(e,t,this.settings.numberOfSlideItemsInDom);return s.forEach((function(e){-1===i.currentItemsInDom.indexOf(e)&&i.$inner.append('<div id="'+e+'" class="lg-item"></div>')})),this.currentItemsInDom.forEach((function(e){-1===s.indexOf(e)&&m("#"+e).remove()})),s},e.prototype.getPreviousSlideIndex=function(){var e=0;try{var t=this.outer.find(".lg-current").first().attr("id");e=parseInt(t.split("-")[3])||0}catch(t){e=0}return e},e.prototype.setDownloadValue=function(e){if(this.settings.download){var t=this.galleryItems[e];if(!1===t.downloadUrl||"false"===t.downloadUrl)this.outer.addClass("lg-hide-download");else{var i=this.getElementById("lg-download");this.outer.removeClass("lg-hide-download"),i.attr("href",t.downloadUrl||t.src),t.download&&i.attr("download",t.download)}}},e.prototype.makeSlideAnimation=function(e,t,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout((function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===e?(t.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(t.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout((function(){s.outer.find(".lg-item").removeClass("lg-current"),t.addClass("lg-current"),s.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},e.prototype.slide=function(e,t,i,s){var o=this,l=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(e,l),!this.lGalleryOn||l!==e){var n=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(e);var r=this.getSlideItem(e),a=this.getSlideItem(l),g=this.galleryItems[e],d=g.__slideVideoInfo;if(this.outer.attr("data-lg-slide-type",this.getSlideType(g)),this.setDownloadValue(e),d){var h=this.mediaContainerPosition,c=h.top,u=h.bottom,m=y(this.items[e],this.outer,c+u,d&&this.settings.videoMaxSize);this.resizeVideoSlide(e,m)}if(this.LGel.trigger("lgBeforeSlide",{prevIndex:l,index:e,fromTouch:!!t,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(e),s||(e<l?s="prev":e>l&&(s="next")),t){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var p=void 0,f=void 0;n>2?(p=e-1,f=e+1,(0===e&&l===n-1||e===n-1&&0===l)&&(f=0,p=n-1)):(p=0,f=1),"prev"===s?this.getSlideItem(f).addClass("lg-next-slide"):this.getSlideItem(p).addClass("lg-prev-slide"),r.addClass("lg-current")}else this.makeSlideAnimation(s,r,a);this.lGalleryOn?setTimeout((function(){o.loadContent(e,!0),".lg-item"!==o.settings.appendSubHtmlTo&&o.addHtml(e)}),this.settings.speed+50+(t?0:this.settings.slideDelay)):this.loadContent(e,!0),setTimeout((function(){o.lgBusy=!1,a.removeClass("lg-slide-progress"),o.LGel.trigger("lgAfterSlide",{prevIndex:l,index:e,fromTouch:t,fromThumb:i})}),(this.lGalleryOn?this.settings.speed+100:100)+(t?0:this.settings.slideDelay))}this.index=e}},e.prototype.updateCurrentCounter=function(e){this.getElementById("lg-counter-current").html(e+1+"")},e.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},e.prototype.getSlideType=function(e){return e.__slideVideoInfo?"video":e.iframe?"iframe":"image"},e.prototype.touchMove=function(e,t,i){var s=t.pageX-e.pageX,o=t.pageY-e.pageY,l=!1;if(this.swipeDirection?l=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",l=!0):Math.abs(o)>15&&(this.swipeDirection="vertical",l=!0),l){var n=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){null==i||i.preventDefault(),this.outer.addClass("lg-dragging"),this.setTranslate(n,s,0);var r=n.get().offsetWidth,a=15*r/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-r+s-a,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),r+s+a,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){null==i||i.preventDefault(),this.$container.addClass("lg-dragging-vertical");var g=1-Math.abs(o)/window.innerHeight;this.$backdrop.css("opacity",g);var d=1-Math.abs(o)/(2*window.innerWidth);this.setTranslate(n,0,o,d,d),Math.abs(o)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},e.prototype.touchEnd=function(e,t,i){var s,o=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){o.$container.removeClass("lg-dragging-vertical"),o.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var l=!0;if("horizontal"===o.swipeDirection){s=e.pageX-t.pageX;var n=Math.abs(e.pageX-t.pageX);s<0&&n>o.settings.swipeThreshold?(o.goToNextSlide(!0),l=!1):s>0&&n>o.settings.swipeThreshold&&(o.goToPrevSlide(!0),l=!1)}else if("vertical"===o.swipeDirection){if(s=Math.abs(e.pageY-t.pageY),o.settings.closable&&o.settings.swipeToClose&&s>100)return void o.closeGallery();o.$backdrop.css("opacity",1)}if(o.outer.find(".lg-item").removeAttr("style"),l&&Math.abs(e.pageX-t.pageX)<5){var r=m(i.target);o.isPosterElement(r)&&o.LGel.trigger(g)}o.swipeDirection=void 0})),setTimeout((function(){o.outer.hasClass("lg-dragging")||"lg-slide"===o.settings.mode||o.outer.removeClass("lg-slide")}),this.settings.speed+100)},e.prototype.enableSwipe=function(){var e=this,t={},i={},s=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(i){e.dragOrSwipeEnabled=!0;var s=e.getSlideItem(e.index);!m(i.target).hasClass("lg-item")&&!s.get().contains(i.target)||e.outer.hasClass("lg-zoomed")||e.lgBusy||1!==i.touches.length||(o=!0,e.touchAction="swipe",e.manageSwipeClass(),t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY})})),this.$inner.on("touchmove.lg",(function(l){o&&"swipe"===e.touchAction&&1===l.touches.length&&(i={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e.touchMove(t,i,l),s=!0)})),this.$inner.on("touchend.lg",(function(l){if("swipe"===e.touchAction){if(s)s=!1,e.touchEnd(i,t,l);else if(o){var n=m(l.target);e.isPosterElement(n)&&e.LGel.trigger(g)}e.touchAction=void 0,o=!1}})))},e.prototype.enableDrag=function(){var e=this,t={},i={},s=!1,o=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(i){e.dragOrSwipeEnabled=!0;var o=e.getSlideItem(e.index);(m(i.target).hasClass("lg-item")||o.get().contains(i.target))&&(e.outer.hasClass("lg-zoomed")||e.lgBusy||(i.preventDefault(),e.lgBusy||(e.manageSwipeClass(),t={pageX:i.pageX,pageY:i.pageY},s=!0,e.outer.get().scrollLeft+=1,e.outer.get().scrollLeft-=1,e.outer.removeClass("lg-grab").addClass("lg-grabbing"),e.LGel.trigger("lgDragStart"))))})),m(window).on("mousemove.lg.global"+this.lgId,(function(l){s&&e.lgOpened&&(o=!0,i={pageX:l.pageX,pageY:l.pageY},e.touchMove(t,i),e.LGel.trigger("lgDragMove"))})),m(window).on("mouseup.lg.global"+this.lgId,(function(l){if(e.lgOpened){var n=m(l.target);o?(o=!1,e.touchEnd(i,t,l),e.LGel.trigger("lgDragEnd")):e.isPosterElement(n)&&e.LGel.trigger(g),s&&(s=!1,e.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},e.prototype.triggerPosterClick=function(){var e=this;this.$inner.on("click.lg",(function(t){!e.dragOrSwipeEnabled&&e.isPosterElement(m(t.target))&&e.LGel.trigger(g)}))},e.prototype.manageSwipeClass=function(){var e=this.index+1,t=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?t=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(e=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),t>-1&&this.getSlideItem(t).addClass("lg-prev-slide"),this.getSlideItem(e).addClass("lg-next-slide")},e.prototype.goToNextSlide=function(e){var t=this,i=this.settings.loop;e&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(d,{index:this.index}),this.slide(this.index,!!e,!1,"next")):i?(this.index=0,this.LGel.trigger(d,{index:this.index}),this.slide(this.index,!!e,!1,"next")):this.settings.slideEndAnimation&&!e&&(this.outer.addClass("lg-right-end"),setTimeout((function(){t.outer.removeClass("lg-right-end")}),400)))},e.prototype.goToPrevSlide=function(e){var t=this,i=this.settings.loop;e&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index>0?(this.index--,this.LGel.trigger(h,{index:this.index,fromTouch:e}),this.slide(this.index,!!e,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(h,{index:this.index,fromTouch:e}),this.slide(this.index,!!e,!1,"prev")):this.settings.slideEndAnimation&&!e&&(this.outer.addClass("lg-left-end"),setTimeout((function(){t.outer.removeClass("lg-left-end")}),400)))},e.prototype.keyPress=function(){var e=this;m(window).on("keydown.lg.global"+this.lgId,(function(t){e.lgOpened&&!0===e.settings.escKey&&27===t.keyCode&&(t.preventDefault(),e.settings.allowMediaOverlap&&e.outer.hasClass("lg-can-toggle")&&e.outer.hasClass("lg-components-open")?e.outer.removeClass("lg-components-open"):e.closeGallery()),e.lgOpened&&e.galleryItems.length>1&&(37===t.keyCode&&(t.preventDefault(),e.goToPrevSlide()),39===t.keyCode&&(t.preventDefault(),e.goToNextSlide()))}))},e.prototype.arrow=function(){var e=this;this.getElementById("lg-prev").on("click.lg",(function(){e.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){e.goToNextSlide()}))},e.prototype.arrowDisable=function(e){if(!this.settings.loop&&this.settings.hideControlOnEnd){var t=this.getElementById("lg-prev"),i=this.getElementById("lg-next");e+1===this.galleryItems.length?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled"),0===e?t.attr("disabled","disabled").addClass("disabled"):t.removeAttr("disabled").removeClass("disabled")}},e.prototype.setTranslate=function(e,t,i,s,o){void 0===s&&(s=1),void 0===o&&(o=1),e.css("transform","translate3d("+t+"px, "+i+"px, 0px) scale3d("+s+", "+o+", 1)")},e.prototype.mousewheel=function(){var e=this,t=0;this.outer.on("wheel.lg",(function(i){if(i.deltaY&&!(e.galleryItems.length<2)){i.preventDefault();var s=(new Date).getTime();s-t<1e3||(t=s,i.deltaY>0?e.goToNextSlide():i.deltaY<0&&e.goToPrevSlide())}}))},e.prototype.isSlideElement=function(e){return e.hasClass("lg-outer")||e.hasClass("lg-item")||e.hasClass("lg-img-wrap")||e.hasClass("lg-img-rotate")},e.prototype.isPosterElement=function(e){var t=this.getSlideItem(this.index).find(".lg-video-play-button").get();return e.hasClass("lg-video-poster")||e.hasClass("lg-video-play-button")||t&&t.contains(e.get())},e.prototype.toggleMaximize=function(){var e=this;this.getElementById("lg-maximize").on("click.lg",(function(){e.$container.toggleClass("lg-inline"),e.refreshOnResize()}))},e.prototype.invalidateItems=function(){for(var e=0;e<this.items.length;e++){var t=m(this.items[e]);t.off("click.lgcustom-item-"+t.attr("data-lg-id"))}},e.prototype.trapFocus=function(){var e=this;this.$container.get().focus({preventScroll:!0}),m(window).on("keydown.lg.global"+this.lgId,(function(t){if(e.lgOpened&&("Tab"===t.key||9===t.keyCode)){var i=(l=e.$container.get(),n=l.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),[].filter.call(n,(function(e){var t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility}))),s=i[0],o=i[i.length-1];t.shiftKey?document.activeElement===s&&(o.focus(),t.preventDefault()):document.activeElement===o&&(s.focus(),t.preventDefault())}var l,n}))},e.prototype.manageCloseGallery=function(){var e=this;if(this.settings.closable){var t=!1;this.getElementById("lg-close").on("click.lg",(function(){e.closeGallery()})),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",(function(i){var s=m(i.target);t=!!e.isSlideElement(s)})),this.outer.on("mousemove.lg",(function(){t=!1})),this.outer.on("mouseup.lg",(function(i){var s=m(i.target);e.isSlideElement(s)&&t&&(e.outer.hasClass("lg-dragging")||e.closeGallery())})))}},e.prototype.closeGallery=function(e){var t=this;if(!this.lgOpened||!this.settings.closable&&!e)return 0;this.LGel.trigger("lgBeforeClose"),this.settings.resetScrollPosition&&!this.settings.hideScrollbar&&m(window).scrollTop(this.prevScrollTop);var i,s=this.items[this.index];if(this.zoomFromOrigin&&s){var o=this.mediaContainerPosition,l=o.top,n=o.bottom,r=this.galleryItems[this.index],a=r.__slideVideoInfo,g=r.poster,d=y(s,this.outer,l+n,a&&g&&this.settings.videoMaxSize);i=b(s,this.outer,l,n,d)}this.zoomFromOrigin&&i?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",i)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,m("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var h=this.zoomFromOrigin&&i?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout((function(){t.zoomFromOrigin&&i&&t.outer.removeClass("lg-zoom-from-image"),t.$container.removeClass("lg-show"),t.resetScrollBar(),t.$backdrop.removeAttr("style").css("transition-duration",t.settings.backdropDuration+"ms"),t.outer.removeClass("lg-closing "+t.settings.startClass),t.getSlideItem(t.index).removeClass("lg-start-end-progress"),t.$inner.empty(),t.lgOpened&&t.LGel.trigger("lgAfterClose",{instance:t}),t.$container.get()&&t.$container.get().blur(),t.lgOpened=!1}),h+100),h+100},e.prototype.initModules=function(){this.plugins.forEach((function(e){try{e.init()}catch(e){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}}))},e.prototype.destroyModules=function(e){this.plugins.forEach((function(t){try{e?t.destroy():t.closeGallery&&t.closeGallery()}catch(e){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}}))},e.prototype.refresh=function(e){this.settings.dynamic||this.invalidateItems(),this.galleryItems=e||this.getItems(),this.updateControls(),this.openGalleryOnItemClick(),this.LGel.trigger(a)},e.prototype.updateControls=function(){this.addSlideVideoInfo(this.galleryItems),this.updateCounterTotal(),this.manageSingleSlideClassName()},e.prototype.destroyGallery=function(){this.destroyModules(!0),this.settings.dynamic||this.invalidateItems(),m(window).off(".lg.global"+this.lgId),this.LGel.off(".lg"),this.$container.remove()},e.prototype.destroy=function(){var e=this.closeGallery(!0);return e?setTimeout(this.destroyGallery.bind(this),e):this.destroyGallery(),e},e}();const w=function(e){var t=e.children,i=e.elementClassNames,o=e.onAfterAppendSlide,l=e.onInit,n=e.onHasVideo,r=e.onContainerResize,a=e.onAfterAppendSubHtml,g=e.onBeforeOpen,d=e.onAfterOpen,h=e.onSlideItemLoad,c=e.onBeforeSlide,u=e.onAfterSlide,m=e.onPosterClick,p=e.onDragStart,f=e.onDragMove,v=e.onDragEnd,y=e.onBeforeNextSlide,b=e.onBeforePrevSlide,C=e.onBeforeClose,x=e.onAfterClose,w=e.onRotateLeft,I=e.onRotateRight,_=e.onFlipHorizontal,z=e.onFlipVertical,T=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i}(e,["children","elementClassNames","onAfterAppendSlide","onInit","onHasVideo","onContainerResize","onAfterAppendSubHtml","onBeforeOpen","onAfterOpen","onSlideItemLoad","onBeforeSlide","onAfterSlide","onPosterClick","onDragStart","onDragMove","onDragEnd","onBeforeNextSlide","onBeforePrevSlide","onBeforeClose","onAfterClose","onRotateLeft","onRotateRight","onFlipHorizontal","onFlipVertical"]),L=(0,s.useRef)(null),E=(0,s.useCallback)((function(){o&&L&&L.current&&L.current.addEventListener("lgAfterAppendSlide",(function(e){o(e.detail)})),l&&L&&L.current&&L.current.addEventListener("lgInit",(function(e){l(e.detail)})),n&&L&&L.current&&L.current.addEventListener("lgHasVideo",(function(e){n(e.detail)})),r&&L&&L.current&&L.current.addEventListener("lgContainerResize",(function(e){r(e.detail)})),a&&L&&L.current&&L.current.addEventListener("lgAfterAppendSubHtml",(function(e){a(e.detail)})),g&&L&&L.current&&L.current.addEventListener("lgBeforeOpen",(function(e){g(e.detail)})),d&&L&&L.current&&L.current.addEventListener("lgAfterOpen",(function(e){d(e.detail)})),h&&L&&L.current&&L.current.addEventListener("lgSlideItemLoad",(function(e){h(e.detail)})),c&&L&&L.current&&L.current.addEventListener("lgBeforeSlide",(function(e){c(e.detail)})),u&&L&&L.current&&L.current.addEventListener("lgAfterSlide",(function(e){u(e.detail)})),m&&L&&L.current&&L.current.addEventListener("lgPosterClick",(function(e){m(e.detail)})),p&&L&&L.current&&L.current.addEventListener("lgDragStart",(function(e){p(e.detail)})),f&&L&&L.current&&L.current.addEventListener("lgDragMove",(function(e){f(e.detail)})),v&&L&&L.current&&L.current.addEventListener("lgDragEnd",(function(e){v(e.detail)})),y&&L&&L.current&&L.current.addEventListener("lgBeforeNextSlide",(function(e){y(e.detail)})),b&&L&&L.current&&L.current.addEventListener("lgBeforePrevSlide",(function(e){b(e.detail)})),C&&L&&L.current&&L.current.addEventListener("lgBeforeClose",(function(e){C(e.detail)})),x&&L&&L.current&&L.current.addEventListener("lgAfterClose",(function(e){x(e.detail)})),w&&L&&L.current&&L.current.addEventListener("lgRotateLeft",(function(e){w(e.detail)})),I&&L&&L.current&&L.current.addEventListener("lgRotateRight",(function(e){I(e.detail)})),_&&L&&L.current&&L.current.addEventListener("lgFlipHorizontal",(function(e){_(e.detail)})),z&&L&&L.current&&L.current.addEventListener("lgFlipVertical",(function(e){z(e.detail)}))}),[o,a,x,w,I,_,z,d,u,C,y,g,b,c,r,v,f,p,n,l,m,h]);return(0,s.useEffect)((function(){E();var e,t=(e=L.current,new S(e,T));return function(){t.destroy()}}),[E,T]),(0,s.createElement)("div",{className:"lg-react-element "+(i||""),ref:L},t)};var I=function(){return I=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},I.apply(this,arguments)},_={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},z=function(){function e(e,t){return this.core=e,this.$LG=t,this.settings=I(I({},_),this.core.settings),this}return e.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},e.prototype.enableZoom=function(e){var t=this,i=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?i=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout((function(){t.isImageSlide(t.core.index)&&(t.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===t.core.index&&t.setZoomEssentials())}),i+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on("lgSlideItemLoad.zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},e.prototype.getSwipeCords=function(e){return{x:e.touches[0].pageX,y:e.touches[0].pageY}},e.prototype.getDragAllowedAxises=function(e,t){if(!this.containerRect)return{allowX:!1,allowY:!1};var i=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,l=i.getBoundingClientRect();e?(s=i.offsetHeight*e,o=i.offsetWidth*e):t?(s=l.height+t*l.height,o=l.width+t*l.width):(s=l.height,o=l.width);var n=s>this.containerRect.height;return{allowX:o>this.containerRect.width,allowY:n}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(e,t,i,s){if(!(Math.abs(t)<=0)){var o,l,n=this.containerRect.width/2+this.containerRect.left,r=this.containerRect.height/2+this.containerRect.top+this.scrollTop;1===e&&(this.positionChanged=!1);var a=this.getDragAllowedAxises(0,t),g=a.allowY,d=a.allowX;this.positionChanged&&(o=this.left/(this.scale-t),l=this.top/(this.scale-t),this.pageX=n-o,this.pageY=r-l,this.positionChanged=!1);var h,c,u=this.getPossibleSwipeDragCords(t),_x=n-this.pageX,m=r-this.pageY;if(e-t>1){var p=(e-t)/Math.abs(t);h=(_x=(t<0?-_x:_x)+this.left*(p+(t<0?-1:1)))/p,c=(m=(t<0?-m:m)+this.top*(p+(t<0?-1:1)))/p}else h=_x*(p=(e-t)*t),c=m*p;i&&(d?this.isBeyondPossibleLeft(h,u.minX)?h=u.minX:this.isBeyondPossibleRight(h,u.maxX)&&(h=u.maxX):e>1&&(h<u.minX?h=u.minX:h>u.maxX&&(h=u.maxX)),g?this.isBeyondPossibleTop(c,u.minY)?c=u.minY:this.isBeyondPossibleBottom(c,u.maxY)&&(c=u.maxY):e>1&&(c<u.minY?c=u.minY:c>u.maxY&&(c=u.maxY))),this.setZoomStyles({x:h,y:c,scale:e}),this.left=h,this.top=c,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var t=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,t.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),t.css("width","auto").css("height","auto"),setTimeout((function(){t.removeClass("no-transition")}),10)}},e.prototype.setZoomImageSize=function(){var e=this,t=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout((function(){var i=e.getCurrentImageActualSizeScale();e.scale>=i&&(t.addClass("no-transition"),e.imageReset=!0)}),500),setTimeout((function(){var i=e.getCurrentImageActualSizeScale();if(e.scale>=i){var s=e.getDragAllowedAxises(e.scale);t.css("width",t.get().naturalWidth+"px").css("height",t.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?t.addClass("reset-transition"):s.allowX&&!s.allowY?t.addClass("reset-transition-x"):!s.allowX&&s.allowY&&t.addClass("reset-transition-y")}}),550)},e.prototype.setZoomStyles=function(e){var t=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),i=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,i.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";t.css("transform",o)},e.prototype.setActualSize=function(e,t){var i=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout((function(){if(s.src&&!i.core.outer.hasClass("lg-first-slide-loading")){var e=i.getCurrentImageActualSizeScale(),o=i.scale;i.core.outer.hasClass("lg-zoomed")?i.scale=1:i.scale=i.getScale(e),i.setPageCords(t),i.beginZoom(i.scale),i.zoomImage(i.scale,i.scale-o,!0,!0)}}),50),setTimeout((function(){i.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}),60),setTimeout((function(){i.zoomInProgress=!1}),610)}},e.prototype.getNaturalWidth=function(e){var t=this.core.getSlideItem(e).find(".lg-image").first(),i=this.core.galleryItems[e].width;return i?parseFloat(i):t.get().naturalWidth},e.prototype.getActualSizeScale=function(e,t){return e>=t?e/t||2:1},e.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first().get().offsetWidth,t=this.getNaturalWidth(this.core.index)||e;return this.getActualSizeScale(t,e)},e.prototype.getPageCords=function(e){var t={};if(e)t.x=e.pageX||e.touches[0].pageX,t.y=e.pageY||e.touches[0].pageY;else{var i=this.core.$content.get().getBoundingClientRect();t.x=i.width/2+i.left,t.y=i.height/2+this.scrollTop+i.top}return t},e.prototype.setPageCords=function(e){var t=this.getPageCords(e);this.pageX=t.x,this.pageY=t.y},e.prototype.manageActualPixelClassNames=function(){this.core.getElementById("lg-actual-size").removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},e.prototype.getScale=function(e){var t=this.getCurrentImageActualSizeScale();return e<1?e=1:e>t&&(e=t),e},e.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var t=null;this.core.outer.on("dblclick.lg",(function(t){e.$LG(t.target).hasClass("lg-image")&&e.setActualSize(e.core.index,t)})),this.core.outer.on("touchstart.lg",(function(i){var s=e.$LG(i.target);1===i.touches.length&&s.hasClass("lg-image")&&(t?(clearTimeout(t),t=null,i.preventDefault(),e.setActualSize(e.core.index,i)):t=setTimeout((function(){t=null}),300))})),this.core.LGel.on("lgContainerResize.zoom lgRotateRight.zoom lgRotateLeft.zoom lgFlipHorizontal.zoom lgFlipVertical.zoom",(function(){if(e.core.lgOpened&&e.isImageSlide(e.core.index)&&!e.core.touchAction){var t=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(t,{x:0,y:0}),e.positionChanged=!0}})),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,(function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())})),this.core.getElementById("lg-zoom-out").on("click.lg",(function(){if(e.isImageSlide(e.core.index)){var t=0;e.imageReset&&(e.resetImageTranslate(e.core.index),t=50),setTimeout((function(){var t=e.scale-e.settings.scale;t<1&&(t=1),e.beginZoom(t),e.zoomImage(t,-e.settings.scale,!0,!e.settings.infiniteZoom)}),t)}})),this.core.getElementById("lg-zoom-in").on("click.lg",(function(){e.zoomIn()})),this.core.getElementById("lg-actual-size").on("click.lg",(function(){e.setActualSize(e.core.index)})),this.core.LGel.on("lgBeforeOpen.zoom",(function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")})),this.core.LGel.on("lgAfterOpen.zoom",(function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1})),this.core.LGel.on("lgAfterSlide.zoom",(function(t){var i=t.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(i),e.resetImageTranslate(i),e.isImageSlide(e.core.index)&&e.setZoomEssentials()})),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var t=this.core.getElementById("lg-actual-size"),i=this.core.getSlideItem(void 0!==e?e:this.core.index);t.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),i.find(".lg-img-wrap").first().removeAttr("style"),i.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},e.prototype.pinchZoom=function(){var e=this,t=0,i=!1,s=1,o=0,l=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",(function(i){if(l=e.core.getSlideItem(e.core.index),e.isImageSlide(e.core.index)&&2===i.touches.length){if(i.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(i),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",t=e.getTouchDistance(i)}})),this.core.$inner.on("touchmove.lg",(function(n){if(2===n.touches.length&&"pinch"===e.core.touchAction&&(e.$LG(n.target).hasClass("lg-item")||l.get().contains(n.target))){n.preventDefault();var r=e.getTouchDistance(n),a=t-r;if(!i&&Math.abs(a)>5&&(i=!0),i){o=e.scale;var g=Math.max(1,s+.02*-a);e.scale=Math.round(100*(g+Number.EPSILON))/100;var d=e.scale-o;e.zoomImage(e.scale,Math.round(100*(d+Number.EPSILON))/100,!1,!1)}}})),this.core.$inner.on("touchend.lg",(function(s){if("pinch"===e.core.touchAction&&(e.$LG(s.target).hasClass("lg-item")||l.get().contains(s.target))){if(i=!1,t=0,e.scale<=1)e.resetZoom();else{var o=e.getCurrentImageActualSizeScale();if(e.scale>=o){var n=o-e.scale;0===n&&(n=.01),e.zoomImage(o,n,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}}))},e.prototype.touchendZoom=function(e,t,i,s,o){var l=t.x-e.x,n=t.y-e.y,r=Math.abs(l)/o+1,a=Math.abs(n)/o+1;r>2&&(r+=1),a>2&&(a+=1),l*=r,n*=a;var g=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),d={};d.x=this.left+l,d.y=this.top+n;var h=this.getPossibleSwipeDragCords();(Math.abs(l)>15||Math.abs(n)>15)&&(s&&(this.isBeyondPossibleTop(d.y,h.minY)?d.y=h.minY:this.isBeyondPossibleBottom(d.y,h.maxY)&&(d.y=h.maxY)),i&&(this.isBeyondPossibleLeft(d.x,h.minX)?d.x=h.minX:this.isBeyondPossibleRight(d.x,h.maxX)&&(d.x=h.maxX)),s?this.top=d.y:d.y=this.top,i?this.left=d.x:d.x=this.left,this.setZoomSwipeStyles(g,d),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(e,t,i,s,o){var l={};if(s){if(l.y=this.top+(t.y-e.y),this.isBeyondPossibleTop(l.y,o.minY)){var n=o.minY-l.y;l.y=o.minY-n/6}else if(this.isBeyondPossibleBottom(l.y,o.maxY)){var r=l.y-o.maxY;l.y=o.maxY+r/6}}else l.y=this.top;if(i){if(l.x=this.left+(t.x-e.x),this.isBeyondPossibleLeft(l.x,o.minX)){var a=o.minX-l.x;l.x=o.minX-a/6}else if(this.isBeyondPossibleRight(l.x,o.maxX)){var g=l.x-o.maxX;l.x=o.maxX+g/6}}else l.x=this.left;return l},e.prototype.isBeyondPossibleLeft=function(e,t){return e>=t},e.prototype.isBeyondPossibleRight=function(e,t){return e<=t},e.prototype.isBeyondPossibleTop=function(e,t){return e>=t},e.prototype.isBeyondPossibleBottom=function(e,t){return e<=t},e.prototype.isImageSlide=function(e){var t=this.core.galleryItems[e];return"image"===this.core.getSlideType(t)},e.prototype.getPossibleSwipeDragCords=function(e){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),i=this.core.mediaContainerPosition.bottom,s=t.get().getBoundingClientRect(),o=s.height,l=s.width;return e&&(o+=e*o,l+=e*l),{minY:(o-this.containerRect.height)/2,maxY:(this.containerRect.height-o)/2+i,minX:(l-this.containerRect.width)/2,maxX:(this.containerRect.width-l)/2}},e.prototype.setZoomSwipeStyles=function(e,t){e.css("transform","translate3d("+t.x+"px, "+t.y+"px, 0)")},e.prototype.zoomSwipe=function(){var e,t,i=this,s={},o={},l=!1,n=!1,r=!1,a=new Date,g=(new Date,this.core.getSlideItem(this.core.index));this.core.$inner.on("touchstart.lg",(function(o){if(i.isImageSlide(i.core.index)&&(g=i.core.getSlideItem(i.core.index),(i.$LG(o.target).hasClass("lg-item")||g.get().contains(o.target))&&1===o.touches.length&&i.core.outer.hasClass("lg-zoomed"))){o.preventDefault(),a=new Date,i.core.touchAction="zoomSwipe",t=i.core.getSlideItem(i.core.index).find(".lg-img-wrap").first();var l=i.getDragAllowedAxises(0);r=l.allowY,((n=l.allowX)||r)&&(s=i.getSwipeCords(o)),e=i.getPossibleSwipeDragCords(),i.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}})),this.core.$inner.on("touchmove.lg",(function(a){if(1===a.touches.length&&"zoomSwipe"===i.core.touchAction&&(i.$LG(a.target).hasClass("lg-item")||g.get().contains(a.target))){a.preventDefault(),i.core.touchAction="zoomSwipe",o=i.getSwipeCords(a);var d=i.getZoomSwipeCords(s,o,n,r,e);(Math.abs(o.x-s.x)>15||Math.abs(o.y-s.y)>15)&&(l=!0,i.setZoomSwipeStyles(t,d))}})),this.core.$inner.on("touchend.lg",(function(e){if("zoomSwipe"===i.core.touchAction&&(i.$LG(e.target).hasClass("lg-item")||g.get().contains(e.target))){if(e.preventDefault(),i.core.touchAction=void 0,i.core.outer.removeClass("lg-zoom-dragging"),!l)return;l=!1;var t=(new Date).valueOf()-a.valueOf();i.touchendZoom(s,o,n,r,t)}}))},e.prototype.zoomDrag=function(){var e,t,i,s,o=this,l={},n={},r=!1,a=!1,g=!1,d=!1;this.core.outer.on("mousedown.lg.zoom",(function(t){if(o.isImageSlide(o.core.index)){var n=o.core.getSlideItem(o.core.index);if(o.$LG(t.target).hasClass("lg-item")||n.get().contains(t.target)){e=new Date,s=o.core.getSlideItem(o.core.index).find(".lg-img-wrap").first();var a=o.getDragAllowedAxises(0);d=a.allowY,g=a.allowX,o.core.outer.hasClass("lg-zoomed")&&o.$LG(t.target).hasClass("lg-object")&&(g||d)&&(t.preventDefault(),l=o.getDragCords(t),i=o.getPossibleSwipeDragCords(),r=!0,o.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}})),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,(function(e){if(r){a=!0,n=o.getDragCords(e);var t=o.getZoomSwipeCords(l,n,g,d,i);o.setZoomSwipeStyles(s,t)}})),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,(function(i){if(r){if(t=new Date,r=!1,o.core.outer.removeClass("lg-zoom-dragging"),a&&(l.x!==n.x||l.y!==n.y)){n=o.getDragCords(i);var s=t.valueOf()-e.valueOf();o.touchendZoom(l,n,g,d,s)}a=!1}o.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}))},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}();const T=z;var L=function(){return L=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},L.apply(this,arguments)},E={hash:!0,galleryId:"1",customSlideName:!1},O=function(){function e(e,t){return this.core=e,this.$LG=t,this.settings=L(L({},E),this.core.settings),this}return e.prototype.init=function(){var e=this;this.settings.hash&&(this.oldHash=window.location.hash,setTimeout((function(){e.buildFromHash()}),100),this.core.LGel.on("lgAfterSlide.hash",this.onAfterSlide.bind(this)),this.core.LGel.on("lgAfterClose.hash",this.onCloseAfter.bind(this)),this.$LG(window).on("hashchange.lg.hash.global"+this.core.lgId,this.onHashchange.bind(this)))},e.prototype.onAfterSlide=function(e){var t=this.core.galleryItems[e.detail.index].slideName;t=this.settings.customSlideName&&t||e.detail.index,history.replaceState?history.replaceState(null,"",window.location.pathname+window.location.search+"#lg="+this.settings.galleryId+"&slide="+t):window.location.hash="lg="+this.settings.galleryId+"&slide="+t},e.prototype.getIndexFromUrl=function(e){void 0===e&&(e=window.location.hash);var t=e.split("&slide=")[1],i=0;if(this.settings.customSlideName){for(var s=0;s<this.core.galleryItems.length;s++)if(this.core.galleryItems[s].slideName===t){i=s;break}}else i=parseInt(t,10);return isNaN(i)?0:i},e.prototype.buildFromHash=function(){var e=window.location.hash;if(e.indexOf("lg="+this.settings.galleryId)>0){this.$LG(document.body).addClass("lg-from-hash");var t=this.getIndexFromUrl(e);return this.core.openGallery(t),!0}},e.prototype.onCloseAfter=function(){this.oldHash&&this.oldHash.indexOf("lg="+this.settings.galleryId)<0?history.replaceState?history.replaceState(null,"",this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash=""},e.prototype.onHashchange=function(){if(this.core.lgOpened){var e=window.location.hash,t=this.getIndexFromUrl(e);e.indexOf("lg="+this.settings.galleryId)>-1?this.core.slide(t,!1,!1):this.core.lGalleryOn&&this.core.closeGallery()}},e.prototype.closeGallery=function(){this.settings.hash&&this.$LG(document.body).removeClass("lg-from-hash")},e.prototype.destroy=function(){this.core.LGel.off(".lg.hash"),this.core.LGel.off(".hash"),this.$LG(window).off("hashchange.lg.hash.global"+this.core.lgId)},e}();const A=O,R=window.ReactJSXRuntime,D=e=>{const[t,i]=(0,s.useState)({elementClassNames:"lcp-gallery grid",plugins:[],zoom:!1,hash:!1,download:!1}),o=(0,s.useRef)(null),l=(0,s.useCallback)((e=>{e&&(o.current=e.instance)}),[]);return(0,s.useEffect)((()=>{console.log("Props received:",e);const t=[];e.plugins&&e.plugins.forEach((e=>{console.log(`Adding plugin: ${e}`),"lgZoom"===e?t.push(T):"lgHash"===e&&t.push(A)})),i((i=>({...i,plugins:t,zoom:e.zoom||!1,hash:e.hash||!1,download:e.download||!1})))}),[e]),(0,s.useEffect)((()=>{console.log("Settings changed:",t),o.current&&(console.log("Refreshing gallery..."),o.current.refresh())}),[t]),(0,R.jsxs)(w,{ref:o,plugins:t.plugins,elementClassNames:t.elementClassNames,zoom:t.zoom,hash:t.hash,download:t.download,onInit:l,children:[(0,R.jsx)("a",{"data-lg-size":"1600-1067",className:"gallery-item","data-src":"https://images.unsplash.com/photo-1609342122563-a43ac8917a3a?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1600&q=80","data-sub-html":"<h4>Photo by - <a href='https://unsplash.com/@tobbes_rd' >Tobias Rademacher </a></h4><p> Location - <a href='https://unsplash.com/s/photos/puezgruppe%2C-wolkenstein-in-gr%C3%B6den%2C-s%C3%BCdtirol%2C-italien'>Puezgruppe, Wolkenstein in Gröden, Südtirol, Italien</a>layers of blue.</p>",children:(0,R.jsx)("img",{alt:"layers of blue.",className:"img-responsive",src:"https://images.unsplash.com/photo-1609342122563-a43ac8917a3a?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=240&q=80"})}),(0,R.jsx)("a",{"data-lg-size":"1600-2400",className:"gallery-item","data-src":"https://images.unsplash.com/photo-1608481337062-4093bf3ed404?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1600&q=80","data-sub-html":"<h4>Photo by - <a href='https://unsplash.com/@therawhunter' >Massimiliano Morosinotto </a></h4><p> Location - <a href='https://unsplash.com/s/photos/tre-cime-di-lavaredo%2C-italia'>Tre Cime di Lavaredo, Italia</a>This is the Way</p>",children:(0,R.jsx)("img",{className:"img-responsive",src:"https://images.unsplash.com/photo-1608481337062-4093bf3ed404?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=240&q=80"})})]})},P=[{value:"1-1",label:(0,t.__)("1:1",n.KR)},{value:"16-9",label:(0,t.__)("16:9",n.KR)},{value:"3-2",label:(0,t.__)("3:2",n.KR)},{value:"5-7",label:(0,t.__)("5:7",n.KR)},{value:"3-4",label:(0,t.__)("3:4",n.KR)},{value:"4-5",label:(0,t.__)("4:5",n.KR)},{value:"2-3",label:(0,t.__)("2:3",n.KR)}],{apiFetch:B}=wp;B({path:"/custom/v1/get-gallery-supported-plugins-data"}).then((e=>{console.log(e),e.jetengine_active&&console.log("Jet Engine is activated")})).catch((e=>{console.error("Error fetching Jet Engine status:",e)}));const G=({onSelect:e})=>{const[o,n]=(0,s.useState)([]);return(0,R.jsx)(i.MediaUploadCheck,{children:(0,R.jsx)(i.MediaUpload,{onSelect:t=>{const i=t.map((e=>({id:e.id,url:e.url,alt:e.alt||""})));n(i),e(i)},allowedTypes:["image","video"],multiple:!0,gallery:!0,render:({open:e})=>(0,R.jsx)(l.Button,{onClick:e,isPrimary:!0,children:(0,t.__)("Open Media Library")})})})};(0,e.registerBlockType)(n.UU,{edit:function(e){const{attributes:r,setAttributes:a}=e,{galleryItems:g=[],source:d,sourceMetaField:h,sourceTable:c,sourceColumn:u,includePostThumbnail:m,initialLayout:p,itemsAspectRatio:f,gridColumnsLarge:v,gridColumnsMedium:y,gridColumnsSmall:b,gridGapLarge:C,gridGapMedium:x,gridGapSmall:S,download:w,downloadSize:I,maxInitialItems:_,thumbnail:z,inlineHeightLarge:T,inlineHeightMedium:L,inlineHeightSmall:E,justifiedRowHeightSmall:O,justifiedRowHeightMedium:A,justifiedRowHeightLarge:B,justifiedLastRow:M,thumbnailsBorders:k,thumbnailsBordersSelected:j,thumbnailsStyle:H,thumbnailActiveStyle:F,showCaptions:N,zoomFromOrigin:$,galleryCustomStyles:K,lgSettings:Y}=r,[X,Z]=(0,s.useState)(Y),[V,U]=(0,s.useState)(k||{top:{color:"#000000",style:"solid",width:"1px"},right:{color:"#000000",style:"solid",width:"1px"},bottom:{color:"#000000",style:"solid",width:"1px"},left:{color:"#000000",style:"solid",width:"1px"}}),[W,q]=(0,s.useState)(j||{top:{color:"#000000",style:"solid",width:"1px"},right:{color:"#000000",style:"solid",width:"1px"},bottom:{color:"#000000",style:"solid",width:"1px"},left:{color:"#000000",style:"solid",width:"1px"}}),J=e=>{a({galleryItems:e})},Q=e=>{U(e),a({thumbnailsBorders:e})},ee=e=>{q(e),a({thumbnailsBordersSelected:e})},te=[{label:"lg-slide",value:"lg-slide"},{label:"lg-fade",value:"lg-fade"},{label:"lg-zoom-in",value:"lg-zoom-in"},{label:"lg-zoom-in-big",value:"lg-zoom-in-big"},{label:"lg-zoom-out",value:"lg-zoom-out"},{label:"lg-zoom-out-big",value:"lg-zoom-out-big"},{label:"lg-zoom-out-in",value:"lg-zoom-out-in"},{label:"lg-zoom-in-out",value:"lg-zoom-in-out"},{label:"lg-soft-zoom",value:"lg-soft-zoom"},{label:"lg-scale-up",value:"lg-scale-up"},{label:"lg-slide-circular",value:"lg-slide-circular"},{label:"lg-slide-circular-vertical",value:"lg-slide-circular-vertical"},{label:"lg-slide-vertical",value:"lg-slide-vertical"},{label:"lg-slide-vertical-growth",value:"lg-slide-vertical-growth"},{label:"lg-slide-skew-only",value:"lg-slide-skew-only"},{label:"lg-slide-skew-only-rev",value:"lg-slide-skew-only-rev"},{label:"lg-slide-skew-only-y",value:"lg-slide-skew-only-y"},{label:"lg-slide-skew-only-y-rev",value:"lg-slide-skew-only-y-rev"},{label:"lg-slide-skew",value:"lg-slide-skew"},{label:"lg-slide-skew-rev",value:"lg-slide-skew-rev"},{label:"lg-slide-skew-cross",value:"lg-slide-skew-cross"},{label:"lg-slide-skew-cross-rev",value:"lg-slide-skew-cross-rev"},{label:"lg-slide-skew-ver",value:"lg-slide-skew-ver"},{label:"lg-slide-skew-ver-rev",value:"lg-slide-skew-ver-rev"},{label:"lg-slide-skew-ver-cross",value:"lg-slide-skew-ver-cross"},{label:"lg-slide-skew-ver-cross-rev",value:"lg-slide-skew-ver-cross-rev"},{label:"lg-lollipop",value:"lg-lollipop"},{label:"lg-lollipop-rev",value:"lg-lollipop-rev"},{label:"lg-rotate",value:"lg-rotate"},{label:"lg-rotate-rev",value:"lg-rotate-rev"},{label:"lg-tube",value:"lg-tube"}],{isTemplate:ie,postType:se,postId:oe}=(0,o.useSelect)((e=>{const t=e("core/editor"),i=t.getCurrentPostType();return{isTemplate:"wp_template"===i,postType:i,postId:t.getCurrentPostId()}}),[]);let le=[];return le=ie?[{value:"manual",label:(0,t.__)("Manually Select",n.KR)},{value:"lcpPostGallery",label:(0,t.__)("Post Gallery",n.KR)},{value:"metaField",label:(0,t.__)("Meta field of current post",n.KR)},{value:"linkedTable",label:(0,t.__)("Linked Table",n.KR)}]:[{value:"manual",label:(0,t.__)("Manually Select",n.KR)},{value:"lcpPostGallery",label:(0,t.__)("Post Gallery",n.KR)}],(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D,{...r.lgSettings}),(0,R.jsx)(i.InspectorControls,{children:(0,R.jsx)(l.TabPanel,{className:"my-tab-panel",activeClass:"active-tab",tabs:[{name:"settings",title:(0,t.__)("Settings"),className:"settings-tab"},{name:"style",title:(0,t.__)("Style Settings"),className:"style-tab"}],children:({name:e})=>"settings"===e?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(l.PanelBody,{title:(0,t.__)("Source Settings"),children:[(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Gallery Items Source",n.KR),value:d,onChange:e=>a({source:e}),options:le}),"manual"===d&&(0,R.jsx)(G,{onSelect:J}),"metaField"===d&&(0,R.jsx)(l.TextControl,{label:(0,t.__)("Meta Field Name"),value:h,onChange:e=>a({sourceMetaField:e})}),"linkedTable"===d&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l.TextControl,{label:(0,t.__)("Table Name"),value:c,onChange:e=>a({sourceTable:e})}),(0,R.jsx)(l.TextControl,{label:(0,t.__)("Column Name"),value:u,onChange:e=>a({sourceColumn:e})})]}),(0,R.jsx)(l.ToggleControl,{checked:r.parseElementForItems,label:(0,t.__)("Parse element for gallery items",n.KR),onChange:e=>{a({parseElementForItems:e})}}),r.parseElementForItems&&(0,R.jsx)(l.TextControl,{label:(0,t.__)("Elements to parse"),value:r.parsedTargetElement,onChange:e=>a({parsedTargetElement:e})}),(0,R.jsx)(l.ToggleControl,{onChange:e=>a({includePostThumbnail:e}),checked:m,label:(0,t.__)("Include Post Thumbnail (Featured Image)",n.KR)})]}),(0,R.jsxs)(l.PanelBody,{title:(0,t.__)("Display Settings"),children:[(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Initial Layout",n.KR),value:p,onChange:e=>{a({initialLayout:e,lgSettings:{...r.lgSettings,closable:"inline"!==e,showMaximizeIcon:"inline"===e}})},options:[{value:"inline",label:(0,t.__)("Inline",n.KR)},{value:"grid",label:(0,t.__)("Grid",n.KR)},{value:"button",label:(0,t.__)("Button",n.KR)}]}),(0,R.jsx)(l.ToggleControl,{onChange:e=>a({includePostThumbnail:e}),checked:m,label:(0,t.__)("Include Post Thumbnail (Featured Image)",n.KR)}),"button"===p&&(0,R.jsx)(l.TextControl,{label:(0,t.__)("Button Text"),value:u,onChange:e=>a({sourceColumn:e})}),(0,R.jsx)(l.ToggleControl,{onChange:e=>{a({lgSettings:{...r.lgSettings,thumbnail:e}})},checked:r.lgSettings?.thumbnail,label:(0,t.__)("Show Thumbnails",n.KR)}),z&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Thumbnails Position - Desktop",n.KR),value:f,onChange:e=>a({itemsAspectRatio:e}),options:[{value:"bottom",label:(0,t.__)("Bottom",n.KR)},{value:"right",label:(0,t.__)("Right",n.KR)},{value:"left",label:(0,t.__)("Left",n.KR)},{value:"hidden",label:(0,t.__)("Hidden",n.KR)}]}),(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Thumbnails Position - Tablet",n.KR),value:f,onChange:e=>a({itemsAspectRatio:e}),options:[{value:"bottom",label:(0,t.__)("Bottom",n.KR)},{value:"right",label:(0,t.__)("Right",n.KR)},{value:"left",label:(0,t.__)("Left",n.KR)},{value:"hidden",label:(0,t.__)("Hidden",n.KR)}]}),(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Thumbnails Position - Mobile",n.KR),value:f,onChange:e=>a({itemsAspectRatio:e}),options:[{value:"bottom",label:(0,t.__)("Bottom",n.KR)},{value:"right",label:(0,t.__)("Right",n.KR)},{value:"left",label:(0,t.__)("Left",n.KR)},{value:"hidden",label:(0,t.__)("Hidden",n.KR)}]})]}),"inline"!==p&&"justified"!==p&&(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Items Aspect Ratio",n.KR),value:f,onChange:e=>a({itemsAspectRatio:e}),options:P}),"inline"!==p&&(0,R.jsx)(l.__experimentalNumberControl,{label:(0,t.__)("Max Initial Images"),onChange:e=>a({maxInitialItems:1}),value:_,isShiftStepEnabled:!0,shiftStep:1,min:0})]}),(0,R.jsxs)(l.PanelBody,{title:(0,t.__)("Gallery Settings"),children:["inline"===r.initialLayout&&(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Show maximize icon",n.KR),checked:r.lgSettings.showMaximizeIcon,onChange:e=>a({lgSettings:{...r.lgSettings,showMaximizeIcon:!0}})}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Dynamic Load","lcp"),checked:Y.dynamic,onChange:e=>{a({lgSettings:{...Y,dynamic:e}})}}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Zoom","lcp"),checked:Y.zoom,onChange:e=>{a({lgSettings:{...Y,zoom:e,plugins:e?[...Y.plugins,"lgZoom"]:Y.plugins.filter((e=>"lgZoom"!==e))}})}}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Fullscreen","lcp"),checked:Y.fullScreen,onChange:e=>{a({lgSettings:{...Y,fullScreen:e,plugins:e?[...Y.plugins,"lgFullScreen"]:Y.plugins.filter((e=>"lgFullScreen"!==e))}})}}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Sharing","lcp"),checked:Y.share,onChange:e=>{a({lgSettings:{...Y,share:e,plugins:e?[...Y.plugins,"lgShare"]:Y.plugins.filter((e=>"lgShare"!==e))}})}}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Autoplay","lcp"),checked:Y.autoplay,onChange:e=>{a({lgSettings:{...Y,autoplay:e,plugins:e?[...Y.plugins,"lgAutoplay"]:Y.plugins.filter((e=>"lgAutoplay"!==e))}})}}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Enable Hash","lcp"),checked:Y.hash,onChange:e=>{a({lgSettings:{...Y,hash:e,plugins:e?[...Y.plugins,"lgHash"]:Y.plugins.filter((e=>"lgHash"!==e))}})}}),Y.hash&&(0,R.jsx)(l.TextControl,{label:(0,t.__)("Hash","lcp"),value:Y.hashGalleryId,onChange:e=>{a({lgSettings:{...Y,galleryId:e}})}}),(0,R.jsx)(l.ToggleControl,{label:(0,t.__)("Zoom From Origin","lcp"),checked:Y.zoomFromOrigin,onChange:e=>{a({lgSettings:{...Y,zoomFromOrigin:e}})}}),(0,R.jsx)(l.ToggleControl,{onChange:e=>a({showCaptions:e}),checked:N,label:(0,t.__)("Show Captions",n.KR)}),(0,R.jsx)(l.ToggleControl,{checked:Y.download,label:(0,t.__)("Allow Download",n.KR),onChange:e=>{a({lgSettings:{...Y,download:e}})}}),w&&(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Download Size",n.KR),value:I,onChange:e=>a({downloadSize:e}),options:[{value:"full",label:(0,t.__)("Full",n.KR)},{value:"medium",label:(0,t.__)("Medium",n.KR)},{value:"large",label:(0,t.__)("Large",n.KR)}]}),(0,R.jsx)(l.SelectControl,{label:"Transition Style",value:Y.mode||"lg-slide",options:te,onChange:e=>{a({lgSettings:{...Y,mode:e}})}}),"inline"!=p,(0,R.jsx)(l.TextControl,{label:(0,t.__)("Open gallery in container"),value:Y.container,onChange:e=>a({lgSettings:{...Y,container:e}})})]})]}):"style"===e?(0,R.jsxs)(l.PanelBody,{title:(0,t.__)("Style Settings"),children:["inline"===p&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Inline Height - Desktop"),onChange:e=>a({inlineHeightLarge:e}),value:T}),(0,R.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Inline Height - Tablet"),onChange:e=>a({inlineHeightMedium:e}),value:L}),(0,R.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Inline Height - Mobile"),onChange:e=>a({inlineHeightSmall:e}),value:E})]}),"justified"===p&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Last Row",n.KR),value:M,onChange:e=>a({justifiedLastRow:e}),options:[{value:"justify",label:(0,t.__)("Justify",n.KR)},{value:"nojustify",label:(0,t.__)("Unjustified",n.KR)},{value:"left",label:(0,t.__)("Align Left",n.KR)},{value:"center",label:(0,t.__)("Align Center",n.KR)},{value:"right",label:(0,t.__)("Align Right",n.KR)},{value:"hide",label:(0,t.__)("Hide",n.KR)}]}),(0,R.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Row Height - Desktop"),onChange:e=>a({justifiedRowHeightLarge:e}),value:B}),(0,R.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Row Height - Tablet"),onChange:e=>a({justifiedRowHeightMedium:e}),value:A}),(0,R.jsx)(l.__experimentalUnitControl,{label:(0,t.__)("Row Height - Mobile"),onChange:e=>a({justifiedRowHeightSmall:e}),value:O})]}),"grid"===p&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l.__experimentalNumberControl,{label:(0,t.__)("Grid Columns - Desktop"),onChange:e=>a({gridColumnsLarge:e}),value:v,isShiftStepEnabled:!0,shiftStep:1,min:1,max:9}),(0,R.jsx)(l.__experimentalNumberControl,{label:(0,t.__)("Grid Columns - Tablet"),onChange:e=>a({gridColumnsMedium:e}),value:y,isShiftStepEnabled:!0,shiftStep:1,min:1,max:9}),(0,R.jsx)(l.__experimentalNumberControl,{label:(0,t.__)("Grid Columns - Mobile"),onChange:e=>a({gridColumnsSmall:e}),value:b,isShiftStepEnabled:!0,shiftStep:1,min:1,max:9}),(0,R.jsx)(l.__experimentalNumberControl,{label:(0,t.__)("Grid Gap"),onChange:e=>a({gridGapLarge:e}),value:C,isShiftStepEnabled:!0,shiftStep:1,min:0})]}),z&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l.__experimentalBorderControl,{label:(0,t.__)("Thumbnail Borders"),value:V,onChange:Q}),(0,R.jsx)(l.__experimentalBorderControl,{label:(0,t.__)("Thumbnail Borders - Selected"),value:j,onChange:ee}),(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Thumbnail Style",n.KR),value:H,onChange:e=>a({thumbnailsStyle:e}),options:[{value:"",label:(0,t.__)("None",n.KR)},{value:"lg-thumbnail-blur",label:(0,t.__)("Blur",n.KR)},{value:"lg-thumbnail-grayscale",label:(0,t.__)("Monochrome",n.KR)}]}),(0,R.jsx)(l.SelectControl,{label:(0,t.__)("Thumbnail Style - Selected",n.KR),value:F,onChange:e=>a({thumbnailActiveStyle:e}),options:[{value:"",label:(0,t.__)("None",n.KR)},{value:"lg-thumbnail-active-grayscale",label:(0,t.__)("Monochrome",n.KR)},{value:"lg-thumbnail-active-blur",label:(0,t.__)("Blur",n.KR)}]})]})]}):void 0})})]})},save:function(){return null}})}},i={};function s(e){var o=i[e];if(void 0!==o)return o.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,s),l.exports}s.m=t,e=[],s.O=(t,i,o,l)=>{if(!i){var n=1/0;for(d=0;d<e.length;d++){for(var[i,o,l]=e[d],r=!0,a=0;a<i.length;a++)(!1&l||n>=l)&&Object.keys(s.O).every((e=>s.O[e](i[a])))?i.splice(a--,1):(r=!1,l<n&&(n=l));if(r){e.splice(d--,1);var g=o();void 0!==g&&(t=g)}}return t}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[i,o,l]},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};s.O.j=t=>0===e[t];var t=(t,i)=>{var o,l,[n,r,a]=i,g=0;if(n.some((t=>0!==e[t]))){for(o in r)s.o(r,o)&&(s.m[o]=r[o]);if(a)var d=a(s)}for(t&&t(i);g<n.length;g++)l=n[g],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(d)},i=globalThis.webpackChunkgallery=globalThis.webpackChunkgallery||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var o=s.O(void 0,[350],(()=>s(659)));o=s.O(o)})();