functionmobileBrowser(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?!0:!1}functiongup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");vart="[\\?&]"+e+"=([^&#]*)",n=newRegExp(t),o=n.exec(window.location.href);returnnull===o?"":o[1]}!function(e,t){"object"==typeofmodule&&"object"==typeofmodule.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)thrownewError("jQuery requires a window with a document");returnt(e)}:t(e)}("undefined"!=typeofwindow?window:this,function(e,t){functionn(e){vart=e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeoft&&t>0&&t-1ine}functiono(e,t,n){if(J.isFunction(t))returnJ.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)returnJ.grep(e,function(e){returne===t!==n});if("string"==typeoft){if(st.test(t))returnJ.filter(t,e,n);t=J.filter(t,e)}returnJ.grep(e,function(e){returnz.call(t,e)>=0!==n})}functioni(e,t){for(;(e=e[t])&&1!==e.nodeType;);returne}functiona(e){vart=ft[e]={};returnJ.each(e.match(ht)||[],function(e,n){t[n]=!0}),t}functionr(){Q.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!1),J.ready()}functions(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+Math.random()}functionl(e,t,n){varo;if(void0===n&&1===e.nodeType)if(o="data-"+t.replace(wt,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeofn){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:yt.test(n)?J.parseJSON(n):n}catch(i){}vt.set(e,t,n)}elsen=void0;returnn}functionu(){return!0}functionc(){return!1}functiond(){try{returnQ.activeElement}catch(e){}}functionp(e,t){returnJ.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}functionh(e){returne.type=(null!==e.getAttribute("type"))+"/"+e.type,e}functionf(e){vart=Lt.exec(e.type);returnt?e.type=t[1]:e.removeAttribute("type"),e}functionm(e,t){for(varn=0,o=e.length;o>n;n++)bt.set(e[n],"globalEval",!t||bt.get(t[n],"globalEval"))}functiong(e,t){varn,o,i,a,r,s,l,u;if(1===t.nodeType){if(bt.hasData(e)&&(a=bt.access(e),r=bt.set(t,a),u=a.events)){deleter.handle,r.events={};for(iinu)for(n=0,o=u[i].length;o>n;n++)J.event.add(t,i,u[i][n])}vt.hasData(e)&&(s=vt.access(e),l=J.extend({},s),vt.set(t,l))}}functionb(e,t){varn=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];returnvoid0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}functionv(e,t){varn=t.nodeName.toLowerCase();"input"===n&&jt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}functiony(t,n){varo,i=J(n.createElement(t)).appendTo(n.body),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");returni.detach(),a}functionw(e){vart=Q,n=Ht[e];returnn||(n=y(e,t),"none"!==n&&n||(qt=(qt||J("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=qt[0].contentDocument,t.write(),t.close(),n=y(e,t),qt.detach()),Ht[e]=n),n}functionx(e,t,n){varo,i,a,r,s=e.style;returnn=n||Ut(e),n&&(r=n.getPropertyValue(t)||n[t]),n&&(""!==r||J.contains(e.ownerDocument,e)||(r=J.style(e,t)),Ft.test(r)&&Bt.test(t)&&(o=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=r,r=n.width,s.width=o,s.minWidth=i,s.maxWidth=a)),void0!==r?r+"":r}functionT(e,t){return{get:function(){returne()?voiddeletethis.get:(this.get=t).apply(this,arguments)}}}functionC(e,t){if(tine)returnt;for(varn=t[0].toUpperCase()+t.slice(1),o=t,i=Vt.length;i--;)if(t=Vt[i]+n,tine)returnt;returno}functionj(e,t,n){varo=Xt.exec(t);returno?Math.max(0,o[1]-(n||0))+(o[2]||"px"):t}functionk(e,t,n,o,i){for(vara=n===(o?"border":"content")?4:"width"===t?1:0,r=0;4>a;a+=2)"margin"===n&&(r+=J.css(e,n+Tt[a],!0,i)),o?("content"===n&&(r-=J.css(e,"padding"+Tt[a],!0,i)),"margin"!==n&&(r-=J.css(e,"border"+Tt[a]+"Width",!0,i))):(r+=J.css(e,"padding"+Tt[a],!0
},multiselect.getSelection=function(e){vart,n,o=150,i=[],a=multiselect.getSize();returnvisible.contextMenu()?!1:visible.multiselect()?($(".photo, .album").each(function(){n=$(this).offset(),n.top>=a.top-o&&n.left>=a.left-o&&n.top+206<=a.top+a.height+o&&n.left+206<=a.left+a.width+o&&(t=$(this).data("id"),"0"!==t&&0!==t&&"f"!==t&&"s"!==t&&"r"!==t&&null!==t&&void0!==t&&(i.push(t),$(this).addClass("active")))}),void(0!==i.length&&visible.album()?contextMenu.photoMulti(i,e):0!==i.length&&visible.albums()?contextMenu.albumMulti(i,e):multiselect.close())):!1},multiselect.close=function(){multiselect.stopResize(),multiselect.position.top=null,multiselect.position.right=null,multiselect.position.bottom=null,multiselect.position.left=null,lychee.animate("#multiselect","fadeOut"),setTimeout(function(){$("#multiselect").remove()},300)},password={value:""},password.get=function(e,t){varn,o=$(".message input.text").val();lychee.publicMode?album.json&&0==album.json.password?t():albums.json&&0==albums.json.content[e].password?t():albums.json||album.json?void0==o?password.getDialog(e,t):(n="checkAlbumAccess&albumID="+e+"&password="+md5(o),lychee.api(n,function(e){e===!0?(password.value=md5(o),t()):(lychee.goto(""),loadingBar.show("error","Access denied. Wrong password!"))})):(album.json={password:!0},t("")):t()},password.getDialog=function(e,t){varn;n=[["Enter",function(){password.get(e,t)}],["Cancel",lychee.goto]],modal.show("<a class='icon-lock'></a> Enter Password","This album is protected by a password. Enter the password below to view the photos of this album: <input class='text' type='password' placeholder='password' value=''>",n,-110,!1)},photo={json:null,cache:null},photo.getID=function(){vare;returne=photo.json?photo.json.id:$(".photo:hover, .photo.active").attr("data-id"),e?e:!1},photo.load=function(e,t){varn,o;n="getPhoto&photoID="+e+"&albumID="+t+"&password="+password.value,lychee.api(n,function(n){return"Warning: Wrong password!"===n?(o=function(){""!==password.value?photo.load(e,t):setTimeout(o,250)},o(),!1):(photo.json=n,visible.photo()||view.photo.show(),view.photo.init(),lychee.imageview.show(),voidsetTimeout(function(){lychee.content.show()},300))})},photo.preloadNext=function(e){vart,n;returnmobileBrowser()?!1:void(album.json&&album.json.content&&album.json.content[e]&&""!=album.json.content[e].nextPhoto&&(t=album.json.content[e].nextPhoto,n=album.json.content[t].url,photo.cache=newImage,photo.cache.src=n,photo.cache.onload=function(){photo.cache=null}))},photo.parse=function(){photo.json.title||(photo.json.title="Untitled")},photo.previous=function(e){vart=0;photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].previousPhoto&&(e===!0&&(t=200,$("#image").css({WebkitTransform:"translateX(100%)",MozTransform:"translateX(100%)",transform:"translateX(100%)",opacity:0})),setTimeout(function(){returnphoto.getID()===!1?!1:voidlychee.goto(album.getID()+"/"+album.json.content[photo.getID()].previousPhoto)},t))},photo.next=function(e){vart=0;photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].nextPhoto&&(e===!0&&(t=200,$("#image").css({WebkitTransform:"translateX(-100%)",MozTransform:"translateX(-100%)",transform:"translateX(-100%)",opacity:0})),setTimeout(function(){returnphoto.getID()===!1?!1:voidlychee.goto(album.getID()+"/"+album.json.content[photo.getID()].nextPhoto)},t))},photo.duplicate=function(e){vart;returne?(einstanceofArray==!1&&(e=[e]),albums.refresh(),t="duplicatePhoto&photoIDs="+e,voidlychee.api(t,function(e){e!==!0?lychee.error(null,t,e):album.load(album.getID())})):!1},photo.delete=function(e){vart,n,o;returne?(einstanceofArray==!1&&(e=[e]),1===e.length&&(o=visible.photo()?photo.json.title:album.json.content[e].title,""===o&&(o="Untitled")),n=[["",function(){varn="",o="";e.forEach(function(e){(""!==album.json.content[e].nextPhoto||""!==album.json.content[e].previousPhoto)&&(n=album.json.content[e].nextPhoto,o=album.json.content[e].previousPhoto,album.json.content[o].nextPhoto=n,