UNPKG

nanogallery2

Version:

modern photo / video gallery and lightbox

21 lines 236 kB
/* nanogallery2 - v3.0.5 - 2021-01-06 */ /*! * @preserve nanogallery2 - javascript photo / video gallery and lightbox * Homepage: http://nanogallery2.nanostudio.org * Sources: https://github.com/nanostudio-org/nanogallery2 * * License: GPLv3 and commercial licence * * Requirements: * - jQuery (http://www.jquery.com) - version >= 1.7.1 * * Embeded components: * - shifty (https://github.com/jeremyckahn/shifty) * - imagesloaded (https://github.com/desandro/imagesloaded) * - hammer.js (http://hammerjs.github.io/) * - screenfull.js (https://github.com/sindresorhus/screenfull.js) * Tools: * - webfont generated with http://fontello.com - mainly based on Font Awesome Copyright (C) 2012 by Dave Gandy (http://fontawesome.io/) * - ICO online converter: https://iconverticons.com/online/ */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)}((function(e){"use strict";function t(e){var t=document.getElementById("ngyColorHelperToRGB");return null===t&&((t=document.createElement("div")).id="ngyColorHelperToRGB",t.style.cssText="display: none; color:"+e+";",document.body.appendChild(t)),getComputedStyle(t).color}function n(e,t,n){var i="";if("RGBA("==t.toUpperCase().substring(0,5)&&(i="a",t="rgb("+t.substring(5)),"number"!=typeof e||e<-1||e>1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||"string"!=typeof n&&void 0!==n)return null;function a(e){var t=e.length,n=new Object;if(t>9){if((e=e.split(",")).length<3||e.length>4)return null;n[0]=o(e[0].slice(4)),n[1]=o(e[1]),n[2]=o(e[2]),n[3]=e[3]?parseFloat(e[3]):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+""+e[4]:"")),e=o(e.slice(1),16),n[0]=e>>16&255,n[1]=e>>8&255,n[2]=255&e,n[3]=9==t||5==t?r((e>>24&255)/255*1e4)/1e4:-1}return n}var o=parseInt,r=Math.round,l=t.length>9,s=(l="string"==typeof n?n.length>9||"c"==n&&!l:l,e<0),u=(e=s?-1*e:e,n=n&&"c"!=n?n:s?"#000000":"#FFFFFF",a(t)),c=a(n);return u&&c?l?"rgb"+i+"("+r((c[0]-u[0])*e+u[0])+","+r((c[1]-u[1])*e+u[1])+","+r((c[2]-u[2])*e+u[2])+(u[3]<0&&c[3]<0?")":","+(u[3]>-1&&c[3]>-1?r(1e4*((c[3]-u[3])*e+u[3]))/1e4:c[3]<0?u[3]:c[3])+")"):"#"+(4294967296+16777216*(u[3]>-1&&c[3]>-1?r(255*((c[3]-u[3])*e+u[3])):c[3]>-1?r(255*c[3]):u[3]>-1?r(255*u[3]):255)+65536*r((c[0]-u[0])*e+u[0])+256*r((c[1]-u[1])*e+u[1])+r((c[2]-u[2])*e+u[2])).toString(16).slice(u[3]>-1||c[3]>-1?1:3):null}function i(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)t[n]=i(e[n]);return t}function a(){var e=jQuery(window);return{l:e.scrollLeft(),t:e.scrollTop(),w:e.width(),h:e.height()}}function o(e,t){var n=0;""==e&&(e="*"),jQuery(e).each((function(){var e=parseInt(jQuery(this).css("z-index"));n=e>n?e:n})),n++,jQuery(t).css("z-index",n)}var r=function(e){return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()};function l(){this.LightboxReOpen=function(){m()},this.ReloadAlbum=function(){if(""===u.O.kind)throw"Not supported for this content source:"+u.O.kind;var e=u.GOM.albumIdx;if(-1==e)throw"Current album not found.";for(var t=u.I[e].GetID(),n=u.I.length,i=0;i<n;i++){var a=u.I[i];a.albumID==t&&(a.selected=!1)}u.I[e].contentIsLoaded=!1,g("-1",t)},this.ItemsSetSelectedValue=function(e,t){for(var n=e.length,i=0;i<n;i++)pe(e[i],t)},this.ItemsSelectedGet=function(){for(var e=[],t=u.I.length,n=0;n<t;n++)1==u.I[n].selected&&e.push(u.I[n]);return e},this.Get=function(e){return u.O[e]},this.Set=function(e,t){switch(u.O[e]=t,e){case"thumbnailSelectable":de(),w(u.GOM.albumIdx)}},this.Refresh=function(){w(u.GOM.albumIdx)},this.Resize=function(){x()},this.DisplayItem=function(e){var t=p(e);"0"!=t.imageID?Q(t.imageID,t.albumID):g("-1",t.albumID)},this.ThumbnailToolbarOneCartUpdate=function(e){R(e)};var l=function(e){if(null==u.I[e])return 0;for(var t=u.I[e].GetID(),n=u.I.length,i=0,a=0;a<n;a++){u.I[a].isToDisplay(t)&&i++}return i};this.Search=function(e){u.GOM.albumSearch=e.toUpperCase();var t=u.GOM.albumIdx;return w(u.GOM.albumIdx),l(t)},this.Search2=function(e,t){return u.GOM.albumSearch=null!=e&&null!=e?e.toUpperCase().trim():"",u.GOM.albumSearchTags=null!=t&&null!=t?t.toUpperCase().trim():"",l(u.GOM.albumIdx)},this.Search2Execute=function(){var e=u.GOM.albumIdx;return w(u.GOM.albumIdx),l(e)},this.Destroy=function(){null!=u.GOM.hammertime&&(u.GOM.hammertime.destroy(),u.GOM.hammertime=null),null!=u.VOM.hammertime&&(u.VOM.hammertime.destroy(),u.VOM.hammertime=null),e("#ngycs_"+u.baseEltID).remove(),u.GOM.items=[],NGY2Item.New(u,u.i18nTranslations.breadcrumbHome,"","0","-1","album"),u.GOM.navigationBar.$newContent=null,u.$E.base.empty(),u.$E.base.removeData(),u.O.locationHash&&jQuery(window).off("hashchange.nanogallery2."+u.baseEltID),jQuery(window).off("resize.nanogallery2."+u.baseEltID),jQuery(window).off("orientationChange.nanogallery2."+u.baseEltID),jQuery(window).off("scroll.nanogallery2."+u.baseEltID),null!==u.$E.scrollableParent&&u.$E.scrollableParent.off("scroll.nanogallery2."+u.baseEltID),u.GOM.firstDisplay=!0},this.CloseViewer=function(){return tt(null),!1},this.MinimizeToolbar=function(){return We(),!1},this.MaximizeToolbar=function(){return Ue(),!1},this.PaginationPreviousPage=function(){return G(),!1},this.PaginationNextPage=function(){return y(),!1},this.PaginationGotoPage=function(e){return e>1&&e--,u.GOM.pagination.currentPage=e,u.GOM.ScrollToTop(),L(),E(!0),!1},this.PaginationCountPages=function(){return 0==u.GOM.items.length?0:Math.ceil((u.GOM.items[u.GOM.items.length-1].row+1)/u.galleryMaxRows.Get())};var s=function(e,t,n){var i;return function(){var a=this,o=arguments;function r(){n||e.apply(a,o),i=null}i?clearTimeout(i):n&&e.apply(a,o),i=setTimeout(r,t||100)}};window.ng_draf=function(e){return requestAnimationFrame((function(){window.requestAnimationFrame(e)}))},window.requestTimeout=function(e,t){if(!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame&&window.mozCancelRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame))return window.setTimeout(e,t);var n=(new Date).getTime(),i=new Object;return i.value=requestAnimFrame((function a(){(new Date).getTime()-n>=t?e.call():i.value=requestAnimFrame(a)})),i},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){window.setTimeout(e,1e3/60)},window.clearRequestTimeout=function(e){window.cancelAnimationFrame?window.cancelAnimationFrame(e.value):window.webkitCancelAnimationFrame?window.webkitCancelAnimationFrame(e.value):window.webkitCancelRequestAnimationFrame?window.webkitCancelRequestAnimationFrame(e.value):window.mozCancelRequestAnimationFrame?window.mozCancelRequestAnimationFrame(e.value):window.oCancelRequestAnimationFrame?window.oCancelRequestAnimationFrame(e.value):window.msCancelRequestAnimationFrame?window.msCancelRequestAnimationFrame(e.value):clearTimeout(e)};var u=this;function c(e){this.$e=null,this.ngy2ItemIdx=e,this.mediaNumber=u.VOM.items.length+1,this.posX=0,this.posY=0}u.I=[],u.Id=[],u.O=null,u.baseEltID=null,u.$E={base:null,conTnParent:null,conLoadingB:null,conConsole:null,conNavigationBar:null,conTnBottom:null,scrollableParent:null},u.shoppingCart=[],u.layout={internal:!0,engine:"",support:{rows:!1},prerequisite:{imageSize:!1},SetEngine:function(){if(u.layout.internal){if("auto"==u.tn.settings.width[u.GOM.curNavLevel][u.GOM.curWidth]||""==u.tn.settings.width[u.GOM.curNavLevel][u.GOM.curWidth])return u.layout.engine="JUSTIFIED",u.layout.support.rows=!0,void(u.layout.prerequisite.imageSize=!0);if("auto"==u.tn.settings.height[u.GOM.curNavLevel][u.GOM.curWidth]||""==u.tn.settings.height[u.GOM.curNavLevel][u.GOM.curWidth])return u.layout.engine="CASCADING",u.layout.support.rows=!1,void(u.layout.prerequisite.imageSize=!0);if(null!=u.tn.settings.getMosaic())return u.layout.engine="MOSAIC",u.layout.support.rows=!0,void(u.layout.prerequisite.imageSize=!1);u.layout.engine="GRID",u.layout.support.rows=!0,u.layout.prerequisite.imageSize=!1}}},u.galleryResizeEventEnabled=!1,u.galleryMaxRows={l1:0,lN:0,Get:function(){return u.galleryMaxRows[u.GOM.curNavLevel]}},u.galleryMaxItems={l1:0,lN:0,Get:function(){return u.galleryMaxItems[u.GOM.curNavLevel]}},u.galleryFilterTags={l1:0,lN:0,Get:function(){return u.galleryFilterTags[u.GOM.curNavLevel]}},u.galleryFilterTagsMode={l1:0,lN:0,Get:function(){return u.galleryFilterTagsMode[u.GOM.curNavLevel]}},u.galleryDisplayMode={l1:"FULLCONTENT",lN:"FULLCONTENT",Get:function(){return u.galleryDisplayMode[u.GOM.curNavLevel]}},u.galleryLastRowFull={l1:!1,lN:!1,Get:function(){return u.galleryLastRowFull[u.GOM.curNavLevel]}},u.gallerySorting={l1:"",lN:"",Get:function(){return u.gallerySorting[u.GOM.curNavLevel]}},u.galleryDisplayTransition={l1:"none",lN:"none",Get:function(){return u.galleryDisplayTransition[u.GOM.curNavLevel]}},u.galleryDisplayTransitionDuration={l1:500,lN:500,Get:function(){return u.galleryDisplayTransitionDuration[u.GOM.curNavLevel]}},u.$currentTouchedThumbnail=null,u.tn={opt:{l1:{crop:!0,stacks:0,stacksTranslateX:0,stacksTranslateY:0,stacksTranslateZ:0,stacksRotateX:0,stacksRotateY:0,stacksRotateZ:0,stacksScale:0,borderHorizontal:0,borderVertical:0,baseGridHeight:0,displayTransition:"FADEIN",displayTransitionStartVal:0,displayTransitionEasing:"easeOutQuart",displayTransitionDuration:240,displayInterval:15},lN:{crop:!0,stacks:0,stacksTranslateX:0,stacksTranslateY:0,stacksTranslateZ:0,stacksRotateX:0,stacksRotateY:0,stacksRotateZ:0,stacksScale:0,borderHorizontal:0,borderVertical:0,baseGridHeight:0,displayTransition:"FADEIN",displayTransitionStartVal:0,displayTransitionEasing:"easeOutQuart",displayTransitionDuration:240,displayInterval:15},Get:function(e){return u.tn.opt[u.GOM.curNavLevel][e]}},scale:1,labelHeight:{l1:0,lN:0,get:function(){return u.tn.labelHeight[u.GOM.curNavLevel]}},defaultSize:{width:{l1:{xs:0,sm:0,me:0,la:0,xl:0},lN:{xs:0,sm:0,me:0,la:0,xl:0}},height:{l1:{xs:0,sm:0,me:0,la:0,xl:0},lN:{xs:0,sm:0,me:0,la:0,xl:0}},getWidth:function(){return u.tn.defaultSize.width[u.GOM.curNavLevel][u.GOM.curWidth]},getOuterWidth:function(){u.tn.borderWidth=u.tn.opt.Get("borderHorizontal"),u.tn.borderHeight=u.tn.opt.Get("borderVertical");var e=u.tn.defaultSize.width[u.GOM.curNavLevel][u.GOM.curWidth]+2*u.tn.opt.Get("borderHorizontal");return"right"!=u.O.thumbnailLabel.get("position")&&"left"!=u.O.thumbnailLabel.get("position")||(e+=u.tn.defaultSize.width[u.GOM.curNavLevel][u.GOM.curWidth]),e},getHeight:function(){return u.tn.defaultSize.height[u.GOM.curNavLevel][u.GOM.curWidth]},getOuterHeight:function(){return u.tn.defaultSize.height[u.GOM.curNavLevel][u.GOM.curWidth]+2*u.tn.opt.Get("borderVertical")}},settings:{width:{l1:{xs:0,sm:0,me:0,la:0,xl:0,xsc:"u",smc:"u",mec:"u",lac:"u",xlc:"u"},lN:{xs:0,sm:0,me:0,la:0,xl:0,xsc:"u",smc:"u",mec:"u",lac:"u",xlc:"u"}},height:{l1:{xs:0,sm:0,me:0,la:0,xl:0,xsc:"u",smc:"u",mec:"u",lac:"u",xlc:"u"},lN:{xs:0,sm:0,me:0,la:0,xl:0,xsc:"u",smc:"u",mec:"u",lac:"u",xlc:"u"}},getH:function(e,t){var n=null==e?u.GOM.curNavLevel:e,i=null==t?u.GOM.curWidth:t;return"MOSAIC"==u.layout.engine?this.height[n][i]*this.mosaic[n+"Factor"].h[i]:this.height[n][i]},getW:function(e,t){var n=null==e?u.GOM.curNavLevel:e,i=null==t?u.GOM.curWidth:t;return"MOSAIC"==u.layout.engine?this.width[n][i]*this.mosaic[n+"Factor"].w[i]:this.width[n][i]},mosaic:{l1:{xs:null,sm:null,me:null,la:null,xl:null},lN:{xs:null,sm:null,me:null,la:null,xl:null},l1Factor:{h:{xs:1,sm:1,me:1,la:1,xl:1},w:{xs:1,sm:1,me:1,la:1,xl:1}},lNFactor:{h:{xs:1,sm:1,me:1,la:1,xl:1},w:{xs:1,sm:1,me:1,la:1,xl:1}}},getMosaic:function(){return this.mosaic[u.GOM.curNavLevel][u.GOM.curWidth]},mosaicCalcFactor:function(e,t){for(var n=1,i=1,a=0;a<u.tn.settings.mosaic[e][t].length;a++)n=Math.max(n,this.mosaic[e][t][a].w),i=Math.max(i,this.mosaic[e][t][a].h);this.mosaic[e+"Factor"].h[t]=i,this.mosaic[e+"Factor"].w[t]=n},gutterHeight:{l1:{xs:0,sm:0,me:0,la:0,xl:0},lN:{xs:0,sm:0,me:0,la:0,xl:0}},gutterWidth:{l1:{xs:0,sm:0,me:0,la:0,xl:0},lN:{xs:0,sm:0,me:0,la:0,xl:0}},GetResponsive:function(e){return this[e][u.GOM.curNavLevel][u.GOM.curWidth]}},hoverEffects:{std:[],level1:[],get:function(){return"l1"==u.GOM.curNavLevel&&0!==this.level1.length?this.level1:this.std}},buildInit:{std:[],level1:[],get:function(){return"l1"==u.GOM.curNavLevel&&0!==this.level1.length?this.level1:this.std}},toolbar:{album:{topLeft:"",topRight:"",bottomLeft:"",bottomRight:""},image:{topLeft:"",topRight:"",bottomLeft:"",bottomRight:""},albumUp:{topLeft:"",topRight:"",bottomLeft:"",bottomRight:""},get:function(e){return this[e.kind]}},style:{l1:{label:"",title:"",desc:""},lN:{label:"",title:"",desc:""},getTitle:function(){return'style="'+this[u.GOM.curNavLevel].title+'"'},getDesc:function(){return'style="'+this[u.GOM.curNavLevel].desc+'"'},getLabel:function(){var e='style="'+this[u.GOM.curNavLevel].label;return e+=u.O.RTL?'"direction:RTL;"':"",e+='"'}}},u.scrollTimeOut=0,u.i18nTranslations={paginationPrevious:"Previous",paginationNext:"Next",breadcrumbHome:"List of Albums",thumbnailImageTitle:"",thumbnailAlbumTitle:"",thumbnailImageDescription:"",thumbnailAlbumDescription:""},u.emptyGif="data:image/gif;base64,R0lGODlhEAAQAIAAAP///////yH5BAEKAAEALAAAAAAQABAAAAIOjI+py+0Po5y02ouzPgUAOw==",u.CSStransformName=dt(["transform","msTransform","MozTransform","WebkitTransform","OTransform"]),u.CSStransformStyle=dt(["transformStyle","msTransformStyle","MozTransformStyle","WebkitTransformStyle","OTransformStyle"]),u.CSSperspective=dt(["perspective","msPerspective","MozPerspective","WebkitPerspective","OPerspective"]),u.CSSbackfaceVisibilityName=dt(["backfaceVisibility","msBackfaceVisibility","MozBackfaceVisibility","WebkitBackfaceVisibility","OBackfaceVisibility"]),u.CSStransitionName=dt(["transition","msTransition","MozTransition","WebkitTransition","OTransition"]),u.CSSanimationName=dt(["animation","msAnimation","MozAnimation","WebkitAnimation","OAnimation"]),u.GalleryResizeThrottled=function(e,t,n){var i,a,o,r=null,l=0;n||(n={});var s=function(){l=!1===n.leading?0:(new Date).getTime(),r=null,o=e.apply(i,a),r||(i=a=null)};return function(){var u=(new Date).getTime();l||!1!==n.leading||(l=u);var c=t-(u-l);return i=this,a=arguments,c<=0||c>t?(r&&(clearTimeout(r),r=null),l=u,o=e.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(s,c)),o}}(x,15,{leading:!1}),u.blockList=null,u.allowList=null,u.albumList=[],u.locationHashLastUsed="",u.custGlobals={},u.touchAutoOpenDelayTimerID=0,u.i18nLang="",u.timeLastTouchStart=0,u.custGlobals={},u.markupOrApiProcessed=!1,u.GOM={albumIdx:-1,clipArea:{top:0,height:0},displayArea:{width:0,height:0},displayAreaLast:{width:0,height:0},displayedMoreSteps:0,items:[],$imgPreloader:[],thumbnails2Display:[],itemsDisplayed:0,firstDisplay:!0,firstDisplayTime:0,navigationBar:{displayed:!1,$newContent:""},cache:{viewport:null,containerOffset:null,areaWidth:100},nbSelected:0,pagination:{currentPage:0},panThreshold:60,panYOnly:!1,lastFullRow:-1,lastDisplayedIdx:-1,displayInterval:{from:0,len:0},hammertime:null,curNavLevel:"l1",curWidth:"me",albumSearch:"",albumSearchTags:"",lastZIndex:0,lastRandomValue:0,slider:{hostIdx:-1,hostItem:null,currentIdx:0,nextIdx:0,timerID:0,tween:null},NGY2Item:function(e){if(null==u.GOM.items[e]||null==u.GOM.items[e])return null;var t=u.GOM.items[e].thumbnailIdx;return u.I[t]},GTn:function(e,t,n){this.thumbnailIdx=e,this.width=0,this.height=0,this.top=0,this.left=0,this.row=0,this.imageWidth=t,this.imageHeight=n,this.resizedContentWidth=0,this.resizedContentHeight=0,this.displayed=!1,this.neverDisplayed=!0,this.inDisplayArea=!1},ScrollToTop:function(){var e,t,n,i;if(!u.GOM.firstDisplay&&(null!==u.$E.scrollableParent||(e=u.$E.base,t=20,n=a(),(i=e.offset()).top>=n.t&&i.top<=n.t+n.h-t)||u.$E.base.get(0).scrollIntoView(),null!==u.$E.scrollableParent)){var o=u.$E.scrollableParent.scrollTop(),r=Math.abs(u.$E.scrollableParent.offset().top-u.$E.base.offset().top-o);o>r&&window.ng_draf((function(){u.$E.scrollableParent.scrollTop(r)}))}}},u.VOM={viewerDisplayed:!1,viewerIsFullscreen:!1,infoDisplayed:!1,toolbarsDisplayed:!0,toolsHide:null,zoom:{posX:0,posY:0,userFactor:1,isZooming:!1},padding:{H:0,V:0},window:{lastWidth:0,lastHeight:0},$viewer:null,$toolbar:null,$toolbarTL:null,$toolbarTR:null,toolbarMode:"std",playSlideshow:!1,playSlideshowTimerID:0,slideshowDelay:3e3,albumID:-1,viewerMediaIsChanged:!1,items:[],panMode:"off",$baseCont:null,$content:null,content:{previous:{vIdx:-1,$media:null,NGY2Item:function(){return u.I[u.VOM.items[u.VOM.content.previous.vIdx].ngy2ItemIdx]}},current:{vIdx:-1,$media:null,NGY2Item:function(){return u.I[u.VOM.items[u.VOM.content.current.vIdx].ngy2ItemIdx]}},next:{vIdx:-1,$media:null,NGY2Item:function(){return u.I[u.VOM.items[u.VOM.content.next.vIdx].ngy2ItemIdx]}}},IdxNext:function(){var e=0;return u.VOM.content.current.vIdx<u.VOM.items.length-1&&(e=u.VOM.content.current.vIdx+1),e},IdxPrevious:function(){var e=u.VOM.content.current.vIdx-1;return 0==u.VOM.content.current.vIdx&&(e=u.VOM.items.length-1),e},gallery:{$elt:null,$tmbCont:null,gwidth:0,vwidth:0,oneTmbWidth:0,firstDisplay:!0,posX:0,SetThumbnailActive(){"none"!=u.O.viewerGallery&&(this.$tmbCont.children().removeClass("activeVThumbnail"),this.$tmbCont.children().eq(u.VOM.content.current.vIdx).addClass("activeVThumbnail"),this.firstDisplay=!1)},Resize:function(){if("none"!=u.O.viewerGallery)if(this.firstDisplay)(new NGTweenable).tween({from:{opacity:0},to:{opacity:1},easing:"easeInOutSine",duration:1e3,step:function(e){},finish:function(e){}});else{var e=u.VOM.$viewer.width(),t=Math.trunc(e/this.oneTmbWidth);if(this.vwidth=t*this.oneTmbWidth,this.$elt.css({width:this.vwidth,left:(e-this.vwidth)/2}),u.VOM.items.length>=t){var n=this.oneTmbWidth*u.VOM.content.current.vIdx;n+this.posX<this.vwidth?n+this.posX<0&&(this.posX=-n):n+this.posX>=this.vwidth&&(this.posX=this.vwidth-(n+this.oneTmbWidth))}this.PanGallery(0)}},PanGallery:function(e){this.gwidth<u.VOM.$viewer.width()&&(this.posX=(u.VOM.$viewer.width()-this.gwidth)/2,e=0),this.posX>this.vwidth-this.oneTmbWidth&&(this.posX=this.vwidth-this.oneTmbWidth),this.posX+this.gwidth<this.oneTmbWidth&&(this.posX=-this.gwidth+this.oneTmbWidth),this.$tmbCont.css(u.CSStransformName,"translateX("+(this.posX+e)+"px)")},PanGalleryEnd:function(e){var t=100*e;(new NGTweenable).tween({from:{pan:u.VOM.gallery.posX},to:{pan:u.VOM.gallery.posX+t},easing:"easeOutQuad",duration:500,step:function(e){u.VOM.gallery.posX=e.pan,u.VOM.gallery.PanGallery(0)}})}},hammertime:null,swipePosX:0,panPosX:0,panPosY:0,panThreshold:60,panXOnly:!1,singletapTime:0,viewerTheme:"",timeImgChanged:0,ImageLoader:{maxChecks:1e3,list:[],intervalHandle:null,loadImage:function(e,t){if("img"==t.mediaKind){var n=new Image;if(n.src=t.responsiveURL(),n.width&&n.height)e(n.width,n.height,t,0);else{var i,a={image:n,url:t.responsiveURL(),ngitem:t,callback:e,checks:1};for(i=0;i<this.list.length&&null!=this.list[i];i++);this.list[i]=a,this.intervalHandle||(this.intervalHandle=setInterval(this.interval,50))}}},interval:function(){for(var e,t=0,n=u.VOM.ImageLoader.list,i=0;i<n.length;i++)null!=(e=n[i])&&(e.image.width&&e.image.height?(u.VOM.ImageLoader.list[i]=null,e.callback(e.image.width,e.image.height,e.ngitem,e.checks)):e.checks>u.VOM.ImageLoader.maxChecks?(u.VOM.ImageLoader.list[i]=null,e.callback(0,0,e.ngitem,e.checks)):(t++,e.checks++));0==t&&(u.VOM.ImageLoader.list=[],clearInterval(u.VOM.ImageLoader.intervalHandle),delete u.VOM.ImageLoader.intervalHandle)}}},u.popup={isDisplayed:!1,$elt:null,close:function(){null!=this.$elt&&(new NGTweenable).tween({from:{opacity:1},to:{opacity:0},attachment:{t:this},easing:"easeInOutSine",duration:100,step:function(e,t){null!=t.t.$elt&&t.t.$elt.css("opacity",e.opacity)},finish:function(e,t){null!=t.t.$elt&&(t.t.$elt.remove(),t.t.$elt=null),t.t.isDisplayed=!1}})}},u.galleryTheme_dark={navigationBar:{background:"none",borderTop:"",borderBottom:"",borderRight:"",borderLeft:""},navigationBreadcrumb:{background:"#111",color:"#fff",colorHover:"#ccc",borderRadius:"4px"},navigationFilter:{color:"#ddd",background:"#111",colorSelected:"#fff",backgroundSelected:"#111",borderRadius:"4px"},navigationPagination:{background:"#111",color:"#fff",colorHover:"#ccc",borderRadius:"4px"},thumbnail:{background:"#444",backgroundImage:"linear-gradient(315deg, #111 0%, #445 90%)",borderColor:"#000",borderRadius:"0px",labelOpacity:1,labelBackground:"rgba(34, 34, 34, 0)",titleColor:"#fff",titleBgColor:"transparent",titleShadow:"",descriptionColor:"#ccc",descriptionBgColor:"transparent",descriptionShadow:"",stackBackground:"#aaa"},thumbnailIcon:{padding:"5px",color:"#fff",shadow:""},pagination:{background:"#181818",backgroundSelected:"#666",color:"#fff",borderRadius:"2px",shapeBorder:"3px solid #666",shapeColor:"#444",shapeSelectedColor:"#aaa"}},u.galleryTheme_light={navigationBar:{background:"none",borderTop:"",borderBottom:"",borderRight:"",borderLeft:""},navigationBreadcrumb:{background:"#eee",color:"#000",colorHover:"#333",borderRadius:"4px"},navigationFilter:{background:"#eee",color:"#222",colorSelected:"#000",backgroundSelected:"#eee",borderRadius:"4px"},navigationPagination:{background:"#eee",color:"#000",colorHover:"#333",borderRadius:"4px"},thumbnail:{background:"#444",backgroundImage:"linear-gradient(315deg, #111 0%, #445 90%)",borderColor:"#000",labelOpacity:1,labelBackground:"rgba(34, 34, 34, 0)",titleColor:"#fff",titleBgColor:"transparent",titleShadow:"",descriptionColor:"#ccc",descriptionBgColor:"transparent",descriptionShadow:"",stackBackground:"#888"},thumbnailIcon:{padding:"5px",color:"#fff"},pagination:{background:"#eee",backgroundSelected:"#aaa",color:"#000",borderRadius:"2px",shapeBorder:"3px solid #666",shapeColor:"#444",shapeSelectedColor:"#aaa"}},u.viewerTheme_dark={background:"#000",barBackground:"rgba(4, 4, 4, 0.2)",barBorder:"0px solid #111",barColor:"#fff",barDescriptionColor:"#ccc"},u.viewerTheme_light={background:"#f8f8f8",barBackground:"rgba(4, 4, 4, 0.7)",barBorder:"0px solid #111",barColor:"#fff",barDescriptionColor:"#ccc"};var h=NGY2Tools.NanoAlert,d=NGY2Tools.NanoConsoleLog;function m(){u.VOM.items=[],u.VOM.albumID="0",u.GOM.curNavLevel="l1";var e=0,t=u.$E.base[0].attributes,n="";t.hasOwnProperty("src")&&(n=t.src.nodeValue),""==n&&t.hasOwnProperty("data-ngthumb")&&(n=t["data-ngthumb"].nodeValue);for(var i=void 0,a=0;a<u.I.length;a++)if("image"==u.I[a].kind){var o=new c(a);u.VOM.items.push(o),u.I[a].thumbImg().src==n&&(i=e),e++}u.VOM.items.length>0?De(i):d(u,"No content for Lightbox standalone.")}function p(e){var t={albumID:"0",imageID:"0"},n=e.split("/");return n.length>0&&(t.albumID=n[0],n.length>1&&(t.imageID=n[1])),t}function g(e,t){u.VOM.viewerDisplayed&&tt(null);var n=NGY2Item.GetIdx(u,t);u.GOM.curNavLevel="lN",0==n&&(u.GOM.curNavLevel="l1"),u.layout.SetEngine(),u.galleryResizeEventEnabled=!1,-1==n&&(NGY2Item.New(u,"","",t,"0","album"),n=u.I.length-1),u.I[n].contentIsLoaded?(de(),u.GOM.pagination.currentPage=0,rt(t,""),w(n)):q(t,g,e,t)}function f(){switch(u.galleryDisplayMode.Get()){case"PAGINATION":u.layout.support.rows&&u.galleryMaxRows.Get()>0&&function(){if(u.$E.conTnBottom.css("opacity",0),u.$E.conTnBottom.children().remove(),0==u.GOM.items.length)return;var e=Math.ceil((u.GOM.items[u.GOM.items.length-1].row+1)/u.galleryMaxRows.Get());if(1==e)return;u.GOM.pagination.currentPage>e-1&&(u.GOM.pagination.currentPage=e-1);if(M(),0==u.GOM.displayInterval.len)return;if("NUMBERS"==u.O.galleryPaginationMode&&u.GOM.pagination.currentPage>0){jQuery('<div class="nGY2PaginationPrev">'+u.O.icons.paginationPrevious+"</div>").appendTo(u.$E.conTnBottom).click((function(e){G()}))}var t=0,n=e;if("NUMBERS"!=u.O.galleryPaginationMode)t=0;else{var i=u.O.paginationVisiblePages;if(i>=e)t=0;else{var a=0;a=i%2==1?(i+1)/2:i/2,u.GOM.pagination.currentPage<a?(t=0,(n=i-1)>e&&(n=e-1)):(t=u.GOM.pagination.currentPage-a,(n=t+i)>e&&(n=e-1)),n-t<i&&(t=n-i)<0&&(t=0)}}for(var o=t;o<n;o++){var r="",l="";switch(u.O.galleryPaginationMode){case"NUMBERS":r="nGY2paginationItem",l=o+1;break;case"DOTS":r="nGY2paginationDot";break;case"RECTANGLES":r="nGY2paginationRectangle"}o==u.GOM.pagination.currentPage&&(r+="CurrentPage");var s=jQuery('<div class="'+r+'">'+l+"</div>").appendTo(u.$E.conTnBottom);s.data("pageNumber",o),s.click((function(e){u.GOM.pagination.currentPage=jQuery(this).data("pageNumber"),at("pageChanged"),u.GOM.ScrollToTop(),L(),E(!0)}))}if("NUMBERS"==u.O.galleryPaginationMode&&u.GOM.pagination.currentPage+1<e){jQuery('<div class="nGY2PaginationNext">'+u.O.icons.paginationNext+"</div>").appendTo(u.$E.conTnBottom).click((function(e){y()}))}u.$E.conTnBottom.css("opacity",1)}();break;case"MOREBUTTON":u.$E.conTnBottom.off("click");var e=u.GOM.items.length-u.GOM.itemsDisplayed;0==e?u.$E.conTnBottom.empty():(u.$E.conTnBottom.html('<div class="nGY2GalleryMoreButton"><div class="nGY2GalleryMoreButtonAnnotation">+'+e+" "+u.O.icons.galleryMoreButton+"</div></div>"),u.$E.conTnBottom.on("click",(function(e){u.GOM.displayedMoreSteps++,x()})))}}function b(e){var t="";u.O.breadcrumbHideIcons||(t=u.O.icons.breadcrumbAlbum,0==e&&(t=u.O.icons.breadcrumbHome));var n=jQuery('<div class="oneItem">'+t+u.I[e].title+"</div>").appendTo(u.GOM.navigationBar.$newContent.find(".nGY2Breadcrumb"));u.O.breadcrumbOnlyCurrentLevel?0==e?jQuery(n).data("albumID","0"):jQuery(n).data("albumID",u.I[e].albumID):jQuery(n).data("albumID",u.I[e].GetID()),n.click((function(){g("-1",jQuery(this).data("albumID"))}))}function v(e){var t=jQuery('<div class="oneItem">'+(u.O.RTL?u.O.icons.breadcrumbSeparatorRtl:u.O.icons.breadcrumbSeparator)+"</div>").appendTo(u.GOM.navigationBar.$newContent.find(".nGY2Breadcrumb"));jQuery(t).data("albumIdx",e),t.click((function(){var e=jQuery(this).data("albumIdx");g("-1",u.I[e].GetID())}))}function O(e){if(u.GOM.navigationBar.$newContent=jQuery('<div class="nGY2Navigationbar"></div>'),1==u.O.displayBreadcrumb&&!u.O.thumbnailAlbumDisplayImage){var t=0,n=[];if(0!=e){var i=u.I.length;n.push(e);var a=e;for(t++;0!=u.I[a].albumID&&-1!=u.I[a].albumID;)for(var o=1;o<i;o++)if(u.I[o].GetID()==u.I[a].albumID){a=o,n.push(a),t++;break}}u.O.breadcrumbAutoHideTopLevel&&0==t||function(e){if(jQuery('<div class="nGY2NavigationbarItem nGY2Breadcrumb"></div>').appendTo(u.GOM.navigationBar.$newContent),u.O.breadcrumbOnlyCurrentLevel)0==e.length?b(0):(1==e.length?v(0):v(e[0]),b(e[0]));else if(b(0),e.length>0){v(0);for(var t=e.length-1;t>=0;t--)b(e[t]),t>0&&v(e[t-1])}}(n)}if(0!=u.galleryFilterTags.Get()){var r=u.I[e].albumTagList.length;if(r>0){for(o=0;o<r;o++){var l=u.I[e].albumTagList[o],s=u.O.icons.navigationFilterUnselected,c="Unselected";jQuery.inArray(l,u.I[e].albumTagListSel)>=0&&(c="Selected",s=u.O.icons.navigationFilterSelected),jQuery('<div class="nGY2NavigationbarItem nGY2NavFilter'+c+'">'+s+" "+l+"</div>").appendTo(u.GOM.navigationBar.$newContent).click((function(){var t=jQuery(this),n=t.text().replace(/^\s*|\s*$/,"");if("single"==u.galleryFilterTagsMode.Get())u.I[e].albumTagListSel=[],u.I[e].albumTagListSel.push(n);else{if(t.hasClass("nGY2NavFilterUnselected"))u.I[e].albumTagListSel.push(n);else{var i=jQuery.inArray(n,u.I[e].albumTagListSel);-1!=i&&u.I[e].albumTagListSel.splice(i,1)}t.toggleClass("nGY2NavFilters-oneTagUnselected nGY2NavFilters-oneTagSelected")}g("-1",u.I[e].GetID())}))}jQuery('<div class="nGY2NavigationbarItem nGY2NavFilterSelectAll">'+u.O.icons.navigationFilterSelectedAll+"</div>").appendTo(u.GOM.navigationBar.$newContent).click((function(){u.I[e].albumTagListSel=[],g("-1",u.I[e].GetID())}))}}"PAGINATION"==u.galleryDisplayMode.Get()&&u.O.galleryPaginationTopButtons&&(u.layout.support.rows&&u.galleryMaxRows.Get()>0&&(jQuery('<div class="nGY2NavigationbarItem nGY2NavPagination">'+u.O.icons.navigationPaginationPrevious+"</div>").appendTo(u.GOM.navigationBar.$newContent).click((function(){G()})),jQuery('<div class="nGY2NavigationbarItem nGY2NavPagination">'+u.O.icons.navigationPaginationNext+"</div>").appendTo(u.GOM.navigationBar.$newContent).click((function(){y()}))))}function y(){var e=0;j(),u.galleryMaxRows.Get()>0&&(e=(u.GOM.items[u.GOM.items.length-1].row+1)/u.galleryMaxRows.Get());var t=Math.ceil(e),n=u.GOM.pagination.currentPage;n<t-1?n++:n=0,u.GOM.pagination.currentPage=n,at("pageChanged"),u.GOM.ScrollToTop(),L(),E(!0)}function G(){var e=0;j(),u.galleryMaxRows.Get()>0&&(e=(u.GOM.items[u.GOM.items.length-1].row+1)/u.galleryMaxRows.Get());var t=Math.ceil(e),n=u.GOM.pagination.currentPage;n>0?n--:n=t-1,u.GOM.pagination.currentPage=n,at("pageChanged"),u.GOM.ScrollToTop(),L(),E(!0)}function M(){switch(u.GOM.displayInterval.from=0,u.GOM.displayInterval.len=u.I.length,u.galleryDisplayMode.Get()){case"PAGINATION":if(u.layout.support.rows){let a=u.GOM.items.length;var e=u.GOM.pagination.currentPage*u.galleryMaxRows.Get(),t=e+u.galleryMaxRows.Get(),n=-1;u.GOM.displayInterval.len=0;for(var i=0;i<a;i++){let a=u.GOM.items[i];a.row>=e&&a.row<t&&(-1==n&&(u.GOM.displayInterval.from=i,n=i),u.GOM.displayInterval.len++)}}break;case"MOREBUTTON":if(u.layout.support.rows){let e=u.GOM.items.length,t=u.O.galleryDisplayMoreStep*(u.GOM.displayedMoreSteps+1);u.GOM.displayInterval.len=0;for(i=0;i<e;i++){u.GOM.items[i].row<t&&u.GOM.displayInterval.len++}}break;case"ROWS":if(u.layout.support.rows){let e=u.GOM.items.length,t=u.galleryMaxRows.Get();u.galleryLastRowFull.Get()&&-1!=u.GOM.lastFullRow&&t>u.GOM.lastFullRow+1&&(t=u.GOM.lastFullRow+1),u.GOM.displayInterval.len=0;for(i=0;i<e;i++){u.GOM.items[i].row<t&&u.GOM.displayInterval.len++}}break;default:case"FULLCONTENT":if(u.layout.support.rows&&u.galleryLastRowFull.Get()&&-1!=u.GOM.lastFullRow){let e=u.GOM.items.length,t=u.GOM.lastFullRow+1;u.GOM.displayInterval.len=0;for(i=0;i<e;i++){u.GOM.items[i].row<t&&u.GOM.displayInterval.len++}}}}function w(e){at("galleryRenderStart"),clearTimeout(u.GOM.slider.timerID),u.GOM.slider.hostIdx=-1;var t=u.O.fnGalleryRenderStart;if(null!==t&&("function"==typeof t?t(u.I[u.GOM.albumIdx]):window[t](u.I[u.GOM.albumIdx])),u.layout.SetEngine(),u.galleryResizeEventEnabled=!1,u.GOM.albumIdx=-1,u.GOM.lastDisplayedIdx=-1,void 0!==u.$E.conTnBottom&&u.$E.conTnBottom.empty(),O(e),u.GOM.firstDisplay){u.GOM.firstDisplay=!1;var n=Date.now()-u.GOM.firstDisplayTime;n<u.O.galleryRenderDelay?requestTimeout((function(){I(e)}),u.O.galleryRenderDelay-n):I(e),u.O.galleryRenderDelay=0}else{var i=!1;0==u.GOM.navigationBar.$newContent.children().length&&(i=!0),(new NGTweenable).tween({from:{opacity:1},to:{opacity:0},duration:300,easing:"easeInQuart",attachment:{h:i},step:function(e,t){u.$E.conTnParent.css({opacity:e.opacity}),t.h&&u.$E.conNavigationBar.css({opacity:e.opacity})},finish:function(t,n){n.h&&u.$E.conNavigationBar.css({opacity:0,display:"none"}),u.GOM.ScrollToTop(),I(e)}})}}function I(e){var t=u.$E.conNavigationBar.children().length;(u.$E.conNavigationBar.empty(),u.GOM.navigationBar.$newContent.children().clone(!0,!0).appendTo(u.$E.conNavigationBar),u.$E.conNavigationBar.children().length>0&&0==t)?(u.$E.conNavigationBar.css({opacity:0,display:"block"}),(new NGTweenable).tween({from:{opacity:0},to:{opacity:1},duration:200,easing:"easeInQuart",step:function(e){u.$E.conNavigationBar.css(e)},finish:function(t){u.$E.conNavigationBar.css({opacity:1}),requestTimeout((function(){T(e)}),20)}})):requestTimeout((function(){T(e)}),20)}function T(e){u.GOM.lastZIndex=parseInt(u.$E.base.css("z-index")),isNaN(u.GOM.lastZIndex)&&(u.GOM.lastZIndex=0),u.$E.conTnParent.css({opacity:0}),u.$E.conTn.off().empty();for(var t=u.I.length,n=0;n<t;n++){var i=u.I[n];i.hovered=!1,i.$elt=null,i.$Elts=[],i.eltTransform=[],i.eltFilter=[],i.width=0,i.height=0,i.left=0,i.top=0,i.resizedContentWidth=0,i.resizedContentHeight=0,i.thumbnailImgRevealed=!1}null==u.CSStransformName?u.$E.conTn.css("left","0px"):u.$E.conTn.css(u.CSStransformName,"none"),requestTimeout((function(){!function(e){var t=new Date;u.$E.conTnParent.css("opacity",1),u.GOM.items=[],u.GOM.displayedMoreSteps=0,"onBottom"==u.O.thumbnailLabel.get("position")?u.tn.labelHeight[u.GOM.curNavLevel]=function(){var e=[],t=0;if(0==u.O.thumbnailLabel.get("display"))return 0;e[t++]='<div class="nGY2GThumbnail '+u.O.theme+'" style="display:block;visibility:hidden;position:absolute;top:-9999px;left:-9999px;" ><div class="nGY2GThumbnailSub">',1==u.O.thumbnailLabel.get("display")&&(e[t++]=' <div class="nGY2GThumbnailLabel" '+u.tn.style.getLabel()+">",e[t++]=' <div class="nGY2GThumbnailAlbumTitle" '+u.tn.style.getTitle()+">aAzZjJ</div>",1==u.O.thumbnailLabel.get("displayDescription")&&(e[t++]=' <div class="nGY2GThumbnailDescription" '+u.tn.style.getDesc()+">aAzZjJ</div>"),e[t++]=" </div>");e[t++]="</div></div>";var n=jQuery(e.join("")).appendTo(u.$E.conTn),i=n.find(".nGY2GThumbnailLabel").outerHeight(!0);return n.remove(),i}():u.tn.labelHeight[u.GOM.curNavLevel]=0;u.GOM.albumIdx=e,at("galleryRenderEnd");var n=u.O.fnGalleryRenderEnd;null!==n&&("function"==typeof n?n(u.I[u.GOM.albumIdx]):window[n](u.I[u.GOM.albumIdx]));!function(){for(var e="",t=u.I[u.GOM.albumIdx].GetID(),n=u.I.length,i=0,a=0;a<n;a++){var o=u.I[a];if(o.isToDisplay(t)){var r=o.thumbImg().width,l=o.thumbImg().height;!u.layout.prerequisite.imageSize||0!=r&&0!=l||(e+='<img src="'+o.thumbImg().src+'" data-idx="'+i+'" data-albumidx="'+u.GOM.albumIdx+'">'),0==l&&(l=u.tn.defaultSize.getHeight()),0==r&&(r=u.tn.defaultSize.getWidth());var s=new u.GOM.GTn(a,r,l);u.GOM.items.push(s),i++}}at("galleryObjectModelBuilt");var c=u.O.fnGalleryObjectModelBuilt;null!==c&&("function"==typeof c?c():window[c]());if(""!=e){var h=jQuery(e),d=ngimagesLoaded(h);return h=null,d.on("progress",(function(e,t){if(t.isLoaded){var n=t.img.getAttribute("data-idx");if(t.img.getAttribute("data-albumidx")==u.GOM.albumIdx){var i=u.GOM.items[n];i.imageWidth=t.img.naturalWidth,i.imageHeight=t.img.naturalHeight;var a=u.I[i.thumbnailIdx];a.thumbs.width[u.GOM.curNavLevel][u.GOM.curWidth]=i.imageWidth,a.thumbs.height[u.GOM.curNavLevel][u.GOM.curWidth]=i.imageHeight,u.GalleryResizeThrottled();var o=a.thumbs.width.l1;for(let e in o)o.hasOwnProperty(e)&&e!=u.GOM.curWidth&&u.tn.settings.width.l1[e]==u.tn.settings.getW()&&u.tn.settings.height.l1[e]==u.tn.settings.getH()&&(a.thumbs.width.l1[e]=i.imageWidth,a.thumbs.height.l1[e]=i.imageHeight);o=a.thumbs.width.lN;for(let e in o)o.hasOwnProperty(e)&&e!=u.GOM.curWidth&&u.tn.settings.width.lN[e]==u.tn.settings.getW()&&u.tn.settings.height.lN[e]==u.tn.settings.getH()&&(a.thumbs.width.lN[e]=i.imageWidth,a.thumbs.height.lN[e]=i.imageHeight)}}})),u.galleryResizeEventEnabled=!0,!1}return!0}()?u.galleryResizeEventEnabled=!0:(S(),function(){var e=u.galleryDisplayTransitionDuration.Get();switch(u.galleryDisplayTransition.Get()){case"ROTATEX":u.$E.base.css({perspective:"1000px","perspective-origin":"50% 0%"}),(new NGTweenable).tween({from:{r:50},to:{r:0},attachment:{orgIdx:u.GOM.albumIdx},duration:e,easing:"easeOutCirc",step:function(e,t){t.orgIdx==u.GOM.albumIdx&&u.$E.conTnParent.css(u.CSStransformName,"rotateX("+e.r+"deg)")}});break;case"SLIDEUP":u.$E.conTnParent.css({opacity:0}),(new NGTweenable).tween({from:{y:200,o:0},to:{y:0,o:1},attachment:{orgIdx:u.GOM.albumIdx},duration:e,easing:"easeOutCirc",step:function(e,t){t.orgIdx==u.GOM.albumIdx&&u.$E.conTnParent.css(u.CSStransformName,"translate( 0px, "+e.y+"px)").css("opacity",e.o)}})}}(),L(),requestTimeout((function(){E(!1)}),20));u.O.debugMode&&console.log("GalleryRenderPart3: "+(new Date-t))}(e)}),20)}function x(){var e=new Date;if(u.galleryResizeEventEnabled=!1,0==S())return u.galleryResizeEventEnabled=!0,void(u.O.debugMode&&console.log("GalleryResize1: "+(new Date-e)));u.O.debugMode&&console.log("GalleryResizeSetLayout: "+(new Date-e)),L(),E(!1),u.O.debugMode&&console.log("GalleryResizeFull: "+(new Date-e))}function S(){var e=!0;switch(u.GOM.cache.areaWidth=u.$E.conTnParent.width(),u.GOM.displayArea={width:0,height:0},u.layout.engine){case"JUSTIFIED":e=function(){for(var e=0,t=u.GOM.cache.areaWidth,n=0,i=0,a=[],o=0,r=[],l=!1,s=u.tn.settings.GetResponsive("gutterWidth"),c=u.tn.settings.GetResponsive("gutterHeight"),h=0,d=0,m=!1,p=!1,g=u.tn.defaultSize.getOuterHeight(),f=2*u.tn.opt.Get("borderHorizontal"),b=2*u.tn.opt.Get("borderVertical"),v=1,O=u.GOM.items.length,y=0;y<O;y++){let n=u.GOM.items[y];if(1==n.deleted)break;if(n.imageWidth>0){let i=n.imageWidth/n.imageHeight,u=Math.floor(g*i);if(l&&(l=!1,o++,e=0,m=!1,p=!1,v=1),n.imageHeight>n.imageWidth?m=!0:p=!0,e+s+u<t-v*f){e+=u+s,r[o]=g;var G=Math.max(m?h:0,p?d:0);G>0&&(r[o]=Math.min(r[o],G)),a[o]=y}else{let n=(t-v*f)/(e+=s+u),i=Math.floor(g*n);r[o]=i,m&&(h=Math.max(h,i)),p&&(d=Math.max(d,i)),a[o]=y,l=!0}v++}}o=0,i=0,n=0,0,u.GOM.lastFullRow=0;for(y=0;y<O;y++){let e=u.GOM.items[y];if(!(e.imageWidth>0))return!1;{let l=e.imageWidth/e.imageHeight,h=Math.floor(l*r[o]);y==a[o]&&(a.length!=o+1||n+s+h+f>t)&&(h=t-n-f);let d=parseInt(r[o]);h=parseInt(h),e.resizedContentWidth=h,e.resizedContentHeight=d,e.width=h+f,e.height=d+u.tn.labelHeight.get()+b,e.row=o,e.top=i;let m=n;u.O.RTL&&(m=t-n-e.width),e.left=m,n+=e.width+s,y==a[o]&&(i+=e.height+c,u.GOM.lastFullRow=o-1,o++,n=0)}}return u.GOM.displayArea.width=t,!0}();break;case"CASCADING":e=function(){var e=0,t=u.GOM.cache.areaWidth,n=0,i=[],a=z(t),o=0,r=u.tn.settings.GetResponsive("gutterHeight"),l=1,s=u.tn.defaultSize.getOuterWidth(),c=u.GOM.items.length,h=0;"justified"==u.O.thumbnailAlignment?(a=Math.min(a,c),o=1==a?0:(t-a*s)/(a-1)):o=u.tn.settings.GetResponsive("gutterWidth");var d=2*u.tn.opt.Get("borderHorizontal"),m=2*u.tn.opt.Get("borderVertical");if(u.GOM.lastFullRow=-1,"fillWidth"==u.O.thumbnailAlignment){var p=(a-1)*o;(l=(t-p)/(a*s))>1&&a++,p=(a-1)*o,l=Math.min((t-p)/(a*s),1)}for(var g=(s=Math.round(s*l))-d,f=Math.round(u.tn.opt.Get("baseGridHeight")*l),b=0;b<c;b++){var v=u.GOM.items[b];if(1==v.deleted)break;if(v.imageHeight>0&&v.imageWidth>0){var O=0,y=(h=0,v.imageHeight/v.imageWidth);if(v.resizedContentWidth=g,v.resizedContentHeight=v.resizedContentWidth*y,f>0){var G=Math.max(Math.trunc(v.resizedContentHeight/f),1);v.resizedContentHeight=f*G+(G-1)*(m+r)}if(v.height=v.resizedContentHeight+m+u.tn.labelHeight.get(),v.width=s,v.row=0,0==n)O=e*(s+o),i[e]=v.height+r,++e>=a&&(e=0,n++);else{for(var M=0,w=i[0],I=1;I<a;I++)i[I]+5<w&&(w=i[I],M=I);h=i[M],O=M*(s+o),i[M]=h+v.height+r}var T=O;u.O.RTL&&(T=0-O-s),v.left=T,v.top=h}}return u.GOM.displayArea.width=a*(s+o)-o,!0}();break;case"MOSAIC":e=function(){var e=u.GOM.cache.areaWidth,t=u.tn.settings.GetResponsive("gutterHeight"),n=u.tn.settings.GetResponsive("gutterWidth"),i=2*u.tn.opt.Get("borderHorizontal"),a=2*u.tn.opt.Get("borderVertical"),o=u.GOM.items.length,r=0,l=0,s=0,c=0,h=0;let d=u.tn.settings.getMosaic();for(var m=0;m<o;m++){let e=d[s];var p=(e.c-1)*u.tn.defaultSize.getOuterWidth()+(e.c-1)*n,g=e.w*u.tn.defaultSize.getOuterWidth()+(e.w-1)*n;if(h=Math.max(h,p+g),c=Math.max(c,e.c-1+e.w),++s>=d.length)break}var f=(c-1)*n,b=Math.min((e-f)/(h-f),1);r=0,s=0;for(m=0;m<o;m++){let e=u.GOM.items[m],o=d[s];e.top=Math.round((o.r-1)*u.tn.defaultSize.getOuterHeight()*b)+(o.r-1)*t+r*l+u.tn.labelHeight.get()*(o.r-1),r>0&&(e.top+=t),e.left=(o.c-1)*Math.round(u.tn.defaultSize.getOuterWidth()*b)+(o.c-1)*n,e.height=Math.round(o.h*u.tn.defaultSize.getOuterHeight()*b)+(o.h-1)*t+u.tn.labelHeight.get()*o.h,e.resizedContentHeight=e.height-u.tn.labelHeight.get()-a,e.width=Math.round(o.w*u.tn.defaultSize.getOuterWidth()*b)+(o.w-1)*n,e.resizedContentWidth=e.width-i,e.row=r,0==r&&(l=Math.max(l,e.top+e.height)),++s>=d.length&&(s=0,r++)}return u.GOM.displayArea.width=(h-f)*b+f,!0}();break;case"GRID":default:e=function(){var e=0,t=0,n=u.GOM.cache.areaWidth,i=0,a=u.tn.settings.GetResponsive("gutterHeight"),o=z(n),r=0,l=[],s=0,c=n,h=u.tn.defaultSize.getOuterWidth(),d=1,m=u.GOM.items.length,p=2*u.tn.opt.Get("borderHorizontal"),g=2*u.tn.opt.Get("borderVertical");"justified"==u.O.thumbnailAlignment?(o=Math.min(o,m),i=1==o?0:(n-o*h)/(o-1)):i=u.tn.settings.GetResponsive("gutterWidth");if(u.O.RTL||"fillWidth"==u.O.thumbnailAlignment){var f=(o-1)*i;(d=(n-f)/(o*h))>1&&o++,f=(o-1)*i,d=Math.min((n-f)/(o*h),1),c=o*h+f}u.GOM.lastFullRow=0;for(var b=0,v=(h=Math.round(h*d))-p,O=Math.round(u.tn.defaultSize.getOuterHeight()*d)+u.tn.labelHeight.get(),y=Math.round(u.tn.defaultSize.getOuterHeight()*d)-g,G=0;G<m;G++){0==t?(e=s*(h+i),l[s]=e,r=e+h):e=l[s];var M=e;u.O.RTL&&(M=parseInt(c)-e-h);var w=u.GOM.items[G];w.top=t,w.left=M,w.height=O,w.width=h,"fillWidth"==u.O.thumbnailAlignment&&(w.resizedContentWidth=v,w.resizedContentHeight=y),w.row=b,++s>=o&&(s=0,t+=O+a,u.GOM.lastFullRow=b,b++)}return u.GOM.displayArea.width=r,!0}()}at("galleryLayoutApplied");var t=u.O.fnGalleryLayoutApplied;return null!==t&&("function"==typeof t?t():window[t]()),e}function L(){null==u.CSStransformName?u.$E.conTn.css("left","0px"):u.$E.conTn.css(u.CSStransformName,"none")}function C(){u.GOM.cache.viewport=a(),u.GOM.cache.areaWidth=u.$E.base.width(),u.O.lightboxStandalone||(u.GOM.cache.containerOffset=u.$E.conLoadingB.offset())}function E(e){C();var t=u.GOM.items.length;u.GOM.itemsDisplayed=0;var n=0;M();for(var i=0;i<t;i++){let t=u.GOM.items[i];i>=u.GOM.displayInterval.from&&n<u.GOM.displayInterval.len?(t.inDisplayArea=!0,e&&(t.neverDisplayed=!0),u.GOM.itemsDisplayed++,n++):t.inDisplayArea=!1}f();var a=[],o=[];C(),u.GOM.clipArea.top=-1,n=0;var r=-1;u.GOM.clipArea.height=0;for(i=0;i<t;i++){let e=u.GOM.items[i];if(e.inDisplayArea){if(-1==u.GOM.clipArea.top&&(u.GOM.clipArea.top=e.top),e.top-u.GOM.clipArea.top<=-1&&(u.GOM.clipArea.top=e.top),u.GOM.clipArea.height=Math.max(u.GOM.clipArea.height,e.top-u.GOM.clipArea.top+e.height),e.neverDisplayed){var l=u.GOM.cache.containerOffset.top+(e.top-u.GOM.clipArea.top);if(l+e.height>=u.GOM.cache.viewport.t-50&&l<=u.GOM.cache.viewport.t+u.GOM.cache.viewport.h+50){let t=u.I[e.thumbnailIdx];null==t.$elt&&A(t,e.thumbnailIdx,i),a.push({idx:i,delay:n,top:e.top,left:e.left}),n++}}else o.push({idx:i,delay:0,top:e.top,left:e.left});r=i}else{e.displayed=!1;let t=u.I[e.thumbnailIdx];null!=t.$elt&&t.$elt.css({opacity:0,display:"none"})}}var s=u.$E.conTnParent.width();if(u.GOM.displayArea.width==u.GOM.displayAreaLast.width&&u.GOM.clipArea.height==u.GOM.displayAreaLast.height||(u.$E.conTn.width(u.GOM.displayArea.width).height(u.GOM.clipArea.height),u.GOM.displayAreaLast.width=u.GOM.displayArea.width,u.GOM.displayAreaLast.height=u.GOM.clipArea.height),s!=u.$E.conTnParent.width())return u.GOM.cache.areaWidth=u.$E.conTnParent.width(),S(),L(),void E(e);if(u.layout.support.rows&&("ROWS"==u.galleryDisplayMode.Get()||"FULLCONTENT"==u.galleryDisplayMode.Get()&&u.galleryLastRowFull.Get()&&-1!=u.GOM.lastFullRow)&&(u.GOM.lastDisplayedIdxNew=r<t-1?r:-1,-1!=u.GOM.lastDisplayedIdx)){u.I[u.GOM.items[u.GOM.lastDisplayedIdx].thumbnailIdx].$getElt(".nGY2GThumbnailIconsFullThumbnail").html("")}u.GOM.thumbnails2Display=[];var c=k(a);k(o),u.GOM.thumbnails2Display.forEach((function(e){!function(e,t){function n(e,t){return Math.floor(Math.random()*(t-e+1)+e)}var i={},a={};switch(u.tn.opt.Get("displayTransition")){case"RANDOMSCALE":{for(var o=n(0,3);o==u.GOM.lastRandomValue;)o=n(0,3);u.GOM.lastRandomValue=o;let t=[.95,1,1.05,1.1][o];e.$elt.css({"z-index":u.GOM.lastZIndex+[1,2,3,4][o],"box-shadow":"0px 0px 5px 3px rgba(0,0,0,0.74)"}),i={scale:.5,opacity:0},a={scale:t,opacity:1};break}case"SCALEUP":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=.6),i={scale:e,opacity:0},a={scale:1,opacity:1};break}case"SCALEDOWN":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=1.3),i={scale:e,opacity:0},a={scale:1,opacity:1};break}case"SLIDEUP":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=50),i={opacity:0,translateY:e},a={opacity:1,translateY:0};break}case"SLIDEDOWN":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=-50),i={opacity:0,translateY:e},a={opacity:1,translateY:0};break}case"FLIPUP":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=100),i={opacity:0,translateY:e,rotateX:45},a={opacity:1,translateY:0,rotateX:0};break}case"FLIPDOWN":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=-100),i={opacity:0,translateY:e,rotateX:-45},a={opacity:1,translateY:0,rotateX:0};break}case"SLIDEUP2":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=100),i={opacity:0,translateY:e,rotateY:40},a={opacity:1,translateY:0,rotateY:0};break}case"IMAGESLIDEUP":i={opacity:0,top:"100%"},a={opacity:1,top:"0%"};break;case"SLIDEDOWN2":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=-100),i={opacity:0,translateY:e,rotateY:40},a={opacity:1,translateY:0,rotateY:0};break}case"SLIDERIGHT":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=-150),i={opacity:0,translateX:e},a={opacity:1,translateX:0};break}case"SLIDELEFT":{let e=u.tn.opt.Get("displayTransitionStartVal");0==e&&(e=150),i={opacity:0,translateX:e},a={opacity:1,translateX:0};break}case"FADEIN":i={opacity:0},a={opacity:1}}var r=new NGTweenable;r.tween({from:i,to:a,attachment:{$e:e.$elt,item:e,tw:r},delay:t,duration:u.tn.opt.Get("displayTransitionDuration"),easing:u.tn.opt.Get("displayTransitionEasing"),step:function(e,t){window.requestAnimationFrame((function(){if(null!==t.item.$elt)switch(u.tn.opt.Get("displayTransition")){case"RANDOMSCALE":case"SCALEUP":t.$e.css(u.CSStransformName,"scale("+e.scale+")").css("opacity",e.opacity);break;case"SCALEDOWN":t.item.$elt.last().css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","scale",e.scale),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"SLIDEUP":t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","translate","0px, "+e.translateY+"px"),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"SLIDEDOWN":t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","translate","0px,"+e.translateY+"px"),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"FLIPUP":t.item.CSSTransformSet(".nGY2GThumbnail","translate","0px,"+e.translateY+"px"),t.item.CSSTransformSet(".nGY2GThumbnail","rotateX",e.rotateX+"deg"),t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"FLIPDOWN":t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","translate","0px,"+e.translateY+"px"),t.item.CSSTransformSet(".nGY2GThumbnail","rotateX",e.rotateX+"deg"),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"SLIDEUP2":t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","translate","0px,"+e.translateY+"px"),t.item.CSSTransformSet(".nGY2GThumbnail","rotateY",e.rotateY+"deg"),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"IMAGESLIDEUP":t.item.$elt.css("opacity",e.opacity),t.item.$Elts[".nGY2GThumbnailImage"].css("top",e.top);break;case"SLIDEDOWN2":t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","translate","0px, "+e.translateY+"px"),t.item.CSSTransformSet(".nGY2GThumbnail","rotateY",e.rotateY+"deg"),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"SLIDERIGHT":t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformSet(".nGY2GThumbnail","translate",e.translateX+"px, 0px"),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"SLIDELEFT":t.item.CSSTransformSet(".nGY2GThumbnail","translate",e.translateX+"px, 0px"),t.item.$elt.css("opacity",e.opacity),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"FADEIN":t.$e.css(e)}else t.tw.stop(!1)}))},finish:function(e,t){window.requestAnimationFrame((function(){if(null!==t.item.$elt){switch(u.tn.opt.Get("displayTransition")){case"RANDOMSCALE":t.$e.css(u.CSStransformName,"scale("+e.scale+")").css("opacity","");break;case"SCALEUP":t.$e.css(u.CSStransformName,"").css("opacity","");break;case"SCALEDOWN":t.item.$elt.last().css("opacity",""),t.item.CSSTransformSet(".nGY2GThumbnail","scale",e.scale),t.item.CSSTransformApply(".nGY2GThumbnail");break;case"IMAGESLIDEUP":t.item.$elt.css("opacity",""),t.item.$Elts[".nGY2GThumbnailImage"].css("top",0);break;case"SLIDEDOWN2":t.item.$elt.css("opacity",""),t.item.CSSTransformApply(".nGY2GThumbnail");break;default:t.item.$elt.css("opacity","")}B(t.item)}}))}})}(e.itm,e.d)})),u.GOM.thumbnails2Display=[],"NONE"==u.tn.opt.Get("displayTransition")?(u.galleryResizeEventEnabled=!0,at("galleryDisplayed")):requestTimeout((function(){u.galleryResizeEventEnabled=!0,at("galleryDisplayed")}),c*u.tn.opt.Get("displayInterval"))}function k(e){var t=e.length;if(0==t)return 0;var n=u.tn.opt.Get("displayOrder");if("random"==n?NGY2Tools.AreaShuffle(e):("rowByRow"==n&&"JUSTIFIED"!=u.layout.engine&&"GRID"!=u.layout.engine&&(n=""),"colFromRight"!=n&&"colFromLeft"!=n||"CASCADING"==u.layout.engine||"GRID"==u.layout.engine||(n="")),"colFromRight"==n||"colFromLeft"==n){for(var i=[],a=[],o=0;o<t;o++)null==i[e[o].left]&&(i[e[o].left]=[],a.push(e[o].left)),i[e[o].left].push(e[o].idx);"colFromRight"==n&&(a=a.reverse());for(o=0;o<a.length;o++)for(var r=a[o],l=0;l<i[r].length;l++)D(i[r][l],o);return o}var s=0,c=e[0].top;for(o=0;o<t;o++)"rowByRow"==n?e[o].top>c&&(s++,c=e[o].top):s++,D(e[o].idx,s);return s}function D(e,t){var n=0,i=u.GOM.items[e],a=u.GOM.items[e].thumbnailIdx,o=u.I[a];if(i.neverDisplayed){var r=i.top-u.GOM.clipArea.top;if(u.tn.opt.Get("stacks")>0?(o.$elt.last().css({display:"block"}),o.$elt.css({top:r,left:i.left})):o.$elt.css({display:"block",top:r,left:i.left}),n=r,!0===u.O.thumbnailWaitImageLoaded)ngimagesLoaded(o.$getElt(".nGY2TnImg2")).on("progress",(function(e,t){if(t.isLoaded&&t.img.getAttribute("data-albumidx")==u.GOM.albumIdx){var n=t.img.getAttribute("data-idx");u.I[n].ThumbnailImageReveal()}}));!function(e,t){var n=u.GOM.items[e],i=u.I[n.thumbnailIdx];if("NONE"==u.tn.opt.Get("displayTransition"))i.$elt.css({opacity:1}),B(i);else{if(null==i.$elt)return;var a=u.GOM.cache.containerOffset.top+(n.top-u.GOM.clipArea.top),o=u.GOM.cache.viewport;if(a+(n.top-u.GOM.clipArea.top)>=o.t-50&&a<=o.t+o.h+50){var r=t*u.tn.opt.Get("displayInterval");return void("CUSTOM"==u.tn.opt.Get("displayTransition")?"lN"==u.GOM.curNavLevel?u.O.fnThumbnailDisplayEffect(i.$elt,i,e,r):u.O.fnThumbnailL1DisplayEffect(i.$elt,i,e,r):u.GOM.thumbnails2Display.push({itm:i,d:r}))}i.$elt.css({opacity:1}),B(i)}