PageSourceSearch

https://rmsothebys.com/sb/main-js.js.vf48fd05dcd29b386d30b5147adc29bc2fb73d1d1

js rmsothebys.com collected 2026-09-24 17:38:01 UTC 702,239 bytes, 3,788 lines download raw bytes

vendor: 45,315 bytes, lines 1-190
1(function(global,factory){if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document");}
2return factory(w);};}else{factory(global);}}(typeof window!=="undefined"?window:this,function(window,noGlobal){var arr=[];var document=window.document;var slice=arr.slice;var concat=arr.concat;var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var support={};var
3version="2.2.2",jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase();};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,selector:"",length:0,toArray:function(){return slice.call(this);},get:function(num){return num!=null?(num<0?this[num+this.length]:this[num]):slice.call(this);},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret;},each:function(callback){return jQuery.each(this,callback);},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},slice:function(){return this.pushStack(slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[]);},end:function(){return this.prevObject||this.constructor();},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++;}
4if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};}
5if(i===length){target=this;i--;}
6for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}
7if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&jQuery.isArray(src)?src:[];}else{clone=src&&jQuery.isPlainObject(src)?src:{};}
8target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}
9return target;};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function(msg){throw new Error(msg);},noop:function(){},isFunction:function(obj){return jQuery.type(obj)==="function";},isArray:Array.isArray,isWindow:function(obj){return obj!=null&&obj===obj.window;},isNumeric:function(obj){var realStringObj=obj&&obj.toString();return!jQuery.isArray(obj)&&(realStringObj-parseFloat(realStringObj)+1)>=0;},isPlainObject:function(obj){var key;if(jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false;}
10if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype||{},"isPrototypeOf")){return false;}
11for(key in obj){}
12return key===undefined||hasOwn.call(obj,key);},isEmptyObject:function(obj){var name;for(name in obj){return false;}
13return true;},type:function(obj){if(obj==null){return obj+"";}
14return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj;},globalEval:function(code){var script,indirect=eval;code=jQuery.trim(code);if(code){if(code.indexOf("use strict")===1){script=document.createElement("script");script.text=code;document.head.appendChild(script).parentNode.removeChild(script);}else{indirect(code);}}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();},each:function(obj,callback){var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i<length;i++){if(callback.call(obj[i],i,obj[i])===false){break;}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===false){break;}}}
15return obj;},trim:function(text){return text==null?"":(text+"").replace(rtrim,"");},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArrayLike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr);}else{push.call(ret,arr);}}
16return ret;},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i);},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j];}
17first.length=i;return first;},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i]);}}
18return matches;},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems)){length=elems.length;for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}
19return concat.apply([],ret);},guid:1,proxy:function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp;}
20if(!jQuery.isFunction(fn)){return undefined;}
21args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy;},now:Date.now,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator];}
22jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function isArrayLike(obj){var length=!!obj&&"length" in obj&&obj.length,type=jQuery.type(obj);if(type==="function"||jQuery.isWindow(obj)){return false;}
23return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj;}
24var Sizzle=(function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date(),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;}
25return 0;},MAX_NEGATIVE=1<<31,hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i;}}
26return-1;},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+identifier+")"),"CLASS":new RegExp("^\\.("+identifier+")"),"TAG":new RegExp("^("+identifier+"|[*])"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+
27whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},unloadHandler=function(){setDocument();};try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){}
28target.length=j-1;}};}
29function Sizzle(selector,context,results,seed){var m,i,elem,nid,nidselect,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results;}
30if(!seed){if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context);}
31context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}}
32if(support.qsa&&!compilerCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(nodeType!==1){newContext=context;newSelector=selector;}else if(context.nodeName.toLowerCase()!=="object"){if((nid=context.getAttribute("id"))){nid=nid.replace(rescape,"\\$&");}else{context.setAttribute("id",(nid=expando));}
33groups=tokenize(selector);i=groups.length;nidselect=ridentifier.test(nid)?"#"+nid:"[id='"+nid+"']";while(i--){groups[i]=nidselect+" "+toSelector(groups[i]);}
34newSelector=groups.join(",");newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;}
35if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){}finally{if(nid===expando){context.removeAttribute("id");}}}}}}
36return select(selector.replace(rtrim,"$1"),context,results,seed);}
37function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];}
38return(cache[key+" "]=value);}
39return cache;}
40function markFunction(fn){fn[expando]=true;return fn;}
41function assert(fn){var div=document.createElement("div");try{return!!fn(div);}catch(e){return false;}finally{if(div.parentNode){div.parentNode.removeChild(div);}
42div=null;}}
43function addHandle(attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler;}}
44function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)-
45(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff;}
46if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}}
47return a?1:-1;}
48function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};}
49function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};}
50function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});}
51function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;}
52support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};setDocument=Sizzle.setDocument=function(node){var hasCompare,parent,doc=node?node.ownerDocument||node:preferredDoc;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document;}
53document=doc;docElem=document.documentElement;documentIsHTML=!isXML(document);if((parent=document.defaultView)&&parent.top!==parent){if(parent.addEventListener){parent.addEventListener("unload",unloadHandler,false);}else if(parent.attachEvent){parent.attachEvent("onunload",unloadHandler);}}
54support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className");});support.getElementsByTagName=assert(function(div){div.appendChild(document.createComment(""));return!div.getElementsByTagName("*").length;});support.getElementsByClassName=rnative.test(document.getElementsByClassName);support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length;});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var m=context.getElementById(id);return m?[m]:[];}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId;};};}
55Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else if(support.qsa){return context.querySelectorAll(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}}
56return tmp;}
57return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(document.querySelectorAll))){assert(function(div){docElem.appendChild(div).innerHTML="<a id='"+expando+"'></a>"+"<select id='"+expando+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(div.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");}
58if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");}
59if(!div.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");}
60if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");}
61if(!div.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}});assert(function(div){var input=document.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("name","D");if(div.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=");}
62if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled");}
63div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});}
64if((support.matchesSelector=rnative.test((matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});}
65rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}}
66return false;};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0;}
67var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;}
68compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)){return-1;}
69if(b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)){return 1;}
70return sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}
71return compare&4?-1:1;}:function(a,b){if(a===b){hasDuplicate=true;return 0;}
72var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);}
73cur=a;while((cur=cur.parentNode)){ap.unshift(cur);}
74cur=b;while((cur=cur.parentNode)){bp.unshift(cur);}
75while(ap[i]===bp[i]){i++;}
76return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0;};return document;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem);}
77expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&!compilerCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){}}
78return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context);}
79return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem);}
80var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null;};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}}
81while(j--){results.splice(duplicates[j],1);}}
82sortInput=null;return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;}
83return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";}
84return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);}
85match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){Sizzle.error(match[0]);}
86return match;},"PSEUDO":function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;}
87if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);}
88return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";}
89if(!operator){return true;}
90result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}}
91start=dir=type==="only"&&!start&&"nextSibling";}
92return true;}
93start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;}
94if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff];}
95if(node===elem){break;}}}}}
96diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);}
97if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};}
98return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);}
99lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":function(elem){return elem.disabled===false;},"disabled":function(elem){return elem.disabled===true;},"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;}
100return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}}
101return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text");},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i);}
102return matchIndexes;}),"odd":createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i);}
103return matchIndexes;}),"lt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;--i>=0;){matchIndexes.push(i);}
104return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i);}
105return matchIndexes;})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i);}
106for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i);}
107function setFilters(){}
108setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0);}
109soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar;}
110groups.push((tokens=[]));}
111matched=false;if((match=rcombinators.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length);}
112for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length);}}
113if(!matched){break;}}
114return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0);};function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value;}
115return selector;}
116function addCombinator(matcher,combinator,base){var dir=combinator.dir,checkNonElements=base&&dir==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml);}}}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true;}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={});if((oldCache=uniqueCache[dir])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return(newCache[2]=oldCache[2]);}else{uniqueCache[dir]=newCache;if((newCache[2]=matcher(elem,context,xml))){return true;}}}}}};}
117function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}}
118return true;}:matchers[0];}
119function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results);}
120return results;}
121function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i);}}}}
122return newUnmatched;}
123function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter);}
124if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector);}
125return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml);}
126if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem);}}}
127if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem));}}
128postFinder(null,(matcherOut=[]),temp,xml);}
129i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});}
130function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret;}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)];}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break;}}
131return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens));}
132matchers.push(matcher);}}
133return elementMatcher(matchers);}
134function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context===document||context||outermost;}
135for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!==document){setDocument(elem);xml=!documentIsHTML;}
136while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){results.push(elem);break;}}
137if(outermost){dirruns=dirrunsUnique;}}
138if(bySet){if((elem=!matcher&&elem)){matchedCount--;}
139if(seed){unmatched.push(elem);}}}
140matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);}
141if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}}
142setMatched=condense(setMatched);}
143push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}}
144if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;}
145return unmatched;};return bySet?markFunction(superMatcher):superMatcher;}
146compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);}
147i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}}
148cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;}
149return cached;};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}else if(compiled){context=context.parentNode;}
150selector=selector.slice(tokens.shift().value.length);}
151i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;}
152if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;}
153break;}}}}
154(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context);return results;};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1;});if(!assert(function(div){div.innerHTML="<a href='#'></a>";return div.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});}
155if(!support.attributes||!assert(function(div){div.innerHTML="<input/>";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});}
156if(!assert(function(div){return div.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null;}});}
157return Sizzle;})(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break;}
158matched.push(elem);}}
159return matched;};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n);}}
160return matched;};var rneedsContext=jQuery.expr.match.needsContext;var rsingleTag=(/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/);var risSimple=/^.[^:#\[\.,]*$/;function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}
161if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});}
162if(typeof qualifier==="string"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);}
163qualifier=jQuery.filter(qualifier,elements);}
164return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});}
165jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";}
166return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));};jQuery.fn.extend({find:function(selector){var i,len=this.length,ret=[],self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true;}}}));}
167for(i=0;i<len;i++){jQuery.find(selector,self[i],ret);}
168ret=this.pushStack(len>1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;}
169root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);}
170if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}}
171return this;}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){this.length=1;this[0]=elem;}
172this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||root).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}else if(jQuery.isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);}
173if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;}
174return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],pos=rneedsContext.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(pos?pos.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break;}}}
175return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;}
176if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);}
177return indexOf.call(this,elem.jquery?elem[0]:elem);},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}
178return cur;}
179jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return dir(elem,"nextSibling");},prevAll:function(elem){return dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until);},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem);},children:function(elem){return siblings(elem.firstChild);},contents:function(elem){return elem.contentDocument||jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;}
180if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);}
181if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);}
182if(rparentsprev.test(name)){matched.reverse();}}
183return this.pushStack(matched);};});var rnotwhite=(/\S+/g);function createOptions(options){var object={};jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=true;});return object;}
184jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var
185firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1])===false&&options.stopOnFalse){firingIndex=list.length;memory=false;}}}
186if(!options.memory){memory=false;}
187firing=false;if(locked){if(memory){list=[];}else{list="";}}},self={add:function(){if(list){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory);}
188(function add(args){jQuery.each(args,function(_,arg){if(jQuery.isFunction(arg)){if(!options.unique||!self.has(arg)){list.push(arg);}}else if(arg&&arg.length&&jQuery.type(arg)!=="string"){add(arg);}});})(arguments);if(memory&&!firing){fire();}}
189return this;},remove:function(){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(index<=firingIndex){firingIndex--;}}});return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0;},empty:function(){if(list){list=[];}
190return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];
190if(!memory){list=memory="";}
191return this;},locked:function(){return!!locked;},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire();}}
192return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);}else{newDefer[tuple[0]+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments);}});});fns=null;}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};promise.pipe=promise.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[i^1][2].disable,tuples[2][2].lock);}
193deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?promise:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);}
194return deferred;},when:function(subordinate){var i=0,resolveValues=slice.call(arguments),length=resolveValues.length,remaining=length!==1||(subordinate&&jQuery.isFunction(subordinate.promise))?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values);}else if(!(--remaining)){deferred.resolveWith(contexts,values);}};},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i<length;i++){if(resolveValues[i]&&jQuery.isFunction(resolveValues[i].promise)){resolveValues[i].promise().progress(updateFunc(i,progressContexts,progressValues)).done(updateFunc(i,resolveContexts,resolveValues)).fail(deferred.reject);}else{--remaining;}}}
195if(!remaining){deferred.resolveWith(resolveContexts,resolveValues);}
196return deferred.promise();}});var readyList;jQuery.fn.ready=function(fn){jQuery.ready.promise().done(fn);return this;};jQuery.extend({isReady:false,readyWait:1,holdReady:function(hold){if(hold){jQuery.readyWait++;}else{jQuery.ready(true);}},ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;}
197jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;}
198readyList.resolveWith(document,[jQuery]);if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");jQuery(document).off("ready");}}});function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();}
199jQuery.ready.promise=function(obj){if(!readyList){readyList=jQuery.Deferred();if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);}}
200return readyList.promise(obj);};jQuery.ready.promise();var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true;}
201if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;
201fn=function(elem,key,value){return bulk.call(jQuery(elem),value);};}}
202if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));}}}
203return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet;};var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!(+owner.nodeType);};function Data(){this.expando=jQuery.expando+Data.uid++;}
204Data.uid=1;Data.prototype={register:function(owner,initial){var value=initial||{};if(owner.nodeType){owner[this.expando]=value;}else{Object.defineProperty(owner,this.expando,{value:value,writable:true,configurable:true});}
205return owner[this.expando];},cache:function(owner){if(!acceptData(owner)){return{};}
206var value=owner[this.expando];if(!value){value={};if(acceptData(owner)){if(owner.nodeType){owner[this.expando]=value;}else{Object.defineProperty(owner,this.expando,{value:value,configurable:true});}}}
207return value;},set:function(owner,data,value){var prop,cache=this.cache(owner);if(typeof data==="string"){cache[data]=value;}else{for(prop in data){cache[prop]=data[prop];}}
208return cache;},get:function(owner,key){return key===undefined?this.cache(owner):owner[this.expando]&&owner[this.expando][key];},access:function(owner,key,value){var stored;if(key===undefined||((key&&typeof key==="string")&&value===undefined)){stored=this.get(owner,key);return stored!==undefined?stored:this.get(owner,jQuery.camelCase(key));}
209this.set(owner,key,value);return value!==undefined?value:key;},remove:function(owner,key){var i,name,camel,cache=owner[this.expando];if(cache===undefined){return;}
210if(key===undefined){this.register(owner);}else{if(jQuery.isArray(key)){name=key.concat(key.map(jQuery.camelCase));}else{camel=jQuery.camelCase(key);if(key in cache){name=[key,camel];}else{name=camel;name=name in cache?[name]:(name.match(rnotwhite)||[]);}}
211i=name.length;while(i--){delete cache[name[i]];}}
212if(key===undefined||jQuery.isEmptyObject(cache)){if(owner.nodeType){owner[this.expando]=undefined;}else{delete owner[this.expando];}}},hasData:function(owner){var cache=owner[this.expando];return cache!==undefined&&!jQuery.isEmptyObject(cache);}};var dataPriv=new Data();var dataUser=new Data();var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data;}catch(e){}
213dataUser.set(elem,key,data);}else{data=undefined;}}
214return data;}
215jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem);},data:function(elem,name,data){return dataUser.access(elem,name,data);},removeData:function(elem,name){dataUser.remove(elem,name);},_data:function(elem,name,data){return dataPriv.access(elem,name,data);},_removeData:function(elem,name){dataPriv.remove(elem,name);}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem);if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.slice(5));dataAttr(elem,name,data[name]);}}}
216dataPriv.set(elem,"hasDataAttrs",true);}}
217return data;}
218if(typeof key==="object"){return this.each(function(){dataUser.set(this,key);});}
219return access(this,function(value){var data,camelKey;if(elem&&value===undefined){data=dataUser.get(elem,key)||dataUser.get(elem,key.replace(rmultiDash,"-$&").toLowerCase());if(data!==undefined){return data;}
220camelKey=jQuery.camelCase(key);data=dataUser.get(elem,camelKey);if(data!==undefined){return data;}
221data=dataAttr(elem,camelKey,undefined);if(data!==undefined){return data;}
222return;}
223camelKey=jQuery.camelCase(key);this.each(function(){var data=dataUser.get(this,camelKey);dataUser.set(this,camelKey,value);if(key.indexOf("-")>
vendor: 8,281 bytes, lines 223-261
223-1&&data!==undefined){dataUser.set(this,key,value);}});},null,value,arguments.length>1,null,true);},removeData:function(key){return this.each(function(){dataUser.remove(this,key);});}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data));}else{queue.push(data);}}
224return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;}
225if(fn){if(type==="fx"){queue.unshift("inprogress");}
226delete hooks.stop;fn.call(elem,next,hooks);}
227if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key]);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;}
228if(arguments.length<setter){return jQuery.queue(this[0],type);}
229return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements]);}};if(typeof type!=="string"){obj=type;type=undefined;}
230type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}}
231resolve();return defer.promise(obj);}});var pnum=(/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right","Bottom","Left"];var isHidden=function(elem,el){elem=el||elem;return jQuery.css(elem,"display")==="none"||!jQuery.contains(elem.ownerDocument,elem);};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale=1,maxIterations=20,currentValue=tween?function(){return tween.cur();}:function(){return jQuery.css(elem,prop,"");},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=(jQuery.cssNumber[prop]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){unit=unit||initialInUnit[3];valueParts=valueParts||[];initialInUnit=+initial||1;do{scale=scale||".5";initialInUnit=initialInUnit/scale;jQuery.style(elem,prop,initialInUnit+unit);}while(scale!==(scale=currentValue()/initial)&&scale!==1&&--maxIterations);}
232if(valueParts){initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;tween.end=adjusted;}}
233return adjusted;}
234var rcheckableType=(/^(?:checkbox|radio)$/i);var rtagName=(/<([\w:-]+)/);var rscriptType=(/^$|\/(?:java|ecma)script/i);var wrapMap={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function getAll(context,tag){var ret=typeof context.getElementsByTagName!=="undefined"?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!=="undefined"?context.querySelectorAll(tag||"*"):[];return tag===undefined||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret;}
235function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"));}}
236var rhtml=/<|&#?\w+;/;function buildFragment(elems,context,scripts,selection,ignored){var elem,tmp,tag,wrap,contains,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(jQuery.type(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem);}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem));}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild;}
237jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent="";}}}
238fragment.textContent="";i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem);}
239continue;}
240contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(fragment.appendChild(elem),"script");if(contains){setGlobalEval(tmp);}
241if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}}
242return fragment;}
243(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue;})();var
244rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;}
245function returnFalse(){return false;}
246function safeActiveElement(){try{return document.activeElement;}catch(err){}}
247function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;}
248for(type in types){on(elem,type,selector,data,types[type],one);}
249return elem;}
250if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}}
251if(fn===false){fn=returnFalse;}else if(!fn){return elem;}
252if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);}
253return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});}
254jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!elemData){return;}
255if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;}
256if(!handler.guid){handler.guid=jQuery.guid++;}
257if(!(events=elemData.events)){events=elemData.events={};}
258if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};}
259types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;}
260special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}}
261if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}
261
262if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);}
263jQuery.event.global[type]=true;}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return;}
264types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);}
265continue;}
266special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;}
267if(special.remove){special.remove.call(elem,handleObj);}}}
268if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);}
269delete events[type];}}
270if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events");}},dispatch:function(event){event=jQuery.event.fix(event);var i,j,ret,matched,handleObj,handlerQueue=[],args=slice.call(arguments),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;}
271handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.rnamespace||event.rnamespace.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}}
272if(special.postDispatch){special.postDispatch.call(this,event);}
273return event.result;},handlers:function(event,handlers){var i,matches,sel,handleObj,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(event.type!=="click"||isNaN(event.button)||event.button<1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&(cur.disabled!==true||event.type!=="click")){matches=[];for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matches[sel]===undefined){matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length;}
274if(matches[sel]){matches.push(handleObj);}}
275if(matches.length){handlerQueue.push({elem:cur,handlers:matches});}}}}
276if(delegateCount<handlers.length){handlerQueue.push({elem:this,handlers:handlers.slice(delegateCount)});}
277return handlerQueue;},props:("altKey bubbles cancelable ctrlKey currentTarget detail eventPhase "+"metaKey relatedTarget shiftKey target timeStamp view which").split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(event,original){if(event.which==null){event.which=original.charCode!=null?original.charCode:original.keyCode;}
278return event;}},mouseHooks:{props:("button buttons clientX clientY offsetX offsetY pageX pageY "+"screenX screenY toElement").split(" "),filter:function(event,original){var eventDoc,doc,body,button=original.button;if(event.pageX==null&&original.clientX!=null){eventDoc=event.target.ownerDocument||document;doc=eventDoc.documentElement;body=eventDoc.body;event.pageX=original.clientX+
279(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-
280(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=original.clientY+
281(doc&&doc.scrollTop||body&&body.scrollTop||0)-
282(doc&&doc.clientTop||body&&body.clientTop||0);}
283if(!event.which&&button!==undefined){event.which=(button&1?1:(button&2?3:(button&4?2:0)));}
284return event;}},fix:function(event){if(event[jQuery.expando]){return event;}
285var i,prop,copy,type=event.type,originalEvent=event,fixHook=this.fixHooks[type];if(!fixHook){this.fixHooks[type]=fixHook=rmouseEvent.test(type)?this.mouseHooks:rkeyEvent.test(type)?this.keyHooks:{};}
286copy=fixHook.props?this.props.concat(fixHook.props):this.props;event=new jQuery.Event(originalEvent);i=copy.length;while(i--){prop=copy[i];event[prop]=originalEvent[prop];}
287if(!event.target){event.target=document;}
288if(event.target.nodeType===3){event.target=event.target.parentNode;}
289return fixHook.filter?fixHook.filter(event,originalEvent):event;},special:{load:{noBubble:true},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus){this.focus();return false;}},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur){this.blur();return false;}},delegateType:"focusout"},click:{trigger:function(){if(this.type==="checkbox"&&this.click&&jQuery.nodeName(this,"input")){this.click();return false;}},_default:function(event){return jQuery.nodeName(event.target,"a");}},beforeunload:{postDispatch:function(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result;}}}}};jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle);}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props);}
290if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse;}else{this.type=src;}
291if(props){jQuery.extend(this,props);}
292this.timeStamp=src&&src.timeStamp||jQuery.now();this[jQuery.expando]=true;};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e){e.preventDefault();}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e){e.stopPropagation();}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e){e.stopImmediatePropagation();}
293this.stopPropagation();}};
vendor: 8,336 bytes, lines 293-328
293jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix;}
294return ret;}};});jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn);},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1);},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this;}
295if(typeof types==="object"){for(type in types){this.off(type,selector,types[type]);}
296return this;}
297if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;}
298if(fn===false){fn=returnFalse;}
299return this.each(function(){jQuery.event.remove(this,types,fn,selector);});}});var
300rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem;}
301function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;}
302function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1];}else{elem.removeAttribute("type");}
303return elem;}
304function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(dest.nodeType!==1){return;}
305if(dataPriv.hasData(src)){pdataOld=dataPriv.access(src);pdataCur=dataPriv.set(dest,pdataOld);events=pdataOld.events;if(events){delete pdataCur.handle;pdataCur.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i]);}}}}
306if(dataUser.hasData(src)){udataOld=dataUser.access(src);udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur);}}
307function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked;}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue;}}
308function domManip(collection,args,callback,ignored){args=concat.apply([],args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||(l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(isFunction){args[0]=value.call(this,index,self.html());}
309domManip(self,args,callback,ignored);});}
310if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;}
311if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"));}}
312callback.call(collection[i],node,i);}
313if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src){if(jQuery._evalUrl){jQuery._evalUrl(node.src);}}else{jQuery.globalEval(node.textContent.replace(rcleanScript,""));}}}}}}
314return collection;}
315function remove(elem,selector,keepData){var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;for(;(node=nodes[i])!=null;i++){if(!keepData&&node.nodeType===1){jQuery.cleanData(getAll(node));}
316if(node.parentNode){if(keepData&&jQuery.contains(node.ownerDocument,node)){setGlobalEval(getAll(node,"script"));}
317node.parentNode.removeChild(node);}}
318return elem;}
319jQuery.extend({htmlPrefilter:function(html){return html.replace(rxhtmlTag,"<$1></$2>");},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=jQuery.contains(elem.ownerDocument,elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i]);}}
320if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i]);}}else{cloneCopyEvent(elem,clone);}}
321destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));}
322return clone;},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}}
323elem[dataPriv.expando]=undefined;}
324if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({domManip:domManip,detach:function(selector){return remove(this,selector,true);},remove:function(selector){return remove(this,selector);},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value;}});},null,value,arguments.length);},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent="";}}
325return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML;}
326if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value;}}
327elem=0;}catch(e){}}
328if(elem){this.empty().append(value);}},null,value,arguments.length);},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;if(jQuery.inArray(this,ignored)<0){jQuery.cleanData(getAll(this));if(parent){parent.replaceChild(elem,this);}}},ignored);}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);
328push.apply(ret,elems.get());}
329return this.pushStack(ret);};});var iframe,elemdisplay={HTML:"block",BODY:"block"};function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");elem.detach();return display;}
330function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];if(!display){display=actualDisplay(nodeName,doc);if(display==="none"||!display){iframe=(iframe||jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);doc=iframe[0].contentDocument;doc.write();doc.close();display=actualDisplay(nodeName,doc);iframe.detach();}
331elemdisplay[nodeName]=display;}
332return display;}
333var rmargin=(/^margin/);var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window;}
334return view.getComputedStyle(elem);};var swap=function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
335ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name];}
336return ret;};var documentElement=document.documentElement;(function(){var pixelPositionVal,boxSizingReliableVal,pixelMarginRightVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return;}
337div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";container.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;"+"padding:0;margin-top:1px;position:absolute";container.appendChild(div);function computeStyleTests(){div.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;"+"position:relative;display:block;"+"margin:auto;border:1px;padding:1px;"+"top:1%;width:50%";div.innerHTML="";documentElement.appendChild(container);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=divStyle.marginLeft==="2px";boxSizingReliableVal=divStyle.width==="4px";div.style.marginRight="50%";pixelMarginRightVal=divStyle.marginRight==="4px";documentElement.removeChild(container);}
338jQuery.extend(support,{pixelPosition:function(){computeStyleTests();return pixelPositionVal;},boxSizingReliable:function(){if(boxSizingReliableVal==null){computeStyleTests();}
339return boxSizingReliableVal;},pixelMarginRight:function(){if(boxSizingReliableVal==null){computeStyleTests();}
340return pixelMarginRightVal;},reliableMarginLeft:function(){if(boxSizingReliableVal==null){computeStyleTests();}
341return reliableMarginLeftVal;},reliableMarginRight:function(){var ret,marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;"+"display:block;margin:0;border:0;padding:0";marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";documentElement.appendChild(container);ret=!parseFloat(window.getComputedStyle(marginDiv).marginRight);documentElement.removeChild(container);div.removeChild(marginDiv);return ret;}});})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;computed=computed||getStyles(elem);ret=computed?computed.getPropertyValue(name)||computed[name]:undefined;if((ret===""||ret===undefined)&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name);}
342if(computed){if(!support.pixelMarginRight()&&rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}}
343return ret!==undefined?ret+"":ret;}
344function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return;}
345return(this.get=hookFn).apply(this,arguments);}};}
346var
347rdisplayswap=/^(none|table(?!-c[ea]).+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","O","Moz","ms"],emptyStyle=document.createElement("div").style;function vendorPropName(name){if(name in emptyStyle){return name;}
348var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}
349function setPositiveNumber(elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value;}
350function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,
350styles);}
351if(isBorderBox){if(extra==="content"){val-=jQuery.css(elem,"padding"+cssExpand[i],true,styles);}
352if(extra!=="margin"){val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{val+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(extra!=="padding"){val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}}
353return val;}
354function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=true,val=name==="width"?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";if(document.msFullscreenElement&&window.top!==window){if(elem.getClientRects().length){val=Math.round(elem.getBoundingClientRect()[name]*100);}}
355if(val<=0||val==null){val=curCSS(elem,name,styles);if(val<0||val==null){val=elem.style[name];}
356if(rnumnonpx.test(val)){return val;}
357valueIsBorderBox=isBorderBox&&(support.boxSizingReliable()||val===elem.style[name]);val=parseFloat(val)||0;}
358return(val+
359augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles))+"px";}
360function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue;}
361values[index]=dataPriv.get(elem,"olddisplay");display=elem.style.display;if(show){if(!values[index]&&display==="none"){elem.style.display="";}
362if(elem.style.display===""&&isHidden(elem)){values[index]=dataPriv.access(elem,"olddisplay",defaultDisplay(elem.nodeName));}}else{hidden=isHidden(elem);if(display!=="none"||!hidden){dataPriv.set(elem,"olddisplay",hidden?display:jQuery.css(elem,"display"));}}}
363for(index=0;index<length;index++){elem=elements[index];if(!elem.style){continue;}
364if(!show||elem.style.display==="none"||elem.style.display===""){elem.style.display=show?values[index]||"":"none";}}
365return elements;}
366jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"animationIterationCount":true,"columnCount":true,"fillOpacity":true,"flexGrow":true,"flexShrink":true,"fontWeight":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":"cssFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;}
367var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(origName)||origName);hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){value=adjustCSS(elem,name,ret);type="number";}
368if(value==null||value!==value){return;}
369if(type==="number"){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px");}
370if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";}
371if(!hooks||!("set" in hooks)||(value=hooks.set(elem,value,extra))!==undefined){style[name]=value;}}else{if(hooks&&"get" in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;}
372return style[name];}},css:function(elem,name,extra,styles){var val,num,hooks,origName=jQuery.camelCase(name);name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(origName)||origName);hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get" in hooks){val=hooks.get(elem,true,extra);}
373if(val===undefined){val=curCSS(elem,name,styles);}
374if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];}
375if(extra===""||extra){num=parseFloat(val);return extra===true||isFinite(num)?num||0:val;}
376return val;}});jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&elem.offsetWidth===0?swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra);}):getWidthOrHeight(elem,name,extra);}},set:function(elem,value,extra){var matches,styles=extra&&getStyles(elem),subtract=extra&&augmentWidthOrHeight(elem,name,extra,jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles);if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[name]=value;value=jQuery.css(elem,name);}
377return setPositiveNumber(elem,value,subtract);}};});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-
378swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left;}))+"px";}});jQuery.cssHooks.marginRight=addGetHookIf(support.reliableMarginRight,function(elem,computed){if(computed){return swap(elem,{"display":"inline-block"},curCSS,[elem,"marginRight"]);}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];}
379return expanded;}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(jQuery.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles);}
380return map;}
381return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name);},name,value,arguments.length>1);},show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();}
382return this.each(function(){if(isHidden(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);}
383jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;}
384this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);}
385if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);}
386return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop];}
387result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;}
387,set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.nodeType===1&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var
388fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=jQuery.now());}
389function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;}
390if(includeWidth){attrs.opacity=attrs.width=type;}
391return attrs;}
392function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween;}}}
393function defaultPrefilter(elem,props,opts){var prop,value,toggle,tween,hooks,oldfire,display,checkDisplay,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHidden(elem),dataShow=dataPriv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire();}};}
394hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire();}});});}
395if(elem.nodeType===1&&("height" in props||"width" in props)){opts.overflow=[style.overflow,style.overflowX,style.overflowY];display=jQuery.css(elem,"display");checkDisplay=display==="none"?dataPriv.get(elem,"olddisplay")||defaultDisplay(elem.nodeName):display;if(checkDisplay==="inline"&&jQuery.css(elem,"float")==="none"){style.display="inline-block";}}
396if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2];});}
397for(prop in props){value=props[prop];if(rfxtypes.exec(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true;}else{continue;}}
398orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop);}else{display=undefined;}}
399if(!jQuery.isEmptyObject(orig)){if(dataShow){if("hidden" in dataShow){hidden=dataShow.hidden;}}else{dataShow=dataPriv.access(elem,"fxshow",{});}
400if(toggle){dataShow.hidden=!hidden;}
401if(hidden){jQuery(elem).show();}else{anim.done(function(){jQuery(elem).hide();});}
402anim.done(function(){var prop;dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop]);}});for(prop in orig){tween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=tween.start;if(hidden){tween.end=tween.start;tween.start=prop==="width"||prop==="height"?1:0;}}}}else if((display==="none"?defaultDisplay(elem.nodeName):display)==="inline"){style.display=display;}}
403function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=jQuery.camelCase(index);
vendor: 4,596 bytes, lines 403-418
403easing=specialEasing[name];value=props[index];if(jQuery.isArray(value)){easing=value[1];value=props[index]=value[0];}
404if(index!==name){props[name]=value;delete props[index];}
405hooks=jQuery.cssHooks[name];if(hooks&&"expand" in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing;}}}else{specialEasing[name]=easing;}}}
406function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem;}),tick=function(){if(stopped){return false;}
407var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent);}
408deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining;}else{deferred.resolveWith(elem,[animation]);return false;}},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween;},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this;}
409stopped=true;for(;index<length;index++){animation.tweens[index].run(1);}
410if(gotoEnd){deferred.notifyWith(elem,[animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd]);}else{deferred.rejectWith(elem,[animation,gotoEnd]);}
411return this;}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=Animation.prefilters[index].call(animation,elem,props,animation.opts);if(result){if(jQuery.isFunction(result.stop)){jQuery._queueHooks(animation.elem,animation.opts.queue).stop=jQuery.proxy(result.stop,result);}
412return result;}}
413jQuery.map(props,createTween,animation);if(jQuery.isFunction(animation.opts.start)){animation.opts.start.call(elem,animation);}
414jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);}
415jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);adjustCSS(tween.elem,prop,rcssNum.exec(value),tween);return tween;}]},tweener:function(props,callback){if(jQuery.isFunction(props)){callback=props;props=["*"];}else{props=props.match(rnotwhite);}
416var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];Animation.tweeners[prop]=Animation.tweeners[prop]||[];Animation.tweeners[prop].unshift(callback);}},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){if(prepend){Animation.prefilters.unshift(callback);}else{Animation.prefilters.push(callback);}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default;if(opt.queue==null||opt.queue===true){opt.queue="fx";}
417opt.old=opt.complete;opt.complete=function(){if(jQuery.isFunction(opt.old)){opt.old.call(this);}
418if(opt.queue){jQuery.dequeue(this,opt.queue);}};return opt;};jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHidden).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback);},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||dataPriv.get(this,"finish")){anim.stop(true);}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation);},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd);};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;
vendor: 5,474 bytes, lines 418-440
418type=undefined;}
419if(clearQueue&&type!==false){this.queue(type||"fx",[]);}
420return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index]);}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index]);}}}
421for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1);}}
422if(dequeue||!gotoEnd){jQuery.dequeue(this,type);}});},finish:function(type){if(type!==false){type=type||"fx";}
423return this.each(function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true);}
424for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1);}}
425for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this);}}
426delete data.finish;});}});jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback);};});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback);};});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=jQuery.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1);}}
427if(!timers.length){jQuery.fx.stop();}
428fxNow=undefined;};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);if(timer()){jQuery.fx.start();}else{jQuery.timers.pop();}};jQuery.fx.interval=13;jQuery.fx.start=function(){if(!timerId){timerId=window.setInterval(jQuery.fx.tick,jQuery.fx.interval);}};jQuery.fx.stop=function(){window.clearInterval(timerId);timerId=null;};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout);};});};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;select.disabled=true;support.optDisabled=!opt.disabled;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t";})();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;}
429if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);}
430if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);}
431if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;}
432if(hooks&&"set" in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
433elem.setAttribute(name,value+"");return value;}
434if(hooks&&"get" in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
435ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;}
436return value;}}}},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(rnotwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){elem[propName]=false;}
437elem.removeAttribute(name);}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);}
438return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle;if(!isXML){handle=attrHandle[name];attrHandle[name]=ret;ret=getter(elem,name,isXML)!=null?name.toLowerCase():null;attrHandle[name]=handle;}
439return ret;};});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name];});}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;}
440if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}
vendor: 9,368 bytes, lines 441-481
441if(value!==undefined){if(hooks&&"set" in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
442return(elem[name]=value);}
443if(hooks&&"get" in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
444return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1;}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex;}
445return null;},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}};}
446jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});var rclass=/[\t\r\n\f]/g;function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";}
447jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});}
448if(typeof value==="string"&&value){classes=value.match(rnotwhite)||[];while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+curValue+" ").replace(rclass," ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" ";}}
449finalValue=jQuery.trim(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}}
450return this;},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});}
451if(!arguments.length){return this.attr("class","");}
452if(typeof value==="string"&&value){classes=value.match(rnotwhite)||[];while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+curValue+" ").replace(rclass," ");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>-1){cur=cur.replace(" "+clazz+" "," ");}}
453finalValue=jQuery.trim(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}}
454return this;},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value);}
455if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});}
456return this.each(function(){var className,i,self,classNames;if(type==="string"){i=0;self=jQuery(this);classNames=value.match(rnotwhite)||[];while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className);}
457if(this.setAttribute){this.setAttribute("class",className||value===false?"":dataPriv.get(this,"__className__")||"");}}});},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+getClass(elem)+" ").replace(rclass," ").indexOf(className)>-1){return true;}}
458return false;}});var rreturn=/\r/g,rspaces=/[\x20\t\r\n\f]+/g;jQuery.fn.extend({val:function(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get" in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;}
459ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;}
460return;}
461isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;}
462if(isFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;}
463if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});}
464hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set" in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:jQuery.trim(jQuery.text(elem)).replace(rspaces," ");}},select:{get:function(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i<max;i++){option=options[i];if((option.selected||i===index)&&(support.optDisabled?!option.disabled:option.getAttribute("disabled")===null)&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;}
465values.push(value);}}
466return values;},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1){optionSet=true;}}
467if(!optionSet){elem.selectedIndex=-1;}
468return values;}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1);}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/;jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;}
469if(rfocusMorph.test(type+jQuery.event.triggered)){return;}
470if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}
471ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;}
472data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;}
473if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;}
474for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;}
475if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}}
476i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data);}
477handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}}
478event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&jQuery.isFunction(elem[type])&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;}
479jQuery.event.triggered=type;elem[type]();jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}}
480return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});jQuery.event.trigger(e,null,elem);if(e.isDefaultPrevented()){event.preventDefault();}}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});support.focusin="onfocusin" in window;if(!support.focusin){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event));};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true);}
481dataPriv.access(doc,fix,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix);}
vendor: 7,078 bytes, lines 481-514
481else{dataPriv.access(doc,fix,attaches);}}};});}
482var location=window.location;var nonce=jQuery.now();var rquery=(/\?/);jQuery.parseJSON=function(data){return JSON.parse(data+"");};jQuery.parseXML=function(data){var xml;if(!data||typeof data!=="string"){return null;}
483try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){xml=undefined;}
484if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);}
485return xml;};var
486rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";}
487var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}
488function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;}
489return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");}
490function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}}
491if(deep){jQuery.extend(true,target,deep);}
492return target;}
493function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}}
494if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}
495if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;}
496if(!firstDataType){firstDataType=type;}}
497finalDataType=finalDataType||firstDataType;}
498if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}
499return responses[finalDataType];}}
500function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}
501current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}
502if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}
503prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}
504break;}}}}
505if(conv!==true){if(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}}
506return{state:"success",data:response};}
507jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;}
508options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,fireGlobals,i,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}}
509match=responseHeaders[key.toLowerCase()];}
510return match==null?null:match;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},setRequestHeader:function(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;}
511return this;},overrideMimeType:function(type){if(!state){s.mimeType=type;}
512return this;},statusCode:function(map){var code;if(map){if(state<2){for(code in map){statusCode[code]=[statusCode[code],map[code]];}}else{jqXHR.always(map[jqXHR.status]);}}
513return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);}
514done(0,finalText);return this;}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||location.href)+"").replace(rhash,"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(rnotwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host;}catch(e){s.crossDomain=true;}}
515if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
516inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR;}
517fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");}
518s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=(s.url+=(rquery.test(cacheURL)?"&":"?")+s.data);delete s.data;}
519if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+nonce++):cacheURL+(rquery.test(cacheURL)?"&":"?")+"_="+nonce++;}}
520if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);}
521if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}}
522if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);}
523jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+
524(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);}
525if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort();}
526strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);}
527transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);}
528if(state===2){return jqXHR;}
529if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);}
530try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{throw e;}}}
531function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return;}
532state=2;if(timeoutTimer){window.clearTimeout(timeoutTimer);}
533transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);}
534response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;}
535modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}}
536if(status===204||s.type==="HEAD"){statusText="nocontent";}else if(status===304){statusText="notmodified";}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error;}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0;}}}
537jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);}
538jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);}
539completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}}
540return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;}
541return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url));};});jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true});};jQuery.fn.extend({wrapAll:function(html){var wrap;if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});}
542if(this[0]){wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}
543wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;}
544return elem;}).append(this);}
545return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}
546return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();}});jQuery.expr.filters.hidden=function(elem){return!jQuery.expr.filters.visible(elem);};jQuery.expr.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0||elem.getClientRects().length>0;};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add);}});}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}}
547jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():(value==null?"":value);s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional;}
548if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}}
549return s.join("&").replace(r20,"+");};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}
vendor: 1,880 bytes, lines 549-553
549).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest();}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials" in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i];}}
550if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);}
551if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";}
552for(i in headers){xhr.setRequestHeader(i,headers[i]);}
553callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort();}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error");}else{complete(xhr.status,xhr.statusText);}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders());}}};};xhr.onload=callback();errorCallback=xhr.onerror=callback("error");
vendor: 4,978 bytes, lines 553-572
553if(xhr.onabort!==undefined){xhr.onabort=errorCallback;}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback();}});}};}
554callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null);}catch(e){if(callback){throw e;}}},abort:function(){if(callback){callback();}}};}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;}
555if(s.crossDomain){s.type="GET";}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery("<script>").prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type);}});document.head.appendChild(script[0]);},abort:function(){if(callback){callback();}}};}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(nonce++));this[callback]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName);}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;}
556s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called");}
557return responseContainer[0];};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments;};jqXHR.always(function(){if(overwritten===undefined){jQuery(window).removeProp(callbackName);}else{window[callbackName]=overwritten;}
558if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName);}
559if(responseContainer&&jQuery.isFunction(overwritten)){overwritten(responseContainer[0]);}
560responseContainer=overwritten=undefined;});return"script";}});jQuery.parseHTML=function(data,context,keepScripts){if(!data||typeof data!=="string"){return null;}
561if(typeof context==="boolean"){keepScripts=context;context=false;}
562context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];}
563parsed=buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove();}
564return jQuery.merge([],parsed.childNodes);};var _load=jQuery.fn.load;jQuery.fn.load=function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments);}
565var selector,type,response,self=this,off=url.indexOf(" ");if(off>-1){selector=jQuery.trim(url.slice(off));url=url.slice(0,off);}
566if(jQuery.isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";}
567if(self.length>0){jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText);}).always(callback&&function(jqXHR,status){self.each(function(){callback.apply(self,response||[jqXHR.responseText,status,jqXHR]);});});}
568return this;};jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn);};});jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView;}
569jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative";}
570curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;}
571if(jQuery.isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset));}
572if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;}
573if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;}
574if("using" in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i);});}
575var docElem,win,elem=this[0],box={top:0,left:0},doc=elem&&elem.ownerDocument;if(!doc){return;}
576docElem=doc.documentElement;if(!jQuery.contains(docElem,elem)){return box;}
577box=elem.getBoundingClientRect();win=getWindow(doc);return{top:box.top+win.pageYOffset-docElem.clientTop,left:box.left+win.pageXOffset-docElem.clientLeft};},position:function(){if(!this[0]){return;}
578var offsetParent,offset,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect();}else{offsetParent=this.offsetParent();offset=this.offset();if(!jQuery.nodeName(offsetParent[0],"html")){parentOffset=offsetParent.offset();}
579parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",true);}
580return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent;}
581return offsetParent||documentElement;});}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win=getWindow(elem);if(val===undefined){return win?win[prop]:elem[method];}
582if(win){win.scrollTo(!top?val:win.pageXOffset,top?val:win.pageYOffset);}else{elem[method]=val;}},method,val,arguments.length);};});jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed;}});});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;if(jQuery.isWindow(elem)){return elem.document.documentElement["client"+name];}
583if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name]);}
584return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra);},type,chainable?margin:undefined,chainable,null);};});});jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn);},size:function(){return this.length;}});jQuery.fn.andSelf=jQuery.fn.addBack;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery;});}
585var
586_jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$;}
587if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;}
588return jQuery;};if(!noGlobal){window.jQuery=window.$=jQuery;}
589return jQuery;}));;;
590if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}
591+function($){'use strict';var version=$.fn.jquery.split(' ')[0].split('.')
592if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)||(version[0]>2)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')}}(jQuery);+function($){'use strict';function transitionEnd(){var el=document.createElement('bootstrap')
593var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'}
vendor: 46,197 bytes, lines 594-1364
594for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}
595return false}
596$.fn.emulateTransitionEnd=function(duration){var called=false
597var $el=this
598$(this).one('bsTransitionEnd',function(){called=true})
599var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
600setTimeout(callback,duration)
601return this}
602$(function(){$.support.transition=transitionEnd()
603if(!$.support.transition)return
604$.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){if($(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}})}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]'
605var Alert=function(el){$(el).on('click',dismiss,this.close)}
606Alert.VERSION='3.3.6'
607Alert.TRANSITION_DURATION=150
608Alert.prototype.close=function(e){var $this=$(this)
609var selector=$this.attr('data-target')
610if(!selector){selector=$this.attr('href')
611selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
612var $parent=$(selector)
613if(e)e.preventDefault()
614if(!$parent.length){$parent=$this.closest('.alert')}
615$parent.trigger(e=$.Event('close.bs.alert'))
616if(e.isDefaultPrevented())return
617$parent.removeClass('in')
618function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()}
619$.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement()}
620function Plugin(option){return this.each(function(){var $this=$(this)
621var data=$this.data('bs.alert')
622if(!data)$this.data('bs.alert',(data=new Alert(this)))
623if(typeof option=='string')data[option].call($this)})}
624var old=$.fn.alert
625$.fn.alert=Plugin
626$.fn.alert.Constructor=Alert
627$.fn.alert.noConflict=function(){$.fn.alert=old
628return this}
629$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element)
630this.options=$.extend({},Button.DEFAULTS,options)
631this.isLoading=false}
632Button.VERSION='3.3.6'
633Button.DEFAULTS={loadingText:'loading...'}
634Button.prototype.setState=function(state){var d='disabled'
635var $el=this.$element
636var val=$el.is('input')?'val':'html'
637var data=$el.data()
638state+='Text'
639if(data.resetText==null)$el.data('resetText',$el[val]())
640setTimeout($.proxy(function(){$el[val](data[state]==null?this.options[state]:data[state])
641if(state=='loadingText'){this.isLoading=true
642$el.addClass(d).attr(d,d)}else if(this.isLoading){this.isLoading=false
643$el.removeClass(d).removeAttr(d)}},this),0)}
644Button.prototype.toggle=function(){var changed=true
645var $parent=this.$element.closest('[data-toggle="buttons"]')
646if($parent.length){var $input=this.$element.find('input')
647if($input.prop('type')=='radio'){if($input.prop('checked'))changed=false
648$parent.find('.active').removeClass('active')
649this.$element.addClass('active')}else if($input.prop('type')=='checkbox'){if(($input.prop('checked'))!==this.$element.hasClass('active'))changed=false
650this.$element.toggleClass('active')}
651$input.prop('checked',this.$element.hasClass('active'))
652if(changed)$input.trigger('change')}else{this.$element.attr('aria-pressed',!this.$element.hasClass('active'))
653this.$element.toggleClass('active')}}
654function Plugin(option){return this.each(function(){var $this=$(this)
655var data=$this.data('bs.button')
656var options=typeof option=='object'&&option
657if(!data)$this.data('bs.button',(data=new Button(this,options)))
658if(option=='toggle')data.toggle()
659else if(option)data.setState(option)})}
660var old=$.fn.button
661$.fn.button=Plugin
662$.fn.button.Constructor=Button
663$.fn.button.noConflict=function(){$.fn.button=old
664return this}
665$(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target)
666if(!$btn.hasClass('btn'))$btn=$btn.closest('.btn')
667Plugin.call($btn,'toggle')
668if(!($(e.target).is('input[type="radio"]')||$(e.target).is('input[type="checkbox"]')))e.preventDefault()}).on('focus.bs.button.data-api blur.bs.button.data-api','[data-toggle^="button"]',function(e){$(e.target).closest('.btn').toggleClass('focus',/^focus(in)?$/.test(e.type))})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element)
669this.$indicators=this.$element.find('.carousel-indicators')
670this.options=options
671this.paused=null
672this.sliding=null
673this.interval=null
674this.$active=null
675this.$items=null
676this.options.keyboard&&this.$element.on('keydown.bs.carousel',$.proxy(this.keydown,this))
677this.options.pause=='hover'&&!('ontouchstart' in document.documentElement)&&this.$element.on('mouseenter.bs.carousel',$.proxy(this.pause,this)).on('mouseleave.bs.carousel',$.proxy(this.cycle,this))}
678Carousel.VERSION='3.3.6'
679Carousel.TRANSITION_DURATION=600
680Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:true,keyboard:true}
681Carousel.prototype.keydown=function(e){if(/input|textarea/i.test(e.target.tagName))return
682switch(e.which){case 37:this.prev();break
683case 39:this.next();break
684default:return}
685e.preventDefault()}
686Carousel.prototype.cycle=function(e){e||(this.paused=false)
687this.interval&&clearInterval(this.interval)
688this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval))
689return this}
690Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item')
691return this.$items.index(item||this.$active)}
692Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active)
693var willWrap=(direction=='prev'&&activeIndex===0)||(direction=='next'&&activeIndex==(this.$items.length-1))
694if(willWrap&&!this.options.wrap)return active
695var delta=direction=='prev'?-1:1
696var itemIndex=(activeIndex+delta)%this.$items.length
697return this.$items.eq(itemIndex)}
698Carousel.prototype.to=function(pos){var that=this
699var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active'))
700if(pos>(this.$items.length-1)||pos<0)return
701if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)})
702if(activeIndex==pos)return this.pause().cycle()
703return this.slide(pos>activeIndex?'next':'prev',this.$items.eq(pos))}
704Carousel.prototype.pause=function(e){e||(this.paused=true)
705if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end)
706this.cycle(true)}
707this.interval=clearInterval(this.interval)
708return this}
709Carousel.prototype.next=function(){if(this.sliding)return
710return this.slide('next')}
711Carousel.prototype.prev=function(){if(this.sliding)return
712return this.slide('prev')}
713Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active')
714var $next=next||this.getItemForDirection(type,$active)
715var isCycling=this.interval
716var direction=type=='next'?'left':'right'
717var that=this
718if($next.hasClass('active'))return(this.sliding=false)
719var relatedTarget=$next[0]
720var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
721this.$element.trigger(slideEvent)
722if(slideEvent.isDefaultPrevented())return
723this.sliding=true
724isCycling&&this.pause()
725if(this.$indicators.length){this.$indicators.find('.active').removeClass('active')
726var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)])
727$nextIndicator&&$nextIndicator.addClass('active')}
728var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction})
729if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type)
730$next[0].offsetWidth
731$active.addClass(direction)
732$next.addClass(direction)
733$active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active')
734$active.removeClass(['active',direction].join(' '))
735that.sliding=false
736setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)}else{$active.removeClass('active')
737$next.addClass('active')
738this.sliding=false
739this.$element.trigger(slidEvent)}
740isCycling&&this.cycle()
741return this}
742function Plugin(option){return this.each(function(){var $this=$(this)
743var data=$this.data('bs.carousel')
744var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option)
745var action=typeof option=='string'?option:options.slide
746if(!data)$this.data('bs.carousel',(data=new Carousel(this,options)))
747if(typeof option=='number')data.to(option)
748else if(action)data[action]()
749else if(options.interval)data.pause().cycle()})}
750var old=$.fn.carousel
751$.fn.carousel=Plugin
752$.fn.carousel.Constructor=Carousel
753$.fn.carousel.noConflict=function(){$.fn.carousel=old
754return this}
755var clickHandler=function(e){var href
756var $this=$(this)
757var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,''))
758if(!$target.hasClass('carousel'))return
759var options=$.extend({},$target.data(),$this.data())
760var slideIndex=$this.attr('data-slide-to')
761if(slideIndex)options.interval=false
762Plugin.call($target,options)
763if(slideIndex){$target.data('bs.carousel').to(slideIndex)}
764e.preventDefault()}
765$(document).on('click.bs.carousel.data-api','[data-slide]',clickHandler).on('click.bs.carousel.data-api','[data-slide-to]',clickHandler)
766$(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this)
767Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element)
768this.options=$.extend({},Collapse.DEFAULTS,options)
769this.$trigger=$('[data-toggle="collapse"][href="#'+element.id+'"],'+'[data-toggle="collapse"][data-target="#'+element.id+'"]')
770this.transitioning=null
771if(this.options.parent){this.$parent=this.getParent()}else{this.addAriaAndCollapsedClass(this.$element,this.$trigger)}
772if(this.options.toggle)this.toggle()}
773Collapse.VERSION='3.3.6'
774Collapse.TRANSITION_DURATION=350
775Collapse.DEFAULTS={toggle:true}
776Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
777return hasWidth?'width':'height'}
778Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
779var activesData
780var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing')
781if(actives&&actives.length){activesData=actives.data('bs.collapse')
782if(activesData&&activesData.transitioning)return}
783var startEvent=$.Event('show.bs.collapse')
784this.$element.trigger(startEvent)
785if(startEvent.isDefaultPrevented())return
786if(actives&&actives.length){Plugin.call(actives,'hide')
787activesData||actives.data('bs.collapse',null)}
788var dimension=this.dimension()
789this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded',true)
790this.$trigger.removeClass('collapsed').attr('aria-expanded',true)
791this.transitioning=1
792var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('')
793this.transitioning=0
794this.$element.trigger('shown.bs.collapse')}
795if(!$.support.transition)return complete.call(this)
796var scrollSize=$.camelCase(['scroll',dimension].join('-'))
797this.$element.one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])}
798Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
799var startEvent=$.Event('hide.bs.collapse')
800this.$element.trigger(startEvent)
801if(startEvent.isDefaultPrevented())return
802var dimension=this.dimension()
803this.$element[dimension](this.$element[dimension]())[0].offsetHeight
804this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded',false)
805this.$trigger.addClass('collapsed').attr('aria-expanded',false)
806this.transitioning=1
807var complete=function(){this.transitioning=0
808this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse')}
809if(!$.support.transition)return complete.call(this)
810this.$element
811[dimension](0).one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)}
812Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
813Collapse.prototype.getParent=function(){return $(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each($.proxy(function(i,element){var $element=$(element)
814this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()}
815Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass('in')
816$element.attr('aria-expanded',isOpen)
817$trigger.toggleClass('collapsed',!isOpen).attr('aria-expanded',isOpen)}
818function getTargetFromTrigger($trigger){var href
819var target=$trigger.attr('data-target')||(href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
820return $(target)}
821function Plugin(option){return this.each(function(){var $this=$(this)
822var data=$this.data('bs.collapse')
823var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
824if(!data&&options.toggle&&/show|hide/.test(option))options.toggle=false
825if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
826if(typeof option=='string')data[option]()})}
827var old=$.fn.collapse
828$.fn.collapse=Plugin
829$.fn.collapse.Constructor=Collapse
830$.fn.collapse.noConflict=function(){$.fn.collapse=old
831return this}
832$(document).on('click.bs.collapse.data-api','[data-toggle="collapse"]',function(e){var $this=$(this)
833if(!$this.attr('data-target'))e.preventDefault()
834var $target=getTargetFromTrigger($this)
835var data=$target.data('bs.collapse')
836var option=data?'toggle':$this.data()
837Plugin.call($target,option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop'
838var toggle='[data-toggle="dropdown"]'
839var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
840Dropdown.VERSION='3.3.6'
841function getParent($this){var selector=$this.attr('data-target')
842if(!selector){selector=$this.attr('href')
843selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
844var $parent=selector&&$(selector)
845return $parent&&$parent.length?$parent:$this.parent()}
846function clearMenus(e){if(e&&e.which===3)return
847$(backdrop).remove()
848$(toggle).each(function(){var $this=$(this)
849var $parent=getParent($this)
850var relatedTarget={relatedTarget:this}
851if(!$parent.hasClass('open'))return
852if(e&&e.type=='click'&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0],e.target))return
853$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
854if(e.isDefaultPrevented())return
855$this.attr('aria-expanded','false')
856$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown',relatedTarget))})}
857Dropdown.prototype.toggle=function(e){var $this=$(this)
858if($this.is('.disabled, :disabled'))return
859var $parent=getParent($this)
860var isActive=$parent.hasClass('open')
861clearMenus()
862if(!isActive){if('ontouchstart' in document.documentElement&&!$parent.closest('.navbar-nav').length){$(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($(this)).on('click',clearMenus)}
863var relatedTarget={relatedTarget:this}
864$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
865if(e.isDefaultPrevented())return
866$this.trigger('focus').attr('aria-expanded','true')
867$parent.toggleClass('open').trigger($.Event('shown.bs.dropdown',relatedTarget))}
868return false}
869Dropdown.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return
870var $this=$(this)
871e.preventDefault()
872e.stopPropagation()
873if($this.is('.disabled, :disabled'))return
874var $parent=getParent($this)
875var isActive=$parent.hasClass('open')
876if(!isActive&&e.which!=27||isActive&&e.which==27){if(e.which==27)$parent.find(toggle).trigger('focus')
877return $this.trigger('click')}
878var desc=' li:not(.disabled):visible a'
879var $items=$parent.find('.dropdown-menu'+desc)
880if(!$items.length)return
881var index=$items.index(e.target)
882if(e.which==38&&index>0)index--
883if(e.which==40&&index<$items.length-1)index++
884if(!~index)index=0
885$items.eq(index).trigger('focus')}
886function Plugin(option){return this.each(function(){var $this=$(this)
887var data=$this.data('bs.dropdown')
888if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
889if(typeof option=='string')data[option].call($this)})}
890var old=$.fn.dropdown
891$.fn.dropdown=Plugin
892$.fn.dropdown.Constructor=Dropdown
893$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
894return this}
895$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle,Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','.dropdown-menu',Dropdown.prototype.keydown)}(jQuery);+function($){'use strict';var Modal=function(element,options){this.options=options
896this.$body=$(document.body)
897this.$element=$(element)
898this.$dialog=this.$element.find('.modal-dialog')
899this.$backdrop=null
900this.isShown=null
901this.originalBodyPad=null
902this.scrollbarWidth=0
903this.ignoreBackdropClick=false
904if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}}
905Modal.VERSION='3.3.6'
906Modal.TRANSITION_DURATION=300
907Modal.BACKDROP_TRANSITION_DURATION=150
908Modal.DEFAULTS={backdrop:true,keyboard:true,show:true}
909Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)}
910Modal.prototype.show=function(_relatedTarget){var that=this
911var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
912this.$element.trigger(e)
913if(this.isShown||e.isDefaultPrevented())return
914this.isShown=true
915this.checkScrollbar()
916this.setScrollbar()
917this.$body.addClass('modal-open')
918this.escape()
919this.resize()
920this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
921this.$dialog.on('mousedown.dismiss.bs.modal',function(){that.$element.one('mouseup.dismiss.bs.modal',function(e){if($(e.target).is(that.$element))that.ignoreBackdropClick=true})})
922this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
923if(!that.$element.parent().length){that.$element.appendTo(that.$body)}
924that.$element.show().scrollTop(0)
925that.adjustDialog()
926if(transition){that.$element[0].offsetWidth}
927that.$element.addClass('in')
928that.enforceFocus()
929var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
930transition?that.$dialog.one('bsTransitionEnd',function(){that.$element.trigger('focus').trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger('focus').trigger(e)})}
931Modal.prototype.hide=function(e){if(e)e.preventDefault()
932e=$.Event('hide.bs.modal')
933this.$element.trigger(e)
934if(!this.isShown||e.isDefaultPrevented())return
935this.isShown=false
936this.escape()
937this.resize()
938$(document).off('focusin.bs.modal')
939this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal')
940this.$dialog.off('mousedown.dismiss.bs.modal')
941$.support.transition&&this.$element.hasClass('fade')?this.$element.one('bsTransitionEnd',$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal()}
942Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.trigger('focus')}},this))}
943Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keydown.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keydown.dismiss.bs.modal')}}
944Modal.prototype.resize=function(){if(this.isShown){$(window).on('resize.bs.modal',$.proxy(this.handleUpdate,this))}else{$(window).off('resize.bs.modal')}}
945Modal.prototype.hideModal=function(){var that=this
946this.$element.hide()
947this.backdrop(function(){that.$body.removeClass('modal-open')
948that.resetAdjustments()
949that.resetScrollbar()
950that.$element.trigger('hidden.bs.modal')})}
951Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
952this.$backdrop=null}
953Modal.prototype.backdrop=function(callback){var that=this
954var animate=this.$element.hasClass('fade')?'fade':''
955if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
956this.$backdrop=$(document.createElement('div')).addClass('modal-backdrop '+animate).appendTo(this.$body)
957this.$element.on('click.dismiss.bs.modal',$.proxy(function(e){if(this.ignoreBackdropClick){this.ignoreBackdropClick=false
958return}
959if(e.target!==e.currentTarget)return
960this.options.backdrop=='static'?this.$element[0].focus():this.hide()},this))
961if(doAnimate)this.$backdrop[0].offsetWidth
962this.$backdrop.addClass('in')
963if(!callback)return
964doAnimate?this.$backdrop.one('bsTransitionEnd',callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
965var callbackRemove=function(){that.removeBackdrop()
966callback&&callback()}
967$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one('bsTransitionEnd',callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else if(callback){callback()}}
968Modal.prototype.handleUpdate=function(){this.adjustDialog()}
969Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight
970this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:'',paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:''})}
971Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:'',paddingRight:''})}
972Modal.prototype.checkScrollbar=function(){var fullWindowWidth=window.innerWidth
973if(!fullWindowWidth){var documentElementRect=document.documentElement.getBoundingClientRect()
974fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}
975this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth
976this.scrollbarWidth=this.measureScrollbar()}
977Modal.prototype.setScrollbar=function(){var bodyPad=parseInt((this.$body.css('padding-right')||0),10)
978this.originalBodyPad=document.body.style.paddingRight||''
979if(this.bodyIsOverflowing)this.$body.css('padding-right',bodyPad+this.scrollbarWidth)}
980Modal.prototype.resetScrollbar=function(){this.$body.css('padding-right',this.originalBodyPad)}
981Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement('div')
982scrollDiv.className='modal-scrollbar-measure'
983this.$body.append(scrollDiv)
984var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth
985this.$body[0].removeChild(scrollDiv)
986return scrollbarWidth}
987function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this)
988var data=$this.data('bs.modal')
989var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
990if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
991if(typeof option=='string')data[option](_relatedTarget)
992else if(options.show)data.show(_relatedTarget)})}
993var old=$.fn.modal
994$.fn.modal=Plugin
995$.fn.modal.Constructor=Modal
996$.fn.modal.noConflict=function(){$.fn.modal=old
997return this}
998$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
999var href=$this.attr('href')
1000var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,'')))
1001var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
1002if($this.is('a'))e.preventDefault()
1003$target.one('show.bs.modal',function(showEvent){if(showEvent.isDefaultPrevented())return
1004$target.one('hidden.bs.modal',function(){$this.is(':visible')&&$this.trigger('focus')})})
1005Plugin.call($target,option,this)})}(jQuery);+function($){'use strict';var Tooltip=function(element,options){this.type=null
1006this.options=null
1007this.enabled=null
1008this.timeout=null
1009this.hoverState=null
1010this.$element=null
1011this.inState=null
1012this.init('tooltip',element,options)}
1013Tooltip.VERSION='3.3.6'
1014Tooltip.TRANSITION_DURATION=150
1015Tooltip.DEFAULTS={animation:true,placement:'top',selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false,viewport:{selector:'body',padding:0}}
1016Tooltip.prototype.init=function(type,element,options){this.enabled=true
1017this.type=type
1018this.$element=$(element)
1019this.options=this.getOptions(options)
1020this.$viewport=this.options.viewport&&$($.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):(this.options.viewport.selector||this.options.viewport))
1021this.inState={click:false,hover:false,focus:false}
1022if(this.$element[0]instanceof document.constructor&&!this.options.selector){throw new Error('`selector` option must be specified when initializing '+this.type+' on the window.document object!')}
1023var triggers=this.options.trigger.split(' ')
1024for(var i=triggers.length;i--;){var trigger=triggers[i]
1025if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin'
1026var eventOut=trigger=='hover'?'mouseleave':'focusout'
1027this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
1028this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
1029this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
1030Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
1031Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options)
1032if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
1033return options}
1034Tooltip.prototype.getDelegateOptions=function(){var options={}
1035var defaults=this.getDefaults()
1036this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
1037return options}
1038Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
1039if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
1040$(obj.currentTarget).data('bs.'+this.type,self)}
1041if(obj instanceof $.Event){self.inState[obj.type=='focusin'?'focus':'hover']=true}
1042if(self.tip().hasClass('in')||self.hoverState=='in'){self.hoverState='in'
1043return}
1044clearTimeout(self.timeout)
1045self.hoverState='in'
1046if(!self.options.delay||!self.options.delay.show)return self.show()
1047self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
1048Tooltip.prototype.isInStateTrue=function(){for(var key in this.inState){if(this.inState[key])return true}
1049return false}
1050Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
1051if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
1052$(obj.currentTarget).data('bs.'+this.type,self)}
1053if(obj instanceof $.Event){self.inState[obj.type=='focusout'?'focus':'hover']=false}
1054if(self.isInStateTrue())return
1055clearTimeout(self.timeout)
1056self.hoverState='out'
1057if(!self.options.delay||!self.options.delay.hide)return self.hide()
1058self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
1059Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type)
1060if(this.hasContent()&&this.enabled){this.$element.trigger(e)
1061var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0])
1062if(e.isDefaultPrevented()||!inDom)return
1063var that=this
1064var $tip=this.tip()
1065var tipId=this.getUID(this.type)
1066this.setContent()
1067$tip.attr('id',tipId)
1068this.$element.attr('aria-describedby',tipId)
1069if(this.options.animation)$tip.addClass('fade')
1070var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
1071var autoToken=/\s?auto?\s?/i
1072var autoPlace=autoToken.test(placement)
1073if(autoPlace)placement=placement.replace(autoToken,'')||'top'
1074$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this)
1075this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
1076this.$element.trigger('inserted.bs.'+this.type)
1077var pos=this.getPosition()
1078var actualWidth=$tip[0].offsetWidth
1079var actualHeight=$tip[0].offsetHeight
1080if(autoPlace){var orgPlacement=placement
1081var viewportDim=this.getPosition(this.$viewport)
1082placement=placement=='bottom'&&pos.bottom+actualHeight>viewportDim.bottom?'top':placement=='top'&&pos.top-actualHeight<viewportDim.top?'bottom':placement=='right'&&pos.right+actualWidth>viewportDim.width?'left':placement=='left'&&pos.left-actualWidth<viewportDim.left?'right':placement
1083$tip.removeClass(orgPlacement).addClass(placement)}
1084var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
1085this.applyPlacement(calculatedOffset,placement)
1086var complete=function(){var prevHoverState=that.hoverState
1087that.$element.trigger('shown.bs.'+that.type)
1088that.hoverState=null
1089if(prevHoverState=='out')that.leave(that)}
1090$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}}
1091Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip()
1092var width=$tip[0].offsetWidth
1093var height=$tip[0].offsetHeight
1094var marginTop=parseInt($tip.css('margin-top'),10)
1095var marginLeft=parseInt($tip.css('margin-left'),10)
1096if(isNaN(marginTop))marginTop=0
1097if(isNaN(marginLeft))marginLeft=0
1098offset.top+=marginTop
1099offset.left+=marginLeft
1100$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0)
1101$tip.addClass('in')
1102var actualWidth=$tip[0].offsetWidth
1103var actualHeight=$tip[0].offsetHeight
1104if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight}
1105var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight)
1106if(delta.left)offset.left+=delta.left
1107else offset.top+=delta.top
1108var isVertical=/top|bottom/.test(placement)
1109var arrowDelta=isVertical?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight
1110var arrowOffsetPosition=isVertical?'offsetWidth':'offsetHeight'
1111$tip.offset(offset)
1112this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)}
1113Tooltip.prototype.replaceArrow=function(delta,dimension,isVertical){this.arrow().css(isVertical?'left':'top',50*(1-delta/dimension)+'%').css(isVertical?'top':'left','')}
1114Tooltip.prototype.setContent=function(){var $tip=this.tip()
1115var title=this.getTitle()
1116$tip.find('.tooltip-inner')[this.options.html?'html':'text'](title)
1117$tip.removeClass('fade in top bottom left right')}
1118Tooltip.prototype.hide=function(callback){var that=this
1119var $tip=$(this.$tip)
1120var e=$.Event('hide.bs.'+this.type)
1121function complete(){if(that.hoverState!='in')$tip.detach()
1122that.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+that.type)
1123callback&&callback()}
1124this.$element.trigger(e)
1125if(e.isDefaultPrevented())return
1126$tip.removeClass('in')
1127$.support.transition&&$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()
1128this.hoverState=null
1129return this}
1130Tooltip.prototype.fixTitle=function(){var $e=this.$element
1131if($e.attr('title')||typeof $e.attr('data-original-title')!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
1132Tooltip.prototype.hasContent=function(){return this.getTitle()}
1133Tooltip.prototype.getPosition=function($element){$element=$element||this.$element
1134var el=$element[0]
1135var isBody=el.tagName=='BODY'
1136var elRect=el.getBoundingClientRect()
1137if(elRect.width==null){elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top})}
1138var elOffset=isBody?{top:0,left:0}:$element.offset()
1139var scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()}
1140var outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null
1141return $.extend({},elRect,scroll,outerDims,elOffset)}
1142Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=='top'?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=='left'?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}}
1143Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0}
1144if(!this.$viewport)return delta
1145var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
1146var viewportDimensions=this.getPosition(this.$viewport)
1147if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll
1148var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight
1149if(topEdgeOffset<viewportDimensions.top){delta.top=viewportDimensions.top-topEdgeOffset}else if(bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height){delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset}}else{var leftEdgeOffset=pos.left-viewportPadding
1150var rightEdgeOffset=pos.left+viewportPadding+actualWidth
1151if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.right){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}}
1152return delta}
1153Tooltip.prototype.getTitle=function(){var title
1154var $e=this.$element
1155var o=this.options
1156title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
1157return title}
1158Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000)
1159while(document.getElementById(prefix))
1160return prefix}
1161Tooltip.prototype.tip=function(){if(!this.$tip){this.$tip=$(this.options.template)
1162if(this.$tip.length!=1){throw new Error(this.type+' `template` option must consist of exactly 1 top-level element!')}}
1163return this.$tip}
1164Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))}
1165Tooltip.prototype.enable=function(){this.enabled=true}
1166Tooltip.prototype.disable=function(){this.enabled=false}
1167Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
1168Tooltip.prototype.toggle=function(e){var self=this
1169if(e){self=$(e.currentTarget).data('bs.'+this.type)
1170if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions())
1171$(e.currentTarget).data('bs.'+this.type,self)}}
1172if(e){self.inState.click=!self.inState.click
1173if(self.isInStateTrue())self.enter(self)
1174else self.leave(self)}else{self.tip().hasClass('in')?self.leave(self):self.enter(self)}}
1175Tooltip.prototype.destroy=function(){var that=this
1176clearTimeout(this.timeout)
1177this.hide(function(){that.$element.off('.'+that.type).removeData('bs.'+that.type)
1178if(that.$tip){that.$tip.detach()}
1179that.$tip=null
1180that.$arrow=null
1181that.$viewport=null})}
1182function Plugin(option){return this.each(function(){var $this=$(this)
1183var data=$this.data('bs.tooltip')
1184var options=typeof option=='object'&&option
1185if(!data&&/destroy|hide/.test(option))return
1186if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))
1187if(typeof option=='string')data[option]()})}
1188var old=$.fn.tooltip
1189$.fn.tooltip=Plugin
1190$.fn.tooltip.Constructor=Tooltip
1191$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
1192return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)}
1193if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
1194Popover.VERSION='3.3.6'
1195Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
1196Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
1197Popover.prototype.constructor=Popover
1198Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
1199Popover.prototype.setContent=function(){var $tip=this.tip()
1200var title=this.getTitle()
1201var content=this.getContent()
1202$tip.find('.popover-title')[this.options.html?'html':'text'](title)
1203$tip.find('.popover-content').children().detach().end()[this.options.html?(typeof content=='string'?'html':'append'):'text'](content)
1204$tip.removeClass('fade top bottom left right in')
1205if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
1206Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
1207Popover.prototype.getContent=function(){var $e=this.$element
1208var o=this.options
1209return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
1210Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))}
1211function Plugin(option){return this.each(function(){var $this=$(this)
1212var data=$this.data('bs.popover')
1213var options=typeof option=='object'&&option
1214if(!data&&/destroy|hide/.test(option))return
1215if(!data)$this.data('bs.popover',(data=new Popover(this,options)))
1216if(typeof option=='string')data[option]()})}
1217var old=$.fn.popover
1218$.fn.popover=Plugin
1219$.fn.popover.Constructor=Popover
1220$.fn.popover.noConflict=function(){$.fn.popover=old
1221return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){this.$body=$(document.body)
1222this.$scrollElement=$(element).is(document.body)?$(window):$(element)
1223this.options=$.extend({},ScrollSpy.DEFAULTS,options)
1224this.selector=(this.options.target||'')+' .nav li > a'
1225this.offsets=[]
1226this.targets=[]
1227this.activeTarget=null
1228this.scrollHeight=0
1229this.$scrollElement.on('scroll.bs.scrollspy',$.proxy(this.process,this))
1230this.refresh()
1231this.process()}
1232ScrollSpy.VERSION='3.3.6'
1233ScrollSpy.DEFAULTS={offset:10}
1234ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)}
1235ScrollSpy.prototype.refresh=function(){var that=this
1236var offsetMethod='offset'
1237var offsetBase=0
1238this.offsets=[]
1239this.targets=[]
1240this.scrollHeight=this.getScrollHeight()
1241if(!$.isWindow(this.$scrollElement[0])){offsetMethod='position'
1242offsetBase=this.$scrollElement.scrollTop()}
1243this.$body.find(this.selector).map(function(){var $el=$(this)
1244var href=$el.data('target')||$el.attr('href')
1245var $href=/^#./.test(href)&&$(href)
1246return($href&&$href.length&&$href.is(':visible')&&[[$href[offsetMethod]().top+offsetBase,href]])||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){that.offsets.push(this[0])
1247that.targets.push(this[1])})}
1248ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset
1249var scrollHeight=this.getScrollHeight()
1250var maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height()
1251var offsets=this.offsets
1252var targets=this.targets
1253var activeTarget=this.activeTarget
1254var i
1255if(this.scrollHeight!=scrollHeight){this.refresh()}
1256if(scrollTop>=maxScroll){return activeTarget!=(i=targets[targets.length-1])&&this.activate(i)}
1257if(activeTarget&&scrollTop<offsets[0]){this.activeTarget=null
1258return this.clear()}
1259for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(offsets[i+1]===undefined||scrollTop<offsets[i+1])&&this.activate(targets[i])}}
1260ScrollSpy.prototype.activate=function(target){this.activeTarget=target
1261this.clear()
1262var selector=this.selector+'[data-target="'+target+'"],'+
1263this.selector+'[href="'+target+'"]'
1264var active=$(selector).parents('li').addClass('active')
1265if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')}
1266active.trigger('activate.bs.scrollspy')}
1267ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')}
1268function Plugin(option){return this.each(function(){var $this=$(this)
1269var data=$this.data('bs.scrollspy')
1270var options=typeof option=='object'&&option
1271if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options)))
1272if(typeof option=='string')data[option]()})}
1273var old=$.fn.scrollspy
1274$.fn.scrollspy=Plugin
1275$.fn.scrollspy.Constructor=ScrollSpy
1276$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old
1277return this}
1278$(window).on('load.bs.scrollspy.data-api',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this)
1279Plugin.call($spy,$spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)}
1280Tab.VERSION='3.3.6'
1281Tab.TRANSITION_DURATION=150
1282Tab.prototype.show=function(){var $this=this.element
1283var $ul=$this.closest('ul:not(.dropdown-menu)')
1284var selector=$this.data('target')
1285if(!selector){selector=$this.attr('href')
1286selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
1287if($this.parent('li').hasClass('active'))return
1288var $previous=$ul.find('.active:last a')
1289var hideEvent=$.Event('hide.bs.tab',{relatedTarget:$this[0]})
1290var showEvent=$.Event('show.bs.tab',{relatedTarget:$previous[0]})
1291$previous.trigger(hideEvent)
1292$this.trigger(showEvent)
1293if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented())return
1294var $target=$(selector)
1295this.activate($this.closest('li'),$ul)
1296this.activate($target,$target.parent(),function(){$previous.trigger({type:'hidden.bs.tab',relatedTarget:$this[0]})
1297$this.trigger({type:'shown.bs.tab',relatedTarget:$previous[0]})})}
1298Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active')
1299var transition=callback&&$.support.transition&&($active.length&&$active.hasClass('fade')||!!container.find('> .fade').length)
1300function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',false)
1301element.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded',true)
1302if(transition){element[0].offsetWidth
1303element.addClass('in')}else{element.removeClass('fade')}
1304if(element.parent('.dropdown-menu').length){element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',true)}
1305callback&&callback()}
1306$active.length&&transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next()
1307$active.removeClass('in')}
1308function Plugin(option){return this.each(function(){var $this=$(this)
1309var data=$this.data('bs.tab')
1310if(!data)$this.data('bs.tab',(data=new Tab(this)))
1311if(typeof option=='string')data[option]()})}
1312var old=$.fn.tab
1313$.fn.tab=Plugin
1314$.fn.tab.Constructor=Tab
1315$.fn.tab.noConflict=function(){$.fn.tab=old
1316return this}
1317var clickHandler=function(e){e.preventDefault()
1318Plugin.call($(this),'show')}
1319$(document).on('click.bs.tab.data-api','[data-toggle="tab"]',clickHandler).on('click.bs.tab.data-api','[data-toggle="pill"]',clickHandler)}(jQuery);+function($){'use strict';var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options)
1320this.$target=$(this.options.target).on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this))
1321this.$element=$(element)
1322this.affixed=null
1323this.unpin=null
1324this.pinnedOffset=null
1325this.checkPosition()}
1326Affix.VERSION='3.3.6'
1327Affix.RESET='affix affix-top affix-bottom'
1328Affix.DEFAULTS={offset:0,target:window}
1329Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop()
1330var position=this.$element.offset()
1331var targetHeight=this.$target.height()
1332if(offsetTop!=null&&this.affixed=='top')return scrollTop<offsetTop?'top':false
1333if(this.affixed=='bottom'){if(offsetTop!=null)return(scrollTop+this.unpin<=position.top)?false:'bottom'
1334return(scrollTop+targetHeight<=scrollHeight-offsetBottom)?false:'bottom'}
1335var initializing=this.affixed==null
1336var colliderTop=initializing?scrollTop:position.top
1337var colliderHeight=initializing?targetHeight:height
1338if(offsetTop!=null&&scrollTop<=offsetTop)return'top'
1339if(offsetBottom!=null&&(colliderTop+colliderHeight>=scrollHeight-offsetBottom))return'bottom'
1340return false}
1341Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset
1342this.$element.removeClass(Affix.RESET).addClass('affix')
1343var scrollTop=this.$target.scrollTop()
1344var position=this.$element.offset()
1345return(this.pinnedOffset=position.top-scrollTop)}
1346Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)}
1347Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return
1348var height=this.$element.height()
1349var offset=this.options.offset
1350var offsetTop=offset.top
1351var offsetBottom=offset.bottom
1352var scrollHeight=Math.max($(document).height(),$(document.body).height())
1353if(typeof offset!='object')offsetBottom=offsetTop=offset
1354if(typeof offsetTop=='function')offsetTop=offset.top(this.$element)
1355if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element)
1356var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom)
1357if(this.affixed!=affix){if(this.unpin!=null)this.$element.css('top','')
1358var affixType='affix'+(affix?'-'+affix:'')
1359var e=$.Event(affixType+'.bs.affix')
1360this.$element.trigger(e)
1361if(e.isDefaultPrevented())return
1362this.affixed=affix
1363this.unpin=affix=='bottom'?this.getPinnedOffset():null
1364this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix','affixed')+'.bs.affix')}
1365if(affix=='bottom'){this.$element.offset({top:scrollHeight-height-offsetBottom})}}
1366function Plugin(option){return this.each(function(){var $this=$(this)
1367var data=$this.data('bs.affix')
1368var options=typeof option=='object'&&option
1369if(!data)$this.data('bs.affix',(data=new Affix(this,options)))
1370if(typeof option=='string')data[option]()})}
1371var old=$.fn.affix
1372$.fn.affix=Plugin
1373$.fn.affix.Constructor=Affix
1374$.fn.affix.noConflict=function(){$.fn.affix=old
1375return this}
1376$(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this)
1377var data=$spy.data()
1378data.offset=data.offset||{}
1379if(data.offsetBottom!=null)data.offset.bottom=data.offsetBottom
1380if(data.offsetTop!=null)data.offset.top=data.offsetTop
1381Plugin.call($spy,data)})})}(jQuery);;;
1382;(function($){$.fn.unveil=function(threshold,callback){var $w=$(window),th=threshold||0,retina=window.devicePixelRatio>1,attrib=retina?"data-src-retina":"data-src",images=this,loaded;this.one("unveil",function(){var source=this.getAttribute(attrib);source=source||this.getAttribute("data-src");if(source){this.setAttribute("src",source);if(typeof callback==="function")callback.call(this);}});function unveil(){var inview=images.filter(function(){var $e=$(this);if($e.is(":hidden"))return;var wt=$w.scrollTop(),wb=wt+$w.height(),et=$e.offset().top,eb=et+$e.height();return eb>=wt-th&&et<=wb+th;});loaded=inview.trigger("unveil");images=images.not(loaded);}
1383$w.scroll(unveil);$w.resize(unveil);unveil();return this;};})(window.jQuery||window.Zepto);;;
1384;(function($,window,document,undefined){function Owl(element,options){this.settings=null;this.options=$.extend({},Owl.Defaults,options);this.$element=$(element);this._handlers={};this._plugins={};this._supress={};this._current=null;this._speed=null;this._coordinates=[];this._breakpoint=null;this._width=null;this._items=[];this._clones=[];this._mergers=[];this._widths=[];this._invalidated={};this._pipe=[];this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null};this._states={current:{},tags:{'initializing':['busy'],'animating':['busy'],'dragging':['interacting']}};$.each(['onResize','onThrottledResize'],$.proxy(function(i,handler){this._handlers[handler]=$.proxy(this[handler],this);},this));$.each(Owl.Plugins,$.proxy(function(key,plugin){this._plugins[key.charAt(0).toLowerCase()+key.slice(1)]=new plugin(this);},this));$.each(Owl.Workers,$.proxy(function(priority,worker){this._pipe.push({'filter':worker.filter,'run':$.proxy(worker.run,this)});},this));this.setup();this.initialize();}
1385Owl.Defaults={items:3,loop:false,center:false,rewind:false,checkVisibility:true,mouseDrag:true,touchDrag:true,pullDrag:true,freeDrag:false,margin:0,stagePadding:0,merge:false,mergeFit:true,autoWidth:false,startPosition:0,rtl:false,smartSpeed:250,fluidSpeed:false,dragEndSpeed:false,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:window,fallbackEasing:'swing',slideTransition:'',info:false,nestedItemSelector:false,itemElement:'div',stageElement:'div',refreshClass:'owl-refresh',loadedClass:'owl-loaded',loadingClass:'owl-loading',rtlClass:'owl-rtl',responsiveClass:'owl-responsive',dragClass:'owl-drag',itemClass:'owl-item',stageClass:'owl-stage',stageOuterClass:'owl-stage-outer',grabClass:'owl-grab',excludeDraggable:[]};Owl.Width={Default:'default',Inner:'inner',Outer:'outer'};Owl.Type={Event:'event',State:'state'};Owl.Plugins={};Owl.Workers=[{filter:['width','settings'],run:function(){this._width=this.$element.width();}},{filter:['width','items','settings'],run:function(cache){cache.current=this._items&&this._items[this.relative(this._current)];}},{filter:['items','settings'],run:function(){this.$stage.children('.cloned').remove();}},{filter:['width','items','settings'],run:function(cache){var margin=this.settings.margin||'',grid=!this.settings.autoWidth,rtl=this.settings.rtl,css={'width':'auto','margin-left':rtl?margin:'','margin-right':rtl?'':margin};!grid&&this.$stage.children().css(css);cache.css=css;}},{filter:['width','items','settings'],run:function(cache){var width=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,merge=null,iterator=this._items.length,grid=!this.settings.autoWidth,widths=[];cache.items={merge:false,width:width};while(iterator--){merge=this._mergers[iterator];merge=this.settings.mergeFit&&Math.min(merge,this.settings.items)||merge;cache.items.merge=merge>1||cache.items.merge;
vendor: 47,851 bytes, lines 1385-1494
1385widths[iterator]=!grid?this._items[iterator].width():width*merge;}
1386this._widths=widths;}},{filter:['items','settings'],run:function(){var clones=[],items=this._items,settings=this.settings,view=Math.max(settings.items*2,4),size=Math.ceil(items.length/2)*2,repeat=settings.loop&&items.length?settings.rewind?view:Math.max(view,size):0,append='',prepend='';repeat/=2;while(repeat>0){clones.push(this.normalize(clones.length/2,true));append=append+items[clones[clones.length-1]][0].outerHTML;clones.push(this.normalize(items.length-1-(clones.length-1)/2,true));prepend=items[clones[clones.length-1]][0].outerHTML+prepend;repeat-=1;}
1387this._clones=clones;$(append).addClass('cloned').appendTo(this.$stage);$(prepend).addClass('cloned').prependTo(this.$stage);}},{filter:['width','items','settings'],run:function(){var rtl=this.settings.rtl?1:-1,size=this._clones.length+this._items.length,iterator=-1,previous=0,current=0,coordinates=[];while(++iterator<size){previous=coordinates[iterator-1]||0;current=this._widths[this.relative(iterator)]+this.settings.margin;coordinates.push(previous+current*rtl);}
1388this._coordinates=coordinates;}},{filter:['width','items','settings'],run:function(){var padding=this.settings.stagePadding,coordinates=this._coordinates,css={'width':Math.ceil(Math.abs(coordinates[coordinates.length-1]))+padding*2,'padding-left':padding||'','padding-right':padding||''};this.$stage.css(css);}},{filter:['width','items','settings'],run:function(cache){var iterator=this._coordinates.length,grid=!this.settings.autoWidth,items=this.$stage.children();if(grid&&cache.items.merge){while(iterator--){cache.css.width=this._widths[this.relative(iterator)];items.eq(iterator).css(cache.css);}}else if(grid){cache.css.width=cache.items.width;items.css(cache.css);}}},{filter:['items'],run:function(){this._coordinates.length<1&&this.$stage.removeAttr('style');}},{filter:['width','items','settings'],run:function(cache){cache.current=cache.current?this.$stage.children().index(cache.current):0;cache.current=Math.max(this.minimum(),Math.min(this.maximum(),cache.current));this.reset(cache.current);}},{filter:['position'],run:function(){this.animate(this.coordinates(this._current));}},{filter:['width','position','items','settings'],run:function(){var rtl=this.settings.rtl?1:-1,padding=this.settings.stagePadding*2,begin=this.coordinates(this.current())+padding,end=begin+this.width()*rtl,inner,outer,matches=[],i,n;for(i=0,n=this._coordinates.length;i<n;i++){inner=this._coordinates[i-1]||0;outer=Math.abs(this._coordinates[i])+padding*rtl;if((this.op(inner,'<=',begin)&&(this.op(inner,'>',end)))||(this.op(outer,'<',begin)&&this.op(outer,'>',end))){matches.push(i);}}
1389this.$stage.children('.active').removeClass('active');this.$stage.children(':eq('+matches.join('), :eq(')+')').addClass('active');this.$stage.children('.center').removeClass('center');if(this.settings.center){this.$stage.children().eq(this.current()).addClass('center');}}}];Owl.prototype.initializeStage=function(){this.$stage=this.$element.find('.'+this.settings.stageClass);if(this.$stage.length){return;}
1390this.$element.addClass(this.options.loadingClass);this.$stage=$('<'+this.settings.stageElement+'>',{"class":this.settings.stageClass}).wrap($('<div/>',{"class":this.settings.stageOuterClass}));this.$element.append(this.$stage.parent());};Owl.prototype.initializeItems=function(){var $items=this.$element.find('.owl-item');if($items.length){this._items=$items.get().map(function(item){return $(item);});this._mergers=this._items.map(function(){return 1;});this.refresh();return;}
1391this.replace(this.$element.children().not(this.$stage.parent()));if(this.isVisible()){this.refresh();}else{this.invalidate('width');}
1392this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass);};Owl.prototype.initialize=function(){this.enter('initializing');this.trigger('initialize');this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl);if(this.settings.autoWidth&&!this.is('pre-loading')){var imgs,nestedSelector,width;imgs=this.$element.find('img');nestedSelector=this.settings.nestedItemSelector?'.'+this.settings.nestedItemSelector:undefined;width=this.$element.children(nestedSelector).width();if(imgs.length&&width<=0){this.preloadAutoWidthImages(imgs);}}
1393this.initializeStage();this.initializeItems();this.registerEventHandlers();this.leave('initializing');this.trigger('initialized');};Owl.prototype.isVisible=function(){return this.settings.checkVisibility?this.$element.is(':visible'):true;};Owl.prototype.setup=function(){var viewport=this.viewport(),overwrites=this.options.responsive,match=-1,settings=null;if(!overwrites){settings=$.extend({},this.options);}else{$.each(overwrites,function(breakpoint){if(breakpoint<=viewport&&breakpoint>match){match=Number(breakpoint);}});settings=$.extend({},this.options,overwrites[match]);if(typeof settings.stagePadding==='function'){settings.stagePadding=settings.stagePadding();}
1394delete settings.responsive;if(settings.responsiveClass){this.$element.attr('class',this.$element.attr('class').replace(new RegExp('('+this.options.responsiveClass+'-)\\S+\\s','g'),'$1'+match));}}
1395this.trigger('change',{property:{name:'settings',value:settings}});this._breakpoint=match;this.settings=settings;this.invalidate('settings');this.trigger('changed',{property:{name:'settings',value:this.settings}});};Owl.prototype.optionsLogic=function(){if(this.settings.autoWidth){this.settings.stagePadding=false;this.settings.merge=false;}};Owl.prototype.prepare=function(item){var event=this.trigger('prepare',{content:item});if(!event.data){event.data=$('<'+this.settings.itemElement+'/>').addClass(this.options.itemClass).append(item)}
1396this.trigger('prepared',{content:event.data});return event.data;};Owl.prototype.update=function(){var i=0,n=this._pipe.length,filter=$.proxy(function(p){return this[p]},this._invalidated),cache={};while(i<n){if(this._invalidated.all||$.grep(this._pipe[i].filter,filter).length>0){this._pipe[i].run(cache);}
1397i++;}
1398this._invalidated={};!this.is('valid')&&this.enter('valid');};Owl.prototype.width=function(dimension){dimension=dimension||Owl.Width.Default;switch(dimension){case Owl.Width.Inner:case Owl.Width.Outer:return this._width;default:return this._width-this.settings.stagePadding*2+this.settings.margin;}};Owl.prototype.refresh=function(){this.enter('refreshing');this.trigger('refresh');this.setup();this.optionsLogic();this.$element.addClass(this.options.refreshClass);this.update();this.$element.removeClass(this.options.refreshClass);this.leave('refreshing');this.trigger('refreshed');};Owl.prototype.onThrottledResize=function(){window.clearTimeout(this.resizeTimer);this.resizeTimer=window.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate);};Owl.prototype.onResize=function(){if(!this._items.length){return false;}
1399if(this._width===this.$element.width()){return false;}
1400if(!this.isVisible()){return false;}
1401this.enter('resizing');if(this.trigger('resize').isDefaultPrevented()){this.leave('resizing');return false;}
1402this.invalidate('width');this.refresh();this.leave('resizing');this.trigger('resized');};Owl.prototype.registerEventHandlers=function(){if($.support.transition){this.$stage.on($.support.transition.end+'.owl.core',$.proxy(this.onTransitionEnd,this));}
1403if(this.settings.responsive!==false){this.on(window,'resize',this._handlers.onThrottledResize);}
1404if(this.settings.mouseDrag){this.$element.addClass(this.options.dragClass);this.$stage.on('mousedown.owl.core',$.proxy(this.onDragStart,this));this.$stage.on('dragstart.owl.core selectstart.owl.core',function(){return false});}
1405if(this.settings.touchDrag){this.$stage.on('touchstart.owl.core',$.proxy(this.onDragStart,this));this.$stage.on('touchcancel.owl.core',$.proxy(this.onDragEnd,this));}};Owl.prototype.onDragStart=function(event){this.$element.addClass(this.options.dragClass);this.$stage.on('dragstart.owl.core selectstart.owl.core',function(){return false});var ignoreDrag=false;var targetClassList=event.target.className.split(" ");$(this.options.excludeDraggable).each(function(i,e){ignoreDrag=ignoreDrag||targetClassList.indexOf(e)>-1;});if(ignoreDrag){this.$element.removeClass(this.options.dragClass);this.$stage.off('dragstart.owl.core selectstart.owl.core');return;}
1406var stage=null;if(event.which===3){return;}
1407if($.support.transform){stage=this.$stage.css('transform').replace(/.*\(|\)| /g,'').split(',');stage={x:stage[stage.length===16?12:4],y:stage[stage.length===16?13:5]};}else{stage=this.$stage.position();stage={x:this.settings.rtl?stage.left+this.$stage.width()-this.width()+this.settings.margin:stage.left,y:stage.top};}
1408if(this.is('animating')){$.support.transform?this.animate(stage.x):this.$stage.stop()
1409this.invalidate('position');}
1410this.$element.toggleClass(this.options.grabClass,event.type==='mousedown');this.speed(0);this._drag.time=new Date().getTime();this._drag.target=$(event.target);this._drag.stage.start=stage;this._drag.stage.current=stage;this._drag.pointer=this.pointer(event);$(document).on('mouseup.owl.core touchend.owl.core',$.proxy(this.onDragEnd,this));$(document).one('mousemove.owl.core touchmove.owl.core',$.proxy(function(event){var delta=this.difference(this._drag.pointer,this.pointer(event));$(document).on('mousemove.owl.core touchmove.owl.core',$.proxy(this.onDragMove,this));if(Math.abs(delta.x)<Math.abs(delta.y)&&this.is('valid')){return;}
1411event.preventDefault();this.enter('dragging');this.trigger('drag');},this));};Owl.prototype.onDragMove=function(event){var minimum=null,maximum=null,pull=null,delta=this.difference(this._drag.pointer,this.pointer(event)),stage=this.difference(this._drag.stage.start,delta);if(!this.is('dragging')){return;}
1412event.preventDefault();if(this.settings.loop){minimum=this.coordinates(this.minimum());maximum=this.coordinates(this.maximum()+1)-minimum;stage.x=(((stage.x-minimum)%maximum+maximum)%maximum)+minimum;}else{minimum=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum());maximum=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum());pull=this.settings.pullDrag?-1*delta.x/5:0;stage.x=Math.max(Math.min(stage.x,minimum+pull),maximum+pull);}
1413this._drag.stage.current=stage;this.animate(stage.x);};Owl.prototype.onDragEnd=function(event){var delta=this.difference(this._drag.pointer,this.pointer(event)),stage=this._drag.stage.current,direction=delta.x>0^this.settings.rtl?'left':'right';$(document).off('.owl.core');this.$element.removeClass(this.options.grabClass);if(delta.x!==0&&this.is('dragging')||!this.is('valid')){this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed);this.current(this.closest(stage.x,delta.x!==0?direction:this._drag.direction));this.invalidate('position');this.update();this._drag.direction=direction;if(Math.abs(delta.x)>3||new Date().getTime()-this._drag.time>300){this._drag.target.one('click.owl.core',function(){return false;});}}
1414if(!this.is('dragging')){return;}
1415this.leave('dragging');this.trigger('dragged');};Owl.prototype.closest=function(coordinate,direction){var position=-1,pull=30,width=this.width(),coordinates=this.coordinates();if(!this.settings.freeDrag){$.each(coordinates,$.proxy(function(index,value){if(direction==='left'&&coordinate>value-pull&&coordinate<value+pull){position=index;}else if(direction==='right'&&coordinate>value-width-pull&&coordinate<value-width+pull){position=index+1;}else if(this.op(coordinate,'<',value)&&this.op(coordinate,'>',coordinates[index+1]!==undefined?coordinates[index+1]:value-width)){position=direction==='left'?index+1:index;}
1416return position===-1;},this));}
1417if(!this.settings.loop){if(this.op(coordinate,'>',coordinates[this.minimum()])){position=coordinate=this.minimum();}else if(this.op(coordinate,'<',coordinates[this.maximum()])){position=coordinate=this.maximum();}}
1418return position;};Owl.prototype.animate=function(coordinate){var animate=this.speed()>0;this.is('animating')&&this.onTransitionEnd();if(animate){this.enter('animating');this.trigger('translate');}
1419if($.support.transform3d&&$.support.transition){this.$stage.css({transform:'translate3d('+coordinate+'px,0px,0px)',transition:(this.speed()/1000)+'s'+(this.settings.slideTransition?' '+this.settings.slideTransition:'')});}else if(animate){this.$stage.animate({left:coordinate+'px'},this.speed(),this.settings.fallbackEasing,$.proxy(this.onTransitionEnd,this));}else{this.$stage.css({left:coordinate+'px'});}};Owl.prototype.is=function(state){return this._states.current[state]&&this._states.current[state]>0;};Owl.prototype.current=function(position){if(position===undefined){return this._current;}
1420if(this._items.length===0){return undefined;}
1421position=this.normalize(position);if(this._current!==position){var event=this.trigger('change',{property:{name:'position',value:position}});if(event.data!==undefined){position=this.normalize(event.data);}
1422this._current=position;this.invalidate('position');this.trigger('changed',{property:{name:'position',value:this._current}});}
1423return this._current;};Owl.prototype.invalidate=function(part){if($.type(part)==='string'){this._invalidated[part]=true;this.is('valid')&&this.leave('valid');}
1424return $.map(this._invalidated,function(v,i){return i});};Owl.prototype.reset=function(position){position=this.normalize(position);if(position===undefined){return;}
1425this._speed=0;this._current=position;this.suppress(['translate','translated']);this.animate(this.coordinates(position));this.release(['translate','translated']);};Owl.prototype.normalize=function(position,relative){var n=this._items.length,m=relative?0:this._clones.length;if(!this.isNumeric(position)||n<1){position=undefined;}else if(position<0||position>=n+m){position=((position-m/2)%n+n)%n+m/2;}
1426return position;};Owl.prototype.relative=function(position){position-=this._clones.length/2;return this.normalize(position,true);};Owl.prototype.maximum=function(relative){var settings=this.settings,maximum=this._coordinates.length,iterator,reciprocalItemsWidth,elementWidth;if(settings.loop){maximum=this._clones.length/2+this._items.length-1;}else if(settings.autoWidth||settings.merge){iterator=this._items.length;if(iterator){reciprocalItemsWidth=this._items[--iterator].width();elementWidth=this.$element.width();while(iterator--){reciprocalItemsWidth+=this._items[iterator].width()+this.settings.margin;if(reciprocalItemsWidth>elementWidth){break;}}}
1427maximum=iterator+1;}else if(settings.center){maximum=this._items.length-1;}else{maximum=this._items.length-settings.items;}
1428if(relative){maximum-=this._clones.length/2;}
1429return Math.max(maximum,0);};Owl.prototype.minimum=function(relative){return relative?0:this._clones.length/2;};Owl.prototype.items=function(position){if(position===undefined){return this._items.slice();}
1430position=this.normalize(position,true);return this._items[position];};Owl.prototype.mergers=function(position){if(position===undefined){return this._mergers.slice();}
1431position=this.normalize(position,true);return this._mergers[position];};Owl.prototype.clones=function(position){var odd=this._clones.length/2,even=odd+this._items.length,map=function(index){return index%2===0?even+index/2:odd-(index+1)/2};if(position===undefined){return $.map(this._clones,function(v,i){return map(i)});}
1432return $.map(this._clones,function(v,i){return v===position?map(i):null});};Owl.prototype.speed=function(speed){if(speed!==undefined){this._speed=speed;}
1433return this._speed;};Owl.prototype.coordinates=function(position){var multiplier=1,newPosition=position-1,coordinate;if(position===undefined){return $.map(this._coordinates,$.proxy(function(coordinate,index){return this.coordinates(index);},this));}
1434if(this.settings.center){if(this.settings.rtl){multiplier=-1;newPosition=position+1;}
1435coordinate=this._coordinates[position];coordinate+=(this.width()-coordinate+(this._coordinates[newPosition]||0))/2*multiplier;}else{coordinate=this._coordinates[newPosition]||0;}
1436coordinate=Math.ceil(coordinate);return coordinate;};Owl.prototype.duration=function(from,to,factor){if(factor===0){return 0;}
1437return Math.min(Math.max(Math.abs(to-from),1),6)*Math.abs((factor||this.settings.smartSpeed));};Owl.prototype.to=function(position,speed){var current=this.current(),revert=null,distance=position-this.relative(current),direction=(distance>0)-(distance<0),items=this._items.length,minimum=this.minimum(),maximum=this.maximum();if(this.settings.loop){if(!this.settings.rewind&&Math.abs(distance)>items/2){distance+=direction* -1*items;}
1438position=current+distance;revert=((position-minimum)%items+items)%items+minimum;if(revert!==position&&revert-distance<=maximum&&revert-distance>0){current=revert-distance;position=revert;this.reset(current);}}else if(this.settings.rewind){maximum+=1;position=(position%maximum+maximum)%maximum;}else{position=Math.max(minimum,Math.min(maximum,position));}
1439this.speed(this.duration(current,position,speed));this.current(position);if(this.isVisible()){this.update();}};Owl.prototype.next=function(speed){speed=speed||false;this.to(this.relative(this.current())+1,speed);};Owl.prototype.prev=function(speed){speed=speed||false;this.to(this.relative(this.current())-1,speed);};Owl.prototype.onTransitionEnd=function(event){if(event!==undefined){event.stopPropagation();if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){return false;}}
1440this.leave('animating');this.trigger('translated');};Owl.prototype.viewport=function(){var width;if(this.options.responsiveBaseElement!==window){width=$(this.options.responsiveBaseElement).width();}else if(window.innerWidth){width=window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){width=document.documentElement.clientWidth;}else{console.warn('Can not detect viewport width.');}
1441return width;};Owl.prototype.replace=function(content){this.$stage.empty();this._items=[];if(content){content=(content instanceof jQuery)?content:$(content);}
1442if(this.settings.nestedItemSelector){content=content.find('.'+this.settings.nestedItemSelector);}
1443content.filter(function(){return this.nodeType===1;}).each($.proxy(function(index,item){item=this.prepare(item);this.$stage.append(item);this._items.push(item);this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge')*1||1);},this));this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0);this.invalidate('items');};Owl.prototype.add=function(content,position){var current=this.relative(this._current);position=position===undefined?this._items.length:this.normalize(position,true);content=content instanceof jQuery?content:$(content);this.trigger('add',{content:content,position:position});content=this.prepare(content);if(this._items.length===0||position===this._items.length){this._items.length===0&&this.$stage.append(content);this._items.length!==0&&this._items[position-1].after(content);this._items.push(content);this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge')*1||1);}else{this._items[position].before(content);this._items.splice(position,0,content);this._mergers.splice(position,0,content.find('[data-merge]').addBack('[data-merge]').attr('data-merge')*1||1);}
1444this._items[current]&&this.reset(this._items[current].index());this.invalidate('items');this.trigger('added',{content:content,position:position});};Owl.prototype.remove=function(position){position=this.normalize(position,true);if(position===undefined){return;}
1445this.trigger('remove',{content:this._items[position],position:position});this._items[position].remove();this._items.splice(position,1);this._mergers.splice(position,1);this.invalidate('items');this.trigger('removed',{content:null,position:position});};Owl.prototype.preloadAutoWidthImages=function(images){images.each($.proxy(function(i,element){this.enter('pre-loading');element=$(element);$(new Image()).one('load',$.proxy(function(e){element.attr('src',e.target.src);element.css('opacity',1);this.leave('pre-loading');!this.is('pre-loading')&&!this.is('initializing')&&this.refresh();},this)).attr('src',element.attr('src')||element.attr('data-src')||element.attr('data-src-retina'));},this));};Owl.prototype.destroy=function(){this.$element.off('.owl.core');this.$stage.off('.owl.core');$(document).off('.owl.core');if(this.settings.responsive!==false){window.clearTimeout(this.resizeTimer);this.off(window,'resize',this._handlers.onThrottledResize);}
1446for(var i in this._plugins){this._plugins[i].destroy();}
1447this.$stage.children('.cloned').remove();this.$stage.unwrap();this.$stage.children().contents().unwrap();this.$stage.children().unwrap();this.$stage.remove();this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr('class',this.$element.attr('class').replace(new RegExp(this.options.responsiveClass+'-\\S+\\s','g'),'')).removeData('owl.carousel');};Owl.prototype.op=function(a,o,b){var rtl=this.settings.rtl;switch(o){case'<':return rtl?a>b:a<b;case'>':return rtl?a<b:a>b;case'>=':return rtl?a<=b:a>=b;case'<=':return rtl?a>=b:a<=b;default:break;}};Owl.prototype.on=function(element,event,listener,capture){if(element.addEventListener){element.addEventListener(event,listener,capture);}else if(element.attachEvent){element.attachEvent('on'+event,listener);}};Owl.prototype.off=function(element,event,listener,capture){if(element.removeEventListener){element.removeEventListener(event,listener,capture);}else if(element.detachEvent){element.detachEvent('on'+event,listener);}};Owl.prototype.trigger=function(name,data,namespace,state,enter){var status={item:{count:this._items.length,index:this.current()}},handler=$.camelCase($.grep(['on',name,namespace],function(v){return v}).join('-').toLowerCase()),event=$.Event([name,'owl',namespace||'carousel'].join('.').toLowerCase(),$.extend({relatedTarget:this},status,data));if(!this._supress[name]){$.each(this._plugins,function(name,plugin){if(plugin.onTrigger){plugin.onTrigger(event);}});this.register({type:Owl.Type.Event,name:name});this.$element.trigger(event);if(this.settings&&typeof this.settings[handler]==='function'){this.settings[handler].call(this,event);}}
1448return event;};Owl.prototype.enter=function(name){$.each([name].concat(this._states.tags[name]||[]),$.proxy(function(i,name){if(this._states.current[name]===undefined){this._states.current[name]=0;}
1449this._states.current[name]++;},this));};Owl.prototype.leave=function(name){$.each([name].concat(this._states.tags[name]||[]),$.proxy(function(i,name){this._states.current[name]--;},this));};Owl.prototype.register=function(object){if(object.type===Owl.Type.Event){if(!$.event.special[object.name]){$.event.special[object.name]={};}
1450if(!$.event.special[object.name].owl){var _default=$.event.special[object.name]._default;$.event.special[object.name]._default=function(e){if(_default&&_default.apply&&(!e.namespace||e.namespace.indexOf('owl')===-1)){return _default.apply(this,arguments);}
1451return e.namespace&&e.namespace.indexOf('owl')>-1;};$.event.special[object.name].owl=true;}}else if(object.type===Owl.Type.State){if(!this._states.tags[object.name]){this._states.tags[object.name]=object.tags;}else{this._states.tags[object.name]=this._states.tags[object.name].concat(object.tags);}
1452this._states.tags[object.name]=$.grep(this._states.tags[object.name],$.proxy(function(tag,i){return $.inArray(tag,this._states.tags[object.name])===i;},this));}};Owl.prototype.suppress=function(events){$.each(events,$.proxy(function(index,event){this._supress[event]=true;},this));};Owl.prototype.release=function(events){$.each(events,$.proxy(function(index,event){delete this._supress[event];},this));};Owl.prototype.pointer=function(event){var result={x:null,y:null};event=event.originalEvent||event||window.event;event=event.touches&&event.touches.length?event.touches[0]:event.changedTouches&&event.changedTouches.length?event.changedTouches[0]:event;if(event.pageX){result.x=event.pageX;result.y=event.pageY;}else{result.x=event.clientX;result.y=event.clientY;}
1453return result;};Owl.prototype.isNumeric=function(number){return!isNaN(parseFloat(number));};Owl.prototype.difference=function(first,second){return{x:first.x-second.x,y:first.y-second.y};};$.fn.owlCarousel=function(option){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){var $this=$(this),data=$this.data('owl.carousel');if(!data){data=new Owl(this,typeof option=='object'&&option);$this.data('owl.carousel',data);$.each(['next','prev','to','destroy','refresh','replace','add','remove'],function(i,event){data.register({type:Owl.Type.Event,name:event});data.$element.on(event+'.owl.carousel.core',$.proxy(function(e){if(e.namespace&&e.relatedTarget!==this){this.suppress([event]);data[event].apply(this,[].slice.call(arguments,1));this.release([event]);}},data));});}
1454if(typeof option=='string'&&option.charAt(0)!=='_'){data[option].apply(data,args);}});};$.fn.owlCarousel.Constructor=Owl;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var AutoRefresh=function(carousel){this._core=carousel;this._interval=null;this._visible=null;this._handlers={'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.autoRefresh){this.watch();}},this)};this._core.options=$.extend({},AutoRefresh.Defaults,this._core.options);this._core.$element.on(this._handlers);};AutoRefresh.Defaults={autoRefresh:true,autoRefreshInterval:500};AutoRefresh.prototype.watch=function(){if(this._interval){return;}
1455this._visible=this._core.isVisible();this._interval=window.setInterval($.proxy(this.refresh,this),this._core.settings.autoRefreshInterval);};AutoRefresh.prototype.refresh=function(){if(this._core.isVisible()===this._visible){return;}
1456this._visible=!this._visible;this._core.$element.toggleClass('owl-hidden',!this._visible);this._visible&&(this._core.invalidate('width')&&this._core.refresh());};AutoRefresh.prototype.destroy=function(){var handler,property;window.clearInterval(this._interval);for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler]);}
1457for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.AutoRefresh=AutoRefresh;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var Lazy=function(carousel){this._core=carousel;this._loaded=[];this._handlers={'initialized.owl.carousel change.owl.carousel resized.owl.carousel':$.proxy(function(e){if(!e.namespace){return;}
1458if(!this._core.settings||!this._core.settings.lazyLoad){return;}
1459if((e.property&&e.property.name=='position')||e.type=='initialized'){var settings=this._core.settings,n=(settings.center&&Math.ceil(settings.items/2)||settings.items),i=((settings.center&&n* -1)||0),position=(e.property&&e.property.value!==undefined?e.property.value:this._core.current())+i,clones=this._core.clones().length,load=$.proxy(function(i,v){this.load(v)},this);if(settings.lazyLoadEager>0){n+=settings.lazyLoadEager;if(settings.loop){position-=settings.lazyLoadEager;n++;}}
1460while(i++<n){this.load(clones/2+this._core.relative(position));clones&&$.each(this._core.clones(this._core.relative(position)),load);position++;}}},this)};this._core.options=$.extend({},Lazy.Defaults,this._core.options);this._core.$element.on(this._handlers);};Lazy.Defaults={lazyLoad:false,lazyLoadEager:0};Lazy.prototype.load=function(position){var $item=this._core.$stage.children().eq(position),$elements=$item&&$item.find('.owl-lazy');if(!$elements||$.inArray($item.get(0),this._loaded)>-1){return;}
1461$elements.each($.proxy(function(index,element){var $element=$(element),image,url=(window.devicePixelRatio>1&&$element.attr('data-src-retina'))||$element.attr('data-src')||$element.attr('data-srcset');this._core.trigger('load',{element:$element,url:url},'lazy');if($element.is('img')){$element.one('load.owl.lazy',$.proxy(function(){$element.css('opacity',1);this._core.trigger('loaded',{element:$element,url:url},'lazy');},this)).attr('src',url);}else if($element.is('source')){$element.one('load.owl.lazy',$.proxy(function(){this._core.trigger('loaded',{element:$element,url:url},'lazy');},this)).attr('srcset',url);}else{image=new Image();image.onload=$.proxy(function(){$element.css({'background-image':'url("'+url+'")','opacity':'1'});this._core.trigger('loaded',{element:$element,url:url},'lazy');},this);image.src=url;}},this));this._loaded.push($item.get(0));};Lazy.prototype.destroy=function(){var handler,property;for(handler in this.handlers){this._core.$element.off(handler,this.handlers[handler]);}
1462for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var AutoHeight=function(carousel){this._core=carousel;this._previousHeight=null;this._handlers={'initialized.owl.carousel refreshed.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.autoHeight){this.update();}},this),'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.autoHeight&&e.property.name==='position'){this.update();}},this),'loaded.owl.lazy':$.proxy(function(e){if(e.namespace&&this._core.settings.autoHeight&&e.element.closest('.'+this._core.settings.itemClass).index()===this._core.current()){this.update();}},this)};this._core.options=$.extend({},AutoHeight.Defaults,this._core.options);this._core.$element.on(this._handlers);this._intervalId=null;var refThis=this;$(window).on('load',function(){if(refThis._core.settings.autoHeight){refThis.update();}});$(window).resize(function(){if(refThis._core.settings.autoHeight){if(refThis._intervalId!=null){clearTimeout(refThis._intervalId);}
1463refThis._intervalId=setTimeout(function(){refThis.update();},250);}});};AutoHeight.Defaults={autoHeight:false,autoHeightClass:'owl-height'};AutoHeight.prototype.update=function(){var start=this._core._current,end=start+this._core.settings.items,lazyLoadEnabled=this._core.settings.lazyLoad,visible=this._core.$stage.children().toArray().slice(start,end),heights=[],maxheight=0;$.each(visible,function(index,item){heights.push($(item).height());});maxheight=Math.max.apply(null,heights);if(maxheight<=1&&lazyLoadEnabled&&this._previousHeight){maxheight=this._previousHeight;}
1464this._previousHeight=maxheight;this._core.$stage.parent().height(maxheight).addClass(this._core.settings.autoHeightClass);};AutoHeight.prototype.destroy=function(){var handler,property;for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler]);}
1465for(property in Object.getOwnPropertyNames(this)){typeof this[property]!=='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var Video=function(carousel){this._core=carousel;this._videos={};this._playing=null;this._handlers={'initialized.owl.carousel':$.proxy(function(e){if(e.namespace){this._core.register({type:'state',name:'playing',tags:['interacting']});}},this),'resize.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.video&&this.isInFullScreen()){e.preventDefault();}},this),'refreshed.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.is('resizing')){this._core.$stage.find('.cloned .owl-video-frame').remove();}},this),'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name==='position'&&this._playing){this.stop();}},this),'prepared.owl.carousel':$.proxy(function(e){if(!e.namespace){return;}
1466var $element=$(e.content).find('.owl-video');if($element.length){$element.css('display','none');this.fetch($element,$(e.content));}},this)};this._core.options=$.extend({},Video.Defaults,this._core.options);this._core.$element.on(this._handlers);this._core.$element.on('click.owl.video','.owl-video-play-icon',$.proxy(function(e){this.play(e);},this));};Video.Defaults={video:false,videoHeight:false,videoWidth:false};Video.prototype.fetch=function(target,item){var type=(function(){if(target.attr('data-vimeo-id')){return'vimeo';}else if(target.attr('data-vzaar-id')){return'vzaar'}else{return'youtube';}})(),id=target.attr('data-vimeo-id')||target.attr('data-youtube-id')||target.attr('data-vzaar-id'),width=target.attr('data-width')||this._core.settings.videoWidth,height=target.attr('data-height')||this._core.settings.videoHeight,url=target.attr('href');if(url){id=url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);if(id[3].indexOf('youtu')>-1){type='youtube';}else if(id[3].indexOf('vimeo')>-1){type='vimeo';}else if(id[3].indexOf('vzaar')>-1){type='vzaar';}else{throw new Error('Video URL not supported.');}
1467id=id[6];}else{throw new Error('Missing video URL.');}
1468this._videos[url]={type:type,id:id,width:width,height:height};item.attr('data-video',url);this.thumbnail(target,this._videos[url]);};Video.prototype.thumbnail=function(target,video){var tnLink,icon,path,dimensions=video.width&&video.height?'width:'+video.width+'px;height:'+video.height+'px;':'',customTn=target.find('img'),srcType='src',lazyClass='',settings=this._core.settings,create=function(path){icon='<div class="owl-video-play-icon"></div>';if(settings.lazyLoad){tnLink=$('<div/>',{"class":'owl-video-tn '+lazyClass,"srcType":path});}else{tnLink=$('<div/>',{"class":"owl-video-tn","style":'opacity:1;background-image:url('+path+')'});}
1469target.after(tnLink);target.after(icon);};target.wrap($('<div/>',{"class":"owl-video-wrapper","style":dimensions}));if(this._core.settings.lazyLoad){srcType='data-src';lazyClass='owl-lazy';}
1470if(customTn.length){create(customTn.attr(srcType));customTn.remove();return false;}
1471if(video.type==='youtube'){path="//img.youtube.com/vi/"+video.id+"/hqdefault.jpg";create(path);}else if(video.type==='vimeo'){$.ajax({type:'GET',url:'//vimeo.com/api/v2/video/'+video.id+'.json',jsonp:'callback',dataType:'jsonp',success:function(data){path=data[0].thumbnail_large;create(path);}});}else if(video.type==='vzaar'){$.ajax({type:'GET',url:'//vzaar.com/api/videos/'+video.id+'.json',jsonp:'callback',dataType:'jsonp',success:function(data){path=data.framegrab_url;create(path);}});}};Video.prototype.stop=function(){this._core.trigger('stop',null,'video');this._playing.find('.owl-video-frame').remove();this._playing.removeClass('owl-video-playing');this._playing=null;this._core.leave('playing');this._core.trigger('stopped',null,'video');};Video.prototype.play=function(event){var target=$(event.target),item=target.closest('.'+this._core.settings.itemClass),video=this._videos[item.attr('data-video')],width=video.width||'100%',height=video.height||this._core.$stage.height(),html,iframe;if(this._playing){return;}
1472this._core.enter('playing');this._core.trigger('play',null,'video');item=this._core.items(this._core.relative(item.index()));this._core.reset(item.index());html=$('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>');html.attr('height',height);html.attr('width',width);if(video.type==='youtube'){html.attr('src','//www.youtube.com/embed/'+video.id+'?autoplay=1&rel=0&v='+video.id);}else if(video.type==='vimeo'){html.attr('src','//player.vimeo.com/video/'+video.id+'?autoplay=1');}else if(video.type==='vzaar'){html.attr('src','//view.vzaar.com/'+video.id+'/player?autoplay=true');}
1473iframe=$(html).wrap('<div class="owl-video-frame" />').insertAfter(item.find('.owl-video'));this._playing=item.addClass('owl-video-playing');};Video.prototype.isInFullScreen=function(){var element=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;return element&&$(element).parent().hasClass('owl-video-frame');};Video.prototype.destroy=function(){var handler,property;this._core.$element.off('click.owl.video');for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler]);}
1474for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.Video=Video;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var Animate=function(scope){this.core=scope;this.core.options=$.extend({},Animate.Defaults,this.core.options);this.swapping=true;this.previous=undefined;this.next=undefined;this.handlers={'change.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name=='position'){this.previous=this.core.current();this.next=e.property.value;}},this),'drag.owl.carousel dragged.owl.carousel translated.owl.carousel':$.proxy(function(e){if(e.namespace){this.swapping=e.type=='translated';}},this),'translate.owl.carousel':$.proxy(function(e){if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){this.swap();}},this)};this.core.$element.on(this.handlers);};Animate.Defaults={animateOut:false,animateIn:false};Animate.prototype.swap=function(){if(this.core.settings.items!==1){return;}
1475if(!$.support.animation||!$.support.transition){return;}
1476this.core.speed(0);var left,clear=$.proxy(this.clear,this),previous=this.core.$stage.children().eq(this.previous),next=this.core.$stage.children().eq(this.next),incoming=this.core.settings.animateIn,outgoing=this.core.settings.animateOut;if(this.core.current()===this.previous){return;}
1477if(outgoing){left=this.core.coordinates(this.previous)-this.core.coordinates(this.next);previous.one($.support.animation.end,clear).css({'left':left+'px'}).addClass('animated owl-animated-out').addClass(outgoing);}
1478if(incoming){next.one($.support.animation.end,clear).addClass('animated owl-animated-in').addClass(incoming);}};Animate.prototype.clear=function(e){$(e.target).css({'left':''}).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut);this.core.onTransitionEnd();};Animate.prototype.destroy=function(){var handler,property;for(handler in this.handlers){this.core.$element.off(handler,this.handlers[handler]);}
1479for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.Animate=Animate;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var Autoplay=function(carousel){this._core=carousel;this._call=null;this._time=0;this._timeout=0;this._paused=true;this._handlers={'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name==='settings'){if(this._core.settings.autoplay){this.play();}else{this.stop();}}else if(e.namespace&&e.property.name==='position'&&this._paused){this._time=0;}},this),'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.autoplay){this.play();}},this),'play.owl.autoplay':$.proxy(function(e,t,s){if(e.namespace){this.play(t,s);}},this),'stop.owl.autoplay':$.proxy(function(e){if(e.namespace){this.stop();}},this),'mouseover.owl.autoplay':$.proxy(function(){if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){this.pause();}},this),'mouseleave.owl.autoplay':$.proxy(function(){if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){this.play();}},this),'touchstart.owl.core':$.proxy(function(){if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){this.pause();}},this),'touchend.owl.core':$.proxy(function(){if(this._core.settings.autoplayHoverPause){this.play();}},this)};this._core.$element.on(this._handlers);this._core.options=$.extend({},Autoplay.Defaults,this._core.options);};Autoplay.Defaults={autoplay:false,autoplayTimeout:5000,autoplayHoverPause:false,autoplaySpeed:false};Autoplay.prototype._next=function(speed){this._call=window.setTimeout($.proxy(this._next,this,speed),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read());if(this._core.is('interacting')||document.hidden){return;}
1480this._core.next(speed||this._core.settings.autoplaySpeed);}
1481Autoplay.prototype.read=function(){return new Date().getTime()-this._time;};Autoplay.prototype.play=function(timeout,speed){var elapsed;if(!this._core.is('rotating')){this._core.enter('rotating');}
1482timeout=timeout||this._core.settings.autoplayTimeout;elapsed=Math.min(this._time%(this._timeout||timeout),timeout);if(this._paused){this._time=this.read();this._paused=false;}else{window.clearTimeout(this._call);}
1483this._time+=this.read()%timeout-elapsed;this._timeout=timeout;this._call=window.setTimeout($.proxy(this._next,this,speed),timeout-elapsed);};Autoplay.prototype.stop=function(){if(this._core.is('rotating')){this._time=0;this._paused=true;window.clearTimeout(this._call);this._core.leave('rotating');}};Autoplay.prototype.pause=function(){if(this._core.is('rotating')&&!this._paused){this._time=this.read();this._paused=true;window.clearTimeout(this._call);}};Autoplay.prototype.destroy=function(){var handler,property;this.stop();for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler]);}
1484for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){'use strict';var Navigation=function(carousel){this._core=carousel;this._initialized=false;this._pages=[];this._controls={};this._templates=[];this.$element=this._core.$element;this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to};this._handlers={'prepared.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){this._templates.push('<div class="'+this._core.settings.dotClass+'">'+
1485$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot')+'</div>');}},this),'added.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){this._templates.splice(e.position,0,this._templates.pop());}},this),'remove.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){this._templates.splice(e.position,1);}},this),'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name=='position'){this.draw();}},this),'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&!this._initialized){this._core.trigger('initialize',null,'navigation');this.initialize();this.update();this.draw();this._initialized=true;this._core.trigger('initialized',null,'navigation');}},this),'refreshed.owl.carousel':$.proxy(function(e){if(e.namespace&&this._initialized){this._core.trigger('refresh',null,'navigation');this.update();this.draw();this._core.trigger('refreshed',null,'navigation');}},this)};this._core.options=$.extend({},Navigation.Defaults,this._core.options);this.$element.on(this._handlers);};Navigation.Defaults={nav:false,navText:['<span aria-label="'+'Previous'+'">&#x2039;</span>','<span aria-label="'+'Next'+'">&#x203a;</span>'],navSpeed:false,navElement:'button type="button" role="presentation"',navContainer:false,navContainerClass:'owl-nav',navClass:['owl-prev','owl-next'],slideBy:1,dotClass:'owl-dot',dotsClass:'owl-dots',dots:true,dotsEach:false,dotsData:false,dotsSpeed:false,dotsContainer:false};Navigation.prototype.initialize=function(){var override,settings=this._core.settings;this._controls.$relative=(settings.navContainer?$(settings.navContainer):$('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');this._controls.$previous=$('<'+settings.navElement+'>').addClass(settings.navClass[0]).html(settings.navText[0]).prependTo(this._controls.$relative).on('click',$.proxy(function(e){this.prev(settings.navSpeed);},this));this._controls.$next=$('<'+settings.navElement+'>').addClass(settings.navClass[1]).html(settings.navText[1]).appendTo(this._controls.$relative).on('click',$.proxy(function(e){this.next(settings.navSpeed);},this));if(!settings.dotsData){this._templates=[$('<button role="button">').addClass(settings.dotClass).append($('<span>')).prop('outerHTML')];}
1486this._controls.$absolute=(settings.dotsContainer?$(settings.dotsContainer):$('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');this._controls.$absolute.on('click','button',$.proxy(function(e){var index=$(e.target).parent().is(this._controls.$absolute)?$(e.target).index():$(e.target).parent().index();e.preventDefault();this.to(index,settings.dotsSpeed);},this));for(override in this._overrides){this._core[override]=$.proxy(this[override],this);}};Navigation.prototype.destroy=function(){var handler,control,property,override,settings;settings=this._core.settings;for(handler in this._handlers){this.$element.off(handler,this._handlers[handler]);}
1487for(control in this._controls){if(control==='$relative'&&settings.navContainer){this._controls[control].html('');}else{this._controls[control].remove();}}
1488for(override in this.overides){this._core[override]=this._overrides[override];}
1489for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};Navigation.prototype.update=function(){var i,j,k,lower=this._core.clones().length/2,upper=lower+this._core.items().length,maximum=this._core.maximum(true),settings=this._core.settings,size=settings.center||settings.autoWidth||settings.dotsData?1:settings.dotsEach||settings.items;if(settings.slideBy!=='page'){settings.slideBy=Math.min(settings.slideBy,settings.items);}
1490if(settings.dots||settings.slideBy=='page'){this._pages=[];for(i=lower,j=0,k=0;i<upper;i++){if(j>=size||j===0){this._pages.push({start:Math.min(maximum,i-lower),end:i-lower+size-1});if(Math.min(maximum,i-lower)===maximum){break;}
1491j=0,++k;}
1492j+=this._core.mergers(this._core.relative(i));}}};Navigation.prototype.draw=function(){var difference,settings=this._core.settings,disabled=this._core.items().length<=settings.items,index=this._core.relative(this._core.current()),loop=settings.loop||settings.rewind;this._controls.$relative.toggleClass('disabled',!settings.nav||disabled);if(settings.nav){this._controls.$previous.toggleClass('disabled',!loop&&index<=this._core.minimum(true));this._controls.$next.toggleClass('disabled',!loop&&index>=this._core.maximum(true));}
1493this._controls.$absolute.toggleClass('disabled',!settings.dots||disabled);if(settings.dots){difference=this._pages.length-this._controls.$absolute.children().length;if(settings.dotsData&&difference!==0){this._controls.$absolute.html(this._templates.join(''));}else if(difference>0){this._controls.$absolute.append(new Array(difference+1).join(this._templates[0]));}else if(difference<0){this._controls.$absolute.children().slice(difference).remove();}
1494this._controls.$absolute.find('.active').removeClass('active');this._controls.$absolute.children().eq($.inArray(this.current(),this._pages)).addClass('active');}};Navigation.prototype.onTrigger=function(event){var settings=this._core.settings;event.page={index:$.inArray(this.current(),this._pages),count:this._pages.length,size:settings&&(settings.center||settings.autoWidth||settings.dotsData?1:settings.dotsEach||settings.items)};};Navigation.prototype.current=function(){var current=this._core.relative(this._core.current());return $.grep(this._pages,$.proxy(function(page,index){return page.start<=current&&page.end>=current;},this)).pop();};Navigation.prototype.getPosition=function(successor){var position,length,settings=this._core.settings;if(settings.slideBy=='page'){position=$.inArray(this.current(),this._pages);length=this._pages.length;successor?++position:--position;
1494position=this._pages[((position%length)+length)%length].start;}else{position=this._core.relative(this._core.current());length=this._core.items().length;successor?position+=settings.slideBy:position-=settings.slideBy;}
1495return position;};Navigation.prototype.next=function(speed){$.proxy(this._overrides.to,this._core)(this.getPosition(true),speed);};Navigation.prototype.prev=function(speed){$.proxy(this._overrides.to,this._core)(this.getPosition(false),speed);};Navigation.prototype.to=function(position,speed,standard){var length;if(!standard&&this._pages.length){length=this._pages.length;$.proxy(this._overrides.to,this._core)(this._pages[((position%length)+length)%length].start,speed);}else{$.proxy(this._overrides.to,this._core)(position,speed);}};$.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){'use strict';var Hash=function(carousel){this._core=carousel;this._hashes={};this.$element=this._core.$element;this._handlers={'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.startPosition==='URLHash'){$(window).trigger('hashchange.owl.navigation');}},this),'prepared.owl.carousel':$.proxy(function(e){if(e.namespace){var hash=$(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');if(!hash){return;}
1496this._hashes[hash]=e.content;}},this),'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name==='position'){var current=this._core.items(this._core.relative(this._core.current())),hash=$.map(this._hashes,function(item,hash){return item===current?hash:null;}).join();if(!hash||window.location.hash.slice(1)===hash){return;}
1497window.location.hash=hash;}},this)};this._core.options=$.extend({},Hash.Defaults,this._core.options);this.$element.on(this._handlers);$(window).on('hashchange.owl.navigation',$.proxy(function(e){var hash=window.location.hash.substring(1),items=this._core.$stage.children(),position=this._hashes[hash]&&items.index(this._hashes[hash]);if(position===undefined||position===this._core.current()){return;}
1498this._core.to(this._core.relative(position),false,true);},this));};Hash.Defaults={URLhashListener:false};Hash.prototype.destroy=function(){var handler,property;$(window).off('hashchange.owl.navigation');for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler]);}
1499for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null);}};$.fn.owlCarousel.Constructor.Plugins.Hash=Hash;})(window.Zepto||window.jQuery,window,document);;(function($,window,document,undefined){var style=$('<support>').get(0).style,prefixes='Webkit Moz O ms'.split(' '),events={transition:{end:{WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd',transition:'transitionend'}},animation:{end:{WebkitAnimation:'webkitAnimationEnd',MozAnimation:'animationend',OAnimation:'oAnimationEnd',animation:'animationend'}}},tests={csstransforms:function(){return!!test('transform');},csstransforms3d:function(){return!!test('perspective');},csstransitions:function(){return!!test('transition');},cssanimations:function(){return!!test('animation');}};function test(property,prefixed){var result=false,upper=property.charAt(0).toUpperCase()+property.slice(1);$.each((property+' '+prefixes.join(upper+' ')+upper).split(' '),function(i,property){if(style[property]!==undefined){result=prefixed?property:true;return false;}});return result;}
1500function prefixed(property){return test(property,true);}
1501if(tests.csstransitions()){$.support.transition=new String(prefixed('transition'))
1502$.support.transition.end=events.transition.end[$.support.transition];}
1503if(tests.cssanimations()){$.support.animation=new String(prefixed('animation'))
1504$.support.animation.end=events.animation.end[$.support.animation];}
1505if(tests.csstransforms()){$.support.transform=new String(prefixed('transform'));$.support.transform3d=tests.csstransforms3d();}})(window.Zepto||window.jQuery,window,document);;;
1506;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'));}else{factory(jQuery);}})(function($){'use strict';var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1;}
1507$.fn.scrollTo=function(target,duration,settings){if(typeof duration==='object'){settings=duration;duration=0;}
1508if(typeof settings==='function'){settings={onAfter:settings};}
1509if(target==='max'){target=9e9;}
1510settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2;}
1511settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){if(target===null)return;var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;}
1512targ=win?$(targ):$(targ,elem);case'object':if(targ.length===0)return;if(targ.is||targ.style){toff=(targ=$(targ)).offset();}}
1512
1513var offset=$.isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(''),function(i,axis){var Pos=axis==='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos),10)||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'),10)||0;}
1514attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==='x'?'width':'height']()*settings.over[pos];}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==='%'?parseFloat(val)/100*max:val;}
1515if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max);}
1516if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={};}else if(queue){animate(settings.onAfterFirst);attr={};}}});animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings);}});$elem.animate(attr,opts);}});};$scrollTo.max=function(elem,axis){var Dim=axis==='x'?'Width':'Height',scroll='scroll'+Dim;if(!isWin(elem))
1517return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size]);};function both(val){return $.isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val};}
1518$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]();},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop();}
1519var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t);}}};return $scrollTo;});;;
1520(function(root,factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory(require('jquery'));}else{root.lightbox=factory(root.jQuery);}}(this,function($){function Lightbox(options){this.album=[];this.currentImageIndex=void 0;this.init();this.options=$.extend({},this.constructor.defaults);this.option(options);}
1521Lightbox.defaults={albumLabel:'Image %1 of %2',alwaysShowNavOnTouchDevices:false,fadeDuration:500,fitImagesInViewport:true,positionFromTop:50,resizeDuration:700,showImageNumberLabel:true,wrapAround:false,disableScrolling:false};Lightbox.prototype.option=function(options){$.extend(this.options,options);};Lightbox.prototype.imageCountLabel=function(currentImageNum,totalImages){return this.options.albumLabel.replace(/%1/g,currentImageNum).replace(/%2/g,totalImages);};Lightbox.prototype.init=function(){this.enable();this.build();};Lightbox.prototype.enable=function(){var self=this;$('body').on('click','a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]',function(event){self.start($(event.currentTarget));return false;});};Lightbox.prototype.build=function(){var self=this;$('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body'));this.$lightbox=$('#lightbox');this.$overlay=$('#lightboxOverlay');this.$outerContainer=this.$lightbox.find('.lb-outerContainer');this.$container=this.$lightbox.find('.lb-container');this.containerTopPadding=parseInt(this.$container.css('padding-top'),10);this.containerRightPadding=parseInt(this.$container.css('padding-right'),10);this.containerBottomPadding=parseInt(this.$container.css('padding-bottom'),10);this.containerLeftPadding=parseInt(this.$container.css('padding-left'),10);this.$overlay.hide().on('click',function(){self.end();return false;});this.$lightbox.hide().on('click',function(event){if($(event.target).attr('id')==='lightbox'){self.end();}
1522return false;});this.$outerContainer.on('click',function(event){if($(event.target).attr('id')==='lightbox'){self.end();}
1523return false;});this.$lightbox.find('.lb-prev').on('click',function(){if(self.currentImageIndex===0){self.changeImage(self.album.length-1);}else{self.changeImage(self.currentImageIndex-1);}
1524return false;});this.$lightbox.find('.lb-next').on('click',function(){if(self.currentImageIndex===self.album.length-1){self.changeImage(0);}else{self.changeImage(self.currentImageIndex+1);}
1525return false;});this.$lightbox.find('.lb-loader, .lb-close').on('click',function(){self.end();return false;});};Lightbox.prototype.start=function($link){var self=this;var $window=$(window);$window.on('resize',$.proxy(this.sizeOverlay,this));$('select, object, embed').css({visibility:'hidden'});this.sizeOverlay();this.album=[];var imageNumber=0;function addToAlbum($link){self.album.push({link:$link.attr('href'),title:$link.attr('data-title')||$link.attr('title')}
1525);}
1526var dataLightboxValue=$link.attr('data-lightbox');var $links;if(dataLightboxValue){$links=$($link.prop('tagName')+'[data-lightbox="'+dataLightboxValue+'"]');for(var i=0;i<$links.length;i=++i){addToAlbum($($links[i]));if($links[i]===$link[0]){imageNumber=i;}}}else{if($link.attr('rel')==='lightbox'){addToAlbum($link);}else{$links=$($link.prop('tagName')+'[rel="'+$link.attr('rel')+'"]');for(var j=0;j<$links.length;j=++j){addToAlbum($($links[j]));if($links[j]===$link[0]){imageNumber=j;}}}}
1527var top=$window.scrollTop()+this.options.positionFromTop;var left=$window.scrollLeft();this.$lightbox.css({top:top+'px',left:left+'px'}).fadeIn(this.options.fadeDuration);if(this.options.disableScrolling){$('body').addClass('lb-disable-scrolling');}
1528this.changeImage(imageNumber);};Lightbox.prototype.changeImage=function(imageNumber){var self=this;this.disableKeyboardNav();var $image=this.$lightbox.find('.lb-image');this.$overlay.fadeIn(this.options.fadeDuration);$('.lb-loader').fadeIn('slow');this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();this.$outerContainer.addClass('animating');var preloader=new Image();preloader.onload=function(){var $preloader;var imageHeight;var imageWidth;var maxImageHeight;var maxImageWidth;var windowHeight;var windowWidth;$image.attr('src',self.album[imageNumber].link);$preloader=$(preloader);$image.width(preloader.width);$image.height(preloader.height);if(self.options.fitImagesInViewport){windowWidth=$(window).width();windowHeight=$(window).height();maxImageWidth=windowWidth-self.containerLeftPadding-self.containerRightPadding-20;maxImageHeight=windowHeight-self.containerTopPadding-self.containerBottomPadding-120;if(self.options.maxWidth&&self.options.maxWidth<maxImageWidth){maxImageWidth=self.options.maxWidth;}
1529if(self.options.maxHeight&&self.options.maxHeight<maxImageWidth){maxImageHeight=self.options.maxHeight;}
1530if((preloader.width>maxImageWidth)||(preloader.height>maxImageHeight)){if((preloader.width/maxImageWidth)>(preloader.height/maxImageHeight)){imageWidth=maxImageWidth;imageHeight=parseInt(preloader.height/(preloader.width/imageWidth),10);$image.width(imageWidth);$image.height(imageHeight);}else{imageHeight=maxImageHeight;imageWidth=parseInt(preloader.width/(preloader.height/imageHeight),10);$image.width(imageWidth);$image.height(imageHeight);}}}
1531self.sizeContainer($image.width(),$image.height());};preloader.src=this.album[imageNumber].link;this.currentImageIndex=imageNumber;};Lightbox.prototype.sizeOverlay=function(){this.$overlay.width($(document).width()).height($(document).height());};Lightbox.prototype.sizeContainer=function(imageWidth,imageHeight){var self=this;var oldWidth=this.$outerContainer.outerWidth();var oldHeight=this.$outerContainer.outerHeight();var newWidth=imageWidth+this.containerLeftPadding+this.containerRightPadding;var newHeight=imageHeight+this.containerTopPadding+this.containerBottomPadding;function postResize(){self.$lightbox.find('.lb-dataContainer').width(newWidth);self.$lightbox.find('.lb-prevLink').height(newHeight);self.$lightbox.find('.lb-nextLink').height(newHeight);self.showImage();}
1532if(oldWidth!==newWidth||oldHeight!==newHeight){this.$outerContainer.animate({width:newWidth,height:newHeight},this.options.resizeDuration,'swing',function(){postResize();});}else{postResize();}};Lightbox.prototype.showImage=function(){this.$lightbox.find('.lb-loader').stop(true).hide();this.$lightbox.find('.lb-image').fadeIn('slow');this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav();};Lightbox.prototype.updateNav=function(){var alwaysShowNav=false;try{document.createEvent('TouchEvent');alwaysShowNav=(this.options.alwaysShowNavOnTouchDevices)?true:false;}catch(e){}
1533this.$lightbox.find('.lb-nav').show();if(this.album.length>1){if(this.options.wrapAround){if(alwaysShowNav){this.$lightbox.find('.lb-prev, .lb-next').css('opacity','1');}
1534this.$lightbox.find('.lb-prev, .lb-next').show();}else{if(this.currentImageIndex>0){this.$lightbox.find('.lb-prev').show();if(alwaysShowNav){this.$lightbox.find('.lb-prev').css('opacity','1');}}
1535if(this.currentImageIndex<this.album.length-1){this.$lightbox.find('.lb-next').show();if(alwaysShowNav){this.$lightbox.find('.lb-next').css('opacity','1');}}}}};Lightbox.prototype.updateDetails=function(){var self=this;if(typeof this.album[this.currentImageIndex].title!=='undefined'&&this.album[this.currentImageIndex].title!==''){this.$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast').find('a').on('click',function(event){if($(this).attr('target')!==undefined){window.open($(this).attr('href'),$(this).attr('target'));}else{location.href=$(this).attr('href');}});}
1536if(this.album.length>1&&this.options.showImageNumberLabel){var labelText=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast');}else{this.$lightbox.find('.lb-number').hide();}
1537this.$outerContainer.removeClass('animating');this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration,function(){return self.sizeOverlay();});};Lightbox.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var preloadNext=new Image();preloadNext.src=this.album[this.currentImageIndex+1].link;}
1538if(this.currentImageIndex>0){var preloadPrev=new Image();preloadPrev.src=this.album[this.currentImageIndex-1].link;}};Lightbox.prototype.enableKeyboardNav=function(){$(document).on('keyup.keyboard',$.proxy(this.keyboardAction,this));};Lightbox.prototype.disableKeyboardNav=function(){$(document).off('.keyboard');};Lightbox.prototype.keyboardAction=function(event){var KEYCODE_ESC=27;var KEYCODE_LEFTARROW=37;var KEYCODE_RIGHTARROW=39;var keycode=event.keyCode;var key=String.fromCharCode(keycode).toLowerCase();if(keycode===KEYCODE_ESC||key.match(/x|o|c/)){this.end();}else if(key==='p'||keycode===KEYCODE_LEFTARROW){if(this.currentImageIndex!==0){this.changeImage(this.currentImageIndex-1);}else if(this.options.wrapAround&&this.album.length>1){this.changeImage(this.album.length-1);}}else if(key==='n'||keycode===KEYCODE_RIGHTARROW){if(this.currentImageIndex!==this.album.length-1){this.changeImage(this.currentImageIndex+1);}else if(this.options.wrapAround&&this.album.length>1){this.changeImage(0);}}};Lightbox.prototype.end=function(){this.disableKeyboardNav();$(window).off('resize',this.sizeOverlay);this.$lightbox.fadeOut(this.options.fadeDuration);this.$overlay.fadeOut(this.options.fadeDuration);$('select, object, embed').css({visibility:'visible'});if(this.options.disableScrolling){$('body').removeClass('lb-disable-scrolling');}};return new Lightbox();}));;;
1539/*
1540 * jQuery mmenu v5.6.3
1541 * @requires jQuery 1.7.0 or later
1542 *
1543 * mmenu.frebsite.nl
1544 *	
1545 * Copyright (c) Fred Heusschen
1546 * www.frebsite.nl
1547 *
1548 * License: CC-BY-NC-4.0
1549 * http://creativecommons.org/licenses/by-nc/4.0/
1550 */
1551!function(e){function t(){e[n].glbl||(r={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},i={},a={},o={},e.each([i,a,o],function(e,t){t.add=function(e){e=e.split(" ");for(var n=0,s=e.length;s>n;n++)t[e[n]]=t.mm(e[n])}}),i.mm=function(e){return"mm-"+e},i.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),i.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},a.mm=function(e){return"mm-"+e},a.add("parent sub"),o.mm=function(e){return e+".mm"},o.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[n]._c=i,e[n]._d=a,e[n]._e=o,e[n].glbl=r)}var n="mmenu",s="5.6.3";if(!(e[n]&&e[n].version>s)){e[n]=function(e,t,n){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=t,this.conf=n,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[n].version=s,e[n].addons={},e[n].uniqueId=0,e[n].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[n].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[n].prototype={init:function(e){e=e.not("."+i.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+i.listview).children().removeClass(i.selected),e.addClass(i.selected),this.trigger("setSelected",e)},openPanel:function(t){var s=t.parent(),a=this;if(s.hasClass(i.vertical)){var o=s.parents("."+i.subopened);
1551if(o.length)return void this.openPanel(o.first());s.addClass(i.opened),this.trigger("openPanel",t),this.trigger("openingPanel",t),this.trigger("openedPanel",t)}else{if(t.hasClass(i.current))return;var r=this.$pnls.children("."+i.panel),l=r.filter("."+i.current);r.removeClass(i.highest).removeClass(i.current).not(t).not(l).not("."+i.vertical).addClass(i.hidden),e[n].support.csstransitions||l.addClass(i.hidden),t.hasClass(i.opened)?t.nextAll("."+i.opened).addClass(i.highest).removeClass(i.opened).removeClass(i.subopened):(t.addClass(i.highest),l.addClass(i.subopened)),t.removeClass(i.hidden).addClass(i.current),a.trigger("openPanel",t),setTimeout(function(){t.removeClass(i.subopened).addClass(i.opened),a.trigger("openingPanel",t),a.__transitionend(t,function(){a.trigger("openedPanel",t)},a.conf.transitionDuration)},this.conf.openingInterval)}},closePanel:function(e){var t=e.parent();t.hasClass(i.vertical)&&(t.removeClass(i.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+i.listview).children().removeClass(i.selected).filter("."+i.vertical).removeClass(i.opened);var e=this.$pnls.children("."+i.panel),t=e.first();this.$pnls.children("."+i.panel).not(t).removeClass(i.subopened).removeClass(i.opened).removeClass(i.current).removeClass(i.highest).addClass(i.hidden),this.openPanel(t)},togglePanel:function(e){var t=e.parent();t.hasClass(i.vertical)&&this[t.hasClass(i.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,t){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(t)},trigger:function(){var e=this,t=Array.prototype.slice.call(arguments),n=t.shift();if(this.cbck[n])for(var s=0,i=this.cbck[n].length;i>s;s++)this.cbck[n][s].apply(e,t)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each(function(){e(this).attr("id",i.mm(e(this).attr("id")))})),this.$menu.contents().each(function(){3==e(this)[0].nodeType&&e(this).remove()}),this.$pnls=e('<div class="'+i.panels+'" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(i.wrapper);var t=[i.menu];this.opts.slidingSubmenus||t.push(i.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&t.push(this.opts.extensions),this.$menu.addClass(t.join(" "))},_initPanels:function(t){var n=this,s=this.__findAddBack(t,"ul, ol");this.__refactorClass(s,this.conf.classNames.inset,"inset").addClass(i.nolistview+" "+i.nopanel),s.not("."+i.nolistview).addClass(i.listview);var o=this.__findAddBack(t,"."+i.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(t,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=t.add(t.find("."+i.panel)).add(this.__findAddBack(t,"."+i.listview).children().children(this.conf.panelNodetype)).not("."+i.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(i.vertical),l.each(function(){var t=e(this),s=t;t.is("ul, ol")?(t.wrap('<div class="'+i.panel+'" />'),s=t.parent()):s.addClass(i.panel);var a=t.attr("id");t.removeAttr("id"),s.attr("id",a||n.__getUniqueId()),t.hasClass(i.vertical)&&(t.removeClass(n.conf.classNames.vertical),s.add(s.parent()).addClass(i.vertical)),r=r.add(s)});var d=e("."+i.panel,this.$menu);r.each(function(t){var s,o,r=e(this),l=r.parent(),d=l.children("a, span").first();if(l.is("."+i.panels)||(l.data(a.sub,r),r.data(a.parent,l)),l.children("."+i.next).length||l.parent().is("."+i.listview)&&(s=r.attr("id"),o=e('<a class="'+i.next+'" href="#'+s+'" data-target="#'+s+'" />').insertBefore(d),d.is("span")&&o.addClass(i.fullsubopen)),!r.children("."+i.navbar).length&&!l.hasClass(i.vertical)){l.parent().is("."+i.listview)?l=l.closest("."+i.panel):(d=l.closest("."+i.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=d.closest("."+i.panel));var c=e('<div class="'+i.navbar+'" />');if(l.length){switch(s=l.attr("id"),n.opts.navbar.titleLink){case"anchor":_url=d.attr("href");break;case"panel":case"parent":_url="#"+s;break;default:_url=!1}c.append('<a class="'+i.btn+" "+i.prev+'" href="#'+s+'" data-target="#'+s+'" />').append(e('<a class="'+i.title+'"'+(_url?' href="'+_url+'"':"")+" />").text(d.text())).prependTo(r),n.opts.navbar.add&&r.addClass(i.hasnavbar)}else n.opts.navbar.title&&(c.append('<a class="'+i.title+'">'+n.opts.navbar.title+"</a>").prependTo(r),n.opts.navbar.add&&r.addClass(i.hasnavbar))}});var c=this.__findAddBack(t,"."+i.listview).children("."+i.selected).removeClass(i.selected).last(
1551).addClass(i.selected);c.add(c.parentsUntil("."+i.menu,"li")).filter("."+i.vertical).addClass(i.opened).end().each(function(){e(this).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).addClass(i.subopened)}),c.children("."+i.panel).not("."+i.vertical).addClass(i.opened).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).addClass(i.subopened);var p=d.filter("."+i.opened);return p.length||(p=r.first()),p.addClass(i.opened).last().addClass(i.current),r.not("."+i.vertical).not(p.last()).addClass(i.hidden).end().filter(function(){return!e(this).parent().hasClass(i.panels)}).appendTo(this.$pnls),r},_initAnchors:function(){var t=this;r.$body.on(o.click+"-oncanvas","a[href]",function(s){var a=e(this),o=!1,r=t.$menu.find(a).length;for(var l in e[n].addons)if(e[n].addons[l].clickAnchor.call(t,a,r)){o=!0;break}var d=a.attr("href");if(!o&&r&&d.length>1&&"#"==d.slice(0,1))try{var c=e(d,t.$menu);c.is("."+i.panel)&&(o=!0,t[a.parent().hasClass(i.vertical)?"togglePanel":"openPanel"](c))}catch(p){}if(o&&s.preventDefault(),!o&&r&&a.is("."+i.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){t.__valueOrFn(t.opts.onClick.setSelected,a)&&t.setSelected(e(s.target).parent());var h=t.__valueOrFn(t.opts.onClick.preventDefault,a,"#"==d.slice(0,1));h&&s.preventDefault(),t.__valueOrFn(t.opts.onClick.close,a,h)&&t.close()}})},_initAddons:function(){var t;for(t in e[n].addons)e[n].addons[t].add.call(this),e[n].addons[t].add=function(){};for(t in e[n].addons)e[n].addons[t].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=i.umm(e)),e},__api:function(){var t=this,n={};return e.each(this._api,function(e){var s=this;n[s]=function(){var e=t[s].apply(t,arguments);return"undefined"==typeof e?n:e}}),n},__valueOrFn:function(e,t,n){return"function"==typeof e?e.call(t[0]):"undefined"==typeof e&&"undefined"!=typeof n?n:e},__refactorClass:function(e,t,n){return e.filter("."+t).removeClass(t).addClass(i[n])},__findAddBack:function(e,t){return e.find(t).add(e.filter(t))},__filterListItems:function(e){return e.not("."+i.divider).not("."+i.hidden)},__transitionend:function(e,t,n){var s=!1,i=function(){s||t.call(e[0]),s=!0};e.one(o.transitionend,i),e.one(o.webkitTransitionEnd,i),setTimeout(i,1.1*n)},__getUniqueId:function(){return i.mm(e[n].uniqueId++)}},e.fn[n]=function(s,i){return t(),s=e.extend(!0,{},e[n].defaults,s),i=e.extend(!0,{},e[n].configuration,i),this.each(function(){var t=e(this);if(!t.data(n)){var a=new e[n](t,s,i);a.$menu.data(n,a.__api())}})},e[n].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&"undefined"!=typeof Modernizr.csstransitions)return Modernizr.csstransitions;var e=document.body||document.documentElement,t=e.style,n="transition";if("string"==typeof t[n])return!0;var s=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var i=0;i<s.length;i++)if("string"==typeof t[s[i]+n])return!0;return!1}()};var i,a,o,r}}(jQuery),/*	
1552 * jQuery mmenu offCanvas addon
1553 * mmenu.frebsite.nl
1554 *
1555 * Copyright (c) Fred Heusschen
1556 */
1557function(e){var t="mmenu",n="offCanvas";e[t].addons[n]={setup:function(){if(this.opts[n]){var i=this.opts[n],a=this.conf[n];o=e[t].glbl,this._api=e.merge(this._api,["open","close","setPage"]),("top"==i.position||"bottom"==i.position)&&(i.zposition="front"),"string"!=typeof a.pageSelector&&(a.pageSelector="> "+a.pageNodetype),o.$allMenus=(o.$allMenus||e()).add(this.$menu),this.vars.opened=!1;var r=[s.offcanvas];"left"!=i.position&&r.push(s.mm(i.position)),"back"!=i.zposition&&r.push(s.mm(i.zposition)),this.$menu.addClass(r.join(" ")).parent().removeClass(s.wrapper),this.setPage(o.$page),this._initBlocker(),this["_initWindow_"+n](),this.$menu[a.menuInjectMethod+"To"](a.menuWrapperSelector);var l=window.location.hash;if(l){var d=this._getOriginalMenuId();d&&d==l.slice(1)&&this.open()}}},add:function(){s=e[t]._c,i=e[t]._d,a=e[t]._e,s.add("offcanvas slideout blocking modal background opening blocker page"),i.add("style"),a.add("resize")},clickAnchor:function(e,t){if(!this.opts[n])return!1;var s=this._getOriginalMenuId();if(s&&e.is('[href="#'+s+'"]'))return this.open(),!0;if(o.$page)return s=o.$page.first().attr("id"),s&&e.is('[href="#'+s+'"]')?(this.close(),!0):!1}},e[t].defaults[n]={position:"left",zposition:"back",blockUI:!0,moveBackgroun
1557d:!0},e[t].configuration[n]={pageNodetype:"div",pageSelector:null,noPageSelector:[],wrapPageIfNeeded:!0,menuWrapperSelector:"body",menuInjectMethod:"prepend"},e[t].prototype.open=function(){if(!this.vars.opened){var e=this;this._openSetup(),setTimeout(function(){e._openFinish()},this.conf.openingInterval),this.trigger("open")}},e[t].prototype._openSetup=function(){var t=this,r=this.opts[n];this.closeAllOthers(),o.$page.each(function(){e(this).data(i.style,e(this).attr("style")||"")}),o.$wndw.trigger(a.resize+"-"+n,[!0]);var l=[s.opened];r.blockUI&&l.push(s.blocking),"modal"==r.blockUI&&l.push(s.modal),r.moveBackground&&l.push(s.background),"left"!=r.position&&l.push(s.mm(this.opts[n].position)),"back"!=r.zposition&&l.push(s.mm(this.opts[n].zposition)),this.opts.extensions&&l.push(this.opts.extensions),o.$html.addClass(l.join(" ")),setTimeout(function(){t.vars.opened=!0},this.conf.openingInterval),this.$menu.addClass(s.current+" "+s.opened)},e[t].prototype._openFinish=function(){var e=this;this.__transitionend(o.$page.first(),function(){e.trigger("opened")},this.conf.transitionDuration),o.$html.addClass(s.opening),this.trigger("opening")},e[t].prototype.close=function(){if(this.vars.opened){var t=this;this.__transitionend(o.$page.first(),function(){t.$menu.removeClass(s.current).removeClass(s.opened),o.$html.removeClass(s.opened).removeClass(s.blocking).removeClass(s.modal).removeClass(s.background).removeClass(s.mm(t.opts[n].position)).removeClass(s.mm(t.opts[n].zposition)),t.opts.extensions&&o.$html.removeClass(t.opts.extensions),o.$page.each(function(){e(this).attr("style",e(this).data(i.style))}),t.vars.opened=!1,t.trigger("closed")},this.conf.transitionDuration),o.$html.removeClass(s.opening),this.trigger("close"),this.trigger("closing")}},e[t].prototype.closeAllOthers=function(){o.$allMenus.not(this.$menu).each(function(){var n=e(this).data(t);n&&n.close&&n.close()})},e[t].prototype.setPage=function(t){var i=this,a=this.conf[n];t&&t.length||(t=o.$body.find(a.pageSelector),a.noPageSelector.length&&(t=t.not(a.noPageSelector.join(", "))),t.length>1&&a.wrapPageIfNeeded&&(t=t.wrapAll("<"+this.conf[n].pageNodetype+" />").parent())),t.each(function(){e(this).attr("id",e(this).attr("id")||i.__getUniqueId())}),t.addClass(s.page+" "+s.slideout),o.$page=t,this.trigger("setPage",t)},e[t].prototype["_initWindow_"+n]=function(){o.$wndw.off(a.keydown+"-"+n).on(a.keydown+"-"+n,function(e){return o.$html.hasClass(s.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0});var e=0;o.$wndw.off(a.resize+"-"+n).on(a.resize+"-"+n,function(t,n){if(1==o.$page.length&&(n||o.$html.hasClass(s.opened))){var i=o.$wndw.height();(n||i!=e)&&(e=i,o.$page.css("minHeight",i))}})},e[t].prototype._initBlocker=function(){var t=this;this.opts[n].blockUI&&(o.$blck||(o.$blck=e('<div id="'+s.blocker+'" class="'+s.slideout+'" />')),o.$blck.appendTo(o.$body).off(a.touchstart+"-"+n+" "+a.touchmove+"-"+n).on(a.touchstart+"-"+n+" "+a.touchmove+"-"+n,function(e){e.preventDefault(),e.stopPropagation(),o.$blck.trigger(a.mousedown+"-"+n)}).off(a.mousedown+"-"+n).on(a.mousedown+"-"+n,function(e){e.preventDefault(),o.$html.hasClass(s.modal)||(t.closeAllOthers(),t.close())}))};var s,i,a,o}(jQuery),/*	
1558 * jQuery mmenu scrollBugFix addon
1559 * mmenu.frebsite.nl
1560 *
1561 * Copyright (c) Fred Heusschen
1562 */
1563function(e){var t="mmenu",n="scrollBugFix";e[t].addons[n]={setup:function(){var i=this,r=this.opts[n];this.conf[n];if(o=e[t].glbl,e[t].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.blockUI&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),r=this.opts[n]=e.extend(!0,{},e[t].defaults[n],r),r.fix)){var l=this.$menu.attr("id"),d=!1;this.bind("opening",function(){this.$pnls.children("."+s.current).scrollTop(0)}),o.$docu.on(a.touchmove,function(e){i.vars.opened&&e.preventDefault()}),o.$body.on(a.touchstart,"#"+l+"> ."+s.panels+"> ."+s.current,function(e){i.vars.opened&&(d||(d=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),d=!1))}).on(a.touchmove,"#"+l+"> ."+s.panels+"> ."+s.current,function(t){i.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&t.stopPropagation()}),o.$wndw.on(a.orientationchange,function(){i.$pnls.children("."+s.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})})}},add:function(){s=e[t]._c,i=e[t]._d,a=e[t]._e},clickAnchor:function(e,t){}},e[t].defaults[n]={fix:!0};var s,i,a,o}(jQuery);;
1564/*	
1565 * jQuery mmenu navbar addon
1566 * mmenu.frebsite.nl
1567 *
1568 * Copyright (c) Fred Heusschen
1569 */
1570!function(n){var a="mmenu",t="navbars";n[a].addons[t]={setup:function(){var r=this,s=this.opts[t],c=this.conf[t];if(i=n[a].glbl,"undefined"!=typeof s){s instanceof Array||(s=[s]);var o={};n.each(s,function(i){var d=s[i];"boolean"==typeof d&&d&&(d={}),"object"!=typeof d&&(d={}),"undefined"==typeof d.content&&(d.content=["prev","title"]),d.content instanceof Array||(d.content=[d.content]),d=n.extend(!0,{},r.opts.navbar,d);var l=d.position,h=d.height;"number"!=typeof h&&(h=1),h=Math.min(4,Math.max(1,h)),"bottom"!=l&&(l="top"),o[l]||(o[l]=0),o[l]++;var f=n("<div />").addClass(e.navbar+" "+e.navbar+"-"+l+" "+e.navbar+"-"+l+"-"+o[l]+" "+e.navbar+"-size-"+h);o[l]+=h-1;for(var v=0,u=0,p=d.content.length;p>u;u++){var b=n[a].addons[t][d.content[u]]||!1;b?v+=b.call(r,f,d,c):(b=d.content[u],b instanceof n||(b=n(d.content[u])),f.append(b))}v+=Math.ceil(f.children().not("."+e.btn).not("."+e.title+"-prev").length/h),v>1&&f.addClass(e.navbar+"-content-"+v),f.children("."+e.btn).length&&f.addClass(e.hasbtns),f.prependTo(r.$menu)});for(var d in o)r.$menu.addClass(e.hasnavbar+"-"+d+"-"+o[d])}},add:function(){e=n[a]._c,r=n[a]._d,s=n[a]._e,e.add("close hasbtns")},clickAnchor:function(n,a){}},n[a].configuration[t]={breadcrumbSeparator:"/"},n[a].configuration.classNames[t]={};var e,r,s,i}(jQuery),/*	
1571 * jQuery mmenu navbar addon breadcrumbs content
1572 * mmenu.frebsite.nl
1573 *
1574 * Copyright (c) Fred Heusschen
1575 */
1576function(n){var a="mmenu",t="navbars",e="breadcrumbs";n[a].addons[t][e]=function(t,e,r){var s=n[a]._c,i=n[a]._d;s.add("breadcrumbs separator");var c=n('<span class="'+s.breadcrumbs+'" />').appendTo(t);this.bind("init",function(a){a.removeClass(s.hasnavbar).each(function(){for(var a=[],t=n(this),e=n('<span class="'+s.breadcrumbs+'"></span>'),c=n(this).children().first(),o=!0;c&&c.length;){c.is("."+s.panel)||(c=c.closest("."+s.panel));var d=c.children("."+s.navbar).children("."+s.title).text();a.unshift(o?"<span>"+d+"</span>":'<a href="#'+c.attr("id")+'">'+d+"</a>"),o=!1,c=c.data(i.parent)}e.append(a.join('<span class="'+s.separator+'">'+r.breadcrumbSeparator+"</span>")).appendTo(t.children("."+s.navbar))})});var o=function(){c.html(this.$pnls.children("."+s.current).children("."+s.navbar).children("."+s.breadcrumbs).html())};return this.bind("openPanel",o),this.bind("init",o),0}}(jQuery),/*	
1577 * jQuery mmenu navbar addon close content
1578 * mmenu.frebsite.nl
1579 *
1580 * Copyright (c) Fred Heusschen
1581 */
1582function(n){var a="mmenu",t="navbars",e="close";n[a].addons[t][e]=function(t,e){var r=n[a]._c,s=n[a].glbl,i=n('<a class="'+r.close+" "+r.btn+'" href="#" />').appendTo(t),c=function(n){i.attr("href","#"+n.attr("id"))};return c.call(this,s.$page),this.bind("setPage",c),-1}}(jQuery),/*	
1583 * jQuery mmenu navbar addon next content
1584 * mmenu.frebsite.nl
1585 *
1586 * Copyright (c) Fred Heusschen
1587 */
1588function(n){var a="mmenu",t="navbars",e="next";n[a].addons[t][e]=function(e,r){var s,i,c=n[a]._c,o=n('<a class="'+c.next+" "+c.btn+'" href="#" />').appendTo(e),d=function(n){n=n||this.$pnls.children("."+c.current);var a=n.find("."+this.conf.classNames[t].panelNext);s=a.attr("href"),i=a.html(),o[s?"attr":"removeAttr"]("href",s),o[s||i?"removeClass":"addClass"](c.hidden),o.html(i)};return this.bind("openPanel",d),this.bind("init",function(){d.call(this)}),-1},n[a].configuration.classNames[t].panelNext="Next"}(jQuery),/*	
1589 * jQuery mmenu navbar addon prev content
1590 * mmenu.frebsite.nl
1591 *
1592 * Copyright (c) Fred Heusschen
1593 */
1594function(n){var a="mmenu",t="navbars",e="prev";n[a].addons[t][e]=function(e,r){var s=n[a]._c,i=n('<a class="'+s.prev+" "+s.btn+'" href="#" />').appendTo(e);this.bind("init",function(n){n.removeClass(s.hasnavbar).children("."+s.navbar).addClass(s.hidden)});var c,o,d=function(n){if(n=n||this.$pnls.children("."+s.current),!n.hasClass(s.vertical)){var a=n.find("."+this.conf.classNames[t].panelPrev);a.length||(a=n.children("."+s.navbar).children("."+s.prev)),c=a.attr("href"),o=a.html(),i[c?"attr":"removeAttr"]("href",c),i[c||o?"removeClass":"addClass"](s.hidden),i.html(o)}};return this.bind("openPanel",d),this.bind("init",function(){d.call(this)}),-1},n[a].configuration.classNames[t].panelPrev="Prev"}(jQuery),/*	
1595 * jQuery mmenu navbar addon searchfield content
1596 * mmenu.frebsite.nl
1597 *
1598 * Copyright (c) Fred Heusschen
1599 */
1600function(n){var a="mmenu",t="navbars",e="searchfield";n[a].addons[t][e]=function(t,e){var r=n[a]._c,s=n('<div class="'+r.search+'" />').appendTo(t);return"object"!=typeof this.opts.searchfield&&(this.opts.searchfield={}),this.opts.searchfield.add=!0,this.opts.searchfield.addTo=s,0}}(jQuery),/*	
1601 * jQuery mmenu navbar addon title content
1602 * mmenu.frebsite.nl
1603 *
1604 * Copyright (c) Fred Heusschen
1605 */
1606function(n){var a="mmenu",t="navbars",e="title";n[a].addons[t][e]=function(e,r){var s,i,c=n[a]._c,o=n('<a class="'+c.title+'" />').appendTo(e),d=function(n){if(n=n||this.$pnls.children("."+c.current),!n.hasClass(c.vertical)){var a=n.find("."+this.conf.classNames[t].panelTitle);a.length||(a=n.children("."+c.navbar).children("."+c.title)),s=a.attr("href"),i=a.html()||r.title,o[s?"attr":"removeAttr"]("href",s),o[s||i?"removeClass":"addClass"](c.hidden),o.html(i)}};return this.bind("openPanel",d),this.bind("init",function(n){d.call(this)}),0},n[a].configuration.classNames[t].panelTitle="Title"}(jQuery);;
1607(function(factory){"use strict";if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'&&typeof require==='function'){factory(require('jquery'));}else{factory(jQuery);}}(function($){"use strict";function ColorHelperToRGB(color){var obj=document.getElementById('ngyColorHelperToRGB');if(obj===null){obj=document.createElement('div');obj.id="ngyColorHelperToRGB";obj.style.cssText='display: none; color:'+color+';';document.body.appendChild(obj);}
1608var rgb=getComputedStyle(obj).color;return rgb;}
1609function ShadeBlendConvert(p,from,to){var rgba='';if(from.toUpperCase().substring(0,5)=='RGBA('){rgba='a';from='rgb('+from.substring(5);}
1610if(typeof(p)!="number"||p<-1||p>1||typeof(from)!="string"||(from[0]!='r'&&from[0]!='#')||(typeof(to)!="str
vendor: 175,622 bytes, lines 1610-2411
1610ing"&&typeof(to)!="undefined"))return null;function sbcRip(d){var l=d.length,RGB=new Object();if(l>9){d=d.split(",");if(d.length<3||d.length>4)return null;RGB[0]=i(d[0].slice(4)),RGB[1]=i(d[1]),RGB[2]=i(d[2]),RGB[3]=d[3]?parseFloat(d[3]):-1;}else{if(l==8||l==6||l<4)return null;if(l<6)d="#"+d[1]+d[1]+d[2]+d[2]+d[3]+d[3]+(l>4?d[4]+""+d[4]:"");d=i(d.slice(1),16),RGB[0]=d>>16&255,RGB[1]=d>>8&255,RGB[2]=d&255,RGB[3]=l==9||l==5?r(((d>>24&255)/255)*10000)/10000:-1;}
1611return RGB;}
1612var i=parseInt,r=Math.round,h=from.length>9,h=typeof(to)=="string"?to.length>9?true:to=="c"?!h:false:h,b=p<0,p=b?p*-1:p,to=to&&to!="c"?to:b?"#000000":"#FFFFFF",f=sbcRip(from),t=sbcRip(to);if(!f||!t)return null;if(h)return"rgb"+rgba+"("+r((t[0]-f[0])*p+f[0])+","+r((t[1]-f[1])*p+f[1])+","+r((t[2]-f[2])*p+f[2])+(f[3]<0&&t[3]<0?")":","+(f[3]>-1&&t[3]>-1?r(((t[3]-f[3])*p+f[3])*10000)/10000:t[3]<0?f[3]:t[3])+")");else return"#"+(0x100000000+(f[3]>-1&&t[3]>-1?r(((t[3]-f[3])*p+f[3])*255):t[3]>-1?r(t[3]*255):f[3]>-1?r(f[3]*255):255)*0x1000000+r((t[0]-f[0])*p+f[0])*0x10000+r((t[1]-f[1])*p+f[1])*0x100+r((t[2]-f[2])*p+f[2])).toString(16).slice(f[3]>-1||t[3]>-1?1:3);}
1613function cloneJSObject(obj){if(obj===null||typeof obj!=='object'){return obj;}
1614var temp=obj.constructor();for(var key in obj){temp[key]=cloneJSObject(obj[key]);}
1615return temp;}
1616function getViewport(){var $win=jQuery(window);return{l:$win.scrollLeft(),t:$win.scrollTop(),w:$win.width(),h:$win.height()}}
1617function inViewportVert($elt,threshold){var wp=getViewport(),eltOS=$elt.offset(),th=$elt.outerHeight(true);if(wp.t==0&&(eltOS.top)<=(wp.t+wp.h)){return true;}
1618if(eltOS.top>=wp.t&&(eltOS.top+th)<=(wp.t+wp.h-threshold)){return true;}
1619else{return false;}}
1620function topInViewportVert($elt,threshold){var wp=getViewport(),eltOS=$elt.offset();if(eltOS.top>=wp.t&&eltOS.top<=(wp.t+wp.h-threshold)){return true;}
1621else{return false;}}
1622function setElementOnTop(start,elt){var highest_index=0;if(start==''){start='*';}
1623jQuery(start).each(function(){var cur=parseInt(jQuery(this).css('z-index'));highest_index=cur>highest_index?cur:highest_index;});highest_index++;jQuery(elt).css('z-index',highest_index);}
1624var toType=function(obj){return({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase()};$.nanogallery2=function(elt,options){var _this=this;_this.$e=jQuery(elt);_this.e=elt;_this.$e.data('nanogallery2data',_this);_this.init=function(){if(typeof window.NGY2Item==='undefined'){window.NGY2Tools=(function(){function NGY2Tools(){var nextId=1;}
1625NGY2Tools.FilterAlbumName=function(title,ID){var s=title.toUpperCase();if(this.albumList.length>0){for(var j=0;j<this.albumList.length;j++){if(s===this.albumList[j].toUpperCase()||ID===this.albumList[j]){return true;}}}
1626else{var found=false;if(this.allowList!==null){for(var j=0;j<this.allowList.length;j++){if(s.indexOf(this.allowList[j])!==-1){found=true;}}
1627if(!found){return false;}}
1628if(this.blockList!==null){for(var j=0;j<this.blockList.length;j++){if(s.indexOf(this.blockList[j])!==-1){return false;}}}
1629return true;}};NGY2Tools.NanoAlert=function(context,msg,verbose){NGY2Tools.NanoConsoleLog.call(context,msg);if(context.$E.conConsole!=null){context.$E.conConsole.css({visibility:'visible',minHeight:'100px'});if(verbose==false){context.$E.conConsole.append('<p>'+msg+'</p>');}
1630else{context.$E.conConsole.append('<p>nanogallery2: '+msg+' ['+context.baseEltID+']</p>');}}};NGY2Tools.NanoConsoleLog=function(context,msg){if(window.console){console.log('nanogallery2: '+msg+' ['+context.baseEltID+']');}};NGY2Tools.PreloaderDisplay=function(display){if(display===true){this.$E.conLoadingB.removeClass('nanoGalleryLBarOff').addClass('nanoGalleryLBar');if(this.GOM.albumIdxLoading!=undefined&&this.GOM.albumIdxLoading!=-1){let item=this.I[this.GOM.albumIdxLoading];item.$Elts['.nGY2TnImg'].addClass('nGY2GThumbnailLoaderDisplayed');}}
1631else{this.$E.conLoadingB.removeClass('nanoGalleryLBar').addClass('nanoGalleryLBarOff');if(this.GOM.albumIdxLoading!=undefined&&this.GOM.albumIdxLoading!=-1){let item=this.I[this.GOM.albumIdxLoading];item.$Elts['.nGY2TnImg'].removeClass('nGY2GThumbnailLoaderDisplayed');}}};NGY2Tools.AreaShuffle=function(o){for(var j,x,i=o.length;i;j=Math.floor(Math.random()*i),x=o[--i],o[i]=o[j],o[j]=x);return o;};NGY2Tools.GetImageTitleFromURL=function(imageURL){if(this.O.thumbnailLabel.get('title')=='%filename'){return(imageURL.split('/').pop()).replace('_',' ');}
1632if(this.O.thumbnailLabel.get('title')=='%filenameNoExt'){var s=imageURL.split('/').pop();return(s.split('.').shift()).replace('_',' ');}
1633return'';};NGY2Tools.AlbumPostProcess=function(albumID){var sortOrder=this.gallerySorting[this.GOM.curNavLevel];var maxItems=this.galleryMaxItems[this.GOM.curNavLevel];if(sortOrder!=''||maxItems>0){var currentAlbum=this.I.filter(function(obj){return(obj.albumID==albumID&&obj.kind!='albumUp');});switch(sortOrder){case'RANDOM':currentAlbum=NGY2Tools.AreaShuffle(currentAlbum);break;case'REVERSED':currentAlbum=currentAlbum.reverse();break;case'TITLEASC':currentAlbum.sort(function(a,b){return((a.title.toUpperCase()<b.title.toUpperCase())?-1:((a.title.toUpperCase()>b.title.toUpperCase())?1:0));});break;case'TITLEDESC':currentAlbum.sort(function(a,b){return((a.title.toUpperCase()>b.title.toUpperCase())?-1:((a.title.toUpperCase()<b.title.toUpperCase())?1:0));});break;}
1634if(maxItems>0&&currentAlbum.length>maxItems){currentAlbum.splice(maxItems-1,currentAlbum.length-maxItems);}
1635this.I.ngy2removeIf(function(obj){return(obj.albumID==albumID&&obj.kind!='albumUp');});this.I.push.apply(this.I,currentAlbum);}};return NGY2Tools;})();window.NGY2Item=(function(){var nextId=1;function NGY2Item(itemID){var ID=0;if(itemID===undefined||itemID===null){ID=nextId++;}
1636else{ID=itemID;}
1637this.GetID=function(){return ID;};this.kind='';this.mediaKind='img';this.mediaMarkup='';this.G=null;this.title='';this.description='';this.albumID=0;this.src='';this.width=0;this.height=0;this.destinationURL='';this.downloadURL='';this.author='';this.left=0;this.top=0;this.width=0;this.height=0;this.resizedContentWidth=0;this.resizedContentHeight=0;this.thumbs={url:{l1:{xs:'',sm:'',me:'',la:'',xl:''},lN:{xs:'',sm:'',me:'',la:'',xl:''}},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}}};this.thumbnailImgRevealed=false;this.imageDominantColors=null;this.imageDominantColor=null;this.featured=false;this.flickrThumbSizes={};this.picasaThumbs=null;this.hovered=false;this.hoverInitDone=false;this.contentIsLoaded=false;this.contentLength=0;this.numberItems=0;this.mediaNumber=0;this.mediaCounter=0;this.eltTransform=[];this.eltFilter=[];this.eltEffect=[];this.paginationLastPage=0;this.paginationLastWidth=0;this.customData={};this.selected=false;this.imageWidth=0;this.imageHeight=0;this.$elt=null;this.$Elts=[];this.tags=[];this.albumTagList=[];this.albumTagListSel=[];this.exif={exposure:'',flash:'',focallength:'',fstop:'',iso:'',model:'',time:'',location:''};this.deleted=false;this.rotationAngle=0;}
1638NGY2Item.Get=function(instance,ID){var l=instance.I.length;for(var i=0;i<l;i++){if(instance.I[i].GetID()==ID){return instance.I[i];}}
1639return null;};NGY2Item.GetIdx=function(instance,ID){var l=instance.I.length;for(var i=0;i<l;i++){if(instance.I[i].GetID()==ID){return i;}}
1640return-1;};NGY2Item.New=function(instance,title,description,ID,albumID,kind,tags){var album=NGY2Item.Get(instance,albumID);if(instance.O.titleTranslationMap!==null){let obj=instance.O.titleTranslationMap.find(o=>o.title===title);if(obj!==undefined){title=obj.replace;}}
1641if(albumID!=-1&&albumID!=0&&title!='image gallery by nanogallery2 [build]'){if(instance.O.thumbnailLevelUp&&album.getContentLength(false)==0&&instance.O.album==''){let item=new NGY2Item('0');instance.I.push(item);album.contentLength+=1;item.title='UP';item.albumID=albumID;item.kind='albumUp';item.G=instance;jQuery.extend(true,item.thumbs.width,instance.tn.defaultSize.width);jQuery.extend(true,item.thumbs.height,instance.tn.defaultSize.height);}}
1642var item=NGY2Item.Get(instance,ID);if(item===null){item=new NGY2Item(ID);instance.I.push(item);if(albumID!=-1&&title!='image gallery by nanogallery2 [build]'){album.contentLength+=1;}}
1643item.G=instance;item.albumID=albumID;item.kind=kind;if(kind=='image'){album.mediaCounter+=1;item.mediaNumber=album.mediaCounter;}
1644var kw=instance.O.thumbnailFeaturedKeyword;if(kw!=''){kw=kw.toUpperCase();var p=title.toUpperCase().indexOf(kw);if(p>-1){item.featured=true;title=title.substring(0,p)+title.substring(p+kw.length,title.length);}
1645p=description.toUpperCase().indexOf(kw);if(p>-1){item.featured=true;description=description.substring(0,p)+description.substring(p+kw.length,description.length);}}
1646if(typeof instance.galleryFilterTags.Get()=='string'){switch(instance.galleryFilterTags.Get().toUpperCase()){case'TITLE':{let re=/(?:^|\W)#(\w+)(?!\w)/g,match,matches=[];while(match=re.exec(title)){matches.push(match[1].replace(/^\s*|\s*$/,''));}
1647item.setTags(matches);title=title.split('#').join('');break;}
1648case'DESCRIPTION':{let re=/(?:^|\W)#(\w+)(?!\w)/g,match2,matches2=[];while(match2=re.exec(description)){matches2.push(match2[1].replace(/^\s*|\s*$/,''));}
1649item.setTags(matches2);description=description.split('#').join('');break;}}}
1650else{if(tags!=''&&tags!=undefined){item.setTags(tags.split(' '));}}
1651item.title=escapeHtml(instance,title);item.description=escapeHtml(instance,description);return item;};NGY2Item.prototype.delete=function(){this.deleted=true;this.G.I[NGY2Item.GetIdx(this.G,this.albumID)].contentLength--;this.G.I[NGY2Item.GetIdx(this.G,this.albumID)].numberItems--;var nbTn=this.G.GOM.items.length;var ID=this.GetID();var foundIdx=-1;var foundGOMidx=-1;for(var i=0;i<nbTn;i++){var curTn=this.G.GOM.items[i];var item=this.G.I[curTn.thumbnailIdx];if(item.GetID()==ID){if(!curTn.neverDisplayed){foundIdx=curTn.thumbnailIdx;foundGOMidx=i;}}
1652else{if(foundIdx!=-1){if(!curTn.neverDisplayed){item.$getElt('.nGY2GThumbnail').data('index',i-1);item.$getElt('.nGY2GThumbnailImg').data('index',i-1);}}}}
1653if(foundIdx!=-1){var G=this.G;if(this.selected==true){this.selected=false;G.GOM.nbSelected--;}
1654if(G.I[foundIdx].$elt!==null){G.I[foundIdx].$elt.remove();}
1655G.GOM.items.splice(foundGOMidx,1);if(G.GOM.lastDisplayedIdx!=-1){G.GOM.lastDisplayedIdx-=1;}}}
1656NGY2Item.prototype.addToGOM=function(){var ID=this.GetID();var l=this.G.I.length;for(var idx=0;idx<l;idx++){var item=this.G.I[idx];if(item.GetID()==ID){var w=item.thumbImg().width;var h=item.thumbImg().height;if(h==0){h=this.G.tn.defaultSize.getHeight();}
1657if(w==0){w=this.G.tn.defaultSize.getWidth();}
1658var tn=new this.G.GOM.GTn(idx,w,h);this.G.GOM.items.push(tn);break;}}}
1659var entityMap={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;','/':'&#x2F;','`':'&#x60;','=':'&#x3D;'};function escapeHtml(instance,string){if(instance.O.allowHTMLinData==true){return string;}
1660else{return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s];});}}
1661NGY2Item.get_nextId=function(){return nextId;};NGY2Item.prototype.$getElt=function(elt,forceRefresh){if(this.$elt==null){return null;}
1662if(this.$Elts[elt]!==undefined&&!forceRefresh==true){return this.$Elts[elt];}
1663else{if(elt=='.nGY2GThumbnail'){this.$Elts[elt]=this.$elt;}
1664else{this.$Elts[elt]=this.$elt.find(elt);}
1665return this.$Elts[elt];}};NGY2Item.prototype.removeElt=function(elt){if(this.$elt==null){return;}
1666if(this.$Elts[elt]==undefined){return;}
1667this.$Elts[elt].remove();var index=this.$Elts.indexOf(elt);this.$Elts.splice(index,1);};NGY2Item.prototype.album=function(){return this.G.I[NGY2Item.GetIdx(this.G,this.albumID)];};NGY2Item.prototype.mediaTransition=function(){if(this.G.O.viewerTransitionMediaKind.indexOf(this.mediaKind)>-1){return true;}
1668return false;};NGY2Item.prototype.imageSet=function(src,w,h){this.src=src;this.width=w;this.height=h;};NGY2Item.prototype.thumbSet=function(src,w,h,screenSize,level){var lst=['xs','sm','me','la','xl'];if(typeof screenSize==='undefined'||screenSize==''||screenSize==null){for(var i=0;i<lst.length;i++){if(typeof level==='undefined'||level==''){this.thumbs.url.l1[lst[i]]=src;this.thumbs.height.l1[lst[i]]=h;this.thumbs.width.l1[lst[i]]=w;this.thumbs.url.lN[lst[i]]=src;this.thumbs.height.lN[lst[i]]=h;this.thumbs.width.lN[lst[i]]=w;}
1669else{this.thumbs.url[level][lst[i]]=src;this.thumbs.height[level][lst[i]]=h;this.thumbs.width[level][lst[i]]=w;}}}
1670else{if(typeof level==='undefined'||level==''||level==null){this.thumbs.url.l1[screenSize]=src;this.thumbs.height.l1[screenSize]=h;this.thumbs.width.l1[screenSize]=w;this.thumbs.url.lN[screenSize]=src;this.thumbs.height.lN[screenSize]=h;this.thumbs.width.lN[screenSize]=w;}
1671else{this.thumbs.url[level][screenSize]=src;this.thumbs.height[level][screenSize]=h;this.thumbs.width[level][screenSize]=w;}}
1672for(var i=0;i<lst.length;i++){this.thumbs.height.l1[lst[i]]=h;}
1673for(var i=0;i<lst.length;i++){if(this.G.tn.settings.height.lN[lst[i]]==this.G.tn.settings.getH()&&this.G.tn.settings.width.l1[lst[i]]==this.G.tn.settings.getW()){this.thumbs.height.lN[lst[i]]=h;}}};NGY2Item.prototype.thumbSetImgHeight=function(h){var lst=['xs','sm','me','la','xl'];for(var i=0;i<lst.length;i++){if(this.G.tn.settings.height.l1[lst[i]]==this.G.tn.settings.getH()&&this.G.tn.settings.width.l1[lst[i]]==this.G.tn.settings.getW()){this.thumbs.height.l1[lst[i]]=h;}}
1674for(var i=0;i<lst.length;i++){if(this.G.tn.settings.height.lN[lst[i]]==this.G.tn.settings.getH()&&this.G.tn.settings.width.l1[lst[i]]==this.G.tn.settings.getW()){this.thumbs.height.lN[lst[i]]=h;}}};NGY2Item.prototype.thumbSetImgWidth=function(w){var lst=['xs','sm','me','la','xl'];for(var i=0;i<lst.length;i++){if(this.G.tn.settings.height.l1[lst[i]]==this.G.tn.settings.getH()&&this.G.tn.settings.width.l1[lst[i]]==this.G.tn.settings.getW()){this.thumbs.width.l1[lst[i]]=w;}}
1675for(var i=0;i<lst.length;i++){if(this.G.tn.settings.height.lN[lst[i]]==this.G.tn.settings.getH()&&this.G.tn.settings.width.l1[lst[i]]==this.G.tn.settings.getW()){this.thumbs.width.lN[lst[i]]=w;}}};NGY2Item.prototype.thumbImg=function(){var tnImg={src:'',width:0,height:0};if(this.title=='image gallery by nanogallery2 [build]'){tnImg.src=this.G.emptyGif;tnImg.url=this.G.emptyGif;return tnImg;}
1676tnImg.src=this.thumbs.url[this.G.GOM.curNavLevel][this.G.GOM.curWidth];tnImg.width=this.thumbs.width[this.G.GOM.curNavLevel][this.G.GOM.curWidth];tnImg.height=this.thumbs.height[this.G.GOM.curNavLevel][this.G.GOM.curWidth];return tnImg;};NGY2Item.prototype.setTags=function(tags){if(tags.length>0){this.tags=tags;var lstTags=this.album().albumTagList;for(var i=0;i<tags.length;i++){var tfound=false;for(var j=0;j<lstTags.length;j++){if(tags[i].toUpperCase()==lstTags[j].toUpperCase()){tfound=true;}}
1677if(tfound==false){this.album().albumTagList.push(tags[i])}}}};NGY2Item.prototype.checkTagFilter=function(){if(this.G.galleryFilterTags.Get()!=false&&this.album().albumTagList.length>0){if(this.G.O.thumbnailLevelUp&&this.kind=='albumUp'){return true;}
1678var found=false;var lstTags=this.album().albumTagListSel;if(lstTags.length==0){return true;}
1679for(var i=0;i<this.tags.length;i++){for(var j=0;j<lstTags.length;j++){if(this.tags[i].toUpperCase()==lstTags[j].toUpperCase()){found=true;break;}}}
1680return found;}
1681else
1682return true;};NGY2Item.prototype.isSearchTagFound=function(){if(this.G.GOM.albumSearchTags==''){return true;}
1683if(this.G.O.thumbnailLevelUp&&this.kind=='albumUp'){return true;}
1684for(var i=0;i<this.tags.length;i++){if(this.tags[i].toUpperCase().indexOf(this.G.GOM.albumSearchTags)>=0){return true;}}
1685return false;};NGY2Item.prototype.setMediaURL=function(url,mediaKind){this.src=url;this.mediaKind=mediaKind;if(mediaKind=='img'){this.mediaMarkup='<img class="nGY2ViewerMedia" src="'+url+'" alt=" " itemprop="contentURL" draggable="false">';}};NGY2Item.prototype.isToDisplay=function(albumID){return this.albumID==albumID&&this.checkTagFilter()&&this.isSearchFound()&&this.isSearchTagFound()&&this.deleted==false;};NGY2Item.prototype.getContentLength=function(filterTags){if(filterTags==false||this.albumTagList.length==0||this.G.galleryFilterTags.Get()==false){return this.contentLength;}
1686else{var l=this.G.I.length;var cnt=0;var albumID=this.GetID();for(var idx=0;idx<l;idx++){var item=this.G.I[idx];if(item.isToDisplay(albumID)){cnt++;}}
1687return cnt;}};NGY2Item.prototype.isSearchFound=function(){if(this.G.GOM.albumSearch!=''){if(this.title.toUpperCase().indexOf(this.G.GOM.albumSearch)==-1){return false;}}
1688return true;}
1689NGY2Item.prototype.responsiveURL=function(){var url='';switch(this.G.O.kind){case'':url=this.src;break;case'flickr':url=this.src;break;case'picasa':case'google':case'google2':default:url=this.src;break;}
1690return url;};NGY2Item.prototype.ThumbnailImageReveal=function(){if(this.thumbnailImgRevealed==false){this.thumbnailImgRevealed=true;new NGTweenable().tween({from:{opacity:0},to:{opacity:1},attachment:{item:this},delay:30,duration:400,easing:'easeOutQuart',step:function(state,att){var $e=att.item.$getElt('.nGY2TnImg');if($e!=null){$e.css(state);}}});}};function ValueApplyPercent(str,percent){str=String(str);if(str==='0'||percent==1){return str;}
1691var n=Number(str.replace(/[a-zA-Z]/g,''));var ar=str.match(/([^\-0-9\.]+)/g);var a='';if(ar!=null&&ar.length>0){a=ar.join();}
1692if(isNaN(n)||n==0){return str;}
1693n=n*percent;return n+a;}
1694NGY2Item.prototype.CSSTransformApply=function(eltClass){var obj=this.eltTransform[eltClass];if(eltClass=='.nGY2GThumbnail'){var nbStacks=obj.$elt.length-1;var pTranslateX=1;var pTranslateY=1;var pTranslateZ=1;var pTranslate=1;var pRotateX=1;var pRotateY=1;var pRotateZ=1;var pRotate=1;var pScale=1;for(var n=nbStacks;n>=0;n--){var v='translateX('+ValueApplyPercent(obj.translateX,pTranslateX)+') translateY('+ValueApplyPercent(obj.translateY,pTranslateY)+') translateZ('+ValueApplyPercent(obj.translateZ,pTranslateZ)+') scale('+ValueApplyPercent(obj.scale,pScale)+') translate('+ValueApplyPercent(obj.translate,pTranslate)+')';if(!(this.G.IE<=9)&&!this.G.isGingerbread){v+=' rotateX('+ValueApplyPercent(obj.rotateX,pRotateX)+') rotateY('+ValueApplyPercent(obj.rotateY,pRotateY)+') rotateZ('+ValueApplyPercent(obj.rotateZ,pRotateZ)+') rotate('+ValueApplyPercent(obj.rotate,pRotate)+')';}
1695else{v+=' rotate('+ValueApplyPercent(obj.rotateZ,pRotateZ)+')';}
1696obj.$elt[n].style[this.G.CSStransformName]=v;if(nbStacks>0){pTranslateX-=this.G.tn.opt.Get('stacksTranslateX');pTranslateY-=this.G.tn.opt.Get('stacksTranslateY');pTranslateZ-=this.G.tn.opt.Get('stacksTranslateZ');pRotateX-=this.G.tn.opt.Get('stacksRotateX');pRotateY-=this.G.tn.opt.Get('stacksRotateY');pRotateZ-=this.G.tn.opt.Get('stacksRotateZ');pScale-=this.G.tn.opt.Get('stacksScale');}}}
1697else{if(obj.$elt!=null){for(var n=0;n<obj.$elt.length;n++){if(obj.$elt[n]!=undefined){var v='translateX('+obj.translateX+') translateY('+obj.translateY+') translateZ('+obj.translateZ+') scale('+obj.scale+') translate('+obj.translate+')';if(!(this.G.IE<=9)&&!this.G.isGingerbread){v+=' rotateX('+obj.rotateX+') rotateY('+obj.rotateY+') rotateZ('+obj.rotateZ+') rotate('+obj.rotate+')';}
1698else{v+=' rotate('+obj.rotateZ+')';}
1699obj.$elt[n].style[this.G.CSStransformName]=v;}}}}};NGY2Item.prototype.CSSTransformSet=function(eltClass,transform,value,forceRefresh){if(this.eltTransform[eltClass]==undefined){this.eltTransform[eltClass]={translateX:0,translateY:0,translateZ:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,translate:'0px,0px',rotate:0};this.eltTransform[eltClass].$elt=this.$getElt(eltClass);}
1700this.eltTransform[eltClass][transform]=value;if(forceRefresh===true){this.eltTransform[eltClass].$elt=this.$getElt(eltClass,true);}};NGY2Item.prototype.CSSFilterApply=function(eltClass){var obj=this.eltFilter[eltClass];var v='blur('+obj.blur+') brightness('+obj.brightness+') grayscale('+obj.grayscale+') sepia('+obj.sepia+') contrast('+obj.contrast+') opacity('+obj.opacity+') saturate('+obj.saturate+')';if(obj.$elt!=null){for(var n=0;n<obj.$elt.length;n++){if(obj.$elt[n]!=undefined){obj.$elt[n].style.WebkitFilter=v;obj.$elt[n].style.filter=v;}}}};NGY2Item.prototype.CSSFilterSet=function(eltClass,filter,value,forceRefresh){if(this.eltFilter[eltClass]==undefined){this.eltFilter[eltClass]={blur:0,brightness:'100%',grayscale:'0%',sepia:'0%',contrast:'100%',opacity:'100%',saturate:'100%'};this.eltFilter[eltClass].$elt=this.$getElt(eltClass);}
1701this.eltFilter[eltClass][filter]=value;if(forceRefresh===true){this.eltTransform[eltClass].$elt=this.$getElt(eltClass,true);}};NGY2Item.prototype.animate=function(effect,delay,hoverIn){if(this.$getElt()==null){return;}
1702var context={};context.G=this.G;context.item=this;context.effect=effect;context.hoverIn=hoverIn;context.cssKind='';if(hoverIn){if(this.eltEffect[effect.element]==undefined){this.eltEffect[effect.element]=[];}
1703if(this.eltEffect[effect.element][effect.type]==undefined){this.eltEffect[effect.element][effect.type]={initialValue:0,lastValue:0};}
1704if(effect.firstKeyframe){this.eltEffect[effect.element][effect.type]={initialValue:effect.from,lastValue:effect.from};}
1705context.animeFrom=effect.from;context.animeTo=effect.to;context.animeDuration=parseInt(effect.duration);context.animeDelay=30+parseInt(effect.delay+delay);context.animeEasing=effect.easing;}
1706else{context.animeFrom=this.eltEffect[effect.element][effect.type].lastValue;context.animeTo=this.eltEffect[effect.element][effect.type].initialValue;context.animeDuration=parseInt(effect.durationBack);context.animeDelay=30+parseInt(effect.delayBack+delay);context.animeEasing=effect.easingBack;}
1707var transform=['translateX','translateY','translateZ','scale','rotateX','rotateY','rotateZ'];for(var i=0;i<transform.length;i++){if(effect.type==transform[i]){context.cssKind='transform';break;}}
1708var filter=['blur','brightness','grayscale','sepia','contrast','opacity','saturate'];for(var i=0;i<filter.length;i++){if(effect.type==filter[i]){context.cssKind='filter';break;}}
1709if(hoverIn&&effect.element=='.nGY2GThumbnail'&&(effect.type=='scale'||effect.type=='rotateX')){this.G.GOM.lastZIndex++;this.$getElt(effect.element).css('z-index',this.G.GOM.lastZIndex);}
1710var tweenable=new NGTweenable();context.tweenable=tweenable;tweenable.tween({attachment:context,from:{'v':context.animeFrom},to:{'v':context.animeTo},duration:context.animeDuration,delay:context.animeDelay,easing:context.animeEasing,step:function(state,att){if(att.item.$getElt()==null){att.tweenable.stop(false);return;}
1711if(att.hoverIn&&!att.item.hovered){att.tweenable.stop(false);return;}
1712if(att.G.VOM.viewerDisplayed){att.tweenable.stop(false);return;}
1713if(state.v==att.animeFrom){return;}
1714switch(att.cssKind){case'transform':att.item.CSSTransformSet(att.effect.element,att.effect.type,state.v);att.item.CSSTransformApply(att.effect.element);break;case'filter':att.item.CSSFilterSet(att.effect.element,att.effect.type,state.v);att.item.CSSFilterApply(att.effect.element);break;default:var v=state.v;if(state.v.substring(0,4)=='rgb('||state.v.substring(0,5)=='rgba('){v=ShadeBlendConvert(0,v);}
1715att.item.$getElt(att.effect.element).css(att.effect.type,v);break;}
1716if(hoverIn){att.item.eltEffect[att.effect.element][att.effect.type].lastValue=state.v;}},finish:function(state,att){if(hoverIn){att.item.eltEffect[att.effect.element][att.effect.type].lastValue=state.v;}
1717if(att.item.$getElt()==null){return;}
1718if(att.hoverIn&&!att.item.hovered){return;}
1719if(att.G.VOM.viewerDisplayed){return;}
1720switch(att.cssKind){case'transform':att.item.CSSTransformSet(att.effect.element,att.effect.type,att.animeTo);att.item.CSSTransformApply(att.effect.element);break;case'filter':att.item.CSSFilterSet(att.effect.element,att.effect.type,att.animeTo);att.item.CSSFilterApply(att.effect.element);break;default:att.item.$getElt(att.effect.element).css(att.effect.type,att.animeTo);break;}}});};return NGY2Item;})();}
1721_this.options=jQuery.extend(true,{},jQuery.nanogallery2.defaultOptions,options);_this.nG2=null;_this.nG2=new nanoGALLERY2();_this.nG2.initiateGallery2(_this.e,_this.options);};_this.test=function(){}
1722_this.init();};jQuery.nanogallery2.defaultOptions={kind:'',userID:'',photoset:'',album:'',blockList:'scrapbook|profil|auto backup',tagBlockList:'',allowList:'',albumList:'',albumList2:null,RTL:false,flickrSkipOriginal:true,flickrAPIKey:'',breadcrumbAutoHideTopLevel:true,displayBreadcrumb:true,breadcrumbOnlyCurrentLevel:true,breadcrumbHideIcons:true,theme:'nGY2',galleryTheme:'dark',viewerTheme:'dark',items:null,itemsBaseURL:'',thumbnailSelectable:false,dataProvider:'',allowHTMLinData:false,locationHash:true,slideshowDelay:3000,slideshowAutoStart:false,debugMode:false,titleTranslationMap:null,galleryDisplayMoreStep:2,galleryDisplayMode:'fullContent',galleryL1DisplayMode:null,galleryPaginationMode:'rectangles',galleryPaginationTopButtons:true,galleryMaxRows:2,galleryL1MaxRows:null,galleryLastRowFull:false,galleryL1LastRowFull:null,galleryLayoutEngine:'default',paginationSwipe:true,paginationVisiblePages:10,galleryFilterTags:false,galleryL1FilterTags:null,galleryFilterTagsMode:'single',galleryL1FilterTagsMode:null,galleryMaxItems:0,galleryL1MaxItems:null,gallerySorting:'',galleryL1Sorting:null,galleryDisplayTransition:'none',galleryL1DisplayTransition:null,galleryDisplayTransitionDuration:1000,galleryL1DisplayTransitionDuration:null,galleryResizeAnimation:false,galleryRenderDelay:10,thumbnailCrop:true,thumbnailL1Crop:null,thumbnailCropScaleFactor:1.5,thumbnailLevelUp:false,thumbnailAlignment:'fillWidth',thumbnailWidth:300,thumbnailL1Width:null,thumbnailHeight:200,thumbnailL1Height:null,thumbnailBaseGridHeight:0,thumbnailL1BaseGridHeight:null,thumbnailGutterWidth:2,thumbnailL1GutterWidth:null,thumbnailGutterHeight:2,thumbnailL1GutterHeight:null,thumbnailBorderVertical:2,thumbnailL1BorderVertical:null,thumbnailBorderHorizontal:2,thumbnailL1BorderHorizontal:null,thumbnailFeaturedKeyword:'*featured',thumbnailAlbumDisplayImage:false,thumbnailHoverEffect2:'toolsAppear',thumbnailBuildInit2:'',thumbnailStacks:0,thumbnailL1Stacks:null,thumbnailStacksTranslateX:0,thumbnailL1StacksTranslateX:null,thumbnailStacksTranslateY:0,thumbnailL1StacksTranslateY:null,thumbnailStacksTranslateZ:0,thumbnailL1StacksTranslateZ:null,thumbnailStacksRotateX:0,thumbnailL1StacksRotateX:null,thumbnailStacksRotateY:0,thumbnailL1StacksRotateY:null,thumbnailStacksRotateZ:0,thumbnailL1StacksRotateZ:null,thumbnailStacksScale:0,thumbnailL1StacksScale:null,thumbnailDisplayOutsideScreen:true,thumbnailWaitImageLoaded:true,thumbnailSliderDelay:2000,galleryBuildInit2:'',portable:false,eventsDebounceDelay:10,touchAnimation:false,touchAnimationL1:undefined,touchAutoOpenDelay:0,thumbnailLabel:{position:'overImage',align:'center',valign:'bottom',display:true,displayDescription:false,titleMaxLength:0,titleMultiLine:false,descriptionMaxLength:0,descriptionMultiLine:false,hideIcons:true,title:''},thumbnailToolbarImage:{topLeft:'select',topRight:'featured'},thumbnailToolbarAlbum:{topLeft:'select',topRight:'counter'},thumbnailDisplayOrder:'',thumbnailL1DisplayOrder:null,thumbnailDisplayInterval:15,thumbnailL1DisplayInterval:null,thumbnailDisplayTransition:'fadeIn',thumbnailL1DisplayTransition:null,thumbnailDisplayTransitionEasing:'easeOutQuart',thumbnailL1DisplayTransitionEasing:null,thumbnailDisplayTransitionDuration:240,thumbnailL1DisplayTransitionDuration:null,thumbnailOpenInLightox:true,thumbnailOpenOriginal:false,lightboxStandalone:false,viewer:'internal',viewerFullscreen:false,imageTransition:'swipe2',viewerTransitionMediaKind:'img',viewerZoom:true,viewerRelativePinchZoom:false,viewerMinZoom:0.2,viewerResetZoomAtMin:false,viewerZoomOutScale:3.0,viewerImageDisplay:'',openOnStart:'',viewerHideToolsDelay:4000,viewerToolbar:{display:false,position:'bottom',fullWidth:false,align:'center',autoMinimize:0,standard:'minimizeButton,label',minimized:'minimizeButton,label,infoButton,shareButton,fullscreenButton'},viewerTools:{topLeft:'pageCounter,playPauseButton',topRight:'rotateLeft,rotateRight,fullscreenButton,closeButton'},viewerGallery:'bottomOverMedia',viewerGalleryTWidth:40,viewerGalleryTHeight:40,breakpointSizeSM:480,breakpointSizeME:992,breakpointSizeLA:1200,breakpointSizeXL:1800,fnThumbnailInit:null,fnThumbnailHoverInit:null,fnThumbnailHover:null,fnThumbnailHoverOut:null,fnThumbnailDisplayEffect:null,fnViewerInfo:null,fnImgToolbarCustInit:null,fnImgToolbarCustDisplay:null,fnImgToolbarCustClick:null,fnProcessData:null,fnThumbnailSelection:null,fnGalleryRenderStart:null,fnGalleryRenderEnd:null,fnGalleryObjectModelBuilt:null,fnGalleryLayoutApplied:null,fnThumbnailClicked:null,fnShoppingCartUpdated:null,fnThumbnailToolCustAction:null,fnThumbnailOpen:null,fnImgDisplayed:null,fnPopupMediaInfo:null,i18n:{'breadcrumbHome':'Galleries','breadcrumbHome_FR':'Galeries','thumbnailImageTitle':'','thumbnailAlbumTitle':'','thumbnailImageDescription':'','thumbnailAlbumDescription':'','infoBoxPhoto':'Photo','infoBoxDate':'Date','infoBoxAlbum':'Album','infoBoxDimensions':'Dimensions','infoBoxFilename':'Filename','infoBoxFileSize':'File size','infoBoxCamera':'Camera','infoBoxFocalLength':'Focal length','infoBoxExposure':'Exposure','infoBoxFNumber':'F Number','infoBoxISO':'ISO','infoBoxMake':'Make','infoBoxFlash':'Flash','infoBoxViews':'Views','infoBoxComments':'Comments'},icons:{thumbnailAlbum:'<i class="nGY2Icon-folder-empty"></i>',thumbnailImage:'<i class="nGY2Icon-picture"></i>',breadcrumbAlbum:'<i class="nGY2Icon-folder-empty"></i>',breadcrumbHome:'<i class="nGY2Icon-home"></i>',breadcrumbSeparator:'<i class="nGY2Icon-left-open"></i>',breadcrumbSeparatorRtl:'<i class="nGY2Icon-right-open"></i>',navigationFilterSelected:'<i style="color:#fff;" class="nGY2Icon-ok"></i>',navigationFilterUnselected:'<i style="color:#ddd;opacity:0.3;" class="nGY2Icon-circle-empty"></i>',navigationFilterSelectedAll:'<i class="nGY2Icon-ccw"></i>',navigationPaginationPrevious:'<i class="nGY2Icon-ngy2_chevron-left"></i>',navigationPaginationNext:'<i class="nGY2Icon-ngy2_chevron-right"></i>',thumbnailSelected:'<i style="color:#bff;" class="nGY2Icon-ok-circled"></i>',thumbnailUnselected:'<i style="color:#bff;" class="nGY2Icon-circle-empty"></i>',thumbnailFeatured:'<i style="color:#dd5;" class="nGY2Icon-star"></i>',thumbnailCounter:'<i class="nGY2Icon-picture"></i>',thumbnailShare:'<i class="nGY2Icon-ngy2_share2"></i>',thumbnailDownload:'<i class="nGY2Icon-ngy2_download2"></i>',thumbnailInfo:'<i class="nGY2Icon-ngy2_info2"></i>',thumbnailShoppingcart:'<i class="nGY2Icon-basket"></i>',thumbnailDisplay:'<i class="nGY2Icon-resize-full"></i>',thumbnailCustomTool1:'T1',thumbnailCustomTool2:'T2',thumbnailCustomTool3:'T3',thumbnailCustomTool4:'T4',thumbnailCustomTool5:'T5',thumbnailCustomTool6:'T6',thumbnailCustomTool7:'T7',thumbnailCustomTool8:'T8',thumbnailCustomTool9:'T9',thumbnailCustomTool10:'T10',thumbnailAlbumUp:'<i style="font-size: 3em;" class="nGY2Icon-ngy2_chevron_up2"></i>',paginationNext:'<i class="nGY2Icon-right-open"></i>',paginationPrevious:'<i class="nGY2Icon-left-open"></i>',galleryMoreButton:'<i class="nGY2Icon-picture"></i> &nbsp; <i class="nGY2Icon-right-open"></i>',buttonClose:'<i class="nGY2Icon-ngy2_close2"></i>',viewerPrevious:'<i class="nGY2Icon-ngy2_chevron-left"></i>',viewerNext:'<i class="nGY2Icon-ngy2_chevron-right"></i>',viewerImgPrevious:'<i class="nGY2Icon-ngy2_chevron_left3"></i>',viewerImgNext:'<i class="nGY2Icon-ngy2_chevron_right3"></i>',viewerDownload:'<i class="nGY2Icon-ngy2_download2"></i>',viewerToolbarMin:'<i class="nGY2Icon-ellipsis-vert"></i>',viewerToolbarStd:'<i class="nGY2Icon-menu"></i>',viewerPlay:'<i class="nGY2Icon-play"></i>',viewerPause:'<i class="nGY2Icon-pause"></i>',viewerFullscreenOn:'<i class="nGY2Icon-resize-full"></i>',viewerFullscreenOff:'<i class="nGY2Icon-resize-small"></i>',viewerZoomIn:'<i class="nGY2Icon-ngy2_zoom_in2"></i>',viewerZoomOut:'<i class="nGY2Icon-ngy2_zoom_out2"></i>',viewerLinkOriginal:'<i class="nGY2Icon-ngy2_external2"></i>',viewerInfo:'<i class="nGY2Icon-ngy2_info2"></i>',viewerShare:'<i class="nGY2Icon-ngy2_share2"></i>',viewerRotateLeft:'<i class="nGY2Icon-ccw"></i>',viewerRotateRight:'<i class="nGY2Icon-cw"></i>',viewerShoppingcart:'<i class="nGY2Icon-basket"></i>',user:'<i class="nGY2Icon-user"></i>',location:'<i class="nGY2Icon-location"></i>',picture:'<i class="nGY2Icon-picture"></i>',config:'<i class="nGY2Icon-wrench"></i>',shareFacebook:'<i style="color:#3b5998;" class="nGY2Icon-facebook-squared"></i>',shareTwitter:'<i style="color:#00aced;" class="nGY2Icon-twitter-squared"></i>',shareTumblr:'<i style="color:#32506d;" class="nGY2Icon-tumblr-squared"></i>',sharePinterest:'<i style="color:#cb2027;" class="nGY2Icon-pinterest-squared"></i>',shareVK:'<i style="color:#3b5998;" class="nGY2Icon-vkontakte"></i>',shareMail:'<i style="color:#555;" class="nGY2Icon-mail-alt"></i>',viewerCustomTool1:'T1',viewerCustomTool2:'T2',viewerCustomTool3:'T3',viewerCustomTool4:'T4',viewerCustomTool5:'T5',viewerCustomTool6:'T6',viewerCustomTool7:'T7',viewerCustomTool8:'T8',viewerCustomTool9:'T9',viewerCustomTool10:'T10'}};jQuery.fn.nanogallery2=function(args,option,value){if(typeof jQuery(this).data('nanogallery2data')==='undefined'){if(args=='destroy'){return;}
1723return this.each(function(){(new jQuery.nanogallery2(this,args));});}
1724else{var nG2=$(this).data('nanogallery2data').nG2;if(args!==undefined&&args.lightboxStandalone===true){nG2.LightboxReOpen();return;}
1725switch(args){case'displayItem':nG2.DisplayItem(option);break;case'search':return(nG2.Search(option));break;case'search2':return nG2.Search2(option,value);break;case'search2Execute':return nG2.Search2Execute();break;case'refresh':nG2.Refresh();break;case'resize':nG2.Resize();break;case'instance':return nG2;break;case'data':nG2.data={items:nG2.I,gallery:nG2.GOM,lightbox:nG2.VOM,shoppingcart:nG2.shoppingCart};return nG2.data;break;case'reload':nG2.ReloadAlbum();return $(this);break;case'itemsSelectedGet':return nG2.ItemsSelectedGet();break;case'itemsSetSelectedValue':nG2.ItemsSetSelectedValue(option,value);break;case'option':if(typeof value==='undefined'){return nG2.Get(option);}else{nG2.Set(option,value);if(option=='demoViewportWidth'){$(window).trigger('resize');}}
1726break;case'destroy':nG2.Destroy();$(this).removeData('nanogallery2data');break;case'shoppingCartGet':return nG2.shoppingCart;break;case'shoppingCartUpdate':if(typeof value==='undefined'||typeof option==='undefined'){return false;}
1727var item_ID=option;var new_qty=value;for(var i=0;i<nG2.shoppingCart.length;i++){if(nG2.shoppingCart[i].ID==item_ID){nG2.shoppingCart[i].qty=new_qty;let item=nG2.I[nG2.shoppingCart[i].idx];nG2.ThumbnailToolbarOneCartUpdate(item);if(new_qty==0){nG2.shoppingCart.splice(i,1);}
1728var fu=nG2.O.fnShoppingCartUpdated;if(fu!==null){typeof fu=='function'?fu(nG2.shoppingCart,item,'api'):window[fu](nG2.shoppingCart,item,'api');}
1729break;}}
1730return nG2.shoppingCart;break;case'shoppingCartRemove':if(typeof option==='undefined'){return false;}
1731var ID=option;for(var i=0;i<nG2.shoppingCart.length;i++){if(nG2.shoppingCart[i].ID==ID){var item=nG2.I[nG2.shoppingCart[i].idx];nG2.shoppingCart[i].qty=0;nG2.ThumbnailToolbarOneCartUpdate(item);nG2.shoppingCart.splice(i,1);var fu=nG2.O.fnShoppingCartUpdated;if(fu!==null){typeof fu=='function'?fu(nG2.shoppingCart,item,'api'):window[fu](nG2.shoppingCart,item,'api');}
1732break;}}
1733return nG2.shoppingCart;break;case'closeViewer':nG2.CloseViewer();break;case'minimizeToolbar':nG2.MinimizeToolbar();break;case'maximizeToolbar':nG2.MaximizeToolbar();break;case'paginationPreviousPage':nG2.PaginationPreviousPage();break;case'paginationNextPage':nG2.paginationNextPage();break;case'paginationGotoPage':nG2.PaginationGotoPage(option);break;case'paginationCountPages':nG2.PaginationCountPages();break;}
1734return $(this);}};function nanoGALLERY2(){"use strict";this.LightboxReOpen=function(){LightboxStandaloneDisplay();}
1735this.ReloadAlbum=function(){if(G.O.kind===''){throw'Not supported for this content source:'+G.O.kind;}
1736var albumIdx=G.GOM.albumIdx;if(albumIdx==-1){throw('Current album not found.');}
1737var albumID=G.I[albumIdx].GetID();var l=G.I.length;for(var i=0;i<l;i++){var item=G.I[i];if(item.albumID==albumID){item.selected=false;}}
1738G.I[albumIdx].contentIsLoaded=false;DisplayAlbum('-1',albumID);};this.ItemsSetSelectedValue=function(items,value){var l=items.length;for(var j=0;j<l;j++){ThumbnailSelectionSet(items[j],value);}};this.ItemsSelectedGet=function(){var selectedItems=[];var l=G.I.length;for(var i=0;i<l;i++){if(G.I[i].selected==true){selectedItems.push(G.I[i]);}}
1739return selectedItems;};this.Get=function(option){return G.O[option];};this.Set=function(option,value){G.O[option]=value;switch(option){case'thumbnailSelectable':ThumbnailSelectionClear();GalleryRender(G.GOM.albumIdx);break;}};this.Refresh=function(){GalleryRender(G.GOM.albumIdx);};this.Resize=function(){GalleryResize();};this.DisplayItem=function(itemID){var IDs=parseIDs(itemID);if(IDs.imageID!='0'){DisplayPhoto(IDs.imageID,IDs.albumID);}
1740else{DisplayAlbum('-1',IDs.albumID);}};this.ThumbnailToolbarOneCartUpdate=function(item){ThumbnailBuildToolbarOneCartUpdate(item);}
1741var CountItemsToDisplay=function(gIdx){if(G.I[gIdx]==undefined){return 0;}
1742var albumID=G.I[gIdx].GetID();var l=G.I.length;var cnt=0;for(var idx=0;idx<l;idx++){var item=G.I[idx];if(item.isToDisplay(albumID)){cnt++;}}
1743return cnt;}
1744this.Search=function(search){G.GOM.albumSearch=search.toUpperCase();var gIdx=G.GOM.albumIdx;GalleryRender(G.GOM.albumIdx);return CountItemsToDisplay(gIdx);};this.Search2=function(searchTitle,searchTags){if(searchTitle!=undefined&&searchTitle!=null){G.GOM.albumSearch=searchTitle.toUpperCase().trim();}
1745else{G.GOM.albumSearch='';}
1746if(searchTags!=null&&searchTags!=undefined){G.GOM.albumSearchTags=searchTags.toUpperCase().trim();}
1747else{G.GOM.albumSearchTags='';}
1748return CountItemsToDisplay(G.GOM.albumIdx);};this.Search2Execute=function(){var gIdx=G.GOM.albumIdx;GalleryRender(G.GOM.albumIdx);return CountItemsToDisplay(gIdx);};this.Destroy=function(){if(G.GOM.hammertime!=null){G.GOM.hammertime.destroy();G.GOM.hammertime=null;}
1749if(G.VOM.hammertime!=null){G.VOM.hammertime.destroy();G.VOM.hammertime=null;}
1750$('#ngycs_'+G.baseEltID).remove()
1751G.GOM.items=[];NGY2Item.New(G,G.i18nTranslations.breadcrumbHome,'','0','-1','album');G.GOM.navigationBar.$newContent=null;G.$E.base.empty();G.$E.base.removeData();if(G.O.locationHash){jQuery(window).off('hashchange.nanogallery2.'+G.baseEltID);}
1752jQuery(window).off('resize.nanogallery2.'+G.baseEltID);jQuery(window).off('orientationChange.nanogallery2.'+G.baseEltID);jQuery(window).off('scroll.nanogallery2.'+G.baseEltID);if(G.$E.scrollableParent!==null){G.$E.scrollableParent.off('scroll.nanogallery2.'+G.baseEltID);}
1753G.GOM.firstDisplay=true;};this.CloseViewer=function(){LightboxClose(null);return false;};this.MinimizeToolbar=function(){ViewerToolbarForVisibilityMin();return false;};this.MaximizeToolbar=function(){ViewerToolbarForVisibilityStd();return false;};this.PaginationPreviousPage=function(){paginationPreviousPage();return false;};this.PaginationNextPage=function(){paginationNextPage();return false;};this.PaginationGotoPage=function(page){if(page>1){page--;}
1754G.GOM.pagination.currentPage=page;G.GOM.ScrollToTop();GalleryDisplayPart1();GalleryDisplayPart2(true);return false;};this.PaginationCountPages=function(){if(G.GOM.items.length==0){return 0;}
1755var nbPages=Math.ceil((G.GOM.items[G.GOM.items.length-1].row+1)/G.galleryMaxRows.Get());return nbPages;};var throttle=function(func,wait,options){var context,args,result;var timeout=null;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:new Date().getTime();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null;};return function(){var now=new Date().getTime();if(!previous&&options.leading===false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){if(timeout){clearTimeout(timeout);timeout=null;}
1756previous=now;result=func.apply(context,args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);}
1757return result;};};var debounce=function(func,threshold,execAsap){var timeout;return function debounced(){var obj=this,args=arguments;function delayed(){if(!execAsap)
1758func.apply(obj,args);timeout=null;};if(timeout)
1759clearTimeout(timeout);else if(execAsap)
1760func.apply(obj,args);timeout=setTimeout(delayed,threshold||100);};}
1761window.ng_draf=function(cb){return requestAnimationFrame(function(){window.requestAnimationFrame(cb)})}
1762window.requestTimeout=function(fn,delay){if(!window.requestAnimationFrame&&!window.webkitRequestAnimationFrame&&!(window.mozRequestAnimationFrame&&window.mozCancelRequestAnimationFrame)&&!window.oRequestAnimationFrame&&!window.msRequestAnimationFrame)
1763return window.setTimeout(fn,delay);var start=new Date().getTime(),handle=new Object();function loop(){var current=new Date().getTime(),delta=current-start;delta>=delay?fn.call():handle.value=requestAnimFrame(loop);};handle.value=requestAnimFrame(loop);return handle;};window.requestAnimFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback,element){window.setTimeout(callback,1000/60);};})();window.clearRequestTimeout=function(handle){window.cancelAnimationFrame?window.cancelAnimationFrame(handle.value):window.webkitCancelAnimationFrame?window.webkitCancelAnimationFrame(handle.value):window.webkitCancelRequestAnimationFrame?window.webkitCancelRequestAnimationFrame(handle.value):window.mozCancelRequestAnimationFrame?window.mozCancelRequestAnimationFrame(handle.value):window.oCancelRequestAnimationFrame?window.oCancelRequestAnimationFrame(handle.value):window.msCancelRequestAnimationFrame?window.msCancelRequestAnimationFrame(handle.value):clearTimeout(handle);};var G=this;G.I=[];G.Id=[];G.O=null;G.baseEltID=null;G.$E={base:null,conTnParent:null,conLoadingB:null,conConsole:null,conNavigationBar:null,conTnBottom:null,scrollableParent:null};G.shoppingCart=[];G.layout={internal:true,engine:'',support:{rows:false},prerequisite:{imageSize:false},SetEngine:function(){if(G.layout.internal){if(G.tn.settings.width[G.GOM.curNavLevel][G.GOM.curWidth]=='auto'||G.tn.settings.width[G.GOM.curNavLevel][G.GOM.curWidth]==''){G.layout.engine='JUSTIFIED';G.layout.support.rows=true;G.layout.prerequisite.imageSize=true;return;}
1764if(G.tn.settings.height[G.GOM.curNavLevel][G.GOM.curWidth]=='auto'||G.tn.settings.height[G.GOM.curNavLevel][G.GOM.curWidth]==''){G.layout.engine='CASCADING';G.layout.support.rows=false;G.layout.prerequisite.imageSize=true;return;}
1765if(G.tn.settings.getMosaic()!=null){G.layout.engine='MOSAIC';G.layout.support.rows=true;G.layout.prerequisite.imageSize=false;return;}
1766G.layout.engine='GRID';G.layout.support.rows=true;G.layout.prerequisite.imageSize=false;}}};G.galleryResizeEventEnabled=false;G.galleryMaxRows={l1:0,lN:0,Get:function(){return G.galleryMaxRows[G.GOM.curNavLevel];}};G.galleryMaxItems={l1:0,lN:0,Get:function(){return G.galleryMaxItems[G.GOM.curNavLevel];}};G.galleryFilterTags={l1:0,lN:0,Get:function(){return G.galleryFilterTags[G.GOM.curNavLevel];}};G.galleryFilterTagsMode={l1:0,lN:0,Get:function(){return G.galleryFilterTagsMode[G.GOM.curNavLevel];}};G.galleryDisplayMode={l1:'FULLCONTENT',lN:'FULLCONTENT',Get:function(){return G.galleryDisplayMode[G.GOM.curNavLevel];}};G.galleryLastRowFull={l1:false,lN:false,Get:function(){return G.galleryLastRowFull[G.GOM.curNavLevel];}};G.gallerySorting={l1:'',lN:'',Get:function(){return G.gallerySorting[G.GOM.curNavLevel];}};G.galleryDisplayTransition={l1:'none',lN:'none',Get:function(){return G.galleryDisplayTransition[G.GOM.curNavLevel];}};G.galleryDisplayTransitionDuration={l1:500,lN:500,Get:function(){return G.galleryDisplayTransitionDuration[G.GOM.curNavLevel];}};G.$currentTouchedThumbnail=null;G.tn={opt:{l1:{crop:true,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:true,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(opt){return G.tn.opt[G.GOM.curNavLevel][opt];}},scale:1,labelHeight:{l1:0,lN:0,get:function(){return G.tn.labelHeight[G.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 G.tn.defaultSize.width[G.GOM.curNavLevel][G.GOM.curWidth];},getOuterWidth:function(){G.tn.borderWidth=G.tn.opt.Get('borderHorizontal');G.tn.borderHeight=G.tn.opt.Get('borderVertical');var w=G.tn.defaultSize.width[G.GOM.curNavLevel][G.GOM.curWidth]+G.tn.opt.Get('borderHorizontal')*2;if(G.O.thumbnailLabel.get('position')=='right'||G.O.thumbnailLabel.get('position')=='left'){w+=G.tn.defaultSize.width[G.GOM.curNavLevel][G.GOM.curWidth];}
1767return w;},getHeight:function(){return G.tn.defaultSize.height[G.GOM.curNavLevel][G.GOM.curWidth];},getOuterHeight:function(){return G.tn.defaultSize.height[G.GOM.curNavLevel][G.GOM.curWidth]+G.tn.opt.Get('borderVertical')*2;}},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(l,w){var cl=(l==undefined?G.GOM.curNavLevel:l);var cw=(w==undefined?G.GOM.curWidth:w);if(G.layout.engine=='MOSAIC'){return this.height[cl][cw]*this.mosaic[cl+'Factor']['h'][cw];}
1768else{return this.height[cl][cw];}},getW:function(l,w){var cl=(l==undefined?G.GOM.curNavLevel:l);var cw=(w==undefined?G.GOM.curWidth:w);if(G.layout.engine=='MOSAIC'){return this.width[cl][cw]*this.mosaic[cl+'Factor']['w'][cw];}
1769else{return this.width[cl][cw];}},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[G.GOM.curNavLevel][G.GOM.curWidth];},mosaicCalcFactor:function(l,w){var maxW=1;var maxH=1;for(var n=0;n<G.tn.settings.mosaic[l][w].length;n++){maxW=Math.max(maxW,this.mosaic[l][w][n]['w']);maxH=Math.max(maxH,this.mosaic[l][w][n]['h']);}
1770this.mosaic[l+'Factor']['h'][w]=maxH;this.mosaic[l+'Factor']['w'][w]=maxW;},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(setting){return this[setting][G.GOM.curNavLevel][G.GOM.curWidth];}},hoverEffects:{std:[],level1:[],get:function(){if(G.GOM.curNavLevel=='l1'&&this.level1.length!==0){return this.level1;}
1771else{return this.std;}}},buildInit:{std:[],level1:[],get:function(){if(G.GOM.curNavLevel=='l1'&&this.level1.length!==0){return this.level1;}
1772else{return this.std;}}},toolbar:{album:{topLeft:'',topRight:'',bottomLeft:'',bottomRight:''},image:{topLeft:'',topRight:'',bottomLeft:'',bottomRight:''},albumUp:{topLeft:'',topRight:'',bottomLeft:'',bottomRight:''},get:function(item){return this[item.kind];},},style:{l1:{label:'',title:'',desc:''},lN:{label:'',title:'',desc:''},getTitle:function(){return('style="'+this[G.GOM.curNavLevel].title+'"');},getDesc:function(){return('style="'+this[G.GOM.curNavLevel].desc+'"');},getLabel:function(){var s='style="'+this[G.GOM.curNavLevel].label;s+=(G.O.RTL?'"direction:RTL;"':'');s+='"';return s;}}};G.scrollTimeOut=0;G.i18nTranslations={'paginationPrevious':'Previous','paginationNext':'Next','breadcrumbHome':'List of Albums','thumbnailImageTitle':'','thumbnailAlbumTitle':'','thumbnailImageDescription':'','thumbnailAlbumDescription':''};G.emptyGif='data:image/gif;base64,R0lGODlhEAAQAIAAAP///////yH5BAEKAAEALAAAAAAQABAAAAIOjI+py+0Po5y02ouzPgUAOw==';G.CSStransformName=FirstSupportedPropertyName(["transform","msTransform","MozTransform","WebkitTransform","OTransform"]);G.CSStransformStyle=FirstSupportedPropertyName(["transformStyle","msTransformStyle","MozTransformStyle","WebkitTransformStyle","OTransformStyle"]);G.CSSperspective=FirstSupportedPropertyName(["perspective","msPerspective","MozPerspective","WebkitPerspective","OPerspective"]);G.CSSbackfaceVisibilityName=FirstSupportedPropertyName(["backfaceVisibility","msBackfaceVisibility","MozBackfaceVisibility","WebkitBackfaceVisibility","OBackfaceVisibility"]);G.CSStransitionName=FirstSupportedPropertyName(["transition","msTransition","MozTransition","WebkitTransition","OTransition"]);G.CSSanimationName=FirstSupportedPropertyName(["animation","msAnimation","MozAnimation","WebkitAnimation","OAnimation"]);G.GalleryResizeThrottled=throttle(GalleryResize,15,{leading:false});G.blockList=null;G.allowList=null;G.albumList=[];G.locationHashLastUsed='';G.custGlobals={};G.touchAutoOpenDelayTimerID=0;G.i18nLang='';G.timeLastTouchStart=0;G.custGlobals={};G.markupOrApiProcessed=false;G.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:true,firstDisplayTime:0,navigationBar:{displayed:false,$newContent:''},cache:{viewport:null,containerOffset:null,areaWidth:100},nbSelected:0,pagination:{currentPage:0},panThreshold:60,panYOnly:false,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(idx){if(G.GOM.items[idx]==undefined||G.GOM.items[idx]==null){return null;}
1773var i=G.GOM.items[idx].thumbnailIdx;return G.I[i];},GTn:function(index,width,height){this.thumbnailIdx=index;this.width=0;this.height=0;this.top=0;this.left=0;this.row=0;this.imageWidth=width;this.imageHeight=height;this.resizedContentWidth=0;this.resizedContentHeight=0;this.displayed=false;this.neverDisplayed=true;this.inDisplayArea=false;},ScrollToTop:function(){if(G.GOM.firstDisplay){return;}
1774if(G.$E.scrollableParent===null&&!topInViewportVert(G.$E.base,20)){G.$E.base.get(0).scrollIntoView();}
1775if(G.$E.scrollableParent!==null){var scrollTop=G.$E.scrollableParent.scrollTop();var dist=Math.abs(G.$E.scrollableParent.offset().top-G.$E.base.offset().top-scrollTop);if(scrollTop>dist){window.ng_draf(function(){G.$E.scrollableParent.scrollTop(dist);});}}}};G.VOM={viewerDisplayed:false,viewerIsFullscreen:false,infoDisplayed:false,toolbarsDisplayed:true,toolsHide:null,zoom:{posX:0,posY:0,userFactor:1,isZooming:false,lastScale:1,},padding:{H:0,V:0},window:{lastWidth:0,lastHeight:0},$viewer:null,$toolbar:null,$toolbarTL:null,$toolbarTR:null,toolbarMode:'std',playSlideshow:false,playSlideshowTimerID:0,slideshowDelay:3000,albumID:-1,viewerMediaIsChanged:false,items:[],panMode:'off',$baseCont:null,$content:null,content:{previous:{vIdx:-1,$media:null,NGY2Item:function(){return G.I[G.VOM.items[G.VOM.content.previous.vIdx].ngy2ItemIdx];}},current:{vIdx:-1,$media:null,NGY2Item:function(){return G.I[G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx];}},next:{vIdx:-1,$media:null,NGY2Item:function(){return G.I[G.VOM.items[G.VOM.content.next.vIdx].ngy2ItemIdx];}}},IdxNext:function(){var n=0;if(G.VOM.content.current.vIdx<(G.VOM.items.length-1)){n=G.VOM.content.current.vIdx+1;}
1776return n;},IdxPrevious:function(){var n=G.VOM.content.current.vIdx-1;if(G.VOM.content.current.vIdx==0){n=G.VOM.items.length-1;}
1777return n;},gallery:{$elt:null,$tmbCont:null,gwidth:0,vwidth:0,oneTmbWidth:0,firstDisplay:true,posX:0,SetThumbnailActive(){if(G.O.viewerGallery=='none'){return;}
1778this.$tmbCont.children().removeClass('activeVThumbnail');this.$tmbCont.children().eq(G.VOM.content.current.vIdx).addClass('activeVThumbnail');this.firstDisplay=false;},Resize:function(){if(G.O.viewerGallery=='none'){return;}
1779if(!this.firstDisplay){var viewerW=G.VOM.$viewer.width();var maxTmb=Math.trunc(viewerW/this.oneTmbWidth);this.vwidth=maxTmb*this.oneTmbWidth;this.$elt.css({width:this.vwidth,left:(viewerW-this.vwidth)/2});if(G.VOM.items.length>=maxTmb){var tmbPos=this.oneTmbWidth*G.VOM.content.current.vIdx;if((tmbPos+this.posX)<this.vwidth){if(tmbPos+this.posX<0){this.posX=-tmbPos;}}
1780else{if(tmbPos+this.posX>=this.vwidth){this.posX=this.vwidth-(tmbPos+this.oneTmbWidth)}}}
1781this.PanGallery(0);}
1782else{new NGTweenable().tween({from:{opacity:0},to:{opacity:1},easing:'easeInOutSine',duration:1000,step:function(state){},finish:function(state){}});}},PanGallery:function(panX){if(this.gwidth<G.VOM.$viewer.width()){this.posX=(G.VOM.$viewer.width()-this.gwidth)/2;panX=0;}
1783if(this.posX>(this.vwidth-this.oneTmbWidth)){this.posX=this.vwidth-this.oneTmbWidth;}
1784if((this.posX+this.gwidth)<this.oneTmbWidth){this.posX=-this.gwidth+this.oneTmbWidth;}
1785this.$tmbCont.css(G.CSStransformName,'translateX('+(this.posX+panX)+'px)');},PanGalleryEnd:function(velocity){var d=velocity*100;new NGTweenable().tween({from:{pan:G.VOM.gallery.posX},to:{pan:G.VOM.gallery.posX+d},easing:'easeOutQuad',duration:500,step:function(state){G.VOM.gallery.posX=state.pan;G.VOM.gallery.PanGallery(0);}});}},hammertime:null,swipePosX:0,panPosX:0,panPosY:0,panThreshold:60,panXOnly:false,singletapTime:0,viewerTheme:'',timeImgChanged:0,ImageLoader:{maxChecks:1000,list:[],intervalHandle:null,loadImage:function(callback,ngitem){if(ngitem.mediaKind!='img'){return;}
1786var img=new Image();img.src=ngitem.responsiveURL();if(img.width&&img.height){callback(img.width,img.height,ngitem,0);}
1787else{var obj={image:img,url:ngitem.responsiveURL(),ngitem:ngitem,callback:callback,checks:1};var i;for(i=0;i<this.list.length;i++){if(this.list[i]==null)
1788break;}
1789this.list[i]=obj;if(!this.intervalHandle)
1790this.intervalHandle=setInterval(this.interval,50);}},interval:function(){var count=0;var list=G.VOM.ImageLoader.list,item;for(var i=0;i<list.length;i++){item=list[i];if(item!=null){if(item.image.width&&item.image.height){G.VOM.ImageLoader.list[i]=null;item.callback(item.image.width,item.image.height,item.ngitem,item.checks);}
1791else if(item.checks>G.VOM.ImageLoader.maxChecks){G.VOM.ImageLoader.list[i]=null;item.callback(0,0,item.ngitem,item.checks);}
1792else{count++;item.checks++;}}}
1793if(count==0){G.VOM.ImageLoader.list=[];clearInterval(G.VOM.ImageLoader.intervalHandle);delete G.VOM.ImageLoader.intervalHandle;}}}}
1794function VImg(index){this.$e=null;this.ngy2ItemIdx=index;this.mediaNumber=G.VOM.items.length+1;this.posX=0;this.posY=0;}
1795G.popup={isDisplayed:false,$elt:null,close:function(){if(this.$elt!=null){var tweenable=new NGTweenable();tweenable.tween({from:{opacity:1},to:{opacity:0},attachment:{t:this},easing:'easeInOutSine',duration:100,step:function(state,att){if(att.t.$elt!=null){att.t.$elt.css('opacity',state.opacity);}},finish:function(state,att){if(att.t.$elt!=null){att.t.$elt.remove();att.t.$elt=null;}
1796att.t.isDisplayed=false;}});}}}
1797G.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'}};G.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'}};G.viewerTheme_dark={background:'#000',barBackground:'rgba(4, 4, 4, 0.2)',barBorder:'0px solid #111',barColor:'#fff',barDescriptionColor:'#ccc'};G.viewerTheme_light={background:'#f8f8f8',barBackground:'rgba(4, 4, 4, 0.7)',barBorder:'0px solid #111',barColor:'#fff',barDescriptionColor:'#ccc'};var NanoAlert=NGY2Tools.NanoAlert;var NanoConsoleLog=NGY2Tools.NanoConsoleLog;this.initiateGallery2=function(element,params){G.O=params;G.$E.base=jQuery(element);G.baseEltID=G.$E.base.attr('id');if(G.baseEltID==undefined){var base_id='my_nanogallery';var c='';var f=true;while(f){if(document.getElementById(base_id+c)){if(c==''){c=1;}
1798else{c++;}}
1799else{f=false;G.baseEltID='my_nanogallery'+c;}}
1800G.$E.base.attr('id',G.baseEltID)}
1801G.O.$markup=[];DefineVariables();SetPolyFills();BuildSkeleton();G.GOM.firstDisplayTime=Date.now();SetGlobalEvents();if(!G.O.lightboxStandalone){var albumToDisplay=G.O.album;if(albumToDisplay==''&&G.O.photoset!=''){albumToDisplay=G.O.photoset;G.O.album=G.O.photoset;}
1802if(albumToDisplay!=''){G.O.displayBreadcrumb=false;if(albumToDisplay.toUpperCase()!='NONE'){if(G.O.kind=="nano_photos_provider2"){if(albumToDisplay==decodeURIComponent(albumToDisplay)){albumToDisplay=encodeURIComponent(albumToDisplay);G.O.album=albumToDisplay;}}
1803NGY2Item.New(G,'','',albumToDisplay,'-1','album');if(!ProcessLocationHash()){DisplayAlbum('-1',albumToDisplay);}
1804return;}}}
1805NGY2Item.New(G,G.i18nTranslations.breadcrumbHome,'','0','-1','album');processStartOptions();}
1806function processStartOptions(){if(!ProcessLocationHash()){processStartOptionsPart2();}}
1807function processStartOptionsPart2(){if(G.O.lightboxStandalone){LightboxStandaloneFindContent();}
1808else{if(G.O.openOnStart!=''){var IDs=parseIDs(G.O.openOnStart);if(IDs.imageID!='0'){DisplayPhoto(IDs.imageID,IDs.albumID);}
1809else{DisplayAlbum('-1',IDs.albumID);}}
1810else{DisplayAlbum('-1',0);}}}
1811function LightboxStandaloneFindContent(){G.GOM.curNavLevel='l1';if(G.O.items==null){var elts=jQuery('[data-nanogallery2-Lightbox');var g=G.$E.base[0].dataset.nanogallery2Lgroup;GetContentMarkup(elts,g);}
1812else{GetContentApiObject();}
1813LightboxStandaloneDisplay();}
1814function LightboxStandaloneDisplay(){G.VOM.items=[];G.VOM.albumID='0';G.GOM.curNavLevel='l1';var vcnt=0;var elt=G.$E.base[0].attributes;var thumbsrc='';if(elt.hasOwnProperty('src')){thumbsrc=elt['src'].nodeValue;}
1815if(thumbsrc==''&&elt.hasOwnProperty('data-ngthumb')){thumbsrc=elt['data-ngthumb'].nodeValue;}
1816var displayIdx=undefined;for(var idx=0;idx<G.I.length;idx++){if(G.I[idx].kind=='image'){var vimg=new VImg(idx);G.VOM.items.push(vimg);if(G.I[idx].thumbImg().src==thumbsrc){displayIdx=vcnt;}
1817vcnt++;}}
1818if(G.VOM.items.length>0){LightboxOpen(displayIdx);}
1819else{NanoConsoleLog(G,'No content for Lightbox standalone.');}}
1820function parseIDs(IDs){var r={albumID:'0',imageID:'0'};var t=IDs.split('/');if(t.length>0){r.albumID=t[0];if(t.length>1){r.imageID=t[1];}}
1821return r;}
1822function DisplayAlbum(imageID,albumID){if(G.VOM.viewerDisplayed){LightboxClose(null);}
1823var albumIdx=NGY2Item.GetIdx(G,albumID);G.GOM.curNavLevel='lN';if(albumIdx==0){G.GOM.curNavLevel='l1';}
1824G.layout.SetEngine();G.galleryResizeEventEnabled=false;if(albumIdx==-1){NGY2Item.New(G,'','',albumID,'0','album');albumIdx=G.I.length-1;}
1825if(!G.I[albumIdx].contentIsLoaded){AlbumGetContent(albumID,DisplayAlbum,imageID,albumID);return;}
1826ThumbnailSelectionClear();G.GOM.pagination.currentPage=0;SetLocationHash(albumID,'');GalleryRender(albumIdx);}
1827function GalleryBottomManage(){switch(G.galleryDisplayMode.Get()){case'PAGINATION':if(G.layout.support.rows&&G.galleryMaxRows.Get()>0){ManagePagination();}
1828break;case'MOREBUTTON':G.$E.conTnBottom.off('click');var nb=G.GOM.items.length-G.GOM.itemsDisplayed;if(nb==0){G.$E.conTnBottom.empty();}
1829else{G.$E.conTnBottom.html('<div class="nGY2GalleryMoreButton"><div class="nGY2GalleryMoreButtonAnnotation">+'+nb+' '+G.O.icons.galleryMoreButton+'</div></div>');G.$E.conTnBottom.on('click',function(e){G.GOM.displayedMoreSteps++;GalleryResize();});}
1830break;case'FULLCONTENT':default:break;}}
1831function breadcrumbAdd(albumIdx){var ic='';if(!G.O.breadcrumbHideIcons){ic=G.O.icons.breadcrumbAlbum;if(albumIdx==0){ic=G.O.icons.breadcrumbHome;}}
1832var $newDiv=jQuery('<div class="oneItem">'+ic+G.I[albumIdx].title+'</div>').appendTo(G.GOM.navigationBar.$newContent.find('.nGY2Breadcrumb'));if(G.O.breadcrumbOnlyCurrentLevel){if(albumIdx==0){jQuery($newDiv).data('albumID','0');}
1833else{jQuery($newDiv).data('albumID',G.I[albumIdx].albumID);}}
1834else{jQuery($newDiv).data('albumID',G.I[albumIdx].GetID());}
1835$newDiv.click(function(){var cAlbumID=jQuery(this).data('albumID');DisplayAlbum('-1',cAlbumID);return;});}
1836function breadcrumbAddSeparator(lastAlbumID){var $newSep=jQuery('<div class="oneItem">'+(G.O.RTL?G.O.icons.breadcrumbSeparatorRtl:G.O.icons.breadcrumbSeparator)+'</div>').appendTo(G.GOM.navigationBar.$newContent.find('.nGY2Breadcrumb'));jQuery($newSep).data('albumIdx',lastAlbumID);$newSep.click(function(){var sepAlbumIdx=jQuery(this).data('albumIdx');DisplayAlbum('-1',G.I[sepAlbumIdx].GetID());return;});}
1837function GalleryNavigationBar(albumIdx){G.GOM.navigationBar.$newContent=jQuery('<div class="nGY2Navigationbar"></div>');if(G.O.displayBreadcrumb==true&&!G.O.thumbnailAlbumDisplayImage){var newLevel=0,lstItems=[];if(albumIdx!=0){var l=G.I.length,parentID=0;lstItems.push(albumIdx);var curIdx=albumIdx;newLevel++;while(G.I[curIdx].albumID!=0&&G.I[curIdx].albumID!=-1){for(var i=1;i<l;i++){if(G.I[i].GetID()==G.I[curIdx].albumID){curIdx=i;lstItems.push(curIdx);newLevel++;break;}}}}
1838if(!(G.O.breadcrumbAutoHideTopLevel&&newLevel==0)){BreadcrumbBuild(lstItems);}}
1839if(G.galleryFilterTags.Get()!=false){var nTags=G.I[albumIdx].albumTagList.length;if(nTags>0){for(var i=0;i<nTags;i++){var s=G.I[albumIdx].albumTagList[i];var ic=G.O.icons.navigationFilterUnselected;var tagClass='Unselected';if(jQuery.inArray(s,G.I[albumIdx].albumTagListSel)>=0){tagClass='Selected';ic=G.O.icons.navigationFilterSelected;}
1840var $newTag=jQuery('<div class="nGY2NavigationbarItem nGY2NavFilter'+tagClass+'">'+ic+' '+s+'</div>').appendTo(G.GOM.navigationBar.$newContent);$newTag.click(function(){var $this=jQuery(this);var tag=$this.text().replace(/^\s*|\s*$/,'');if(G.galleryFilterTagsMode.Get()=='single'){G.I[albumIdx].albumTagListSel=[];G.I[albumIdx].albumTagListSel.push(tag);}
1841else{if($this.hasClass('nGY2NavFilterUnselected')){G.I[albumIdx].albumTagListSel.push(tag);}
1842else{var tidx=jQuery.inArray(tag,G.I[albumIdx].albumTagListSel);if(tidx!=-1){G.I[albumIdx].albumTagListSel.splice(tidx,1);}}
1843$this.toggleClass('nGY2NavFilters-oneTagUnselected nGY2NavFilters-oneTagSelected');}
1844DisplayAlbum('-1',G.I[albumIdx].GetID());});}
1845var $newClearFilter=jQuery('<div class="nGY2NavigationbarItem nGY2NavFilterSelectAll">'+G.O.icons.navigationFilterSelectedAll+'</div>').appendTo(G.GOM.navigationBar.$newContent);$newClearFilter.click(function(){G.I[albumIdx].albumTagListSel=[];DisplayAlbum('-1',G.I[albumIdx].GetID());});}}
1846if(G.galleryDisplayMode.Get()=="PAGINATION"&&G.O.galleryPaginationTopButtons){if(G.layout.support.rows&&G.galleryMaxRows.Get()>0){var $newTagPrev=jQuery('<div class="nGY2NavigationbarItem nGY2NavPagination">'+G.O.icons.navigationPaginationPrevious+'</div>').appendTo(G.GOM.navigationBar.$newContent);$newTagPrev.click(function(){paginationPreviousPage();});var $newTagNext=jQuery('<div class="nGY2NavigationbarItem nGY2NavPagination">'+G.O.icons.navigationPaginationNext+'</div>').appendTo(G.GOM.navigationBar.$newContent);$newTagNext.click(function(){paginationNextPage();});}}}
1847function BreadcrumbBuild(lstItems){jQuery('<div class="nGY2NavigationbarItem nGY2Breadcrumb"></div>').appendTo(G.GOM.navigationBar.$newContent);if(G.O.breadcrumbOnlyCurrentLevel){if(lstItems.length==0){breadcrumbAdd(0);}
1848else{if(lstItems.length==1){breadcrumbAddSeparator(0);}
1849else{breadcrumbAddSeparator(lstItems[0]);}
1850breadcrumbAdd(lstItems[0]);}}
1851else{breadcrumbAdd(0);if(lstItems.length>0){breadcrumbAddSeparator(0);for(var i=lstItems.length-1;i>=0;i--){breadcrumbAdd(lstItems[i]);if(i>0){breadcrumbAddSeparator(lstItems[i-1]);}}}}}
1852function ManagePagination(){G.$E.conTnBottom.css('opacity',0);G.$E.conTnBottom.children().remove();if(G.GOM.items.length==0){return;}
1853var nbPages=Math.ceil((G.GOM.items[G.GOM.items.length-1].row+1)/G.galleryMaxRows.Get());if(nbPages==1){return;}
1854if(G.GOM.pagination.currentPage>(nbPages-1)){G.GOM.pagination.currentPage=nbPages-1;}
1855GalleryRenderGetInterval();if(G.GOM.displayInterval.len==0){return;}
1856if(G.O.galleryPaginationMode=='NUMBERS'&&G.GOM.pagination.currentPage>0){var $eltPrev=jQuery('<div class="nGY2PaginationPrev">'+G.O.icons.paginationPrevious+'</div>').appendTo(G.$E.conTnBottom);$eltPrev.click(function(e){paginationPreviousPage();});}
1857var firstPage=0;var lastPage=nbPages;if(G.O.galleryPaginationMode!='NUMBERS'){firstPage=0;}
1858else{var numberOfPagesToDisplay=G.O.paginationVisiblePages;if(numberOfPagesToDisplay>=nbPages){firstPage=0;}
1859else{var nbBeforeAfter=0;if(isOdd(numberOfPagesToDisplay)){nbBeforeAfter=(numberOfPagesToDisplay+1)/2;}
1860else{nbBeforeAfter=numberOfPagesToDisplay/2;}
1861if(G.GOM.pagination.currentPage<nbBeforeAfter){firstPage=0;lastPage=numberOfPagesToDisplay-1;if(lastPage>nbPages){lastPage=nbPages-1;}}
1862else{firstPage=G.GOM.pagination.currentPage-nbBeforeAfter;lastPage=firstPage+numberOfPagesToDisplay;if(lastPage>nbPages){lastPage=nbPages-1;}}
1863if((lastPage-firstPage)<numberOfPagesToDisplay){firstPage=lastPage-numberOfPagesToDisplay;if(firstPage<0){firstPage=0;}}}}
1864for(var i=firstPage;i<lastPage;i++){var c='';var p='';switch(G.O.galleryPaginationMode){case'NUMBERS':c='nGY2paginationItem';p=i+1;break;case'DOTS':c='nGY2paginationDot';break;case'RECTANGLES':c='nGY2paginationRectangle';break;}
1865if(i==G.GOM.pagination.currentPage){c+='CurrentPage';}
1866var elt$=jQuery('<div class="'+c+'">'+p+'</div>').appendTo(G.$E.conTnBottom);elt$.data('pageNumber',i);elt$.click(function(e){G.GOM.pagination.currentPage=jQuery(this).data('pageNumber');TriggerCustomEvent('pageChanged');G.GOM.ScrollToTop();GalleryDisplayPart1();GalleryDisplayPart2(true);});}
1867if(G.O.galleryPaginationMode=='NUMBERS'&&(G.GOM.pagination.currentPage+1)<nbPages){var $eltNext=jQuery('<div class="nGY2PaginationNext">'+G.O.icons.paginationNext+'</div>').appendTo(G.$E.conTnBottom);$eltNext.click(function(e){paginationNextPage();});}
1868G.$E.conTnBottom.css('opacity',1);}
1869function isOdd(num){return(num%2)==1;}
1870function paginationNextPage(){var n1=0;ThumbnailHoverOutAll();if(G.galleryMaxRows.Get()>0){n1=(G.GOM.items[G.GOM.items.length-1].row+1)/G.galleryMaxRows.Get();}
1871var n2=Math.ceil(n1);var pn=G.GOM.pagination.currentPage;if(pn<(n2-1)){pn++;}
1872else{pn=0;}
1873G.GOM.pagination.currentPage=pn;TriggerCustomEvent('pageChanged');G.GOM.ScrollToTop();GalleryDisplayPart1();GalleryDisplayPart2(true);}
1874function paginationPreviousPage(){var n1=0;ThumbnailHoverOutAll();if(G.galleryMaxRows.Get()>0){n1=(G.GOM.items[G.GOM.items.length-1].row+1)/G.galleryMaxRows.Get();}
1875var n2=Math.ceil(n1);var pn=G.GOM.pagination.currentPage;if(pn>0){pn--;}
1876else{pn=n2-1;}
1877G.GOM.pagination.currentPage=pn;TriggerCustomEvent('pageChanged');G.GOM.ScrollToTop();GalleryDisplayPart1();GalleryDisplayPart2(true);}
1878function GalleryRenderGetInterval(){G.GOM.displayInterval.from=0;G.GOM.displayInterval.len=G.I.length;switch(G.galleryDisplayMode.Get()){case'PAGINATION':if(G.layout.support.rows){let nbTn=G.GOM.items.length;var firstRow=G.GOM.pagination.currentPage*G.galleryMaxRows.Get();var lastRow=firstRow+G.galleryMaxRows.Get();var firstTn=-1;G.GOM.displayInterval.len=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.row>=firstRow&&curTn.row<lastRow){if(firstTn==-1){G.GOM.displayInterval.from=i;firstTn=i;}
1879G.GOM.displayInterval.len++;}}}
1880break;case'MOREBUTTON':if(G.layout.support.rows){let nbTn=G.GOM.items.length;let lastRow=G.O.galleryDisplayMoreStep*(G.GOM.displayedMoreSteps+1);G.GOM.displayInterval.len=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.row<lastRow){G.GOM.displayInterval.len++;}}}
1881break;case'ROWS':if(G.layout.support.rows){let nbTn=G.GOM.items.length;let lastRow=G.galleryMaxRows.Get();if(G.galleryLastRowFull.Get()&&G.GOM.lastFullRow!=-1){if(lastRow>(G.GOM.lastFullRow+1)){lastRow=G.GOM.lastFullRow+1;}}
1882G.GOM.displayInterval.len=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.row<lastRow){G.GOM.displayInterval.len++;}}}
1883break;default:case'FULLCONTENT':if(G.layout.support.rows&&G.galleryLastRowFull.Get()&&G.GOM.lastFullRow!=-1){let nbTn=G.GOM.items.length;let lastRow=G.GOM.lastFullRow+1;G.GOM.displayInterval.len=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.row<lastRow){G.GOM.displayInterval.len++;}}}
1884break;}}
1885function GalleryRender(albumIdx){TriggerCustomEvent('galleryRenderStart');clearTimeout(G.GOM.slider.timerID);G.GOM.slider.hostIdx=-1;var fu=G.O.fnGalleryRenderStart;if(fu!==null){typeof fu=='function'?fu(G.I[G.GOM.albumIdx]):window[fu](G.I[G.GOM.albumIdx]);}
1886G.layout.SetEngine();G.galleryResizeEventEnabled=false;G.GOM.albumIdx=-1;G.GOM.lastDisplayedIdx=-1;if(G.$E.conTnBottom!==undefined){G.$E.conTnBottom.empty();}
1887GalleryNavigationBar(albumIdx);if(G.GOM.firstDisplay){G.GOM.firstDisplay=false;var d=Date.now()-G.GOM.firstDisplayTime;if(d<G.O.galleryRenderDelay){requestTimeout(function(){GalleryRenderPart1(albumIdx)},G.O.galleryRenderDelay-d);}
1888else{GalleryRenderPart1(albumIdx);}
1889G.O.galleryRenderDelay=0;}
1890else{var hideNavigationBar=false;if(G.GOM.navigationBar.$newContent.children().length==0){hideNavigationBar=true;}
1891var tweenable=new NGTweenable();tweenable.tween({from:{'opacity':1},to:{'opacity':0},duration:300,easing:'easeInQuart',attachment:{h:hideNavigationBar},step:function(state,att){G.$E.conTnParent.css({'opacity':state.opacity});if(att.h){G.$E.conNavigationBar.css({'opacity':state.opacity});}},finish:function(state,att){if(att.h){G.$E.conNavigationBar.css({'opacity':0,'display':'none'});}
1892G.GOM.ScrollToTop();GalleryRenderPart1(albumIdx);}});}}
1893function GalleryRenderPart1(albumIdx){var oldN=G.$E.conNavigationBar.children().length;G.$E.conNavigationBar.empty();G.GOM.navigationBar.$newContent.children().clone(true,true).appendTo(G.$E.conNavigationBar);if(G.$E.conNavigationBar.children().length>0&&oldN==0){G.$E.conNavigationBar.css({'opacity':0,'display':'block'});var tweenable=new NGTweenable();tweenable.tween({from:{opacity:0},to:{opacity:1},duration:200,easing:'easeInQuart',step:function(state){G.$E.conNavigationBar.css(state);},finish:function(state){G.$E.conNavigationBar.css({'opacity':1});requestTimeout(function(){GalleryRenderPart2(albumIdx)},20);}});}
1894else{requestTimeout(function(){GalleryRenderPart2(albumIdx)},20);}}
1895function GalleryRenderPart2(albumIdx){G.GOM.lastZIndex=parseInt(G.$E.base.css('z-index'));if(isNaN(G.GOM.lastZIndex)){G.GOM.lastZIndex=0;}
1896G.$E.conTnParent.css({'opacity':0});G.$E.conTn.off().empty();var l=G.I.length;for(var i=0;i<l;i++){var item=G.I[i];item.hovered=false;item.$elt=null;item.$Elts=[];item.eltTransform=[];item.eltFilter=[];item.width=0;item.height=0;item.left=0;item.top=0;item.resizedContentWidth=0;item.resizedContentHeight=0;item.thumbnailImgRevealed=false;}
1897if(G.CSStransformName==null){G.$E.conTn.css('left','0px');}
1898else{G.$E.conTn.css(G.CSStransformName,'none');}
1899requestTimeout(function(){GalleryRenderPart3(albumIdx)},20);}
1900function GalleryRenderPart3(albumIdx){var d=new Date();G.$E.conTnParent.css('opacity',1);G.GOM.items=[];G.GOM.displayedMoreSteps=0;if(G.O.thumbnailLabel.get('position')=='onBottom'){G.tn.labelHeight[G.GOM.curNavLevel]=ThumbnailGetLabelHeight();}
1901else{G.tn.labelHeight[G.GOM.curNavLevel]=0;}
1902G.GOM.albumIdx=albumIdx;TriggerCustomEvent('galleryRenderEnd');var fu=G.O.fnGalleryRenderEnd;if(fu!==null){typeof fu=='function'?fu(G.I[G.GOM.albumIdx]):window[fu](G.I[G.GOM.albumIdx]);}
1903if(GalleryPopulateGOM()){GallerySetLayout();GalleryAppear();GalleryDisplayPart1();requestTimeout(function(){GalleryDisplayPart2(false)},20);}
1904else{G.galleryResizeEventEnabled=true;}
1905if(G.O.debugMode){console.log('GalleryRenderPart3: '+(new Date()-d));}}
1906function GalleryResize(){var d=new Date();G.galleryResizeEventEnabled=false;if(GallerySetLayout()==false){G.galleryResizeEventEnabled=true;if(G.O.debugMode){console.log('GalleryResize1: '+(new Date()-d));}
1907return;}
1908if(G.O.debugMode){console.log('GalleryResizeSetLayout: '+(new Date()-d));}
1909GalleryDisplayPart1();GalleryDisplayPart2(false);if(G.O.debugMode){console.log('GalleryResizeFull: '+(new Date()-d));}}
1910function GalleryPopulateGOM(){var preloadImages='';var albumID=G.I[G.GOM.albumIdx].GetID();var l=G.I.length;var cnt=0;for(var idx=0;idx<l;idx++){var item=G.I[idx];if(item.isToDisplay(albumID)){var w=item.thumbImg().width;var h=item.thumbImg().height;if(G.layout.prerequisite.imageSize&&(w==0||h==0)){preloadImages+='<img src="'+item.thumbImg().src+'" data-idx="'+cnt+'" data-albumidx="'+G.GOM.albumIdx+'">';}
1911if(h==0){h=G.tn.defaultSize.getHeight();}
1912if(w==0){w=G.tn.defaultSize.getWidth();}
1913var tn=new G.GOM.GTn(idx,w,h);G.GOM.items.push(tn);cnt++;}}
1914TriggerCustomEvent('galleryObjectModelBuilt');var fu=G.O.fnGalleryObjectModelBuilt;if(fu!==null){typeof fu=='function'?fu():window[fu]();}
1915if(preloadImages!=''){var $newImg=jQuery(preloadImages);var gi_imgLoad=ngimagesLoaded($newImg);$newImg=null;gi_imgLoad.on('progress',function(instance,image){if(image.isLoaded){var idx=image.img.getAttribute('data-idx');var albumIdx=image.img.getAttribute('data-albumidx');if(albumIdx==G.GOM.albumIdx){var curTn=G.GOM.items[idx];curTn.imageWidth=image.img.naturalWidth;curTn.imageHeight=image.img.naturalHeight;var item=G.I[curTn.thumbnailIdx];item.thumbs.width[G.GOM.curNavLevel][G.GOM.curWidth]=curTn.imageWidth;item.thumbs.height[G.GOM.curNavLevel][G.GOM.curWidth]=curTn.imageHeight;G.GalleryResizeThrottled();var object=item.thumbs.width.l1;for(let property in object){if(object.hasOwnProperty(property)){if(property!=G.GOM.curWidth){if(G.tn.settings.width.l1[property]==G.tn.settings.getW()&&G.tn.settings.height.l1[property]==G.tn.settings.getH()){item.thumbs.width.l1[property]=curTn.imageWidth;item.thumbs.height.l1[property]=curTn.imageHeight;}}}}
1916object=item.thumbs.width.lN;for(let property in object){if(object.hasOwnProperty(property)){if(property!=G.GOM.curWidth){if(G.tn.settings.width.lN[property]==G.tn.settings.getW()&&G.tn.settings.height.lN[property]==G.tn.settings.getH()){item.thumbs.width.lN[property]=curTn.imageWidth;item.thumbs.height.lN[property]=curTn.imageHeight;}}}}}}});G.galleryResizeEventEnabled=true;return false;}
1917else{return true;}}
1918function GallerySetLayout(){var r=true;G.GOM.cache.areaWidth=G.$E.conTnParent.width();G.GOM.displayArea={width:0,height:0};switch(G.layout.engine){case'JUSTIFIED':r=GallerySetLayoutWidthtAuto();break;case'CASCADING':r=GallerySetLayoutHeightAuto();break;case'MOSAIC':r=GallerySetLayoutMosaic();break;case'GRID':default:r=GallerySetLayoutGrid();break;}
1919TriggerCustomEvent('galleryLayoutApplied');var fu=G.O.fnGalleryLayoutApplied;if(fu!==null){typeof fu=='function'?fu():window[fu]();}
1920return r;}
1921function GallerySetLayoutHeightAuto(){var curCol=0,areaWidth=G.GOM.cache.areaWidth,curRow=0,colHeight=[],maxCol=NbThumbnailsPerRow(areaWidth),gutterWidth=0,gutterHeight=G.tn.settings.GetResponsive('gutterHeight');var w=0;var scaleFactor=1;var tnWidth=G.tn.defaultSize.getOuterWidth();var nbTn=G.GOM.items.length;var curPosY=0;if(G.O.thumbnailAlignment=='justified'){maxCol=Math.min(maxCol,nbTn);gutterWidth=(maxCol==1?0:(areaWidth-(maxCol*tnWidth))/(maxCol-1));}
1922else{gutterWidth=G.tn.settings.GetResponsive('gutterWidth');}
1923var borderWidth=G.tn.opt.Get('borderHorizontal')*2;var borderHeight=G.tn.opt.Get('borderVertical')*2;G.GOM.lastFullRow=-1;if(G.O.thumbnailAlignment=='fillWidth'){var totalGutterWidth=(maxCol-1)*gutterWidth;scaleFactor=(areaWidth-totalGutterWidth)/(maxCol*tnWidth);if(scaleFactor>1){maxCol++;}
1924totalGutterWidth=(maxCol-1)*gutterWidth;scaleFactor=Math.min((areaWidth-totalGutterWidth)/(maxCol*tnWidth),1);}
1925tnWidth=Math.round(tnWidth*scaleFactor);var contentWidth=tnWidth-borderWidth;var baseHeight=Math.round(G.tn.opt.Get('baseGridHeight')*scaleFactor);for(var i=0;i<nbTn;i++){var curTn=G.GOM.items[i];if(curTn.deleted==true){break;}
1926if(curTn.imageHeight>0&&curTn.imageWidth>0){var curPosX=0,curPosY=0;var imageRatio=curTn.imageHeight/curTn.imageWidth;curTn.resizedContentWidth=contentWidth;curTn.resizedContentHeight=curTn.resizedContentWidth*imageRatio;if(baseHeight>0){var t=Math.max(Math.trunc(curTn.resizedContentHeight/baseHeight),1);curTn.resizedContentHeight=baseHeight*t+((t-1)*(borderHeight+gutterHeight));}
1927curTn.height=curTn.resizedContentHeight+borderHeight+G.tn.labelHeight.get();curTn.width=tnWidth;curTn.row=0;if(curRow==0){curPosX=curCol*(tnWidth+gutterWidth);colHeight[curCol]=curTn.height+gutterHeight;curCol++;if(curCol>=maxCol){curCol=0;curRow++;}}
1928else{var c=0,minColHeight=colHeight[0];for(var j=1;j<maxCol;j++){if((colHeight[j]+5)<minColHeight){minColHeight=colHeight[j];c=j;}}
1929curPosY=colHeight[c];curPosX=c*(tnWidth+gutterWidth);colHeight[c]=curPosY+curTn.height+gutterHeight;}
1930var x=curPosX;if(G.O.RTL){x=w-curPosX-tnWidth;}
1931curTn.left=x;curTn.top=curPosY;}}
1932G.GOM.displayArea.width=maxCol*(tnWidth+gutterWidth)-gutterWidth;return true;}
1933function GallerySetLayoutWidthtAuto(){var curWidth=0,areaWidth=G.GOM.cache.areaWidth,lastPosX=0,curPosY=0,rowLastItem=[],rowNum=0,rowHeight=[],bNewRow=false,cnt=0,gutterWidth=G.tn.settings.GetResponsive('gutterWidth'),gutterHeight=G.tn.settings.GetResponsive('gutterHeight');var maxRowHeightVertical=0;var maxRowHeightHorizontal=0;var rowHasVertical=false;var rowHasHorizontal=false;var tnHeight=G.tn.defaultSize.getOuterHeight();var borderWidth=G.tn.opt.Get('borderHorizontal')*2;var borderHeight=G.tn.opt.Get('borderVertical')*2;var nbTnInCurrRow=1;var nbTn=G.GOM.items.length;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.deleted==true){break;}
1934if(curTn.imageWidth>0){let imageRatio=curTn.imageWidth/curTn.imageHeight;let imageWidth=Math.floor(tnHeight*imageRatio);if(bNewRow){bNewRow=false;rowNum++;curWidth=0;rowHasVertical=false;rowHasHorizontal=false;nbTnInCurrRow=1;}
1935if(curTn.imageHeight>curTn.imageWidth){rowHasVertical=true;}
1936else{rowHasHorizontal=true;}
1937if((curWidth+gutterWidth+imageWidth)<(areaWidth-(nbTnInCurrRow*borderWidth))){curWidth+=imageWidth+gutterWidth;rowHeight[rowNum]=tnHeight;var rowHeightLimit=Math.max(rowHasVertical?maxRowHeightVertical:0,rowHasHorizontal?maxRowHeightHorizontal:0);if(rowHeightLimit>0){rowHeight[rowNum]=Math.min(rowHeight[rowNum],rowHeightLimit);}
1938rowLastItem[rowNum]=i;}
1939else{curWidth+=gutterWidth+imageWidth;let ratio=(areaWidth-nbTnInCurrRow*borderWidth)/curWidth;let rH=Math.floor(tnHeight*ratio);rowHeight[rowNum]=rH;if(rowHasVertical){maxRowHeightVertical=Math.max(maxRowHeightVertical,rH);}
1940if(rowHasHorizontal){maxRowHeightHorizontal=Math.max(maxRowHeightHorizontal,rH);}
1941rowLastItem[rowNum]=i;bNewRow=true;}
1942cnt++;nbTnInCurrRow++;}}
1943rowNum=0;curPosY=0;lastPosX=0;cnt=0;G.GOM.lastFullRow=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.imageWidth>0){let imageRatio=curTn.imageWidth/curTn.imageHeight;let imageWidth=Math.floor(imageRatio*rowHeight[rowNum]);if(i==rowLastItem[rowNum]){if(rowLastItem.length!=(rowNum+1)){imageWidth=areaWidth-lastPosX-borderWidth;}
1944else{if((lastPosX+gutterWidth+imageWidth+borderWidth)>areaWidth){imageWidth=areaWidth-lastPosX-borderWidth;}}}
1945let rh=parseInt(rowHeight[rowNum]);imageWidth=parseInt(imageWidth);curTn.resizedContentWidth=imageWidth;curTn.resizedContentHeight=rh;curTn.width=imageWidth+borderWidth;curTn.height=rh+G.tn.labelHeight.get()+borderHeight;curTn.row=rowNum;curTn.top=curPosY;let x=lastPosX;if(G.O.RTL){x=areaWidth-lastPosX-curTn.width;}
1946curTn.left=x;lastPosX+=curTn.width+gutterWidth;if(i==rowLastItem[rowNum]){curPosY+=curTn.height+gutterHeight;G.GOM.lastFullRow=rowNum-1;rowNum++;lastPosX=0;}
1947cnt++;}
1948else{return false;}}
1949if(false){var newTop=0;if(typeof GOMidx!=='undefined'){if(G.GOM.albumIdx!=-1){var hoveredTn=G.GOM.items[GOMidx];hoveredTn.width+=40;hoveredTn.height+=40;for(var i=0;i<nbTn;i++){var curTn=G.GOM.items[i];if(curTn.imageWidth>0){if(curTn.row==hoveredTn.row){newTop=40;if(hoveredTn.thumbnailIdx!=curTn.thumbnailIdx){curTn.top+=30;curTn.width-=20;curTn.height-=20;}}
1950else{if(curTn.row==0){}
1951else{curTn.top+=newTop;}}}}}}}
1952G.GOM.displayArea.width=areaWidth;return true;}
1953function GallerySetLayoutMosaic(){var areaWidth=G.GOM.cache.areaWidth;var gutterHeight=G.tn.settings.GetResponsive('gutterHeight');var gutterWidth=G.tn.settings.GetResponsive('gutterWidth');var borderWidth=G.tn.opt.Get('borderHorizontal')*2;var borderHeight=G.tn.opt.Get('borderVertical')*2;var nbTn=G.GOM.items.length;var row=0;var h=0;var n=0;var nbCols=0;var maxW=0;let mosaicPattern=G.tn.settings.getMosaic();for(var i=0;i<nbTn;i++){let curPatternElt=mosaicPattern[n];var cLeft=(curPatternElt.c-1)*G.tn.defaultSize.getOuterWidth()+(curPatternElt.c-1)*gutterWidth;var cWidth=curPatternElt.w*G.tn.defaultSize.getOuterWidth()+(curPatternElt.w-1)*gutterWidth;maxW=Math.max(maxW,cLeft+cWidth);nbCols=Math.max(nbCols,(curPatternElt.c-1)+curPatternElt.w);n++;if(n>=mosaicPattern.length){break;}}
1954var totalGutterWidth=(nbCols-1)*gutterWidth;var scaleFactor=Math.min((areaWidth-totalGutterWidth)/(maxW-totalGutterWidth),1);row=0;n=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];let curPatternElt=mosaicPattern[n];curTn.top=Math.round((curPatternElt.r-1)*G.tn.defaultSize.getOuterHeight()*scaleFactor)+(curPatternElt.r-1)*gutterHeight+row*h+(G.tn.labelHeight.get()*(curPatternElt.r-1));if(row>0){curTn.top+=gutterHeight;}
1955curTn.left=(curPatternElt.c-1)*Math.round(G.tn.defaultSize.getOuterWidth()*scaleFactor)+(curPatternElt.c-1)*gutterWidth;curTn.height=Math.round(curPatternElt.h*G.tn.defaultSize.getOuterHeight()*scaleFactor)+(curPatternElt.h-1)*gutterHeight+(G.tn.labelHeight.get()*curPatternElt.h);curTn.resizedContentHeight=curTn.height-G.tn.labelHeight.get()-borderHeight;curTn.width=Math.round(curPatternElt.w*G.tn.defaultSize.getOuterWidth()*scaleFactor)+(curPatternElt.w-1)*gutterWidth;curTn.resizedContentWidth=curTn.width-borderWidth;curTn.row=row;if(row==0){h=Math.max(h,curTn.top+curTn.height);}
1956n++;if(n>=mosaicPattern.length){n=0;row++;}}
1957G.GOM.displayArea.width=(maxW-totalGutterWidth)*scaleFactor+totalGutterWidth;return true;}
1958function GallerySetLayoutGrid(){var curPosX=0,curPosY=0,areaWidth=G.GOM.cache.areaWidth,gutterWidth=0,gutterHeight=G.tn.settings.GetResponsive('gutterHeight'),maxCol=NbThumbnailsPerRow(areaWidth),w=0,cols=[],curCol=0,newAreaWidth=areaWidth,tnWidth=G.tn.defaultSize.getOuterWidth();var scaleFactor=1;var nbTn=G.GOM.items.length;var borderWidth=G.tn.opt.Get('borderHorizontal')*2;var borderHeight=G.tn.opt.Get('borderVertical')*2;if(G.O.thumbnailAlignment=='justified'){maxCol=Math.min(maxCol,nbTn);gutterWidth=(maxCol==1?0:(areaWidth-(maxCol*tnWidth))/(maxCol-1));}
1959else{gutterWidth=G.tn.settings.GetResponsive('gutterWidth');}
1960if(G.O.RTL||G.O.thumbnailAlignment=='fillWidth'){var totalGutterWidth=(maxCol-1)*gutterWidth;scaleFactor=(areaWidth-totalGutterWidth)/(maxCol*tnWidth);if(scaleFactor>1){maxCol++;}
1961totalGutterWidth=(maxCol-1)*gutterWidth;scaleFactor=Math.min((areaWidth-totalGutterWidth)/(maxCol*tnWidth),1);newAreaWidth=(maxCol*tnWidth)+totalGutterWidth;}
1962G.GOM.lastFullRow=0;var row=0;tnWidth=Math.round(tnWidth*scaleFactor);var contentWidth=tnWidth-borderWidth;var tnHeight=Math.round(G.tn.defaultSize.getOuterHeight()*scaleFactor)+G.tn.labelHeight.get();var contentHeight=Math.round(G.tn.defaultSize.getOuterHeight()*scaleFactor)-borderHeight;for(var i=0;i<nbTn;i++){if(curPosY==0){curPosX=curCol*(tnWidth+gutterWidth)
1963cols[curCol]=curPosX;w=curPosX+tnWidth;}
1964else{curPosX=cols[curCol];}
1965var x=curPosX;if(G.O.RTL){x=parseInt(newAreaWidth)-curPosX-tnWidth;}
1966var curTn=G.GOM.items[i];curTn.top=curPosY;curTn.left=x;curTn.height=tnHeight;curTn.width=tnWidth;if(G.O.thumbnailAlignment=='fillWidth'){curTn.resizedContentWidth=contentWidth;curTn.resizedContentHeight=contentHeight;}
1967curTn.row=row;curCol++;if(curCol>=maxCol){curCol=0;curPosY+=tnHeight+gutterHeight;G.GOM.lastFullRow=row;row++;}}
1968G.GOM.displayArea.width=w;return true;}
1969function GalleryDisplayPart1(){if(G.CSStransformName==null){G.$E.conTn.css('left','0px');}
1970else{G.$E.conTn.css(G.CSStransformName,'none');}}
1971function CacheViewport(){G.GOM.cache.viewport=getViewport();G.GOM.cache.areaWidth=G.$E.base.width();if(!G.O.lightboxStandalone){G.GOM.cache.containerOffset=G.$E.conLoadingB.offset();}}
1972function GalleryDisplayPart2(forceTransition){CacheViewport();var nbTn=G.GOM.items.length;G.GOM.itemsDisplayed=0;var threshold=50;var cnt=0;GalleryRenderGetInterval();for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(i>=G.GOM.displayInterval.from&&cnt<G.GOM.displayInterval.len){curTn.inDisplayArea=true;if(forceTransition){curTn.neverDisplayed=true;}
1973G.GOM.itemsDisplayed++;cnt++;}
1974else{curTn.inDisplayArea=false;}}
1975GalleryBottomManage();var tnToDisplay=[];var tnToReDisplay=[];CacheViewport();G.GOM.clipArea.top=-1;cnt=0;var lastTnIdx=-1;G.GOM.clipArea.height=0;for(var i=0;i<nbTn;i++){let curTn=G.GOM.items[i];if(curTn.inDisplayArea){if(G.GOM.clipArea.top==-1){G.GOM.clipArea.top=curTn.top;}
1976if((curTn.top-G.GOM.clipArea.top)<=-1){G.GOM.clipArea.top=curTn.top;}
1977G.GOM.clipArea.height=Math.max(G.GOM.clipArea.height,curTn.top-G.GOM.clipArea.top+curTn.height);if(curTn.neverDisplayed){var top=G.GOM.cache.containerOffset.top+(curTn.top-G.GOM.clipArea.top);if((top+curTn.height)>=(G.GOM.cache.viewport.t-threshold)&&top<=(G.GOM.cache.viewport.t+G.GOM.cache.viewport.h+threshold)){let item=G.I[curTn.thumbnailIdx];if(item.$elt==null){ThumbnailBuild(item,curTn.thumbnailIdx,i);}
1978tnToDisplay.push({idx:i,delay:cnt,top:curTn.top,left:curTn.left});cnt++;}}
1979else{tnToReDisplay.push({idx:i,delay:0,top:curTn.top,left:curTn.left});}
1980lastTnIdx=i;}
1981else{curTn.displayed=false;let item=G.I[curTn.thumbnailIdx];if(item.$elt!=null){item.$elt.css({opacity:0,display:'none'});}}}
1982var areaWidth=G.$E.conTnParent.width();if(G.GOM.displayArea.width!=G.GOM.displayAreaLast.width||G.GOM.clipArea.height!=G.GOM.displayAreaLast.height){G.$E.conTn.width(G.GOM.displayArea.width).height(G.GOM.clipArea.height);G.GOM.displayAreaLast.width=G.GOM.displayArea.width;G.GOM.displayAreaLast.height=G.GOM.clipArea.height;}
1983if(areaWidth!=G.$E.conTnParent.width()){G.GOM.cache.areaWidth=G.$E.conTnParent.width();GallerySetLayout();GalleryDisplayPart1();GalleryDisplayPart2(forceTransition);return;}
1984if(G.layout.support.rows){if(G.galleryDisplayMode.Get()=='ROWS'||(G.galleryDisplayMode.Get()=='FULLCONTENT'&&G.galleryLastRowFull.Get()&&G.GOM.lastFullRow!=-1)){if(lastTnIdx<(nbTn-1)){G.GOM.lastDisplayedIdxNew=lastTnIdx;}
1985else{G.GOM.lastDisplayedIdxNew=-1;}
1986if(G.GOM.lastDisplayedIdx!=-1){let item=G.I[G.GOM.items[G.GOM.lastDisplayedIdx].thumbnailIdx];item.$getElt('.nGY2GThumbnailIconsFullThumbnail').html('');}}}
1987G.GOM.thumbnails2Display=[];var duration=ThumbnailPreparePosition(tnToDisplay);ThumbnailPreparePosition(tnToReDisplay);ThumbnailDisplayAnimBatch();if(G.tn.opt.Get('displayTransition')=='NONE'){G.galleryResizeEventEnabled=true;TriggerCustomEvent('galleryDisplayed');}
1988else{requestTimeout(function(){G.galleryResizeEventEnabled=true;TriggerCustomEvent('galleryDisplayed');},duration*G.tn.opt.Get('displayInterval'));}}
1989function ThumbnailPreparePosition(lstThumb){var nbBuild=lstThumb.length;if(nbBuild==0){return 0;}
1990var displayOrder=G.tn.opt.Get('displayOrder');if(displayOrder=='random'){NGY2Tools.AreaShuffle(lstThumb);}
1991else{if(displayOrder=='rowByRow'&&!(G.layout.engine=='JUSTIFIED'||G.layout.engine=='GRID')){displayOrder='';}
1992if((displayOrder=='colFromRight'||displayOrder=='colFromLeft')&&!(G.layout.engine=='CASCADING'||G.layout.engine=='GRID')){displayOrder='';}}
1993if(displayOrder=='colFromRight'||displayOrder=='colFromLeft'){var tab=[];var cols=[];for(var i=0;i<nbBuild;i++){if(tab[lstThumb[i].left]==undefined){tab[lstThumb[i].left]=[];cols.push(lstThumb[i].left);}
1994tab[lstThumb[i].left].push(lstThumb[i].idx)}
1995if(displayOrder=='colFromRight'){cols=cols.reverse();}
1996for(var i=0;i<cols.length;i++){var col=cols[i];for(var j=0;j<tab[col].length;j++){ThumbnailSetPosition(tab[col][j],i);}}
1997return(i);}
1998var d=0;var top=lstThumb[0].top;for(var i=0;i<nbBuild;i++){if(displayOrder=='rowByRow'){if(lstThumb[i].top>top){d++;top=lstThumb[i].top;}}
1999else{d++;}
2000ThumbnailSetPosition(lstThumb[i].idx,d);}
2001return(d);}
2002function ThumbnailSetPosition(GOMidx,cnt){var newTop=0;var curTn=G.GOM.items[GOMidx];var idx=G.GOM.items[GOMidx].thumbnailIdx;var item=G.I[idx];if(curTn.neverDisplayed){var top=curTn.top-G.GOM.clipArea.top;if(G.tn.opt.Get('stacks')>0){item.$elt.last().css({display:'block'});item.$elt.css({top:top,left:curTn.left});}
2003else{item.$elt.css({display:'block',top:top,left:curTn.left});}
2004newTop=top;if(G.O.thumbnailWaitImageLoaded===true){var gi_imgLoad=ngimagesLoaded(item.$getElt('.nGY2TnImg2'));gi_imgLoad.on('progress',function(instance,image){if(image.isLoaded){var albumIdx=image.img.getAttribute('data-albumidx');if(albumIdx==G.GOM.albumIdx){var idx=image.img.getAttribute('data-idx');G.I[idx].ThumbnailImageReveal();}}});}
2005ThumbnailAppear(GOMidx,cnt);curTn.displayed=true;curTn.neverDisplayed=false;}
2006else{var topOld=G.GOM.cache.containerOffset.top+item.top;var top=G.GOM.cache.containerOffset.top+(curTn.top-G.GOM.clipArea.top);newTop=curTn.top-G.GOM.clipArea.top;var vp=G.GOM.cache.viewport;if(G.O.thumbnailDisplayOutsideScreen||(((topOld+curTn.height)>=(vp.t-vp.h)&&topOld<=(vp.t+vp.h*4))||((top+curTn.height)>=(vp.t-vp.h)&&top<=(vp.t+vp.h*4)))){if(curTn.displayed){if(item.top!=curTn.top||item.left!=curTn.left){if(G.O.galleryResizeAnimation==true){var tweenable=new NGTweenable();tweenable.tween({from:{top:item.top,left:item.left,height:item.height,width:item.width},to:{top:newTop,left:curTn.left,height:curTn.height,width:curTn.width},attachment:{$e:item.$elt},duration:100,delay:cnt*G.tn.opt.Get('displayInterval')/5,easing:'easeOutQuart',step:function(state,att){att.$e.css(state);},finish:function(state,att){var _this=this;_this.dispose();}});}
2007else{item.$elt.css({top:newTop,left:curTn.left});}}}
2008else{curTn.displayed=true;item.$elt.css({display:'block',top:newTop,left:curTn.left,opacity:1});ThumbnailAppearFinish(item);}}
2009else{curTn.displayed=false;item.$elt.css({display:'none'});}}
2010item.left=curTn.left;item.top=newTop;if(item.width!=curTn.width||item.height!=curTn.height){item.$elt.css({width:curTn.width,height:curTn.height});item.width=curTn.width;item.height=curTn.height;if(item.resizedContentWidth!=curTn.resizedContentWidth||item.resizedContentHeight!=curTn.resizedContentHeight){if(item.kind=='albumUp'){}
2011else{item.$getElt('.nGY2GThumbnailImage').css({'height':curTn.resizedContentHeight,'width':curTn.resizedContentWidth});if(G.layout.engine=='JUSTIFIED'){item.$getElt('.nGY2GThumbnailImg').css({'height':curTn.resizedContentHeight,'width':curTn.resizedContentWidth});}}
2012item.resizedContentWidth=curTn.resizedContentWidth;item.resizedContentHeight=curTn.resizedContentHeight;}}
2013if(G.GOM.lastDisplayedIdxNew==GOMidx&&G.layout.support.rows){if((G.galleryDisplayMode.Get()=='ROWS'&&G.galleryMaxRows.Get()>0)||(G.galleryDisplayMode.Get()=='FULLCONTENT'&&G.galleryLastRowFull.Get()&&G.GOM.lastFullRow!=-1)){var nb=G.GOM.items.length-GOMidx-1;if(item.albumID!='0'&&G.O.thumbnailLevelUp){nb--;}
2014if(nb>0){if(G.O.thumbnailOpenInLightox||G.O.thumbnailSliderDelay>0){item.$getElt('.nGY2GThumbnailIconsFullThumbnail').html('+'+nb);}
2015if(G.O.thumbnailLabel.get('position')!='right'&&G.O.thumbnailLabel.get('position')!='left'){if(G.GOM.slider.hostItem!=G.GOM.NGY2Item(GOMidx)){GalleryThumbnailSliderSetContent(G.GOM.slider.hostItem);G.GOM.slider.hostIdx=GOMidx;G.GOM.slider.hostItem=G.GOM.NGY2Item(GOMidx);G.GOM.slider.nextIdx=GOMidx;G.GOM.slider.currentIdx=GOMidx;GalleryThumbnailSliderBuildAndStart();}}}
2016else{GalleryThumbnailSliderSetContent(G.GOM.slider.hostItem);G.GOM.slider.hostIdx=-1;}
2017G.GOM.lastDisplayedIdx=GOMidx;}}}
2018function GalleryThumbnailSliderBuildAndStart(){if(G.O.thumbnailSliderDelay==0||G.GOM.slider.hostIdx==-1){return;}
2019clearTimeout(G.GOM.slider.timerID);var item=G.GOM.slider.hostItem;if(item.$getElt('.nGY2TnImgNext').length==0){item.$getElt('.nGY2TnImg').clone().removeClass('nGY2TnImg').addClass('nGY2TnImgNext').insertAfter(item.$getElt('.nGY2TnImg'));item.$getElt('.nGY2TnImgBack').clone().removeClass('nGY2TnImgBack').addClass('nGY2TnImgBackNext').insertAfter(item.$getElt('.nGY2TnImg',true));item.$getElt('.nGY2GThumbnailImage',true);item.$getElt('.nGY2GThumbnailImg',true);}
2020item.CSSTransformSet('.nGY2TnImgNext','translateX','100%',true);item.CSSTransformApply('.nGY2TnImgNext');item.CSSTransformSet('.nGY2TnImgBackNext','translateX','100%',true);item.CSSTransformApply('.nGY2TnImgBackNext');GalleryThumbnailSliderSetNextContent();G.GOM.slider.timerID=requestTimeout(function(){GalleryThumbnailSliderStartTransition()},G.O.thumbnailSliderDelay);}
2021function GalleryThumbnailSliderSetNextContent(){G.GOM.slider.nextIdx++;if(G.GOM.slider.nextIdx>=G.GOM.items.length){G.GOM.slider.nextIdx=G.GOM.slider.hostIdx;}
2022var newItem=G.GOM.NGY2Item(G.GOM.slider.nextIdx);var bgImg="url('"+G.emptyGif+"')";if(newItem.imageDominantColors!=null){bgImg="url('"+newItem.imageDominantColors+"')";}
2023G.GOM.slider.hostItem.$getElt('.nGY2TnImgBackNext',true).css({'background-image':bgImg,opacity:1});G.GOM.slider.hostItem.$getElt('.nGY2TnImgNext',true).css({'background-image':"url('"+newItem.thumbImg().src+"')",opacity:1});G.GOM.slider.hostItem.$getElt('.nGY2TnImgNext .nGY2GThumbnailImg',true).attr('src',newItem.thumbImg().src);}
2024function GalleryThumbnailSliderStartTransition(){if(G.GOM.slider.hostItem.$getElt()!=null){var tweenable=new NGTweenable();G.GOM.slider.tween=tweenable;tweenable.tween({from:{'left':100},to:{'left':0},duration:800,delay:0,easing:'easeOutQuart',step:function(state){if(G.GOM.slider.hostItem.$getElt()==null){G.GOM.slider.tween.stop(false);return;}
2025G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImgBack','translateX',-(100-state.left)+'%');G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImgBack');G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImg','translateX',-(100-state.left)+'%');G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImg');G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImgBackNext','translateX',state.left+'%');G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImgBackNext');G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImgNext','translateX',state.left+'%');G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImgNext');},finish:function(state){if(G.GOM.slider.hostItem.$getElt()==null){return;}
2026if(G.GOM.NGY2Item(G.GOM.slider.nextIdx)==null){return;}
2027GalleryThumbnailSliderSetContent(G.GOM.NGY2Item(G.GOM.slider.nextIdx));G.GOM.slider.currentIdx=G.GOM.slider.nextIdx;GalleryThumbnailSliderSetNextContent();clearTimeout(G.GOM.slider.timerID);G.GOM.slider.timerID=requestTimeout(function(){GalleryThumbnailSliderStartTransition()},G.O.thumbnailSliderDelay);}});}}
2028function GalleryThumbnailSliderSetContent(ngy2itemContent){if(G.GOM.slider.hostIdx==-1){return;}
2029if(G.GOM.slider.tween!=null){if(G.GOM.slider.tween._isTweening==true){G.GOM.slider.tween.stop(false);}}
2030var bgImg="url('"+G.emptyGif+"')";if(ngy2itemContent.imageDominantColors!=null){bgImg="url('"+ngy2itemContent.imageDominantColors+"')";}
2031G.GOM.slider.hostItem.$getElt('.nGY2TnImgBack').css('background-image',bgImg);G.GOM.slider.hostItem.$getElt('.nGY2TnImg').css('background-image',"url('"+ngy2itemContent.thumbImg().src+"')");G.GOM.slider.hostItem.$getElt('.nGY2TnImg .nGY2GThumbnailImg').attr('src',ngy2itemContent.thumbImg().src);G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImgBack','translateX','0');G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImgBack');G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImg','translateX','0');G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImg');G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImgBackNext','translateX','100%',true);G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImgBackNext');G.GOM.slider.hostItem.CSSTransformSet('.nGY2TnImgNext','translateX','100%',true);G.GOM.slider.hostItem.CSSTransformApply('.nGY2TnImgNext');if(G.O.thumbnailLabel.get('display')==true){var icons=G.O.icons.thumbnailAlbum;if(ngy2itemContent.kind!='album'){icons=G.O.icons.thumbnailImage;}
2032G.GOM.slider.hostItem.$getElt('.nGY2GThumbnailTitle').html(icons+getThumbnailTitle(ngy2itemContent));G.GOM.slider.hostItem.$getElt('.nGY2GThumbnailDescription').html(icons+getTumbnailDescription(ngy2itemContent));}}
2033function ThumbnailGetLabelHeight(){var newElt=[],newEltIdx=0;if(G.O.thumbnailLabel.get('display')==false){return 0;}
2034newElt[newEltIdx++]='<div class="nGY2GThumbnail '+G.O.theme+'" style="display:block;visibility:hidden;position:absolute;top:-9999px;left:-9999px;" ><div class="nGY2GThumbnailSub">';if(G.O.thumbnailLabel.get('display')==true){newElt[newEltIdx++]='  <div class="nGY2GThumbnailLabel" '+G.tn.style.getLabel()+'>';newElt[newEltIdx++]='    <div class="nGY2GThumbnailAlbumTitle" '+G.tn.style.getTitle()+'>aAzZjJ</div>';if(G.O.thumbnailLabel.get('displayDescription')==true){newElt[newEltIdx++]='    <div class="nGY2GThumbnailDescription" '+G.tn.style.getDesc()+'>'+'aAzZjJ'+'</div>';}
2035newElt[newEltIdx++]='  </div>';}
2036newElt[newEltIdx++]='</div></div>';var $newDiv=jQuery(newElt.join('')).appendTo(G.$E.conTn);var h=$newDiv.find('.nGY2GThumbnailLabel').outerHeight(true);$newDiv.remove();return h;}
2037function ThumbnailBuildStacks(bgColor){var ns=G.tn.opt.Get('stacks');if(ns==0){return'';}
2038var s='';for(var i=0;i<ns;i++){s='<div class="nGY2GThumbnailStack " style="display:none;'+bgColor+'"></div>'+s;}
2039return s;}
2040function ThumbnailBuildAlbumpUp(item,GOMidx){var newElt=[],newEltIdx=0;var mp='';if(G.O.thumbnailOpenInLightox===false){mp='cursor:default;'}
2041newElt[newEltIdx++]=ThumbnailBuildStacks('')+'<div class="nGY2GThumbnail" style="display:none;opacity:0;'+mp+'" >';newElt[newEltIdx++]='  <div class="nGY2GThumbnailSub">';var h=G.tn.defaultSize.getHeight(),w=G.tn.defaultSize.getWidth();newElt[newEltIdx++]='    <div class="nGY2GThumbnailImage" style="width:'+w+'px;height:'+h+'px;"><img class="nGY2GThumbnailImg" src="'+G.emptyGif+'" alt="" style="max-width:'+w+'px;max-height:'+h+'px;" ></div>';newElt[newEltIdx++]='    <div class="nGY2GThumbnailAlbumUp" >'+G.O.icons.thumbnailAlbumUp+'</div>';newElt[newEltIdx++]='  </div>';newElt[newEltIdx++]='</div>';var $newDiv=jQuery(newElt.join('')).appendTo(G.$E.conTn);item.$elt=$newDiv;$newDiv.data('index',GOMidx);item.$getElt('.nGY2GThumbnailImg').data('index',GOMidx);return;}
2042function ThumbnailBuild(item,idx,GOMidx){item.eltTransform=[];item.eltFilter=[];item.hoverInitDone=false;item.$Elts=[];if(item.kind=='albumUp'){ThumbnailBuildAlbumpUp(item,GOMidx);return;}
2043var newElt=[],newEltIdx=0;var mp='';if(G.O.thumbnailOpenInLightox===false){mp='cursor:default;'}
2044var src=(item.thumbImg().src).replace(/'/g,"%27"),sTitle=getThumbnailTitle(item);var bg='';var bgImg="background-image: url('"+G.emptyGif+"');";if(item.imageDominantColors!=null){bgImg="background-image: url('"+item.imageDominantColors+"');";}
2045else{if(item.imageDominantColor!=null){bg='background-color:'+item.imageDominantColor+';';}
2046else{bgImg='';}}
2047var op='opacity:1;';if(G.O.thumbnailWaitImageLoaded==true){op='opacity:0;';}
2048newElt[newEltIdx++]=ThumbnailBuildStacks(bg)+'<div class="nGY2GThumbnail nGY2GThumbnail_'+G.GOM.curNavLevel+'" style="display:none;opacity:0;'+mp+'"><div class="nGY2GThumbnailSub '+(G.O.thumbnailSelectable&&item.selected?"nGY2GThumbnailSubSelected":"")+'">';var w=G.tn.settings.getW();var h=G.tn.settings.getH();if(G.tn.settings.getMosaic()!==null){w=G.GOM.items[GOMidx].width;h=G.GOM.items[GOMidx].height;}
2049var bgSize='contain';if(G.tn.opt.Get('crop')){bgSize='cover';}
2050var s1="position: absolute; top: 0px; left: 0px; width:"+w+"px; height:"+h+"px;"+bg+bgImg+" background-position: center center;  background-repeat: no-repeat; background-size:"+bgSize+"; overflow: hidden;";newElt[newEltIdx++]='<div class="nGY2GThumbnailImage nGY2TnImgBack" style="'+s1+'"></div>';var s2=op+"position: absolute; top: 0px; left: 0px; width:"+w+"px; height:"+h+"px; background-image: url('"+src.replace(/\\/g,'\\\\')+"'); background-position: center center; background-repeat: no-repeat; background-size:"+bgSize+"; overflow: hidden;";newElt[newEltIdx++]='<div class="nGY2GThumbnailImage nGY2TnImg" style="'+s2+'">';newElt[newEltIdx++]='  <img class="nGY2GThumbnailImg nGY2TnImg2" src="'+src+'" alt="'+sTitle+'" style="opacity:0;" data-idx="'+idx+'" data-albumidx="'+G.GOM.albumIdx+'" >';newElt[newEltIdx++]='</div>';newElt[newEltIdx++]='<div class="nGY2GThumbnailCustomLayer"></div>';if(G.O.thumbnailLabel.get('display')==true){newElt[newEltIdx++]='  <div class="nGY2GThumbnailLabel" '+G.tn.style.getLabel(item)+'>';if(item.kind=='album'){newElt[newEltIdx++]='    <div class="nGY2GThumbnailTitle nGY2GThumbnailAlbumTitle" '+G.tn.style.getTitle()+'>'+G.O.icons.thumbnailAlbum+sTitle+'</div>';}
2051else{newElt[newEltIdx++]='    <div class="nGY2GThumbnailTitle nGY2GThumbnailImageTitle" '+G.tn.style.getTitle()+'>'+G.O.icons.thumbnailImage+sTitle+'</div>';}
2052newElt[newEltIdx++]='    <div class="nGY2GThumbnailDescription" '+G.tn.style.getDesc()+'>'+getTumbnailDescription(item)+'</div>';newElt[newEltIdx++]='  </div>';}
2053newElt[newEltIdx++]=ThumbnailBuildTools(item);newElt[newEltIdx++]='</div></div>';var $newDiv=jQuery(newElt.join('')).appendTo(G.$E.conTn);item.$elt=$newDiv;$newDiv.data('index',GOMidx);item.$getElt('.nGY2GThumbnailImg').data('index',GOMidx);var fu=G.O.fnThumbnailInit;if(fu!==null){typeof fu=='function'?fu($newDiv,item,GOMidx):window[fu]($newDiv,item,GOMidx);}
2054if(item.title!='image gallery by nanogallery2 [build]'){ThumbnailOverInit(GOMidx);}
2055return;}
2056function ThumbnailBuildTools(item){var tb=ThumbnailBuildToolbarOne(item,'topLeft')+ThumbnailBuildToolbarOne(item,'topRight')+ThumbnailBuildToolbarOne(item,'bottomLeft')+ThumbnailBuildToolbarOne(item,'bottomRight');tb+='<div class="nGY2GThumbnailIconsFullThumbnail"></div>';return tb;}
2057function ThumbnailBuildToolbarOne(item,position){var toolbar='';var tb=G.tn.toolbar.get(item);var width={xs:0,sm:1,me:2,la:3,xl:4};var cnt=0;if(tb[position]!=''){var pos='top: 0; right: 0; text-align: right;';switch(position){case'topLeft':pos='top: 0; left: 0; text-align: left;';break;case'bottomRight':pos='bottom: 0; right: 0; text-align: right;';break;case'bottomLeft':pos='bottom: 0; left: 0; text-align: left;';break;}
2058toolbar+='  <ul class="nGY2GThumbnailIcons" style="'+pos+'">';var icons=tb[position].split(',');var nb=icons.length;for(var i=0;i<nb;i++){var icon=icons[i].replace(/^\s*|\s*$/,'');var minWidth=icon.substring(0,2).toLowerCase();var tIcon=icon;var display=true;if(/xs|sm|me|la|xl/i.test(minWidth)){if(width[minWidth]>width[G.GOM.curWidth]){display=false;}
2059tIcon=icon.substring(2);}
2060if(display){var sp=(i+1<nb?'&nbsp;':'');switch(tIcon){case'COUNTER':if(item.kind=='album'){toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="">';toolbar+='      <div class="nGY2GThumbnailIconImageCounter"></div>';toolbar+='      <div class="nGY2GThumbnailIconText">'+G.O.icons.thumbnailCounter+Math.max((item.getContentLength(false)),item.numberItems)+sp+'</div>';toolbar+='    </li>';cnt++;}
2061break;case'COUNTER2':if(item.kind=='album'){toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="">';toolbar+='      <div class="nGY2GThumbnailIconTextBadge">'+G.O.icons.thumbnailCounter+Math.max((item.getContentLength(false)),item.numberItems)+sp+'</div>';toolbar+='    </li>';cnt++;}
2062break;case'SHARE':toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="'+tIcon+'">';toolbar+='      <div>'+G.O.icons.thumbnailShare+'</div>';toolbar+='    </li>';cnt++;break;case'DOWNLOAD':toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="'+tIcon+'">';toolbar+='      <div>'+G.O.icons.thumbnailDownload+'</div>';toolbar+='    </li>';cnt++;break;case'INFO':toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="'+tIcon+'">';toolbar+='      <div>'+G.O.icons.thumbnailInfo+'</div>';toolbar+='    </li>';cnt++;break;case'SHOPPINGCART':toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="'+tIcon+'">';toolbar+=ThumbnailBuildToolbarOneCart(item);toolbar+='    </li>';cnt++;break;case'DISPLAY':toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="DISPLAY">';toolbar+='      <div class="nGY2GThumbnailIconImageShare">'+G.O.icons.thumbnailDisplay+'</div>';toolbar+='    </li>';cnt++;break;case'CUSTOM1':case'CUSTOM2':case'CUSTOM3':case'CUSTOM4':case'CUSTOM5':case'CUSTOM6':case'CUSTOM7':case'CUSTOM8':case'CUSTOM9':case'CUSTOM10':var cust=tIcon.replace('CUSTOM','');toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="'+tIcon.toLowerCase()+'">';toolbar+='      <div class="nGY2GThumbnailIconImageShare">'+G.O.icons['thumbnailCustomTool'+cust]+'</div>';toolbar+='    </li>';cnt++;break;case'FEATURED':if(item.featured===true){toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="">';toolbar+='      <div class="nGY2GThumbnailIconImageFeatured">'+G.O.icons.thumbnailFeatured+'</div>';toolbar+='    </li>';cnt++;}
2063break;case'SELECT':if(G.O.thumbnailSelectable==true){toolbar+='    <li class="nGY2GThumbnailIcon" data-ngy2action="TOGGLESELECT">';if(item.selected===true){toolbar+='      <div class="nGY2GThumbnailIconImageSelect nGY2ThumbnailSelected">'+G.O.icons.thumbnailSelected+'</div>';}
2064else{toolbar+='      <div class="nGY2GThumbnailIconImageSelect nGY2ThumbnailUnselected">'+G.O.icons.thumbnailUnselected+'</div>';}
2065toolbar+='    </li>';cnt++;}
2066break;}}}
2067toolbar+='  </ul>';}
2068if(cnt>0){return toolbar;}
2069else{return'';}}
2070function ThumbnailBuildToolbarOneCart(item){var q=0;var id=item.GetID()
2071for(var i=0;i<G.shoppingCart.length;i++){if(G.I[G.shoppingCart[i].idx].GetID()==id){q=G.shoppingCart[i].qty;}}
2072if(q==0){q='';}
2073return'      <div>'+G.O.icons.thumbnailShoppingcart+q+'</div>';}
2074function ThumbnailBuildToolbarOneCartUpdate(item){var $e=item.$elt;if($e!=null){var $q=$e.find('*[data-ngy2action="SHOPPINGCART"]');if($q!==undefined){$q.html(ThumbnailBuildToolbarOneCart(item));}}}
2075function getThumbnailTitle(item){var sTitle=item.title;if(G.O.thumbnailLabel.get('display')==true){if(sTitle===undefined||sTitle.length==0){sTitle='&nbsp;';}
2076if(G.i18nTranslations.thumbnailImageTitle!=''){sTitle=G.i18nTranslations.thumbnailImageTitle;}
2077var ml=G.O.thumbnailLabel.get('titleMaxLength');if(ml>3&&sTitle.length>ml){sTitle=sTitle.substring(0,ml)+'...';}}
2078return sTitle;}
2079function getTumbnailDescription(item){var sDesc='';if(G.O.thumbnailLabel.get('displayDescription')==true){if(item.kind=='album'){if(G.i18nTranslations.thumbnailImageDescription!=''){sDesc=G.i18nTranslations.thumbnailAlbumDescription;}
2080else{sDesc=item.description;}}
2081else{if(G.i18nTranslations.thumbnailImageDescription!=''){sDesc=G.i18nTranslations.thumbnailImageDescription;}
2082else{sDesc=item.description;}}
2083var ml=G.O.thumbnailLabel.get('descriptionMaxLength');if(ml>3&&sDesc.length>ml){sDesc=sDesc.substring(0,ml)+'...';}
2084if(sDesc.length==0){sDesc='&nbsp;';}}
2085return sDesc;}
2086function NbThumbnailsPerRow(areaWidth){var tnW=G.tn.defaultSize.getOuterWidth();var nbMaxTn=0;if(G.O.thumbnailAlignment=='justified'){nbMaxTn=Math.floor((areaWidth)/(tnW));}
2087else{nbMaxTn=Math.floor((areaWidth+G.tn.settings.GetResponsive('gutterWidth'))/(tnW+G.tn.settings.GetResponsive('gutterWidth')));}
2088if(G.O.maxItemsPerLine>0&&nbMaxTn>G.O.maxItemsPerLine){nbMaxTn=G.O.maxItemsPerLine;}
2089if(nbMaxTn<1){nbMaxTn=1;}
2090return nbMaxTn}
2091function ThumbnailAppear(n,cnt){var curTn=G.GOM.items[n];var item=G.I[curTn.thumbnailIdx];if(G.tn.opt.Get('displayTransition')=='NONE'){item.$elt.css({opacity:1});ThumbnailAppearFinish(item);}
2092else{if(item.$elt==null){return;}
2093var top=G.GOM.cache.containerOffset.top+(curTn.top-G.GOM.clipArea.top);var vp=G.GOM.cache.viewport;if((top+(curTn.top-G.GOM.clipArea.top))>=(vp.t-50)&&top<=(vp.t+vp.h+50)){var delay=cnt*G.tn.opt.Get('displayInterval');if(G.tn.opt.Get('displayTransition')=='CUSTOM'){if(G.GOM.curNavLevel=='lN'){G.O.fnThumbnailDisplayEffect(item.$elt,item,n,delay);}
2094else{G.O.fnThumbnailL1DisplayEffect(item.$elt,item,n,delay);}}
2095else{G.GOM.thumbnails2Display.push({itm:item,d:delay});}
2096return;}
2097else{item.$elt.css({opacity:1});ThumbnailAppearFinish(item);}}}
2098function ThumbnailAppearFinish(item){var ns=G.tn.opt.Get('stacks');if(ns>0){item.$elt.css({display:'block'});var o=0.9;for(var i=ns-1;i>=0;i--){item.$elt.eq(i).css('opacity',o);o=o-0.2;}}}
2099function ThumbnailDisplayAnim2(item,delay){function randomIntFromInterval(min,max){return Math.floor(Math.random()*(max-min+1)+min);}
2100var oFrom={};var oTo={};switch(G.tn.opt.Get('displayTransition')){case'RANDOMSCALE':{var scales=[0.95,1,1.05,1.1];var zi=[1,2,3,4];var r=randomIntFromInterval(0,3);while(r==G.GOM.lastRandomValue){r=randomIntFromInterval(0,3);}
2101G.GOM.lastRandomValue=r;let f=scales[r];item.$elt.css({'z-index':G.GOM.lastZIndex+zi[r],'box-shadow':'0px 0px 5px 3px rgba(0,0,0,0.74)'});oFrom={scale:0.5,opacity:0};oTo={scale:f,opacity:1};break;}
2102case'SCALEUP':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=0.6;}
2103oFrom={scale:f,opacity:0};oTo={scale:1,opacity:1};break;}
2104case'SCALEDOWN':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=1.3;}
2105oFrom={scale:f,opacity:0};oTo={scale:1,opacity:1};break;}
2106case'SLIDEUP':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=50;}
2107oFrom={opacity:0,translateY:f};oTo={opacity:1,translateY:0};break;}
2108case'SLIDEDOWN':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=-50;}
2109oFrom={opacity:0,translateY:f};oTo={opacity:1,translateY:0};break;}
2110case'FLIPUP':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=100;}
2111oFrom={opacity:0,translateY:f,rotateX:45};oTo={opacity:1,translateY:0,rotateX:0};break;}
2112case'FLIPDOWN':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=-100;}
2113oFrom={opacity:0,translateY:f,rotateX:-45};oTo={opacity:1,translateY:0,rotateX:0};break;}
2114case'SLIDEUP2':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=100;}
2115oFrom={opacity:0,translateY:f,rotateY:40};oTo={opacity:1,translateY:0,rotateY:0};break;}
2116case'IMAGESLIDEUP':{oFrom={opacity:0,top:'100%'};oTo={opacity:1,top:'0%'};break;}
2117case'SLIDEDOWN2':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=-100;}
2118oFrom={opacity:0,translateY:f,rotateY:40};oTo={opacity:1,translateY:0,rotateY:0};break;}
2119case'SLIDERIGHT':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=-150;}
2120oFrom={opacity:0,translateX:f};oTo={opacity:1,translateX:0};break;}
2121case'SLIDELEFT':{let f=G.tn.opt.Get('displayTransitionStartVal');if(f==0){f=150;}
2122oFrom={opacity:0,translateX:f};oTo={opacity:1,translateX:0};break;}
2123case'FADEIN':oFrom={opacity:0};oTo={opacity:1};break;}
2124var tweenable=new NGTweenable();tweenable.tween({from:oFrom,to:oTo,attachment:{$e:item.$elt,item:item,tw:tweenable},delay:delay,duration:G.tn.opt.Get('displayTransitionDuration'),easing:G.tn.opt.Get('displayTransitionEasing'),step:function(state,att){window.requestAnimationFrame(function(){if(att.item.$elt===null){att.tw.stop(false);return;}
2125switch(G.tn.opt.Get('displayTransition')){case'RANDOMSCALE':att.$e.css(G.CSStransformName,'scale('+state.scale+')').css('opacity',state.opacity);break;case'SCALEUP':att.$e.css(G.CSStransformName,'scale('+state.scale+')').css('opacity',state.opacity);break;case'SCALEDOWN':att.item.$elt.last().css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','scale',state.scale);att.item.CSSTransformApply('.nGY2GThumbnail');break;case'SLIDEUP':att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','translate','0px, '+state.translateY+'px');att.item.CSSTransformApply('.nGY2GThumbnail');break;case'SLIDEDOWN':att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','translate','0px,'+state.translateY+'px');att.item.CSSTransformApply('.nGY2GThumbnail');break;case'FLIPUP':att.item.CSSTransformSet('.nGY2GThumbnail','translate','0px,'+state.translateY+'px');att.item.CSSTransformSet('.nGY2GThumbnail','rotateX',state.rotateX+'deg');att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformApply('.nGY2GThumbnail');break;case'FLIPDOWN':att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','translate','0px,'+state.translateY+'px');att.item.CSSTransformSet('.nGY2GThumbnail','rotateX',state.rotateX+'deg');att.item.CSSTransformApply('.nGY2GThumbnail');break;case'SLIDEUP2':att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','translate','0px,'+state.translateY+'px');att.item.CSSTransformSet('.nGY2GThumbnail','rotateY',state.rotateY+'deg');att.item.CSSTransformApply('.nGY2GThumbnail');break;case'IMAGESLIDEUP':att.item.$elt.css('opacity',state.opacity);att.item.$Elts['.nGY2GThumbnailImage'].css('top',state.top);break;case'SLIDEDOWN2':att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','translate','0px, '+state.translateY+'px');att.item.CSSTransformSet('.nGY2GThumbnail','rotateY',state.rotateY+'deg');att.item.CSSTransformApply('.nGY2GThumbnail');break;case'SLIDERIGHT':att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformSet('.nGY2GThumbnail','translate',state.translateX+'px, 0px');att.item.CSSTransformApply('.nGY2GThumbnail');break;case'SLIDELEFT':att.item.CSSTransformSet('.nGY2GThumbnail','translate',state.translateX+'px, 0px');att.item.$elt.css('opacity',state.opacity);att.item.CSSTransformApply('.nGY2GThumbnail');break;case'FADEIN':att.$e.css(state);break;}});},finish:function(state,att){window.requestAnimationFrame(function(){if(att.item.$elt===null){return;}
2126switch(G.tn.opt.Get('displayTransition')){case'RANDOMSCALE':att.$e.css(G.CSStransformName,'scale('+state.scale+')').css('opacity','');break;case'SCALEUP':att.$e.css(G.CSStransformName,'').css('opacity','');break;case'SCALEDOWN':att.item.$elt.last().css('opacity','');att.item.CSSTransformSet('.nGY2GThumbnail','scale',state.scale);att.item.CSSTransformApply('.nGY2GThumbnail');break;case'IMAGESLIDEUP':att.item.$elt.css('opacity','');att.item.$Elts['.nGY2GThumbnailImage'].css('top',0);break;case'SLIDEDOWN2':att.item.$elt.css('opacity','');att.item.CSSTransformApply('.nGY2GThumbnail');break;default:att.item.$elt.css('opacity','');}
2127ThumbnailAppearFinish(att.item);});}});}
2128function ThumbnailDisplayAnimBatch(){G.GOM.thumbnails2Display.forEach(function(one){ThumbnailDisplayAnim2(one.itm,one.d);});G.GOM.thumbnails2Display=[];}
2129function GalleryAppear(){var d=G.galleryDisplayTransitionDuration.Get();switch(G.galleryDisplayTransition.Get()){case'ROTATEX':G.$E.base.css({perspective:'1000px','perspective-origin':'50% 0%'});new NGTweenable().tween({from:{r:50},to:{r:0},attachment:{orgIdx:G.GOM.albumIdx},duration:d,easing:'easeOutCirc',step:function(state,att){if(att.orgIdx==G.GOM.albumIdx){G.$E.conTnParent.css(G.CSStransformName,'rotateX('+state.r+'deg)');}}});break;case'SLIDEUP':G.$E.conTnParent.css({opacity:0});new NGTweenable().tween({from:{y:200,o:0},to:{y:0,o:1},attachment:{orgIdx:G.GOM.albumIdx},duration:d,easing:'easeOutCirc',step:function(state,att){if(att.orgIdx==G.GOM.albumIdx){G.$E.conTnParent.css(G.CSStransformName,'translate( 0px, '+state.y+'px)').css('opacity',state.o);}}});break;case'NONE':default:break;}}
2130function ThumbnailOverInit(GOMidx){var curTn=G.GOM.items[GOMidx];var item=G.I[curTn.thumbnailIdx];if(item.$elt==null){return;}
2131var fu=G.O.fnThumbnailHoverInit;if(fu!==null){typeof fu=='function'?fu($e,item,GOMidx):window[fu]($e,item,GOMidx);}
2132var inits=G.tn.buildInit.get();for(var j=0;j<inits.length;j++){switch(inits[j].property){case'scale':case'rotateX':case'rotateY':case'rotateZ':case'translateX':case'translateY':case'translateZ':item.CSSTransformSet(inits[j].element,inits[j].property,inits[j].value);item.CSSTransformApply(inits[j].element);break;case'blur':case'brightness':case'grayscale':case'sepia':case'contrast':case'opacity':case'saturate':item.CSSFilterSet(inits[j].element,inits[j].property,inits[j].value);item.CSSFilterApply(inits[j].element);break;default:var $t=item.$getElt(inits[j].element);$t.css(inits[j].property,inits[j].value);break;}}
2133var effects=G.tn.hoverEffects.get();for(var j=0;j<effects.length;j++){if(effects[j].firstKeyframe===true){switch(effects[j].type){case'scale':case'rotateX':case'rotateY':case'rotateZ':case'translateX':case'translateY':case'translateZ':item.CSSTransformSet(effects[j].element,effects[j].type,effects[j].from);item.CSSTransformApply(effects[j].element);break;case'blur':case'brightness':case'grayscale':case'sepia':case'contrast':case'opacity':case'saturate':item.CSSFilterSet(effects[j].element,effects[j].type,effects[j].from);item.CSSFilterApply(effects[j].element);break;default:var $t=item.$getElt(effects[j].element);$t.css(effects[j].type,effects[j].from);break;}}}
2134item.hoverInitDone=true;}
2135function ThumbnailHoverReInitAll(){if(G.GOM.albumIdx==-1){return;};var l=G.GOM.items.length;for(var i=0;i<l;i++){ThumbnailOverInit(i);G.I[G.GOM.items[i].thumbnailIdx].hovered=false;}}
2136function ThumbnailHover(GOMidx){if(G.GOM.albumIdx==-1||!G.galleryResizeEventEnabled){return;};if(G.GOM.slider.hostIdx==GOMidx){return;}
2137var curTn=G.GOM.items[GOMidx];var item=G.I[curTn.thumbnailIdx];if(item.kind=='albumUp'||item.$elt==null){return;}
2138item.hovered=true;var fu=G.O.fnThumbnailHover;if(fu!==null){typeof fu=='function'?fu(item.$elt,item,GOMidx):window[fu](item.$elt,item,GOMidx);}
2139var effects=G.tn.hoverEffects.get();try{for(var j=0;j<effects.length;j++){if(effects[j].hoverin===true){item.animate(effects[j],0,true);}}}
2140catch(e){NanoAlert(G,'error on hover: '+e.message);}}
2141function ThumbnailHoverOutAll(){if(G.GOM.albumIdx==-1){return;};var l=G.GOM.items.length;for(var i=0;i<l;i++){if(G.GOM.items[i].inDisplayArea){ThumbnailHoverOut(i);}
2142else{G.I[G.GOM.items[i].thumbnailIdx].hovered=false;}}}
2143function ThumbnailHoverOut(GOMidx){if(G.GOM.albumIdx==-1||!G.galleryResizeEventEnabled){return;}
2144if(G.GOM.slider.hostIdx==GOMidx){return;}
2145var curTn=G.GOM.items[GOMidx];var item=G.I[curTn.thumbnailIdx];if(item.kind=='albumUp'||!item.hovered){return;}
2146item.hovered=false;if(item.$elt==null){return;}
2147var fu=G.O.fnThumbnailHoverOut;if(fu!==null){typeof fu=='function'?fu(item.$elt,item,GOMidx):window[fu](item.$elt,item,GOMidx);}
2148var effects=G.tn.hoverEffects.get();try{for(var j=0;j<effects.length;j++){if(effects[j].hoverout===true){item.animate(effects[j],0,false);}}}
2149catch(e){NanoAlert(G,'error on hoverOut: '+e.message);}}
2150function DisplayPhoto(imageID,albumID){if(G.O.debugMode){console.log('#DisplayPhoto : '+albumID+'-'+imageID);}
2151var albumIdx=NGY2Item.GetIdx(G,albumID);if(albumIdx==0){G.GOM.curNavLevel='l1';}
2152else{G.GOM.curNavLevel='lN';}
2153if(albumIdx==-1){if(G.O.kind!=''){NGY2Item.New(G,'','',albumID,'0','album');}}
2154var ngy2ItemIdx=NGY2Item.GetIdx(G,imageID);if(ngy2ItemIdx==-1){AlbumGetContent(albumID,DisplayPhoto,imageID,albumID);return;}
2155if(G.O.debugMode){console.log('#DisplayPhoto : '+ngy2ItemIdx);}
2156DisplayPhotoIdx(ngy2ItemIdx);}
2157function AlbumGetContent(albumID,fnToCall,fnParam1,fnParam2){switch(G.O.kind){case'':AlbumGetMarkupOrApi(fnToCall,fnParam1,fnParam2);break;default:jQuery.nanogallery2['data_'+G.O.kind](G,'AlbumGetContent',albumID,fnToCall,fnParam1,fnParam2);}}
2158var mediaList={youtube:{getID:function(url){var s=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return s!=null?s[1]:null;},thumbUrl:function(id){return'https://img.youtube.com/vi/'+id+'/hqdefault.jpg';},url:function(id){return'https://www.youtube.com/embed/'+id;},markup:function(id){return'<iframe class="nGY2ViewerMedia" src="https://www.youtube.com/embed/'+id+'?rel=0" frameborder="0" allow="autoplay" allowfullscreen></iframe>';},kind:'iframe'},vimeo:{getID:function(url){var s=url.match(/(http|https)?:\/\/(www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|)(\d+)(?:|\/\?)/);return s!=null?s[4]:null;},url:function(id){return'https://player.vimeo.com/video/'+id;},markup:function(id){return'<iframe class="nGY2ViewerMedia" src="https://player.vimeo.com/video/'+id+'" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>';},kind:'iframe'},dailymotion:{getID:function(url){var m=url.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);if(m!==null){if(m[4]!==undefined){return m[4];}
2159return m[2];}
2160return null;},thumbUrl:function(id){return'https://www.dailymotion.com/thumbnail/video/'+id;},url:function(id){return'https://www.dailymotion.com/embed/video/'+id;},markup:function(id){return'<iframe class="nGY2ViewerMedia" src="https://www.dailymotion.com/embed/video/'+id+'?rel=0" frameborder="0" allow="autoplay" allowfullscreen></iframe>';},kind:'iframe'},selfhosted:{getID:function(url){var extension=url.split('.').pop().toLowerCase();var s=(extension==='mp4'||extension==='webm'||extension==='ogv'||extension==='3gp')?extension:null;return s;},markup:function(url){var extension=url.split('.').pop();return'<video controls class="nGY2ViewerMedia"><source src="'+url+'" type="video/'+extension+'" preload="auto">Your browser does not support the video tag (HTML 5).</video>';},kind:'video',selfhosted:true}};function AlbumGetMarkupOrApi(fnToCall,fnParam1,fnParam2){if(G.markupOrApiProcessed===true){DisplayAlbum('-1',0);return;}
2161if(G.O.items!==undefined&&G.O.items!==null){GetContentApiObject();}
2162else{if(G.O.$markup.length>0){GetContentMarkup(G.O.$markup);G.O.$markup=[];}
2163else{NanoConsoleLog(G,'error: no media to process.');return;}}
2164G.markupOrApiProcessed=true;if(fnToCall!==null&&fnToCall!==undefined){fnToCall(fnParam1,fnParam2,null);}}
2165function StartsWithProtocol(path){if(path==undefined){return false;}
2166var pattern=/^((http|https|ftp|ftps|file):\/\/)/;if(!pattern.test(path)){return false;}
2167return true;}
2168function GetContentApiObject(){var foundAlbumID=false;var nbTitles=0;var AlbumPostProcess=NGY2Tools.AlbumPostProcess.bind(G);G.I[0].contentIsLoaded=true;jQuery.each(G.O.items,function(i,item){var title='';title=GetI18nItem(item,'title');if(title===undefined){title='';}
2169var src='';if(item['src'+RetrieveCurWidth().toUpperCase()]!==undefined){src=item['src'+RetrieveCurWidth().toUpperCase()];}
2170else{src=item.src;}
2171if(!StartsWithProtocol(src)){src=G.O.itemsBaseURL+src;}
2172var thumbsrc='';if(item.srct!==undefined&&item.srct.length>0){thumbsrc=item.srct;if(!StartsWithProtocol(thumbsrc)){thumbsrc=G.O.itemsBaseURL+thumbsrc;}}
2173else{thumbsrc=src;}
2174if(G.O.thumbnailLabel.get('title')!=''){title=GetImageTitle(src);}
2175var description='';description=GetI18nItem(item,'description');if(description===undefined){description='';}
2176var tags=GetI18nItem(item,'tags');if(tags===undefined){tags='';}
2177var albumID=0;if(item.albumID!==undefined){albumID=item.albumID;foundAlbumID=true;}
2178var ID=null;if(item.ID!==undefined){ID=item.ID;}
2179var kind='image';if(item.kind!==undefined&&item.kind.length>0){kind=item.kind;}
2180var newItem=NGY2Item.New(G,title,description,ID,albumID,kind,tags);if(title!=''){nbTitles++;}
2181newItem.setMediaURL(src,'img');jQuery.each(mediaList,function(n,media){var id=media.getID(src);if(id!=null){if(thumbsrc==src&&typeof media.thumbUrl=='function'){thumbsrc=media.thumbUrl(id);}
2182if(typeof media.url=='function'){src=media.url(id);}
2183newItem.mediaKind=media.kind;newItem.mediaMarkup=(media.selfhosted)?media.markup(src):media.markup(id);return false;}});if(item.imageWidth!==undefined){newItem.imageWidth=item.width;}
2184if(item.imageHeight!==undefined){newItem.imageHeight=item.height;}
2185var tw=item.imgtWidth!==undefined?item.imgtWidth:0;var th=item.imgtHeight!==undefined?item.imgtHeight:0;newItem.thumbs={url:{l1:{xs:thumbsrc,sm:thumbsrc,me:thumbsrc,la:thumbsrc,xl:thumbsrc},lN:{xs:thumbsrc,sm:thumbsrc,me:thumbsrc,la:thumbsrc,xl:thumbsrc}},width:{l1:{xs:tw,sm:tw,me:tw,la:tw,xl:tw},lN:{xs:tw,sm:tw,me:tw,la:tw,xl:tw}},height:{l1:{xs:th,sm:th,me:th,la:th,xl:th},lN:{xs:th,sm:th,me:th,la:th,xl:th}}};if(newItem.mediaKind=='img'){var lst=['xs','sm','me','la','xl'];for(var i=0;i<lst.length;i++){var turl=item['srct'+lst[i].toUpperCase()];if(turl!==undefined){if(!StartsWithProtocol(turl)){turl=G.O.itemsBaseURL+turl;}
2186newItem.url.l1[lst[i]]=turl;newItem.url.lN[lst[i]]=turl;}
2187var tw=item['imgt'+lst[i].toUpperCase()+'Width'];if(tw!=undefined){newItem.width.l1[lst[i]]=parseInt(tw);newItem.width.lN[lst[i]]=parseInt(tw);}
2188var th=item['imgt'+lst[i].toUpperCase()+'Height'];if(th!=undefined){newItem.height.l1[lst[i]]=parseInt(th);newItem.height.lN[lst[i]]=parseInt(th);}}}
2189if(item.imageDominantColors!==undefined){newItem.imageDominantColors=item.imageDominantColors;}
2190if(item.imageDominantColor!==undefined){newItem.imageDominantColor=item.imageDominantColor;}
2191if(item.destURL!==undefined&&item.destURL.length>0){newItem.destinationURL=item.destURL;}
2192if(item.downloadURL!==undefined&&item.downloadURL.length>0){newItem.downloadURL=item.downloadURL;}
2193if(item.exifModel!==undefined){newItem.exif.model=item.exifModel;}
2194if(item.exifFlash!==undefined){newItem.exif.flash=item.exifFlash;}
2195if(item.exifFocalLength!==undefined){newItem.exif.focallength=item.exifFocalLength;}
2196if(item.exifFStop!==undefined){newItem.exif.fstop=item.exifFStop;}
2197if(item.exifExposure!==undefined){newItem.exif.exposure=item.exifExposure;}
2198if(item.exifIso!==undefined){newItem.exif.iso=item.exifIso;}
2199if(item.exifTime!==undefined){newItem.exif.time=item.exifTime;}
2200if(item.exifLocation!==undefined){newItem.exif.location=item.exifLocation;}
2201if(item.customData!==null){newItem.customData=cloneJSObject(item.customData);}
2202newItem.contentIsLoaded=true;var fu=G.O.fnProcessData;if(fu!==null){typeof fu=='function'?fu(newItem,'api',item):window[fu](newItem,'api',item);}
2203AlbumPostProcess(albumID);});if(nbTitles==0){G.O.thumbnailLabel.display=false;}}
2204function ElementGetText(element){var text='';if(element.childNodes[0]!==undefined){if(element.childNodes[0].nodeValue!==null&&element.childNodes[0].nodeValue!==undefined){text=element.childNodes[0].nodeValue.trim();}}
2205return text;}
2206function GetContentMarkup($elements,group){var foundAlbumID=false;var nbTitles=0;var AlbumPostProcess=NGY2Tools.AlbumPostProcess.bind(G);var GetImageTitleFromURL=NGY2Tools.GetImageTitleFromURL.bind(G);G.I[0].contentIsLoaded=true;jQuery.each($elements,function(i,item){if(item.dataset.nanogallery2Lgroup!=group){return;}
2207if(item.nodeName=='SCRIPT'){return;}
2208var data={'data-ngdesc':'','data-ngid':null,'data-ngkind':'image','data-ngtags':null,'data-ngdest':'','data-ngthumbimgwidth':0,'data-ngthumbimgheight':0,'data-ngimagewidth':0,'data-ngimageheight':0,'data-ngimagedominantcolors':null,'data-ngimagedominantcolor':null,'data-ngexifmodel':'','data-ngexifflash':'','data-ngexiffocallength':'','data-ngexiffstop':'','data-ngexifexposure':'','data-ngexifiso':'','data-ngexiftime':'','data-ngexiflocation':'','data-ngsrc':'','alt':''};[].forEach.call(item.attributes,function(attr){data[attr.name.toLowerCase()]=attr.value.trim();});var title=ElementGetText(item);if(title==''&&data.alt!=''){title=data['alt'];}
2209jQuery.each($(item).children(),function(i,sub_item){if(title==''){title=ElementGetText(sub_item);}
2210[].forEach.call(sub_item.attributes,function(attr){data[attr.name.toLowerCase()]=attr.value.trim();});if(title==''&&data.alt!=''){title=data['alt'];}});var src='',st=RetrieveCurWidth().toUpperCase();if(data.hasOwnProperty('data-ngsrc'+st)){src=data['data-ngsrc'+st];}
2211src=src||data['data-ngsrc']||data['href'];if(src!==undefined&&!StartsWithProtocol(src)){src=G.O.itemsBaseURL+src;}
2212var thumbsrc='';if(data.hasOwnProperty('src')){thumbsrc=data['src'];}
2213if(thumbsrc==''&&data.hasOwnProperty('data-ngthumb')){thumbsrc=data['data-ngthumb'];}
2214if(thumbsrc==''){thumbsrc=src;}
2215if(thumbsrc!==undefined&&!StartsWithProtocol(thumbsrc)){thumbsrc=G.O.itemsBaseURL+thumbsrc;}
2216if(src===undefined&&thumbsrc===undefined){return;}
2217var description=data['data-ngdesc'];var ID=data['id']||data['data-ngid'];var kind=data['data-ngkind'];var tags=data['data-ngtags'];var albumID='0';if(data.hasOwnProperty('data-ngalbumid')){albumID=data['data-ngalbumid'];foundAlbumID=true;}
2218var title_from_url=GetImageTitleFromURL(src);if(title_from_url!=''){title=title_from_url;}
2219var newItem=NGY2Item.New(G,title,description,ID,albumID,kind,tags);if(title!=''){nbTitles++;}
2220newItem.setMediaURL(src,'img');jQuery.each(mediaList,function(n,media){var id=media.getID(src);if(id!=null){if(thumbsrc==src&&typeof media.thumbUrl=='function'){thumbsrc=media.thumbUrl(id);}
2221if(typeof media.url=='function'){src=media.url(id);}
2222newItem.mediaKind=media.kind;newItem.mediaMarkup=(media.selfhosted)?media.markup(src):media.markup(id);return false;}});newItem.imageWidth=parseInt(data['data-ngimagewidth']);newItem.imageHeight=parseInt(data['data-ngimageheight']);var tw=parseInt(data['data-ngthumbimgwidth']);var th=parseInt(data['data-ngthumbimgheight']);newItem.thumbs={url:{l1:{xs:thumbsrc,sm:thumbsrc,me:thumbsrc,la:thumbsrc,xl:thumbsrc},lN:{xs:thumbsrc,sm:thumbsrc,me:thumbsrc,la:thumbsrc,xl:thumbsrc}},width:{l1:{xs:tw,sm:tw,me:tw,la:tw,xl:tw},lN:{xs:tw,sm:tw,me:tw,la:tw,xl:tw}},height:{l1:{xs:th,sm:th,me:th,la:th,xl:th},lN:{xs:th,sm:th,me:th,la:th,xl:th}}};if(newItem.mediaKind=='img'){var lst=['xs','sm','me','la','xl'];for(var i=0;i<lst.length;i++){if(data.hasOwnProperty('data-ngthumb'+lst[i])){var turl=data['data-ngthumb'+lst[i]];if(!StartsWithProtocol(turl)){turl=G.O.itemsBaseURL+turl;}
2223newItem.url.l1[lst[i]]=turl;newItem.url.lN[lst[i]]=turl;}
2224if(data.hasOwnProperty('data-ngthumb'+lst[i]+'width')){var tw=parseInt(data['data-ngthumb'+lst[i]+'width']);newItem.width.l1[lst[i]]=tw;newItem.width.lN[lst[i]]=tw;}
2225if(data.hasOwnProperty('data-ngthumb'+lst[i]+'height')){var th=parseInt('data-ngthumb'+lst[i]+'height');newItem.height.l1[lst[i]]=th;newItem.height.lN[lst[i]]=th;}}}
2226newItem.imageDominantColors=data['data-ngimagedominantcolors'];newItem.imageDominantColor=data['data-ngimagedominantcolors'];newItem.destinationURL=data['data-ngdest'];newItem.downloadURL=data['data-ngdownloadurl'];newItem.exif.model=data['data-ngexifmodel'];newItem.exif.flash=data['data-ngexifflash'];newItem.exif.focallength=data['data-ngexiffocallength'];newItem.exif.fstop=data['data-ngexiffstop'];newItem.exif.exposure=data['data-ngexifexposure'];newItem.exif.iso=data['data-ngexifiso'];newItem.exif.time=data['data-ngexiftime'];newItem.exif.location=data['data-ngexiflocation'];newItem.contentIsLoaded=true;if(jQuery(item).data('customdata')!==undefined){newItem.customData=cloneJSObject(jQuery(item).data('customdata'));}
2227if(jQuery(item).data('ngcustomdata')!==undefined){newItem.customData=cloneJSObject(jQuery(item).data('ngcustomdata'));}
2228var fu=G.O.fnProcessData;if(fu!==null){typeof fu=='function'?fu(newItem,'markup',item):window[fu](newItem,'markup',item);}
2229AlbumPostProcess(albumID);});if(nbTitles==0){G.O.thumbnailLabel.display=false;}}
2230function DefineVariables(){if(G.O.kind.toUpperCase()=='PICASA'||G.O.kind.toUpperCase()=='GOOGLE'){G.O.kind='google2';}
2231G.GOM.cache.viewport=getViewport();G.GOM.curWidth=RetrieveCurWidth();jQuery.extend(true,G.tn.toolbar.image,G.O.thumbnailToolbarImage);jQuery.extend(true,G.tn.toolbar.album,G.O.thumbnailToolbarAlbum);var t=['image','album'];var pos=['topLeft','topRight','bottomLeft','bottomRight']
2232for(var i=0;i<t.length;i++){for(var j=0;j<pos.length;j++){G.tn.toolbar[t[i]][pos[j]]=G.tn.toolbar[t[i]][pos[j]].toUpperCase();}}
2233if(G.O.thumbnailLabel.position=='overImageOnBottom'){G.O.thumbnailLabel.valign='bottom';G.O.thumbnailLabel.position='overImage';}
2234if(G.O.thumbnailLabel.position=='overImageOnMiddle'){G.O.thumbnailLabel.valign='middle';G.O.thumbnailLabel.position='overImage';}
2235if(G.O.thumbnailLabel.position=='overImageOnTop'){G.O.thumbnailLabel.valign='top';G.O.thumbnailLabel.position='overImage';}
2236if(G.O.thumbnailL1Label!==undefined&&G.O.thumbnailL1Label.position!==undefined){if(G.O.thumbnailL1Label.position=='overImageOnBottom'){G.O.thumbnailL1Label.valign='bottom';G.O.thumbnailL1Label.position='overImage';}
2237if(G.O.thumbnailL1Label.position=='overImageOnMiddle'){G.O.thumbnailL1Label.valign='middle';G.O.thumbnailL1Label.position='overImage';}
2238if(G.O.thumbnailL1Label.position=='overImageOnTop'){G.O.thumbnailL1Label.valign='top';G.O.thumbnailL1Label.position='overImage';}}
2239G.O.thumbnailLabel.get=function(opt){if(G.GOM.curNavLevel=='l1'&&G.O.thumbnailL1Label!==undefined&&G.O.thumbnailL1Label[opt]!==undefined){return G.O.thumbnailL1Label[opt];}
2240else{return G.O.thumbnailLabel[opt];}};G.O.thumbnailLabel.set=function(opt,value){if(G.GOM.curNavLevel=='l1'&&G.O.thumbnailL1Label!==undefined&&G.O.thumbnailL1Label[opt]!==undefined){G.O.thumbnailL1Label[opt]=value;}
2241else{G.O.thumbnailLabel[opt]=value;}};if(G.O.blockList!=''){G.blockList=G.O.blockList.toUpperCase().split('|');}
2242if(G.O.allowList!=''){G.allowList=G.O.allowList.toUpperCase().split('|');}
2243if(G.O.albumList2!==undefined&&G.O.albumList2!==null&&G.O.albumList2.constructor===Array){var l=G.O.albumList2.length;for(var i=0;i<l;i++){G.albumList.push(G.O.albumList2[i]);}}
2244if(G.O.albumList2!==undefined&&typeof G.O.albumList2=='string'){G.albumList.push(G.O.albumList2);}
2245G.tn.opt.lN.crop=G.O.thumbnailCrop;G.tn.opt.l1.crop=G.O.thumbnailL1Crop!=null?G.O.thumbnailL1Crop:G.O.thumbnailCrop;function ThumbnailOpt(lN,l1,opt){G.tn.opt.lN[opt]=G.O[lN];G.tn.opt.l1[opt]=G.O[lN];if(toType(G.O[l1])=='number'){G.tn.opt.l1[opt]=G.O[l1];}}
2246ThumbnailOpt('thumbnailStacks','thumbnailL1Stacks','stacks');ThumbnailOpt('thumbnailStacksTranslateX','thumbnailL1StacksTranslateX','stacksTranslateX');ThumbnailOpt('thumbnailStacksTranslateY','thumbnailL1StacksTranslateY','stacksTranslateY');ThumbnailOpt('thumbnailStacksTranslateZ','thumbnailL1StacksTranslateZ','stacksTranslateZ');ThumbnailOpt('thumbnailStacksRotateX','thumbnailL1StacksRotateX','stacksRotateX');ThumbnailOpt('thumbnailStacksRotateY','thumbnailL1StacksRotateY','stacksRotateY');ThumbnailOpt('thumbnailStacksRotateZ','thumbnailL1StacksRotateZ','stacksRotateZ');ThumbnailOpt('thumbnailStacksScale','thumbnailL1StacksScale','stacksScale');ThumbnailOpt('thumbnailBorderHorizontal','thumbnailL1BorderHorizontal','borderHorizontal');ThumbnailOpt('thumbnailBorderVertical','thumbnailL1BorderVertical','borderVertical');ThumbnailOpt('thumbnailBaseGridHeight','thumbnailL1BaseGridHeight','baseGridHeight');function ResponsiveSetSize(setting,level,v){G.tn.settings[setting][level]['xs']=v;G.tn.settings[setting][level]['sm']=v;G.tn.settings[setting][level]['me']=v;G.tn.settings[setting][level]['la']=v;G.tn.settings[setting][level]['xl']=v;}
2247function ResponsiveOption(option,setting,level){var v=G.O[option];if(v===undefined||v===null){return;}
2248if(toType(v)=='number'||v.indexOf(' ')==-1){var vn='auto';if(v!='auto'){vn=parseInt(v);}
2249ResponsiveSetSize(setting,level,vn);}
2250else{var sp=v.split(' ');if(sp.length>0&&+sp[0]===+sp[0]){var vn='auto';if(sp[0]!='auto'){vn=parseInt(sp[0]);}
2251ResponsiveSetSize(setting,level,vn);}
2252for(var i=1;i<sp.length;i++){if(/^xs|sm|me|la|xl/i.test(sp[i])){var wi=sp[i].substring(0,2).toLowerCase();var va=sp[i].substring(2);var vn='auto';if(va!='auto'){vn=parseInt(va);}
2253G.tn.settings[setting][level][wi]=vn;}}}}
2254ResponsiveOption('thumbnailGutterWidth','gutterWidth','lN');ResponsiveOption('thumbnailGutterWidth','gutterWidth','l1');ResponsiveOption('thumbnailL1GutterWidth','gutterWidth','l1');ResponsiveOption('thumbnailGutterHeight','gutterHeight','lN');ResponsiveOption('thumbnailGutterHeight','gutterHeight','l1');ResponsiveOption('thumbnailL1GutterHeight','gutterHeight','l1');G.galleryDisplayMode.lN=G.O.galleryDisplayMode.toUpperCase();G.galleryDisplayMode.l1=G.O.galleryL1DisplayMode!=null?G.O.galleryL1DisplayMode.toUpperCase():G.O.galleryDisplayMode.toUpperCase();G.galleryMaxRows.lN=G.O.galleryMaxRows;G.galleryMaxRows.l1=toType(G.O.galleryL1MaxRows)=='number'?G.O.galleryL1MaxRows:G.O.galleryMaxRows;G.galleryLastRowFull.lN=G.O.galleryLastRowFull;G.galleryLastRowFull.l1=G.O.galleryL1LastRowFull!=null?G.O.galleryL1LastRowFull:G.O.galleryLastRowFull;G.gallerySorting.lN=G.O.gallerySorting.toUpperCase();G.gallerySorting.l1=G.O.galleryL1Sorting!=null?G.O.galleryL1Sorting.toUpperCase():G.gallerySorting.lN;G.galleryDisplayTransition.lN=G.O.galleryDisplayTransition.toUpperCase();G.galleryDisplayTransition.l1=G.O.galleryL1DisplayTransition!=null?G.O.galleryL1DisplayTransition.toUpperCase():G.galleryDisplayTransition.lN;G.galleryDisplayTransitionDuration.lN=G.O.galleryDisplayTransitionDuration;G.galleryDisplayTransitionDuration.l1=G.O.galleryL1DisplayTransitionDuration!=null?G.O.galleryL1DisplayTransitionDuration:G.galleryDisplayTransitionDuration.lN;G.galleryMaxItems.lN=G.O.galleryMaxItems;G.galleryMaxItems.l1=toType(G.O.galleryL1MaxItems)=='number'?G.O.galleryL1MaxItems:G.O.galleryMaxItems;G.galleryFilterTags.lN=G.O.galleryFilterTags;G.galleryFilterTags.l1=G.O.galleryL1FilterTags!=null?G.O.galleryL1FilterTags:G.O.galleryFilterTags;G.galleryFilterTagsMode.lN=G.O.galleryFilterTagsMode;G.galleryFilterTagsMode.l1=G.O.galleryL1FilterTagsMode!=null?G.O.galleryL1FilterTagsMode:G.O.galleryFilterTagsMode;G.O.galleryPaginationMode=G.O.galleryPaginationMode.toUpperCase();if(toType(G.O.slideshowDelay)=='number'&&G.O.slideshowDelay>=2000){G.VOM.slideshowDelay=G.O.slideshowDelay;}
2255else{NanoConsoleLog(G,'Parameter "slideshowDelay" must be an integer >= 2000 ms.');}
2256if(typeof G.O.thumbnailDisplayTransition=='boolean'){if(G.O.thumbnailDisplayTransition===true){G.tn.opt.lN.displayTransition='FADEIN';G.tn.opt.l1.displayTransition='FADEIN';}
2257else{G.tn.opt.lN.displayTransition='NONE';G.tn.opt.l1.displayTransition='NONE';}}
2258if(G.O.fnThumbnailDisplayEffect!==''){G.tn.opt.lN.displayTransition='CUSTOM';G.tn.opt.l1.displayTransition='CUSTOM';}
2259if(G.O.fnThumbnailL1DisplayEffect!==''){G.tn.opt.l1.displayTransition='CUSTOM';}
2260ThumbnailOpt('thumbnailDisplayTransitionEasing','thumbnailL1DisplayTransitionEasing','displayTransitionEasing');function thumbnailDisplayTransitionParse(cfg,level){if(typeof cfg=='string'){var st=cfg.split('_');if(st.length==1){G.tn.opt[level]['displayTransition']=cfg.toUpperCase();}
2261if(st.length==2){G.tn.opt[level]['displayTransition']=st[0].toUpperCase();G.tn.opt[level]['displayTransitionStartVal']=Number(st[1]);}
2262if(st.length==3){G.tn.opt[level]['displayTransition']=st[0].toUpperCase();G.tn.opt[level]['displayTransitionStartVal']=Number(st[1]);G.tn.opt[level]['displayTransitionEasing']=st[2];}}}
2263thumbnailDisplayTransitionParse(G.O.thumbnailDisplayTransition,'lN');thumbnailDisplayTransitionParse(G.O.thumbnailDisplayTransition,'l1');thumbnailDisplayTransitionParse(G.O.thumbnailL1DisplayTransition,'l1');ThumbnailOpt('thumbnailDisplayTransitionDuration','thumbnailL1DisplayTransitionDuration','displayTransitionDuration');ThumbnailOpt('thumbnailDisplayInterval','thumbnailL1DisplayInterval','displayInterval');ThumbnailOpt('thumbnailDisplayOrder','thumbnailL1DisplayOrder','displayOrder');if(G.O.thumbnailSizeSM!==undefined){G.O.breakpointSizeSM=G.O.thumbnailSizeSM;}
2264if(G.O.thumbnailSizeME!==undefined){G.O.breakpointSizeME=G.O.thumbnailSizeME;}
2265if(G.O.thumbnailSizeLA!==undefined){G.O.breakpointSizeLA=G.O.thumbnailSizeLA;}
2266if(G.O.thumbnailSizeXL!==undefined){G.O.breakpointSizeXL=G.O.thumbnailSizeXL;}
2267if(G.O.thumbnailL1BuildInit2!==undefined){var t1=G.O.thumbnailL1BuildInit2.split('|');for(var i=0;i<t1.length;i++){var o1=t1[i].trim().split('_');if(o1.length==3){var i1=NewTBuildInit();i1.element=ThumbnailOverEffectsGetCSSElement(o1[0],'');i1.property=o1[1];i1.value=o1[2];G.tn.buildInit.level1.push(i1);}}}
2268if(G.O.thumbnailBuildInit2!==undefined){var t1=G.O.thumbnailBuildInit2.split('|');for(var i=0;i<t1.length;i++){var o1=t1[i].trim().split('_');if(o1.length==3){var i1=NewTBuildInit();i1.element=ThumbnailOverEffectsGetCSSElement(o1[0],'');i1.property=o1[1];i1.value=o1[2];G.tn.buildInit.std.push(i1);}}}
2269var tL1HE=G.O.thumbnailL1HoverEffect2;if(tL1HE!==undefined){switch(toType(tL1HE)){case'string':{let tmp=tL1HE.split('|');for(var i=0;i<tmp.length;i++){let oDef=NewTHoverEffect();oDef=ThumbnailHoverEffectExtract(tmp[i].trim(),oDef);if(oDef!=null){G.tn.hoverEffects.level1.push(oDef);}}
2270break;}
2271case'object':{let oDef=NewTHoverEffect();oDef=jQuery.extend(oDef,tL1HE);oDef=ThumbnailHoverEffectExtract(oDef.name,oDef);if(oDef!=null){G.tn.hoverEffects.level1.push(oDef);}
2272break;}
2273case'array':{for(var i=0;i<tL1HE.length;i++){let oDef=NewTHoverEffect();oDef=jQuery.extend(oDef,tL1HE[i]);oDef=ThumbnailHoverEffectExtract(oDef.name,oDef);if(oDef!=null){G.tn.hoverEffects.level1.push(oDef);}}
2274break;}
2275case'null':break;default:NanoAlert(G,'incorrect parameter for "thumbnailL1HoverEffect2".');}}
2276G.tn.hoverEffects.level1=ThumbnailOverEffectsPreset(G.tn.hoverEffects.level1);var tHE=G.O.thumbnailHoverEffect2;switch(toType(tHE)){case'string':{let tmp=tHE.split('|');for(var i=0;i<tmp.length;i++){let oDef=NewTHoverEffect();oDef=ThumbnailHoverEffectExtract(tmp[i].trim(),oDef);if(oDef!=null){G.tn.hoverEffects.std.push(oDef);}}
2277break;}
2278case'object':{let oDef=NewTHoverEffect();oDef=jQuery.extend(oDef,tHE);oDef=ThumbnailHoverEffectExtract(oDef.name,oDef);if(oDef!=null){G.tn.hoverEffects.std.push(oDef);}
2279break;}
2280case'array':{for(var i=0;i<tHE.length;i++){let oDef=NewTHoverEffect();oDef=jQuery.extend(oDef,tHE[i]);oDef=ThumbnailHoverEffectExtract(oDef.name,oDef);if(oDef!=null){G.tn.hoverEffects.std.push(oDef);}}
2281break;}
2282case'null':break;default:NanoAlert(G,'incorrect parameter for "thumbnailHoverEffect2".');}
2283G.tn.hoverEffects.std=ThumbnailOverEffectsPreset(G.tn.hoverEffects.std);if(G.O.touchAnimationL1==undefined){G.O.touchAnimationL1=G.O.touchAnimation;}
2284if(G.tn.hoverEffects.std.length==0){if(G.tn.hoverEffects.level1.length==0){G.O.touchAnimationL1=false;}
2285G.O.touchAnimation=false;}
2286if(G.O.thumbnailHeight==0||G.O.thumbnailHeight==''){G.O.thumbnailHeight='auto';}
2287if(G.O.thumbnailWidth==0||G.O.thumbnailWidth==''){G.O.thumbnailWidth='auto';}
2288if(G.O.thumbnailL1Height==0||G.O.thumbnailL1Height==''){G.O.thumbnailL1Height='auto';}
2289if(G.O.thumbnailL1Width==0||G.O.thumbnailL1Width==''){G.O.thumbnailL1Width='auto';}
2290ResponsiveOption('thumbnailWidth','width','lN');ResponsiveOption('thumbnailWidth','width','l1');ResponsiveOption('thumbnailL1Width','width','l1');ResponsiveOption('thumbnailHeight','height','lN');ResponsiveOption('thumbnailHeight','height','l1');ResponsiveOption('thumbnailL1Height','height','l1');G.O.thumbnailLabelHeight=parseInt(G.O.thumbnailLabelHeight);if(G.O.galleryMosaic!=undefined){G.tn.settings.mosaic.l1.xs=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.l1.sm=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.l1.me=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.l1.la=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.l1.xl=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.lN.xs=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.lN.sm=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.lN.me=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.lN.la=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaic.lN.xl=JSON.parse(JSON.stringify(G.O.galleryMosaic));G.tn.settings.mosaicCalcFactor('l1','xs');G.tn.settings.mosaicCalcFactor('l1','sm');G.tn.settings.mosaicCalcFactor('l1','me');G.tn.settings.mosaicCalcFactor('l1','la');G.tn.settings.mosaicCalcFactor('l1','xl');G.tn.settings.mosaicCalcFactor('lN','xs');G.tn.settings.mosaicCalcFactor('lN','sm');G.tn.settings.mosaicCalcFactor('lN','me');G.tn.settings.mosaicCalcFactor('lN','la');G.tn.settings.mosaicCalcFactor('lN','xl');}
2291if(G.O.galleryL1Mosaic!=undefined){G.tn.settings.mosaic.l1.xs=JSON.parse(JSON.stringify(G.O.galleryL1Mosaic));G.tn.settings.mosaic.l1.sm=JSON.parse(JSON.stringify(G.O.galleryL1Mosaic));G.tn.settings.mosaic.l1.me=JSON.parse(JSON.stringify(G.O.galleryL1Mosaic));G.tn.settings.mosaic.l1.la=JSON.parse(JSON.stringify(G.O.galleryL1Mosaic));G.tn.settings.mosaic.l1.xl=JSON.parse(JSON.stringify(G.O.galleryL1Mosaic));G.tn.settings.mosaicCalcFactor('l1','xs');G.tn.settings.mosaicCalcFactor('l1','sm');G.tn.settings.mosaicCalcFactor('l1','me');G.tn.settings.mosaicCalcFactor('l1','la');G.tn.settings.mosaicCalcFactor('l1','xl');}
2292var lst=['xs','sm','me','la','xl'];for(var w=0;w<lst.length;w++){if(G.O['galleryMosaic'+lst[w].toUpperCase()]!=undefined){G.tn.settings.mosaic.lN[lst[w]]=JSON.parse(JSON.stringify(G.O['galleryMosaic'+lst[w].toUpperCase()]));G.tn.settings.mosaic.l1[lst[w]]=JSON.parse(JSON.stringify(G.O['galleryMosaic'+lst[w].toUpperCase()]));G.tn.settings.mosaicCalcFactor('lN',lst[w]);G.tn.settings.mosaicCalcFactor('l1',lst[w]);}}
2293for(var w=0;w<lst.length;w++){if(G.O['galleryL1Mosaic'+lst[w].toUpperCase()]!=undefined){G.tn.settings.mosaic.l1[lst[w]]=JSON.parse(JSON.stringify(G.O['galleryL1Mosaic'+lst[w].toUpperCase()]));G.tn.settings.mosaicCalcFactor('l1',lst[w]);}}
2294G.O.imageTransition=G.O.imageTransition.toUpperCase();G.layout.SetEngine();switch(G.O.kind){case'':break;default:jQuery.nanogallery2['data_'+G.O.kind](G,'Init');}}
2295function ThumbnailHoverEffectExtract(name,effect){var easings=['easeInQuad','easeOutQuad','easeInOutQuad','easeInCubic','easeOutCubic','easeInOutCubic','easeInQuart','easeOutQuart','easeInOutQuart','easeInQuint','easeOutQuint','easeInOutQuint','easeInSine','easeOutSine','easeInOutSine','easeInExpo','easeOutExpo','easeInOutExpo','easeInCirc','easeOutCirc','easeInOutCirc','easeOutBounce','easeInBack','easeOutBack','easeInOutBack','elastic','bounce'];var sp=name.split('_');if(sp.length>=4){effect.name='';effect.type=sp[1];effect.from=sp[2];effect.to=sp[3];if(sp.length>=5){for(var n=4;n<sp.length;n++){var v=sp[n];var foundEasing=false;for(var e=0;e<easings.length;e++){if(v==easings[e]){foundEasing=true;effect.easing=v;break;}}
2296if(foundEasing===true){continue;}
2297v=v.toUpperCase();if(v=='HOVERIN'){effect.hoverout=false;continue;}
2298if(v=='HOVEROUT'){effect.hoverin=false;continue;}
2299if(v=='KEYFRAME'){effect.firstKeyframe=false;continue;}
2300var num=parseInt(v.replace(/[^0-9\.]/g,''),10);if(num>0){if(v.indexOf('DURATION')>=0){effect.duration=num;continue;}
2301if(v.indexOf('DURATIONBACK')>=0){effect.durationBack=num;continue;}
2302if(v.indexOf('DELAY')>=0){effect.delay=num;continue;}
2303if(v.indexOf('DELAYBACK')>=0){effect.delayBack=num;continue;}
2304effect.duration=num;}}}
2305effect.element=ThumbnailOverEffectsGetCSSElement(sp[0],effect.type);}
2306else{effect.name=name;}
2307return effect;}
2308function ThumbnailOverEffectsGetCSSElement(element,property){var elts={'image':'.nGY2GThumbnailImage','thumbnail':'.nGY2GThumbnail','label':'.nGY2GThumbnailLabel','title':'.nGY2GThumbnailTitle','description':'.nGY2GThumbnailDescription','tools':'.nGY2GThumbnailIcons','customlayer':'.nGY2GThumbnailCustomLayer','default':'nGY2GThumbnailImage'};return(elts[element]||elts['default']);}
2309function ThumbnailOverEffectsPreset(effects){var newEffects=[];for(var i=0;i<effects.length;i++){switch(effects[i].name.toUpperCase()){case'BORDERLIGHTER':{let rgb=ColorHelperToRGB(GalleryThemeGetCurrent().thumbnail.borderColor);let name='thumbnail_borderColor_'+rgb+'_'+ShadeBlendConvert(0.5,rgb);newEffects.push(ThumbnailHoverEffectExtract(name,effects[i]));break;}
2310case'BORDERDARKER':{let rgb=ColorHelperToRGB(GalleryThemeGetCurrent().thumbnail.borderColor);let name='thumbnail_borderColor_'+rgb+'_'+ShadeBlendConvert(-0.5,rgb);newEffects.push(ThumbnailHoverEffectExtract(name,effects[i]));break;}
2311case'SCALE120':newEffects.push(ThumbnailHoverEffectExtract('thumbnail_scale_1.00_1.20',effects[i]));break;case'LABELAPPEAR':case'LABELAPPEAR75':newEffects.push(ThumbnailHoverEffectExtract('label_opacity_0.00_1.00',effects[i]));break;case'TOOLSAPPEAR':newEffects.push(ThumbnailHoverEffectExtract('tools_opacity_0_1',effects[i]));break;case'TOOLSSLIDEDOWN':newEffects.push(ThumbnailHoverEffectExtract('tools_translateY_-100%_0%',effects[i]));break;case'TOOLSSLIDEUP':newEffects.push(ThumbnailHoverEffectExtract('tools_translateY_100%_0%',effects[i]));break;case'LABELOPACITY50':newEffects.push(ThumbnailHoverEffectExtract('label_opacity_1.00_0.50',effects[i]));break;case'LABELSLIDEUPTOP':case'LABELSLIDEUP':newEffects.push(ThumbnailHoverEffectExtract('label_translateY_100%_0%',effects[i]));newEffects.push(ThumbnailHoverEffectExtract('label_translateY_100%_0%',effects[i]));break;case'LABELSLIDEDOWN':newEffects.push(ThumbnailHoverEffectExtract('label_translateY_-100%_0%',effects[i]));break;case'SCALELABELOVERIMAGE':newEffects.push(ThumbnailHoverEffectExtract('label_scale_0.00_1.00',effects[i]));var n=cloneJSObject(effects[i]);newEffects.push(ThumbnailHoverEffectExtract('image_scale_1.00_0.00',n));break;case'OVERSCALE':case'OVERSCALEOUTSIDE':newEffects.push(ThumbnailHoverEffectExtract('label_scale_2.00_1.00',effects[i]));var n=cloneJSObject(effects[i]);newEffects.push(ThumbnailHoverEffectExtract('label_opacity_0.00_1.00',n));n=cloneJSObject(effects[i]);newEffects.push(ThumbnailHoverEffectExtract('image_scale_1.00_0.00',n));n=cloneJSObject(effects[i]);newEffects.push(ThumbnailHoverEffectExtract('image_opacity_1.00_0.00',n));break;case'DESCRIPTIONAPPEAR':newEffects.push(ThumbnailHoverEffectExtract('description_opacity_0_1',effects[i]));break;case'SLIDERIGHT':newEffects.push(ThumbnailHoverEffectExtract('image_translateX_0%_100%',effects[i]));newEffects.push(ThumbnailHoverEffectExtract('label_translateX_-100%_0%',cloneJSObject(effects[i])));break;case'SLIDELEFT':newEffects.push(ThumbnailHoverEffectExtract('image_translateX_0%_-100%',effects[i]));newEffects.push(ThumbnailHoverEffectExtract('label_translateX_100%_0%',cloneJSObject(effects[i])));break;case'SLIDEUP':newEffects.push(ThumbnailHoverEffectExtract('image_translateY_0%_-100%',effects[i]));newEffects.push(ThumbnailHoverEffectExtract('label_translateY_100%_0%',cloneJSObject(effects[i])));break;case'SLIDEDOWN':newEffects.push(ThumbnailHoverEffectExtract('image_translateY_0%_100%',effects[i]));newEffects.push(ThumbnailHoverEffectExtract('label_translateY_-100%_0%',cloneJSObject(effects[i])));break;case'IMAGESCALE150':case'IMAGESCALE150OUTSIDE':newEffects.push(ThumbnailHoverEffectExtract('image_scale_1.00_1.50',effects[i]));break;case'IMAGESCALEIN80':newEffects.push(ThumbnailHoverEffectExtract('image_scale_1.20_1.00',effects[i]));break;case'IMAGESLIDERIGHT':newEffects.push(ThumbnailHoverEffectExtract('image_translateX_0%_100%',effects[i]));break;case'IMAGESLIDELEFT':newEffects.push(ThumbnailHoverEffectExtract('image_translateX_0%_-100%',effects[i]));break;case'IMAGESLIDEUP':newEffects.push(ThumbnailHoverEffectExtract('image_translateY_0%_-100%',effects[i]));break;case'IMAGESLIDEDOWN':newEffects.push(ThumbnailHoverEffectExtract('image_translateY_0%_100%',effects[i]));break;case'LABELSLIDEUPDOWN':newEffects.push(ThumbnailHoverEffectExtract('label_translateY_0%_100%',effects[i]));break;case'DESCRIPTIONSLIDEUP':newEffects.push(ThumbnailHoverEffectExtract('description_translateY_110%_0%',effects[i]));break;case'IMAGEBLURON':newEffects.push(ThumbnailHoverEffectExtract('image_blur_2.00px_0.00px',effects[i]));break;case'IMAGEBLUROFF':newEffects.push(ThumbnailHoverEffectExtract('image_blur_0.00px_2.00px',effects[i]));break;case'IMAGEGRAYON':newEffects.push(ThumbnailHoverEffectExtract('image_grayscale_0%_100%',effects[i]));break;case'IMAGEGRAYOFF':newEffects.push(ThumbnailHoverEffectExtract('image_grayscale_100%_0%',effects[i]));break;case'IMAGESEPIAON':newEffects.push(ThumbnailHoverEffectExtract('image_sepia_100%_1%',effects[i]));break;case'IMAGESEPIAOFF':newEffects.push(ThumbnailHoverEffectExtract('image_sepia_1%_100%',effects[i]));break;default:newEffects.push(effects[i]);break;}}
2312return newEffects;}
2313function NewTHoverEffect(){var oDef={name:'',element:'',type:'',from:'',to:'',hoverin:true,hoverout:true,firstKeyframe:true,delay:0,delayBack:0,duration:400,durationBack:300,easing:'easeOutQuart',easingBack:'easeOutQuart',animParam:null};return oDef;}
2314function NewTBuildInit(){var oDef={element:'',property:'',value:''};return oDef;}
2315function ThumbnailStyle(cfg,level){switch(cfg.position){case'onBottom':G.tn.style[level]['label']='bottom:0; ';break;case'right':switch(cfg.valign){case'top':G.tn.style[level]['label']='top:0; position:absolute; left: 50%;';break;case'middle':G.tn.style[level]['label']='top:0; bottom:0; left: 50%;';G.tn.style[level]['title']='position:absolute; bottom:50%;';G.tn.style[level]['desc']='position:absolute; top:50%;';break;case'bottom':default:G.tn.style[level].label='bottom:0; position:absolute; left: 50%;';G.tn.style[level].title='position:absolute;bottom:0;';break;}
2316break;case'custom':break;default:case'overImage':switch(cfg.valign){case'top':G.tn.style[level]['label']='top:0; position:absolute;';break;case'middle':G.tn.style[level]['label']='top:0; bottom:0;';G.tn.style[level]['title']='position:absolute; bottom:50%;';G.tn.style[level]['desc']='position:absolute; top:50%;';break;case'bottom':default:G.tn.style[level].label='bottom:0; position:absolute;';break;}}
2317if(cfg.position!='onBottom'){if(cfg.titleMultiLine){G.tn.style[level]['title']+='white-space:normal;';}
2318if(cfg.descriptionMultiLine){G.tn.style[level]['desc']+='white-space:normal;';}}
2319switch(cfg.align){case'right':G.tn.style[level].label+='text-align:right;';break;case'left':G.tn.style[level].label+='text-align:left;';break;default:G.tn.style[level].label+='text-align:center;';break;}
2320if(cfg.titleFontSize!=undefined&&cfg.titleFontSize!=''){G.tn.style[level].title+='font-size:'+cfg.titleFontSize+';';}
2321if(cfg.descriptionFontSize!=undefined&&cfg.descriptionFontSize!=''){G.tn.style[level].desc+='font-size:'+cfg.descriptionFontSize+';';}
2322if(cfg.displayDescription==false){G.tn.style[level].desc+='display:none;';}}
2323function ThumbnailDefCaches(){ThumbnailStyle(G.O.thumbnailLabel,'lN');if(G.O.thumbnailL1Label!==undefined){ThumbnailStyle(G.O.thumbnailL1Label,'l1');}
2324else{ThumbnailStyle(G.O.thumbnailLabel,'l1');}
2325if(G.O.thumbnailL1Label&&G.O.thumbnailL1Label.display){ThumbnailStyle(G.O.thumbnailL1Label,'l1');}
2326var lst=['xs','sm','me','la','xl'];for(var i=0;i<lst.length;i++){var w=G.tn.settings.width.lN[lst[i]];if(w!='auto'){G.tn.defaultSize.width.lN[lst[i]]=w;G.tn.defaultSize.width.l1[lst[i]]=w;}
2327else{var h=G.tn.settings.height.lN[lst[i]];G.tn.defaultSize.width.lN[lst[i]]=h;G.tn.defaultSize.width.l1[lst[i]]=h;}}
2328for(var i=0;i<lst.length;i++){var h=G.tn.settings.height.lN[lst[i]];if(h!='auto'){G.tn.defaultSize.height.lN[lst[i]]=h;G.tn.defaultSize.height.l1[lst[i]]=h;}
2329else{var w=G.tn.settings.width.lN[lst[i]];G.tn.defaultSize.height.lN[lst[i]]=w;G.tn.defaultSize.height.l1[lst[i]]=w;}}
2330for(var i=0;i<lst.length;i++){var w=G.tn.settings.width.l1[lst[i]];if(w!='auto'){G.tn.defaultSize.width.l1[lst[i]]=w;}
2331else{var h=G.tn.settings.height.l1[lst[i]];G.tn.defaultSize.width.l1[lst[i]]=h;}}
2332for(var i=0;i<lst.length;i++){var h=G.tn.settings.height.l1[lst[i]];if(h!='auto'){G.tn.defaultSize.height.l1[lst[i]]=h;}
2333else{var w=G.tn.settings.width.l1[lst[i]];G.tn.defaultSize.height.l1[lst[i]]=w;}}}
2334function GalleryThemeGetCurrent(){var cs=null;switch(toType(G.O.galleryTheme)){case'object':cs=G.galleryTheme_dark;jQuery.extend(true,cs,G.O.galleryTheme);break;case'string':switch(G.O.galleryTheme){case'light':cs=G.galleryTheme_light;break;case'default':case'dark':case'none':default:cs=G.galleryTheme_dark;}
2335break;default:cs=G.galleryTheme_dark;}
2336return cs;}
2337function SetGalleryTheme(){if(typeof G.O.colorScheme!=='undefined'){G.O.galleryTheme=G.O.colorScheme;}
2338var cs=null;var galleryTheme='';switch(toType(G.O.galleryTheme)){case'object':cs=G.galleryTheme_dark;jQuery.extend(true,cs,G.O.galleryTheme);galleryTheme='nanogallery_gallerytheme_custom_'+G.baseEltID;break;case'string':switch(G.O.galleryTheme){case'light':cs=G.galleryTheme_light;galleryTheme='nanogallery_gallerytheme_light_'+G.baseEltID;break;case'default':case'dark':case'none':default:cs=G.galleryTheme_dark;galleryTheme='nanogallery_gallerytheme_dark_'+G.baseEltID;}
2339break;default:NanoAlert(G,'Error in galleryTheme parameter.');return;}
2340var s1='.'+galleryTheme+' ';var c=cs.navigationBar;var s=s1+'.nGY2Navigationbar { background:'+c.background+'; }'+'\n';if(c.border!==undefined&&c.border!==''){s+=s1+'.nGY2Navigationbar { border:'+c.border+'; }'+'\n';}
2341if(c.borderTop!==undefined&&c.borderTop!==''){s+=s1+'.nGY2Navigationbar { border-top:'+c.borderTop+'; }'+'\n';}
2342if(c.borderBottom!==undefined&&c.borderBottom!==''){s+=s1+'.nGY2Navigationbar { border-bottom:'+c.borderBottom+'; }'+'\n';}
2343if(c.borderRight!==undefined&&c.borderRight!==''){s+=s1+'.nGY2Navigationbar { border-right:'+c.borderRight+'; }'+'\n';}
2344if(c.borderLeft!==undefined&&c.borderLeft!==''){s+=s1+'.nGY2Navigationbar { border-left:'+c.borderLeft+'; }'+'\n';}
2345var c=cs.navigationBreadcrumb;s+=s1+'.nGY2Breadcrumb { background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';s+=s1+'.nGY2Breadcrumb .oneItem  { color:'+c.color+'; }'+'\n';s+=s1+'.nGY2Breadcrumb .oneItem:hover { color:'+c.colorHover+'; }'+'\n';var c=cs.navigationFilter;s+=s1+'.nGY2NavFilterUnselected { color:'+c.color+'; background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';s+=s1+'.nGY2NavFilterSelected { color:'+c.colorSelected+'; background:'+c.backgroundSelected+'; border-radius:'+c.borderRadius+'; }'+'\n';s+=s1+'.nGY2NavFilterSelectAll { color:'+c.colorSelected+'; background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';var c=cs.navigationPagination;s+=s1+'.nGY2NavPagination { color:'+c.color+'; background:'+c.background+'; border-radius:'+c.borderRadius+'; }'+'\n';s+=s1+'.nGY2NavPagination:hover { color:'+c.colorHover+'; }'+'\n';var c=cs.thumbnail;s+=s1+'.nGY2GThumbnail { border-radius: '+c.borderRadius+'; background:'+c.background+'; border-color:'+c.borderColor+'; }'+'\n';s+=s1+'.nGY2GThumbnail_l1 { border-top-width:'+G.tn.opt.l1.borderVertical+'px; border-right-width:'+G.tn.opt.l1.borderHorizontal+'px; border-bottom-width:'+G.tn.opt.l1.borderVertical+'px; border-left-width:'+G.tn.opt.l1.borderHorizontal+'px;}'+'\n';s+=s1+'.nGY2GThumbnail_lN { border-top-width:'+G.tn.opt.lN.borderVertical+'px; border-right-width:'+G.tn.opt.lN.borderHorizontal+'px; border-bottom-width:'+G.tn.opt.lN.borderVertical+'px; border-left-width:'+G.tn.opt.lN.borderHorizontal+'px;}'+'\n';s+=s1+'.nGY2GThumbnailStack { background:'+c.stackBackground+'; }'+'\n';s+=s1+'.nGY2TnImgBack { background:'+c.background+'; background-image:'+c.backgroundImage+'; }'+'\n';s+=s1+'.nGY2GThumbnailAlbumUp { background:'+c.background+'; background-image:'+c.backgroundImage+'; color:'+cs.thumbnail.titleColor+'; }'+'\n';s+=s1+'.nGY2GThumbnailIconsFullThumbnail { color:'+c.titleColor+'; }\n';s+=s1+'.nGY2GThumbnailLabel { background:'+c.labelBackground+'; opacity:'+c.labelOpacity+'; }'+'\n';s+=s1+'.nGY2GThumbnailImageTitle  { color:'+c.titleColor+'; background-color:'+c.titleBgColor+'; '+(c.titleShadow==''?'':'Text-Shadow:'+c.titleShadow+';')+' }'+'\n';s+=s1+'.nGY2GThumbnailAlbumTitle { color:'+c.titleColor+'; background-color:'+c.titleBgColor+'; '+(c.titleShadow==''?'':'Text-Shadow:'+c.titleShadow+';')+' }'+'\n';s+=s1+'.nGY2GThumbnailDescription { color:'+c.descriptionColor+'; background-color:'+c.descriptionBgColor+'; '+(c.descriptionShadow==''?'':'Text-Shadow:'+c.descriptionShadow+';')+' }'+'\n';var c=cs.thumbnailIcon;s+=s1+'.nGY2GThumbnailIcons { padding:'+c.padding+'; }\n';s+=s1+'.nGY2GThumbnailIcon { color:'+c.color+'; '+(c.shadow==''?'':'Text-Shadow:'+c.shadow+';')+' }\n';s+=s1+'.nGY2GThumbnailIconTextBadge { background-color:'+c.color+'; }\n';var c=cs.pagination;if(G.O.galleryPaginationMode!='NUMBERS'){s+=s1+'.nGY2paginationDot { border:'+c.shapeBorder+'; background:'+c.shapeColor+';}\n';s+=s1+'.nGY2paginationDotCurrentPage { border:'+c.shapeBorder+'; background:'+c.shapeSelectedColor+';}\n';s+=s1+'.nGY2paginationRectangle { border:'+c.shapeBorder+'; background:'+c.shapeColor+';}\n';s+=s1+'.nGY2paginationRectangleCurrentPage { border:'+c.shapeBorder+'; background:'+c.shapeSelectedColor+';}\n';}else{s+=s1+'.nGY2paginationItem { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';s+=s1+'.nGY2paginationItemCurrentPage { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';s+=s1+'.nGY2PaginationPrev { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';s+=s1+'.nGY2PaginationNext { background:'+c.background+'; color:'+c.color+'; border-radius:'+c.borderRadius+'; }\n';s+=s1+'.nGY2paginationItemCurrentPage { background:'+c.backgroundSelected+'; }\n';}
2346var c=cs.thumbnail;s+=s1+'.nGY2GalleryMoreButtonAnnotation { background:'+c.background+'; border-color:'+c.borderColor+'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;}\n';s+=s1+'.nGY2GalleryMoreButtonAnnotation  { color:'+c.titleColor+'; '+(c.titleShadow==''?'':'Text-Shadow:'+c.titleShadow)+'; }\n';jQuery('head').append('<style id="ngycs_'+G.baseEltID+'">'+s+'</style>');G.$E.base.addClass(galleryTheme);};function SetViewerTheme(){if(G.VOM.viewerTheme!=''){G.VOM.$baseCont.addClass(G.VOM.viewerTheme);return;}
2347if(typeof G.O.colorSchemeViewer!=='undefined'){G.O.viewerTheme=G.O.colorSchemeViewer;}
2348var cs=null;switch(toType(G.O.viewerTheme)){case'object':cs=G.viewerTheme_dark;jQuery.extend(true,cs,G.O.viewerTheme);G.VOM.viewerTheme='nanogallery_viewertheme_custom_'+G.baseEltID;break;case'string':switch(G.O.viewerTheme){case'none':return;break;case'light':cs=G.viewerTheme_light;G.VOM.viewerTheme='nanogallery_viewertheme_light_'+G.baseEltID;break;case'dark':case'default':cs=G.viewerTheme_dark;G.VOM.viewerTheme='nanogallery_viewertheme_dark_'+G.baseEltID;break;}
2349break;default:NanoAlert(G,'Error in viewerTheme parameter.');return;}
2350var s1='.'+G.VOM.viewerTheme+' ';var s=s1+'.nGY2Viewer { background:'+cs.background+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbarBackground { background:'+cs.barBackground+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbar { border:'+cs.barBorder+'; color:'+cs.barColor+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbar .previousButton:after { color:'+cs.barColor+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbar .nextButton:after { color:'+cs.barColor+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbar .closeButton:after { color:'+cs.barColor+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbar .label .title { color:'+cs.barColor+'; }'+'\n';s+=s1+'.nGY2Viewer .toolbar .label .description { color:'+cs.barDescriptionColor+'; }'+'\n';jQuery('head').append('<style>'+s+'</style>');G.VOM.$baseCont.addClass(G.VOM.viewerTheme);};function SetPolyFills(){if(!Function.prototype.bind){Function.prototype.bind=function(oThis){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");}
2351var aArgs=Array.prototype.slice.call(arguments,1),fToBind=this,fNOP=function(){},fBound=function(){return fToBind.apply(this instanceof fNOP&&oThis?this:oThis,aArgs.concat(Array.prototype.slice.call(arguments)));};fNOP.prototype=this.prototype;fBound.prototype=new fNOP();return fBound;};}
2352(function(){var lastTime=0;var vendors=['ms','moz','webkit','o'];for(var x=0;x<vendors.length&&!window.requestAnimationFrame;++x){window.requestAnimationFrame=window[vendors[x]+'RequestAnimationFrame'];window.cancelAnimationFrame=window[vendors[x]+'CancelAnimationFrame']||window[vendors[x]+'CancelRequestAnimationFrame'];}
2353if(!window.requestAnimationFrame)
2354window.requestAnimationFrame=function(callback,element){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){callback(currTime+timeToCall);},timeToCall);lastTime=currTime+timeToCall;return id;};if(!window.cancelAnimationFrame)
2355window.cancelAnimationFrame=function(id){clearTimeout(id);};}());Array.prototype.ngy2removeIf=function(callback){var i=this.length;while(i--){if(callback(this[i],i)){this.splice(i,1);}}};if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position;};}}
2356function GalleryClicked(e){var r=GalleryEventRetrieveElementl(e,false);if(r.GOMidx==-1){return'exit';}
2357var idx=G.GOM.items[r.GOMidx].thumbnailIdx;if(G.GOM.slider.hostIdx==r.GOMidx){idx=G.GOM.items[G.GOM.slider.currentIdx].thumbnailIdx;}
2358switch(r.action){case'OPEN':ThumbnailOpen(idx,false);return'exit';break;case'DISPLAY':ThumbnailOpen(idx,true);return'exit';break;case'TOGGLESELECT':ThumbnailSelectionToggle(idx);return'exit';break;case'SHARE':PopupShare(idx);return'exit';break;case'DOWNLOAD':DownloadImage(idx);return'exit';break;case'INFO':ItemDisplayInfo(G.I[idx]);return'exit';break;case'SHOPPINGCART':AddToCart(idx,'gallery');return'exit';break;default:var fu=G.O.fnThumbnailToolCustAction;if(fu!==null){typeof fu=='function'?fu(r.action,G.I[idx]):window[fu](r.action,G.I[idx]);}
2359break;}}
2360function DownloadImage(idx){if(G.I[idx].mediaKind!='img'){return;}
2361var url=G.I[idx].src;if(G.I[idx].downloadURL!=undefined&&G.I[idx].downloadURL!=''){url=G.I[idx].downloadURL;}
2362var a=document.createElement('a');a.href=url;a.download=url.split('/').pop();a.target='_blank';a.style.display='none';document.body.appendChild(a);a.click();document.body.removeChild(a);}
2363function AddToCart(idx,source){var found=false;for(var i=0;i<G.shoppingCart.length;i++){if(G.shoppingCart[i].idx==idx){G.shoppingCart[i].qty++;ThumbnailBuildToolbarOneCartUpdate(G.I[idx]);var fu=G.O.fnShoppingCartUpdated;if(fu!==null){typeof fu=='function'?fu(G.shoppingCart,G.I[idx],source):window[fu](G.shoppingCart,G.I[idx],source);}
2364TriggerCustomEvent('shoppingCartUpdated');return;}}
2365if(!found){G.shoppingCart.push({idx:idx,ID:G.I[idx].GetID(),qty:1});ThumbnailBuildToolbarOneCartUpdate(G.I[idx]);var fu=G.O.fnShoppingCartUpdated;if(fu!==null){typeof fu=='function'?fu(G.shoppingCart,G.I[idx],source):window[fu](G.shoppingCart,G.I[idx],source);}
2366TriggerCustomEvent('shoppingCartUpdated');}}
2367function ThumbnailSelectionClear(){G.GOM.nbSelected=0;for(var i=0,nbTn=G.GOM.items.length;i<nbTn;i++){var item=G.I[G.GOM.items[i].thumbnailIdx];if(item.selected){item.selected=false;var fu=G.O.fnThumbnailSelection;if(fu!==null){typeof fu=='function'?fu(item.$elt,item,G.I):window[fu](item.$elt,item,G.I);}}
2368item.selected=false;}}
2369function ThumbnailSelectionToggle(idx){var item=G.I[idx];if(item.selected===true){ThumbnailSelectionSet(item,false);G.GOM.nbSelected--;TriggerCustomEvent('itemUnSelected');}
2370else{ThumbnailSelectionSet(item,true);G.GOM.nbSelected++;TriggerCustomEvent('itemSelected');}}
2371function ThumbnailSelectionSet(item,selected){item.selected=selected;ThumbnailSelectionSetIcon(item);var fu=G.O.fnThumbnailSelection;if(fu!==null){typeof fu=='function'?fu(item.$elt,item,G.I):window[fu](item.$elt,item,G.I);}}
2372function ThumbnailSelectionSetIcon(item){if(item.$elt==null){return;}
2373var $sub=item.$getElt('.nGY2GThumbnail');var $icon=item.$getElt('.nGY2GThumbnailIconImageSelect');if(item.selected===true){$sub.addClass('nGY2GThumbnailSubSelected');$icon.addClass('nGY2ThumbnailSelected');$icon.removeClass('nGY2ThumbnailUnselected');$icon.html(G.O.icons.thumbnailSelected);}
2374else{$sub.removeClass('nGY2GThumbnailSubSelected');$icon.removeClass('nGY2ThumbnailSelected');$icon.addClass('nGY2ThumbnailUnselected');$icon.html(G.O.icons.thumbnailUnselected);}}
2375function PopupShare(idx){var item=G.I[idx];var currentURL=document.location.protocol+'//'+document.location.hostname+document.location.pathname;var newLocationHash='#nanogallery/'+G.baseEltID+'/';if(item.kind=='image'){newLocationHash+=item.albumID+'/'+item.GetID();}
2376else{newLocationHash+=item.GetID();}
2377var content='<br><br>';content+='<div class="nGY2PopupOneItem" style="text-align:center;" data-share="facebook">'+G.O.icons.shareFacebook+'</div>';content+='<div class="nGY2PopupOneItem" style="text-align:center;" data-share="pinterest">'+G.O.icons.sharePinterest+'</div>';content+='<div class="nGY2PopupOneItem" style="text-align:center;" data-share="tumblr">'+G.O.icons.shareTumblr+'</div>';content+='<div class="nGY2PopupOneItem" style="text-align:center;" data-share="twitter">'+G.O.icons.shareTwitter+'</div>';content+='<div class="nGY2PopupOneItem" style="text-align:center;" data-share="vk">'+G.O.icons.shareVK+'</div>';content+='<div class="nGY2PopupOneItem" style="text-align:center;" data-share="mail">'+G.O.icons.shareMail+'</div>';content+='<div class="nGY2PopupOneItem" style="text-align:center;"></div>';content+='<input class="nGY2PopupOneItemText" readonly type="text" value="'+currentURL+newLocationHash+'" style="width:100%;text-align:center;">';content+='<br>';currentURL=encodeURIComponent(document.location.protocol+'//'+document.location.hostname+document.location.pathname+newLocationHash);var currentTitle=item.title;var currentTn=item.thumbImg().src;Popup('nanogallery2 - share to:',content,'Center');G.popup.$elt.find('.nGY2PopupOneItem').on('click',function(e){e.stopPropagation();var shareURL='';var found=true;switch(jQuery(this).attr('data-share').toUpperCase()){case'FACEBOOK':shareURL='https://www.facebook.com/sharer.php?u='+currentURL;break;case'VK':shareURL='http://vk.com/share.php?url='+currentURL;break;case'GOOGLEPLUS':shareURL="https://plus.google.com/share?url="+currentURL;break;case'TWITTER':shareURL='https://twitter.com/intent/tweet?text='+currentTitle+'url='+currentURL;break;case'PINTEREST':shareURL='https://pinterest.com/pin/create/button/?media='+currentTn+'&url='+currentURL+'&description='+currentTitle;break;case'TUMBLR':shareURL='http://www.tumblr.com/share/link?url='+currentURL+'&name='+currentTitle;break;case'MAIL':shareURL='mailto:?subject='+currentTitle+'&body='+currentURL;break;default:found=false;break;}
2378if(found){window.open(shareURL,"","height=550,width=500,left=100,top=100,menubar=0");G.popup.close();}});}
2379function Popup(title,content,align){var pp='<div class="nGY2Popup" style="opacity:0;"><div class="nGY2PopupContent'+align+'">';pp+='<div class="nGY2PopupCloseButton" style="font-size:0.9em;">'+G.O.icons.buttonClose+'</div>';pp+='<div class="nGY2PopupTitle">'+title+'</div>';pp+=content;pp+='</div></div>';G.popup.$elt=jQuery(pp).appendTo('body');setElementOnTop(G.VOM.$viewer,G.popup.$elt);G.popup.isDisplayed=true;var tweenable=new NGTweenable();tweenable.tween({from:{o:0,y:100},to:{o:1,y:0},easing:'easeInOutSine',duration:250,step:function(state,att){G.popup.$elt[0].style.opacity=state.o;G.popup.$elt[0].style[G.CSStransformName]='translateY('+(state.y)+'px)';}});G.popup.$elt.find('.nGY2PopupCloseButton').on('click',function(e){e.stopPropagation();G.popup.close();});}
2380function GalleryMouseEnter(e){if(!G.VOM.viewerDisplayed&&G.GOM.albumIdx!=-1){var r=GalleryEventRetrieveElementl(e,true);if(r.GOMidx!=-1){ThumbnailHover(r.GOMidx);}}}
2381function GalleryMouseLeave(e){if(!G.VOM.viewerDisplayed&&G.GOM.albumIdx!=-1){var r=GalleryEventRetrieveElementl(e,true);if(r.GOMidx!=-1){ThumbnailHoverOut(r.GOMidx);}}}
2382function GalleryEventRetrieveElementl(e,ignoreSubItems){var r={action:'NONE',GOMidx:-1};if(e==undefined){return r;}
2383var target=e.target||e.srcElement;while(target!=G.$E.conTnParent[0]){if(jQuery(target).hasClass('nGY2GThumbnail')){if(r.action=='NONE'){r.action='OPEN';}
2384r.GOMidx=jQuery(target).data('index');return r;}
2385if(!ignoreSubItems){var a=jQuery(target).data('ngy2action');if(a!=''&&a!=undefined){r.action=a;}}
2386if(target.parentNode==null){return r;}
2387target=target.parentNode;}
2388return r;}
2389function ThumbnailOpen(idx,ignoreSelected){var item=G.I[idx];G.GOM.albumIdxLoading=idx;var fu=G.O.fnThumbnailClicked;if(fu!==null){typeof fu=='function'?fu(item.$elt,item):window[fu](item.$elt,item);}
2390if(item.destinationURL!==undefined&&item.destinationURL.length>0){window.location=item.destinationURL;return;}
2391switch(item.kind){case'image':if(ignoreSelected===false&&G.GOM.nbSelected>0){ThumbnailSelectionToggle(idx);}
2392else{DisplayPhotoIdx(idx);}
2393break;case'album':if(ignoreSelected===false&&G.GOM.nbSelected>0){ThumbnailSelectionToggle(idx);}
2394else{if(G.O.thumbnailAlbumDisplayImage&&idx!=0){DisplayFirstMediaInAlbum(idx);return;}
2395else{DisplayAlbum('-1',item.GetID());}}
2396break;case'albumUp':var parent=NGY2Item.Get(G,item.albumID);DisplayAlbum('-1',parent.albumID);break;}}
2397function DisplayFirstMediaInAlbum(albumIdx){if(G.O.debugMode){console.log('#DisplayFirstPhotoInAlbum : '+albumIdx);}
2398var item=G.I[albumIdx];var l=G.I.length;for(var i=0;i<l;i++){if(G.I[i].albumID==item.GetID()){DisplayPhotoIdx(i);return;}}
2399AlbumGetContent(item.GetID(),DisplayFirstMediaInAlbum,albumIdx,null);}
2400function OpenOriginal(item){switch(G.O.kind){case'flickr':var sU='https://www.flickr.com/photos/'+G.O.userID+'/'+item.GetID();if(item.albumID!='0'){sU+='/in/album-'+item.albumID+'/';}
2401window.open(sU,'_blank');break;case'picasa':case'google':case'google2':default:var sU=item.responsiveURL();window.open(sU,'_blank');break;}}
2402function DisplayPhotoIdx(ngy2ItemIdx){if(!G.O.thumbnailOpenInLightox){return;}
2403if(G.O.thumbnailOpenOriginal){OpenOriginal(G.I[ngy2ItemIdx]);return;}
2404var items=[];G.VOM.content.current.vIdx=0;G.VOM.items=[];G.VOM.albumID=G.I[ngy2ItemIdx].albumID;var vimg=new VImg(ngy2ItemIdx);G.VOM.items.push(vimg);items.push(G.I[ngy2ItemIdx]);var l=G.I.length;for(let idx=ngy2ItemIdx+1;idx<l;idx++){let item=G.I[idx];if(item.kind=='image'&&item.isToDisplay(G.VOM.albumID)&&item.destinationURL==''){let vimg=new VImg(idx);G.VOM.items.push(vimg);items.push(item);}}
2405var last=G.VOM.items.length;var cnt=1;for(let idx=0;idx<ngy2ItemIdx;idx++){let item=G.I[idx];if(item.kind=='image'&&item.isToDisplay(G.VOM.albumID)&&item.destinationURL==''){let vimg=new VImg(idx);vimg.mediaNumber=cnt;G.VOM.items.push(vimg);items.push(item);cnt++;}}
2406for(let i=0;i<last;i++){G.VOM.items[i].mediaNumber=cnt;cnt++;}
2407var fu=G.O.fnThumbnailOpen;if(fu!==null){typeof fu=='function'?fu(items):window[fu](items);return;}
2408if(!G.VOM.viewerDisplayed){LightboxOpen();}
2409else{G.VOM.content.current.$media.empty();let item=G.VOM.content.current.NGY2Item();var spreloader='<div class="nGY2ViewerMediaLoaderDisplayed"></div>';if(item.mediaKind=='img'&&item.imageWidth!=0&&item.imageHeight!=0){spreloader='<div class="nGY2ViewerMediaLoaderHidden"></div>';}
2410G.VOM.content.current.$media.append(spreloader+item.mediaMarkup);ViewerSetMediaVisibility(G.VOM.content.next,0);ViewerSetMediaVisibility(G.VOM.content.previous,0);if(item.mediaKind=='img'){G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,item);}
2411LightboxDisplay('');}}
2412function ViewerZoomStart(){if(G.O.viewerZoom&&!G.VOM.viewerMediaIsChanged){var item=G.VOM.content.current.NGY2Item();if(item.mediaKind=='img'&&item.imageHeight>0&&item.imageWidth>0){if(G.VOM.zoom.isZooming===false){G.VOM.zoom.userFactor=1;G.VOM.zoom.isZooming=true;}
2413return true;}}
2414return false;}
2415function ViewerZoomIn(zoomIn){if(zoomIn){G.VOM.zoom.userFactor+=0.1;ViewerZoomMax();}
2416else{G.VOM.zoom.userFactor-=0.1;if(ViewerZoomMin()&&G.O.viewerResetZoomAtMin){G.VOM.zoom.isZooming=false;ResizeLightbox(true);};}
2417ViewerMediaSetPosAndZoom();}
2418function ViewerZoomMax(){var item=G.VOM.content.current.NGY2Item();var zoomBaseFactor=ViewerZoomBaseFactor(item);if(G.VOM.zoom.userFactor>(1/zoomBaseFactor)){G.VOM.zoom.userFactor=(1/zoomBaseFactor);}}
2419function ViewerZoomMin(){if(G.VOM.zoom.userFactor<G.O.viewerMinZoom){G.VOM.zoom.userFactor=G.O.viewerMinZoom;return true;}
2420return false;}
2421function ViewerMediaSetPosAndZoom(){if(!G.VOM.zoom.isZooming){G.VOM.zoom.userFactor=1;}
2422ViewerMediaSetPosAndZoomOne(G.VOM.content.current,true);ViewerMediaSetPosAndZoomOne(G.VOM.content.previous,false);ViewerMediaSetPosAndZoomOne(G.VOM.content.next,false);}
2423function ViewerMediaCenterNotImg($mediaContainer){var $media=$mediaContainer.children().eq(1);var h=90;if(G.O.viewerGallery!='none'){h-=10;}
2424if(G.O.viewerToolbar.display!='none'){h-=10;}
2425$media.css({'height':h+'%'});$media.css({'width':'90%'});$media[0].style[G.CSStransformName]='translate(0px, "50%") ';}
2426function ViewerZoomBaseFactor(item){var dpr=1;if(G.O.viewerImageDisplay=='bestImageQuality'){dpr=window.devicePixelRatio;}
2427var zoomBaseFactorW=(G.VOM.window.lastWidth-G.VOM.padding.V)/(item.imageWidth/dpr);var zoomBaseFactorH=(G.VOM.window.lastHeight-G.VOM.padding.H)/(item.imageHeight/dpr);var zoomBaseFactor=Math.min(zoomBaseFactorW,zoomBaseFactorH);if(zoomBaseFactor>1&&G.O.viewerImageDisplay!='upscale'){zoomBaseFactor=1;}
2428return zoomBaseFactor;}
2429function ViewerMediaDimensions(item,isCurrent){var zoomUserFactor=isCurrent==true?G.VOM.zoom.userFactor:1;var dpr=1;if(G.O.viewerImageDisplay=='bestImageQuality'){dpr=window.devicePixelRatio;}
2430var zoomBaseFactor=ViewerZoomBaseFactor(item);var imageCurrentHeight=(item.imageHeight/dpr)*zoomUserFactor*zoomBaseFactor;var imageCurrentWidth=(item.imageWidth/dpr)*zoomUserFactor*zoomBaseFactor;return[imageCurrentHeight,imageCurrentWidth];}
2431function ViewerMediaSetPosAndZoomOne(content_item,isCurrent){var item=content_item.NGY2Item();var $img=content_item.$media;if(item.mediaKind!='img'){ViewerMediaCenterNotImg($img);return;}
2432if(item.imageHeight==0||item.imageWidth==0){ViewerSetMediaVisibility(content_item,0);return;}
2433ViewerZoomMin();ViewerZoomMax();var[imageCurrentHeight,imageCurrentWidth]=ViewerMediaDimensions(item,isCurrent);$img.children().eq(1).css({'height':imageCurrentHeight});$img.children().eq(1).css({'width':imageCurrentWidth});var posX=0;if(imageCurrentWidth>G.VOM.window.lastWidth){posX=-(imageCurrentWidth-G.VOM.window.lastWidth)/2;}
2434var posY=0;if(isCurrent){if(!G.VOM.zoom.isZooming){G.VOM.panPosX=0;G.VOM.panPosY=0;}
2435G.VOM.zoom.posX=posX;G.VOM.zoom.posY=posY;ViewerImagePanSetPosition(item,G.VOM.panPosX,G.VOM.panPosY,$img,false);}
2436else{ViewerMediaPanX(G.VOM.swipePosX);$img.children().eq(1)[0].style[G.CSStransformName]='translate(0px, 0px) rotate('+item.rotationAngle+'deg)';}}
2437function ViewerImagePanSetPosition(item,posX,posY,imageContainer,savePosition){var[imageCurrentHeight,imageCurrentWidth]=ViewerMediaDimensions(item,true);posX=Math.max(-(imageCurrentWidth/2),Math.min(posX,(imageCurrentWidth/2)));posY=Math.max(-(imageCurrentHeight/2),Math.min(posY,(imageCurrentHeight/2)));if(savePosition){G.VOM.panPosX=posX;G.VOM.panPosY=posY;}
2438posX+=G.VOM.zoom.posX;posY+=G.VOM.zoom.posY;imageContainer.children().eq(1)[0].style[G.CSStransformName]='translate('+posX+'px, '+posY+'px) rotate('+G.VOM.content.current.NGY2Item().rotationAngle+'deg)';}
2439function LightboxOpen(idx){G.GOM.firstDisplay=false;jQuery('head').append('<style id="nGY2_body_scrollbar_style" type="text/css">.nGY2_body_scrollbar{margin-right: '+(window.innerWidth-document.documentElement.clientWidth)+'px;}</style>');jQuery("body").addClass("nGY2_body_scrollbar");G.VOM.$baseCont=jQuery('<div  class="nGY2 nGY2ViewerContainer" style="opacity:1"></div>').appendTo('body');SetViewerTheme();G.VOM.$viewer=jQuery('<div class="nGY2Viewer" style="opacity:0" itemscope itemtype="http://schema.org/ImageObject"></div>').appendTo(G.VOM.$baseCont);G.VOM.$viewer.css({msTouchAction:'none',touchAction:'none'});if(idx==undefined){G.VOM.content.current.vIdx=0;}
2440else{G.VOM.content.current.vIdx=idx;}
2441G.VOM.content.previous.vIdx=G.VOM.IdxNext();G.VOM.content.next.vIdx=G.VOM.IdxPrevious();var sMedia='<div class="nGY2ViewerMediaPan"><div class="nGY2ViewerMediaLoaderDisplayed"></div>'+G.VOM.content.previous.NGY2Item().mediaMarkup+'</div>';sMedia+='<div class="nGY2ViewerMediaPan"><div class="nGY2ViewerMediaLoaderDisplayed"></div>'+G.VOM.content.current.NGY2Item().mediaMarkup+'</div>';sMedia+='<div class="nGY2ViewerMediaPan"><div class="nGY2ViewerMediaLoaderDisplayed"></div>'+G.VOM.content.next.NGY2Item().mediaMarkup+'</div>';var sNav='';var iconP=G.O.icons.viewerImgPrevious;if(iconP!=undefined&&iconP!=''){sNav+='<div class="nGY2ViewerAreaPrevious ngy2viewerToolAction" data-ngy2action="previous">'+iconP+'</div>';}
2442var iconN=G.O.icons.viewerImgNext;if(iconN!=undefined&&iconN!=''){sNav+='<div class="nGY2ViewerAreaNext ngy2viewerToolAction" data-ngy2action="next">'+iconN+'</div>';}
2443G.VOM.$content=jQuery('<div class="nGY2ViewerContent">'+sMedia+sNav+'</div>').appendTo(G.VOM.$viewer);G.VOM.$buttonLeft=G.VOM.$content.find('.nGY2ViewerAreaPrevious');G.VOM.$buttonRight=G.VOM.$content.find('.nGY2ViewerAreaNext');var $mediaPan=G.VOM.$content.find('.nGY2ViewerMediaPan');G.VOM.content.previous.$media=$mediaPan.eq(0);G.VOM.content.current.$media=$mediaPan.eq(1);G.VOM.content.next.$media=$mediaPan.eq(2);var vP=G.GOM.cache.viewport;G.VOM.content.previous.$media[0].style[G.CSStransformName]='translate(-'+vP.w+'px, 0px)';G.VOM.content.next.$media[0].style[G.CSStransformName]='translate('+vP.w+'px, 0px)';G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,G.VOM.content.current.NGY2Item());G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,G.VOM.content.previous.NGY2Item());G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,G.VOM.content.next.NGY2Item());G.VOM.padding.H=parseInt(G.VOM.$content.css("padding-left"))+parseInt(G.VOM.$content.css("padding-right"));G.VOM.padding.V=parseInt(G.VOM.$content.css("padding-top"))+parseInt(G.VOM.$content.css("padding-bottom"));var vtbBg1='';
vendor: 82,940 bytes, lines 2443-2853
2443var vtbBg2=' toolbarBackground';if(G.O.viewerToolbar.fullWidth){vtbBg1=' toolbarBackground';vtbBg2='';}
2444var vtbAlign='text-align:center;';switch(G.O.viewerToolbar.align){case'left':vtbAlign='text-align:left;';break;case'right':vtbAlign='text-align:right;';break;}
2445var sTB='<div class="toolbarContainer nGEvent'+vtbBg1+'" style="visibility:'+(G.O.viewerToolbar.display?"visible":"hidden")+';'+vtbAlign+'"><div class="toolbar nGEvent'+vtbBg2+'"></div></div>';G.VOM.$toolbar=jQuery(sTB).appendTo(G.VOM.$viewer);if(G.VOM.toolbarMode=='min'||(G.O.viewerToolbar.autoMinimize>0&&G.O.viewerToolbar.autoMinimize>=G.GOM.cache.viewport.w)){ViewerToolbarForVisibilityMin();}
2446else{ViewerToolbarForVisibilityStd();}
2447var sTopLeft='<div class="nGY2ViewerToolsTopLeft nGEvent"><div class="toolbar nGEvent">';var sTL=G.O.viewerTools.topLeft.split(',');for(var i=0,sTLL=sTL.length;i<sTLL;i++){sTopLeft+=ToolbarAddElt(sTL[i]);}
2448sTopLeft+='</div></div>';G.VOM.$toolbarTL=jQuery(sTopLeft).appendTo(G.VOM.$viewer);var sTopRight='<div class="nGY2ViewerToolsTopRight nGEvent"><div class="toolbar nGEvent">';var sTR=G.O.viewerTools.topRight.split(',');for(var i=0,sTRL=sTR.length;i<sTRL;i++){sTopRight+=ToolbarAddElt(sTR[i]);}
2449sTopRight+='</div></div>';G.VOM.$toolbarTR=jQuery(sTopRight).appendTo(G.VOM.$viewer);ViewerToolsOn();if(ngscreenfull.enabled&&G.O.viewerFullscreen){ngscreenfull.request();G.VOM.viewerIsFullscreen=true;}
2450LightboxGalleryBuild();setElementOnTop('',G.VOM.$viewer);ResizeLightbox(true);G.VOM.gallery.Resize();G.VOM.timeImgChanged=new Date().getTime();G.VOM.$toolbarTL.css('opacity',0);G.VOM.$toolbarTR.css('opacity',0);G.VOM.$buttonLeft.css('opacity',0);G.VOM.$buttonRight.css('opacity',0);if(G.O.viewerGallery!='none'){G.VOM.gallery.$elt.css('opacity',0);}
2451G.VOM.$content.css('opacity',0);G.VOM.$toolbarTR[0].style[G.CSStransformName]='translateY(-40px) ';G.VOM.$toolbarTL[0].style[G.CSStransformName]='translateY(-40px) ';G.VOM.$buttonLeft[0].style[G.CSStransformName]='translateX(-40px) ';G.VOM.$buttonRight[0].style[G.CSStransformName]='translateX(40px) ';new NGTweenable().tween({from:{opacity:0,posY:G.VOM.window.lastHeight*.5},to:{opacity:1,posY:0},delay:10,duration:450,easing:'easeInOutQuint',step:function(state){G.VOM.$viewer.css('opacity',state.opacity);G.VOM.$viewer[0].style[G.CSStransformName]='translateY('+(state.posY)+'px) ';G.VOM.$content.css('opacity',state.opacity);}});new NGTweenable().tween({from:{posY:-40,opacity:0,scale:3},to:{posY:0,opacity:1,scale:1},delay:300,duration:400,easing:'easeInOutQuint',step:function(state){G.VOM.$toolbarTR[0].style[G.CSStransformName]='translateY('+(state.posY)+'px) ';G.VOM.$toolbarTL[0].style[G.CSStransformName]='translateY('+(state.posY)+'px) ';G.VOM.$buttonLeft[0].style[G.CSStransformName]='translateX('+(state.posY)+'px) ';G.VOM.$buttonRight[0].style[G.CSStransformName]='translateX('+(-state.posY)+'px) ';if(G.O.viewerGallery!='none'){G.VOM.gallery.$elt.css({opacity:state.opacity});G.VOM.gallery.$elt[0].style[G.CSStransformName]='scale('+state.scale+')';}},finish:function(){G.VOM.viewerDisplayed=true;ViewerMediaPanX(0);ViewerSetEvents();LightboxDisplay('');if(G.O.slideshowAutoStart){G.VOM.playSlideshow=false;SlideshowToggle();}
2452ViewerToolsUnHide();LightboxDisplayFinalize('');}});}
2453function ViewerEvents(){if(!G.VOM.viewerDisplayed||G.VOM.viewerMediaIsChanged){return false;}
2454return true;}
2455function LightboxGalleryBuild(){G.VOM.gallery.firstDisplay=true;if(G.O.viewerGallery!='none'){var tw=G.O.viewerGalleryTWidth;var th=G.O.viewerGalleryTHeight;var gutter=2;var t='';for(var i=0;i<G.VOM.items.length;i++){var idx=G.VOM.items[i].ngy2ItemIdx;var o=G.I[idx];var src=(o.thumbImg().src).replace(/'/g,"%27");src=src.replace(/\\/g,'\\\\');t+='<div class="nGY2VThumbnail" style="width:'+tw+'px;height:'+th+'px;left:'+i*(tw+gutter*2)+'px;background-image: url(&apos;'+src+'&apos;);" data-ngy2_lightbox_thumbnail="true" data-ngy2_idx="'+idx+'" data-ngy2_vidx="'+i+'" ></div>';}
2456G.VOM.gallery.gwidth=(tw+2*gutter)*G.VOM.items.length;G.VOM.gallery.oneTmbWidth=tw+2*gutter;var tc="<div class='nGY2VThumbnailContainer' style='height:"+(th+gutter*2)+"px;left:0;width:"+G.VOM.gallery.gwidth+"px;' data-ngy2_lightbox_gallery='true'>"+t+"</div>";G.VOM.gallery.$elt=jQuery('<div class="nGY2viewerGallery" style="display: inline-block;height:'+(th+gutter*2)+'px;left:0;right:0;">'+tc+'</div>').appendTo(G.VOM.$viewer);G.VOM.gallery.$tmbCont=G.VOM.gallery.$elt.find('.nGY2VThumbnailContainer')
2457G.VOM.gallery.Resize();G.VOM.gallery.SetThumbnailActive();}}
2458function ViewerSetEvents(){if(G.VOM.hammertime==null){G.VOM.hammertime=new NGHammer.Manager(G.VOM.$baseCont[0],{recognizers:[[NGHammer.Pinch,{enable:true}],[NGHammer.Pan,{direction:NGHammer.DIRECTION_ALL}]]});G.VOM.hammertime.on('pan',function(ev){if(!ViewerEvents()){return;}
2459if(G.VOM.panMode=='off'){if(ev.target.dataset.ngy2_lightbox_thumbnail!=undefined||ev.target.dataset.ngy2_lightbox_gallery!=undefined){G.VOM.panMode='gallery';}
2460else{if(G.VOM.zoom.isZooming){G.VOM.panMode='zoom';}
2461else{G.VOM.panMode='media';}}}
2462switch(G.VOM.panMode){case'zoom':ViewerImagePanSetPosition(G.VOM.content.current.NGY2Item(),G.VOM.panPosX+ev.deltaX,G.VOM.panPosY+ev.deltaY,G.VOM.content.current.$media,false);G.VOM.toolsHide();break;case'media':if(Math.abs(ev.deltaY)>G.VOM.panThreshold&&Math.abs(ev.deltaX)<G.VOM.panThreshold&&!G.VOM.panXOnly){ViewerMediaPanX(0);var dist=0;if(ev.deltaY<0){dist=Math.max(ev.deltaY,-200);}
2463else{dist=Math.min(ev.deltaY,200);}
2464G.VOM.$viewer[0].style[G.CSStransformName]='translateY('+dist+'px) ';G.VOM.$viewer.css('opacity',1-Math.abs(dist)/200/2);}
2465else{if(Math.abs(ev.deltaX)>G.VOM.panThreshold){G.VOM.panXOnly=true;}
2466ViewerMediaPanX(ev.deltaX);G.VOM.$viewer[0].style[G.CSStransformName]='translateY(0px)';G.VOM.$viewer.css('opacity',1);}
2467break;case'gallery':G.VOM.gallery.PanGallery(ev.deltaX);break;}});G.VOM.hammertime.on('panend',function(ev){if(!ViewerEvents()){return;}
2468switch(G.VOM.panMode){case'zoom':G.VOM.timeImgChanged=new Date().getTime();ViewerImagePanSetPosition(G.VOM.content.current.NGY2Item(),G.VOM.panPosX+ev.deltaX,G.VOM.panPosY+ev.deltaY,G.VOM.content.current.$media,true);break;case'media':var panY=false;if(!G.VOM.panXOnly){if(Math.abs(ev.deltaY)>50&&Math.abs(ev.deltaX)<50){LightboxClose();panY=true;}}
2469if(!panY){if(Math.abs(ev.deltaX)<50){ViewerMediaPanX(0);}
2470else{ev.deltaX>50?DisplayPreviousMedia(Math.abs(ev.velocityX)):DisplayNextMedia(Math.abs(ev.velocityX));}}
2471G.VOM.panXOnly=false;break;case'gallery':G.VOM.gallery.posX+=ev.deltaX;G.VOM.gallery.PanGallery(0);G.VOM.gallery.PanGalleryEnd(ev.velocityX);break;}
2472G.VOM.panMode='off';});if(G.O.viewerZoom){G.VOM.hammertime.add(new NGHammer.Tap({event:'doubletap',taps:2,interval:250}));G.VOM.hammertime.add(new NGHammer.Tap({event:'singletap'}));G.VOM.hammertime.get('doubletap').recognizeWith('singletap');G.VOM.hammertime.get('singletap').requireFailure('doubletap');G.VOM.hammertime.on('singletap',function(ev){if(!ViewerEvents()){return;}
2473if(ev.target.dataset.ngy2_lightbox_thumbnail!=undefined){var idx=parseInt(ev.target.dataset.ngy2_idx);var vidx=parseInt(ev.target.dataset.ngy2_vidx);if(!isNaN(idx)&&vidx!=G.VOM.content.current.vIdx){if(vidx>G.VOM.content.current.vIdx){TriggerCustomEvent('lightboxNextImage');G.VOM.content.next.$media.empty();var nextItem=G.I[idx];G.VOM.content.next.vIdx=vidx;let spreloader='<div class="nGY2ViewerMediaLoaderDisplayed"></div>';if(nextItem.mediaKind=='img'&&nextItem.imageWidth!=0&&nextItem.imageHeight!=0){spreloader='<div class="nGY2ViewerMediaLoaderHidden"></div>';}
2474G.VOM.content.next.$media.append(spreloader+nextItem.mediaMarkup);if(nextItem.mediaKind=='img'){G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,nextItem);}
2475else{ViewerMediaCenterNotImg(G.VOM.content.next.$media);}
2476LightboxDisplay('nextImage');}
2477else{TriggerCustomEvent('lightboxPreviousImage');G.VOM.content.previous.$media.empty();var previousItem=G.I[idx];G.VOM.content.previous.vIdx=vidx;let spreloader='<div class="nGY2ViewerMediaLoaderDisplayed"></div>';if(previousItem.mediaKind=='img'&&previousItem.imageWidth!=0&&previousItem.imageHeight!=0){spreloader='<div class="nGY2ViewerMediaLoaderHidden"></div>';}
2478G.VOM.content.previous.$media.append(spreloader+previousItem.mediaMarkup);if(previousItem.mediaKind=='img'){G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,previousItem);}
2479else{ViewerMediaCenterNotImg(G.VOM.content.previous.$media);}
2480LightboxDisplay('previousImage');}
2481return;}}
2482StopPropagationPreventDefault(ev.srcEvent);if(G.VOM.toolbarsDisplayed==false){debounce(ViewerToolsUnHide,100,false)();G.VOM.singletapTime=new Date().getTime();}
2483else{if((new Date().getTime())-G.VOM.singletapTime<400){return;}
2484if(G.VOM.content.current.NGY2Item().mediaKind=='img'&&ev.target.className.indexOf('nGY2ViewerMedia')!==-1){var x=0;if(ev.srcEvent instanceof MouseEvent){x=ev.srcEvent.pageX;}
2485else{x=ev.srcEvent.changedTouches[0].pageX;}
2486if(x<(G.GOM.cache.viewport.w/2)){DisplayPreviousMedia();}
2487else{DisplayNextMedia();}}}});G.VOM.hammertime.on('doubletap',function(ev){if(!ViewerEvents()){return;}
2488StopPropagationPreventDefault(ev.srcEvent);if(ev.target.className.indexOf('nGY2ViewerMedia')!==-1){if(G.VOM.zoom.isZooming){G.VOM.zoom.isZooming=false;ResizeLightbox(true);}
2489else{if(ViewerZoomStart()){G.VOM.zoom.userFactor=1.5;ViewerMediaSetPosAndZoom();}}}});G.VOM.hammertime.on('pinchend',function(ev){ev.srcEvent.stopPropagation();ev.srcEvent.preventDefault();G.VOM.timeImgChanged=new Date().getTime();G.VOM.zoom.lastScale=1;});G.VOM.hammertime.on('pinch',function(ev){ev.srcEvent.stopPropagation();ev.srcEvent.preventDefault();if(ViewerZoomStart()){if(G.O.viewerRelativePinchZoom){var scale=ev.scale;if(scale<1){scale=1-((1-scale)*G.O.viewerZoomOutScale);}
2490G.VOM.zoom.userFactor=G.VOM.zoom.userFactor+(scale-G.VOM.zoom.lastScale);G.VOM.zoom.lastScale=scale;}
2491else{G.VOM.zoom.userFactor=ev.scale;}
2492ViewerZoomMax();if(ViewerZoomMin()&&G.O.viewerResetZoomAtMin){G.VOM.zoom.isZooming=false;ResizeLightbox(true);}
2493ViewerMediaSetPosAndZoom();}});}
2494else{G.VOM.hammertime.add(new NGHammer.Tap({event:'singletap'}));G.VOM.hammertime.on('singletap',function(ev){if(!ViewerEvents()){return;}
2495StopPropagationPreventDefault(ev.srcEvent);if(G.VOM.toolbarsDisplayed==false){debounce(ViewerToolsUnHide,100,false)();G.VOM.singletapTime=new Date().getTime();}
2496else{if((new Date().getTime())-G.VOM.singletapTime<400){return;}
2497if(ev.target.className.indexOf('nGY2ViewerMedia')!==-1){var x=0;if(ev.srcEvent instanceof MouseEvent){x=ev.srcEvent.pageX;}
2498else{x=ev.srcEvent.changedTouches[0].pageX;}
2499if(x<(G.GOM.cache.viewport.w/2)){DisplayPreviousMedia();}
2500else{DisplayNextMedia();}}}});}}}
2501function StopPropagationPreventDefault(e){e.stopPropagation();e.preventDefault();}
2502function ViewerToolsHide(){if(G.VOM.viewerDisplayed){G.VOM.toolbarsDisplayed=false;ViewerToolsOpacity(0);}}
2503function ViewerToolsUnHide(){if(G.VOM.viewerDisplayed){G.VOM.toolbarsDisplayed=true;ViewerToolsOpacity(1);G.VOM.toolsHide();}}
2504function ViewerToolsOpacity(op){if(G.VOM.$toolbar!=null){G.VOM.$toolbar.css('opacity',op);}
2505if(G.VOM.$toolbarTL!=null){G.VOM.$toolbarTL.css('opacity',op);}
2506if(G.VOM.$toolbarTR!=null){G.VOM.$toolbarTR.css('opacity',op);}
2507G.VOM.$content.find('.nGY2ViewerAreaNext').css('opacity',op);G.VOM.$content.find('.nGY2ViewerAreaPrevious').css('opacity',op);}
2508function ViewerToolsOn(){G.VOM.$viewer.off('touchstart click','.ngy2viewerToolAction',ViewerToolsAction);G.VOM.$viewer.on('touchstart click','.ngy2viewerToolAction',ViewerToolsAction);}
2509function ViewerToolsAction(e){if((new Date().getTime())-G.timeLastTouchStart<300){return;}
2510G.timeLastTouchStart=new Date().getTime();var $this=$(this);var ngy2action=$this.data('ngy2action');if(ngy2action==undefined){return;}
2511switch(ngy2action){case'next':StopPropagationPreventDefault(e);DisplayNextMedia();break;case'previous':StopPropagationPreventDefault(e);DisplayPreviousMedia();break;case'playPause':e.stopPropagation();SlideshowToggle();break;case'zoomIn':StopPropagationPreventDefault(e);if(ViewerZoomStart()){ViewerZoomIn(true);}
2512break;case'zoomOut':StopPropagationPreventDefault(e);if(ViewerZoomStart()){ViewerZoomIn(false);}
2513break;case'minimize':StopPropagationPreventDefault(e);if(G.VOM.toolbarMode=='std'){ViewerToolbarForVisibilityMin();}
2514else{ViewerToolbarForVisibilityStd();}
2515break;case'fullScreen':e.stopPropagation();if(ngscreenfull.enabled){ngscreenfull.toggle();}
2516break;case'info':e.stopPropagation();ItemDisplayInfo(G.VOM.content.current.NGY2Item());break;case'close':StopPropagationPreventDefault(e);if((new Date().getTime())-G.VOM.timeImgChanged<400){return;}
2517LightboxClose();break;case'download':StopPropagationPreventDefault(e);DownloadImage(G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx);break;case'share':StopPropagationPreventDefault(e);PopupShare(G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx);break;case'linkOriginal':StopPropagationPreventDefault(e);OpenOriginal(G.VOM.content.current.NGY2Item());break;case'rotateLeft':StopPropagationPreventDefault(e);ViewerImageRotate(-90);break;case'rotateRight':StopPropagationPreventDefault(e);ViewerImageRotate(90);break;case'shoppingcart':StopPropagationPreventDefault(e);AddToCart(G.VOM.items[G.VOM.content.current.vIdx].ngy2ItemIdx,'lightbox');break;}
2518var fu=G.O.fnImgToolbarCustClick;if(ngy2action.indexOf('custom')==0&&fu!==null){typeof fu=='function'?fu(ngy2action,$this,G.VOM.content.current.NGY2Item()):window[fu](ngy2action,$this,G.VOM.content.current.NGY2Item());}}
2519function ViewerImageRotate(angle){var item=G.VOM.content.current.NGY2Item();if(item.mediaKind=='img'){item.rotationAngle+=angle;item.rotationAngle=item.rotationAngle%360;if(item.rotationAngle<0){item.rotationAngle+=360;}
2520ViewerMediaPanX(0);ViewerMediaSetPosAndZoomOne(G.VOM.content.current,true);}}
2521function ItemDisplayInfo(ng2item){var content='<div class="nGY2PopupOneItem">'+ng2item.title+'</div>';content+='<div class="nGY2PopupOneItemText">'+ng2item.description+'</div>';if(ng2item.author!=''){content+='<div class="nGY2PopupOneItemText">'+G.O.icons.user+' '+ng2item.author+'</div>';}
2522if(ng2item.exif.model!=''){content+='<div class="nGY2PopupOneItemText">'+G.O.icons.config+' '+ng2item.exif.model+'</div>';}
2523var sexif=G.O.icons.picture+':';if(ng2item.exif.flash!=''||ng2item.exif.focallength!=''||ng2item.exif.fstop!=''||ng2item.exif.exposure!=''||ng2item.exif.iso!=''||ng2item.exif.time!=''){sexif+='<br>';sexif+=ng2item.exif.flash==''?'':' &nbsp; '+ng2item.exif.flash;sexif+=ng2item.exif.focallength==''?'':' &nbsp; '+ng2item.exif.focallength+'mm';sexif+=ng2item.exif.fstop==''?'':' &nbsp; f'+ng2item.exif.fstop;sexif+=ng2item.exif.exposure==''?'':' &nbsp; '+ng2item.exif.exposure+'s';sexif+=ng2item.exif.iso==''?'':' &nbsp; '+ng2item.exif.iso+' ISO';if(ng2item.exif.time!=''){sexif+=' &nbsp; '+ng2item.exif.time;}}
2524else{sexif+=' n/a';}
2525content+='<div class="nGY2PopupOneItemText">'+sexif+'</div>';if(ng2item.exif.location!=''){content+='<div class="nGY2PopupOneItemText">'+G.O.icons.location+' <a href="http://maps.google.com/maps?z=12&t=m&q='+encodeURIComponent(ng2item.exif.location)+'" target="_blank">'+ng2item.exif.location+'</a></div>';content+='<iframe width="300" height="150" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?&amp;t=m&amp;q='+encodeURIComponent(ng2item.exif.location)+'&amp;output=embed"></iframe>';}
2526else{content+='<div class="nGY2PopupOneItemText">'+G.O.icons.location+': n/a</div>';}
2527var r={title:G.O.icons.viewerInfo,content:content};var fu=G.O.fnPopupMediaInfo;if(fu!==null){typeof fu=='function'?r=fu(ng2item,r.title,r.content):r=window[fu](ng2item,r.title,r.content);}
2528Popup(r.title,r.content,'Left');}
2529function ToolbarAddElt(elt){var r='<div class="ngbt ngy2viewerToolAction ',e=elt.replace(/^\s+|\s+$/g,'');switch(e){case'minimizeButton':case'minimize':var ic=G.O.icons.viewerToolbarMin;if(G.VOM.toolbarMode=='min'){ic=G.O.icons.viewerToolbarStd;}
2530r+='minimizeButton nGEvent" data-ngy2action="minimize">'+ic+'</div>';break;case'previousButton':case'previous':r+='previousButton nGEvent" data-ngy2action="previous">'+G.O.icons.viewerPrevious+'</div>';break;case'pageCounter':r+='pageCounter nGEvent"></div>';break;case'nextButton':case'next':r+='nextButton nGEvent" data-ngy2action="next">'+G.O.icons.viewerNext+'</div>';break;case'playPauseButton':case'playPause':r+='playButton playPauseButton nGEvent" data-ngy2action="playPause">'+G.O.icons.viewerPlay+'</div>';break;case'rotateLeft':r+='rotateLeftButton nGEvent" data-ngy2action="rotateLeft">'+G.O.icons.viewerRotateLeft+'</div>';break;case'rotateRight':r+='rotateRightButton nGEvent" data-ngy2action="rotateRight">'+G.O.icons.viewerRotateRight+'</div>';break;case'downloadButton':case'download':r+='downloadButton nGEvent" data-ngy2action="download">'+G.O.icons.viewerDownload+'</div>';break;case'zoomButton':case'zoom':r+='nGEvent" data-ngy2action="zoomIn">'+G.O.icons.viewerZoomIn+'</div><div class="ngbt ngy2viewerToolAction nGEvent" data-ngy2action="zoomOut">'+G.O.icons.viewerZoomOut+'</div>';break;case'fullscreenButton':case'fullscreen':var s=G.O.icons.viewerFullscreenOn;if(ngscreenfull.enabled&&G.VOM.viewerIsFullscreen){s=G.O.icons.viewerFullscreenOff;}
2531r+='setFullscreenButton fullscreenButton nGEvent" data-ngy2action="fullScreen">'+s+'</div>';break;case'infoButton':case'info':r+='infoButton nGEvent" data-ngy2action="info">'+G.O.icons.viewerInfo+'</div>';break;case'linkOriginalButton':case'linkOriginal':r+='linkOriginalButton nGEvent" data-ngy2action="linkOriginal">'+G.O.icons.viewerLinkOriginal+'</div>';break;case'closeButton':case'close':r+='closeButton nGEvent" data-ngy2action="close">'+G.O.icons.buttonClose+'</div>';break;case'shareButton':case'share':r+='nGEvent" data-ngy2action="share">'+G.O.icons.viewerShare+'</div>';break;case'label':r+='"><div class="label"><div class="title nGEvent" itemprop="name"></div><div class="description nGEvent" itemprop="description"></div></div></div>';break;case'shoppingcart':r+='closeButton nGEvent" data-ngy2action="shoppingcart">'+G.O.icons.viewerShoppingcart+'</div>';break;default:if(e.indexOf('custom')==0){var t='';var fu=G.O.fnImgToolbarCustInit;if(fu!==null){typeof fu=='function'?fu(e):window[fu](e);}
2532if(t==undefined||t==''){var n=e.substring(6);t=G.O.icons['viewerCustomTool'+n];}
2533r+='ngy2CustomBtn '+e+' nGEvent" data-ngy2action="'+e+'">'+t+'</div>';}
2534else{r='';}
2535break;}
2536return r;}
2537function SlideshowToggle(){if(G.VOM.playSlideshow){window.clearTimeout(G.VOM.playSlideshowTimerID);G.VOM.playSlideshow=false;G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPlay);}
2538else{G.VOM.playSlideshow=true;DisplayNextMedia();G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPause);}}
2539function ViewerToolbarForVisibilityStd(){G.VOM.toolbarMode='std';var sTB='';var t=G.O.viewerToolbar.standard.split(',');for(var i=0,lt=t.length;i<lt;i++){sTB+=ToolbarAddElt(t[i]);}
2540G.VOM.$toolbar.find('.toolbar').html(sTB);ViewerToolbarElementContent();}
2541function ViewerToolbarForVisibilityMin(){if(G.O.viewerToolbar.minimized==undefined||G.O.viewerToolbar.minimized==''){ViewerToolbarForVisibilityStd();}
2542else{G.VOM.toolbarMode='min';var sTB='';var t=G.O.viewerToolbar.minimized.split(',');for(var i=0,lt=t.length;i<lt;i++){sTB+=ToolbarAddElt(t[i]);}
2543G.VOM.$toolbar.find('.toolbar').html(sTB);ViewerToolbarElementContent();}}
2544function ViewerToolbarElementContent(){var vomIdx=G.VOM.content.current.vIdx;if(vomIdx==null){return;}
2545var item=G.VOM.content.current.NGY2Item();var setTxt=false;if(item.title!==undefined&&item.title!=''){G.VOM.$viewer.find('.ngy2viewerToolAction').find('.title').html(item.title);setTxt=true;}
2546else{G.VOM.$viewer.find('.ngy2viewerToolAction').find('.title').html('');}
2547if(item.description!==undefined&&item.description!=''){G.VOM.$viewer.find('.ngy2viewerToolAction').find('.description').html(item.description);setTxt=true;}
2548else{G.VOM.$viewer.find('.ngy2viewerToolAction').find('.description').html('');}
2549if(setTxt){G.VOM.$viewer.find('.ngy2viewerToolAction').find('.label').show();}
2550else{G.VOM.$viewer.find('.ngy2viewerToolAction').find('.label').hide();}
2551var viewerMaxImages=G.VOM.items.length;if(viewerMaxImages>0){G.VOM.$viewer.find('.pageCounter').html((G.VOM.items[vomIdx].mediaNumber)+'/'+viewerMaxImages);}
2552var $cu=G.VOM.$viewer.find('.ngy2CustomBtn');var fu=G.O.fnImgToolbarCustDisplay;if($cu.length>0&&fu!==null){typeof fu=='function'?fu($cu,item):window[fu]($cu,item);}
2553ViewerToolsOn();}
2554function ViewerMediaPanX(posX){G.VOM.swipePosX=posX;if(G.CSStransformName==null){}
2555else{G.VOM.content.current.$media[0].style[G.CSStransformName]='translate('+posX+'px, 0px)';var itemPrevious=G.VOM.content.previous.NGY2Item();var itemNext=G.VOM.content.next.NGY2Item();if(G.O.imageTransition.startsWith('SWIPE')){if(itemPrevious.mediaTransition()){ViewerSetMediaVisibility(G.VOM.content.previous,1);}
2556if(itemNext.mediaTransition()){ViewerSetMediaVisibility(G.VOM.content.next,1);}
2557var sc=Math.min(Math.max(Math.abs(posX)/G.VOM.window.lastWidth,.8),1);if(G.O.imageTransition=='SWIPE'){sc=1;}
2558if(posX>0){let dir=G.VOM.window.lastWidth;if(itemPrevious.mediaTransition()){G.VOM.content.previous.$media[0].style[G.CSStransformName]='translate('+(-dir+posX)+'px, 0px) scale('+sc+')';}
2559if(itemNext.mediaTransition()){G.VOM.content.next.$media[0].style[G.CSStransformName]='translate('+(dir)+'px, 0px) scale('+sc+')';}}
2560else{let dir=-G.VOM.window.lastWidth;if(itemNext.mediaTransition()){G.VOM.content.next.$media[0].style[G.CSStransformName]='translate('+(-dir+posX)+'px, 0px) scale('+sc+')';}
2561if(itemPrevious.mediaTransition()){G.VOM.content.previous.$media[0].style[G.CSStransformName]='translate('+(dir)+'px, 0px) scale('+sc+')';}}}
2562if(G.O.imageTransition=='SLIDEAPPEAR'){G.VOM.content.previous.$media[0].style[G.CSStransformName]='';G.VOM.content.next.$media[0].style[G.CSStransformName]='';if(posX<0){let o=(-posX)/G.VOM.window.lastWidth;if(itemNext.mediaTransition()){ViewerSetMediaVisibility(G.VOM.content.next,o);}
2563if(itemPrevious.mediaTransition()){ViewerSetMediaVisibility(G.VOM.content.previous,0);}}
2564else{let o=posX/G.VOM.window.lastWidth;if(itemPrevious.mediaTransition()){ViewerSetMediaVisibility(G.VOM.content.previous,o);}
2565if(itemNext.mediaTransition()){ViewerSetMediaVisibility(G.VOM.content.next,0);}}}}}
2566function DisplayNextMedia(velocity){velocity=velocity||0;if(G.VOM.viewerMediaIsChanged||((new Date().getTime())-G.VOM.timeImgChanged<300)){return;}
2567TriggerCustomEvent('lightboxNextImage');LightboxDisplay('nextImage',velocity);};function DisplayPreviousMedia(velocity){velocity=velocity||0;if(G.VOM.viewerMediaIsChanged||((new Date().getTime())-G.VOM.timeImgChanged<300)){return;}
2568if(G.VOM.playSlideshow){SlideshowToggle();}
2569TriggerCustomEvent('lightboxPreviousImage');LightboxDisplay('previousImage',velocity);};function LightboxDisplay(displayType,velocity){velocity=velocity||0;if(G.O.debugMode&&console.timeline){console.timeline('nanogallery2_viewer');}
2570if(G.VOM.playSlideshow){window.clearTimeout(G.VOM.playSlideshowTimerID);}
2571var current_content_item=null;var new_content_item=null;G.VOM.timeImgChanged=new Date().getTime();G.VOM.viewerMediaIsChanged=true;G.VOM.zoom.isZooming=false;ResizeLightbox(true);switch(displayType){case'':current_content_item=G.VOM.content.current;new_content_item=G.VOM.content.current;break;case'previousImage':current_content_item=G.VOM.content.current;new_content_item=G.VOM.content.previous;break;default:current_content_item=G.VOM.content.current;new_content_item=G.VOM.content.next;}
2572SetLocationHash(new_content_item.NGY2Item().albumID,new_content_item.NGY2Item().GetID());if(displayType==''){return;}
2573var vP=G.GOM.cache.viewport;var t_easing='';var t_dur=500*(vP.w-Math.abs(G.VOM.swipePosX))/vP.w;if(velocity>0){t_dur=Math.min((vP.w-Math.abs(G.VOM.swipePosX))/velocity,t_dur);t_easing='linear';}
2574if(G.CSStransformName==null){ViewerSetMediaVisibility(new_content_item,1);ViewerSetMediaVisibility(current_content_item,1);LightboxDisplayFinalize(displayType);}
2575else{switch(G.O.imageTransition){case'SWIPE':case'SWIPE2':var dir=(displayType=='nextImage'?-vP.w:vP.w);new_content_item.$media[0].style[G.CSStransformName]='translate('+(-dir)+'px, 0px) '
2576if(velocity==0){t_easing=G.O.imageTransition=='swipe'?'easeInOutSine':'easeOutCubic';}
2577ViewerSetMediaVisibility(G.VOM.content.current,1);G.VOM.content.current.$media[0].style[G.CSStransformName]='translate(0px, 0px)';ViewerSetMediaVisibility(new_content_item,1);new NGTweenable().tween({from:{t:G.VOM.swipePosX},to:{t:(displayType=='nextImage'?-vP.w:vP.w)},attachment:{dT:displayType,new_content_item:new_content_item,dir:dir,media_transition:new_content_item.NGY2Item().mediaTransition()},duration:t_dur,easing:(t_easing),step:function(state,att){G.VOM.content.current.$media[0].style[G.CSStransformName]='translate('+state.t+'px, 0px)';if(att.media_transition){var sc=Math.min(Math.max((Math.abs(state.t))/G.VOM.window.lastWidth,.8),1);if(G.O.imageTransition=='SWIPE'){sc=1;}
2578att.new_content_item.$media[0].style[G.CSStransformName]='translate('+(-att.dir+state.t)+'px, 0px) scale('+sc+')';}},finish:function(state,att){G.VOM.content.current.$media[0].style[G.CSStransformName]='';ViewerSetMediaVisibility(G.VOM.content.current,0);att.new_content_item.$media[0].style[G.CSStransformName]='';LightboxDisplayFinalize(att.dT);}});break;case'SLIDEAPPEAR':default:var op=(Math.abs(G.VOM.swipePosX))/G.VOM.window.lastWidth;new_content_item.$media[0].style[G.CSStransformName]='';if(velocity==0){t_easing='easeInOutSine';}
2579new NGTweenable().tween({from:{o:op,t:G.VOM.swipePosX},to:{o:1,t:(displayType=='nextImage'?-vP.w:vP.w)},attachment:{dT:displayType,new_content_item:new_content_item,media_transition:new_content_item.NGY2Item().mediaTransition()},delay:30,duration:t_dur,easing:t_easing,step:function(state,att){G.VOM.content.current.$media[0].style[G.CSStransformName]='translate('+state.t+'px, 0px)';if(att.media_transition){ViewerSetMediaVisibility(att.new_content_item,state.o);}},finish:function(state,att){G.VOM.content.current.$media[0].style[G.CSStransformName]='';LightboxDisplayFinalize(att.dT);}});break;}}}
2580function LightboxDisplayFinalize(displayType){var newVomIdx=0;switch(displayType){case'':newVomIdx=G.VOM.content.current.vIdx;break;case'previousImage':newVomIdx=G.VOM.content.previous.vIdx;break;default:newVomIdx=G.VOM.content.next.vIdx;}
2581G.VOM.content.current.vIdx=newVomIdx;G.VOM.content.next.vIdx=G.VOM.IdxNext();G.VOM.content.previous.vIdx=G.VOM.IdxPrevious();G.VOM.gallery.Resize();G.VOM.gallery.SetThumbnailActive();var ngy2item=G.VOM.content.current.NGY2Item();ViewerToolbarElementContent();if(G.O.debugMode&&console.timeline){console.timelineEnd('nanogallery2_viewer');}
2582var fu=G.O.fnImgDisplayed;if(fu!==null){typeof fu=='function'?fu(ngy2item):window[fu](ngy2item);}
2583G.VOM.swipePosX=0;if(displayType!=''){G.VOM.content.current.$media.removeClass('imgCurrent');var $tmp=G.VOM.content.current.$media;switch(displayType){case'nextImage':G.VOM.content.current.$media=G.VOM.content.next.$media;G.VOM.content.next.$media=$tmp;break;case'previousImage':G.VOM.content.current.$media=G.VOM.content.previous.$media;G.VOM.content.previous.$media=$tmp;break;}}
2584G.VOM.content.current.$media.addClass('imgCurrent');var $pans=G.VOM.$content.find('.nGY2ViewerMediaPan');G.VOM.content.current.$media.insertAfter($pans.last());if(ngy2item.mediaKind=='img'&&ngy2item.imageWidth==0){ViewerSetMediaVisibility(G.VOM.content.current,0);}
2585else{G.VOM.content.current.$media.children().eq(0).attr('class','nGY2ViewerMediaLoaderHidden');ViewerSetMediaVisibility(G.VOM.content.current,1);}
2586G.VOM.content.next.$media.empty();var nextItem=G.VOM.content.next.NGY2Item();var spreloader='<div class="nGY2ViewerMediaLoaderDisplayed"></div>';if(nextItem.mediaKind=='img'&&nextItem.imageWidth!=0&&nextItem.imageHeight!=0){spreloader='<div class="nGY2ViewerMediaLoaderHidden"></div>';}
2587G.VOM.content.next.$media.append(spreloader+nextItem.mediaMarkup);ViewerSetMediaVisibility(G.VOM.content.next,0);ViewerSetMediaVisibility(G.VOM.content.previous,0);if(nextItem.mediaKind=='img'){G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,nextItem);}
2588else{ViewerMediaCenterNotImg(G.VOM.content.next.$media);}
2589G.VOM.content.previous.$media.empty();var previousItem=G.VOM.content.previous.NGY2Item();spreloader='<div class="nGY2ViewerMediaLoaderDisplayed"></div>';if(previousItem.mediaKind=='img'&&previousItem.imageWidth!=0&&previousItem.imageHeight!=0){spreloader='<div class="nGY2ViewerMediaLoaderHidden"></div>';}
2590G.VOM.content.previous.$media.append(spreloader+previousItem.mediaMarkup);ViewerSetMediaVisibility(G.VOM.content.previous,0);ViewerSetMediaVisibility(G.VOM.content.next,0);if(previousItem.mediaKind=='img'){G.VOM.ImageLoader.loadImage(VieweImgSizeRetrieved,previousItem);}
2591else{ViewerMediaCenterNotImg(G.VOM.content.previous.$media);}
2592if(G.VOM.playSlideshow){G.VOM.content.current.$media.children().eq(1).ngimagesLoaded().always(function(instance){if(G.VOM.playSlideshow){G.VOM.playSlideshowTimerID=window.setTimeout(function(){DisplayNextMedia();},G.VOM.slideshowDelay);}});}
2593ResizeLightbox();G.VOM.viewerMediaIsChanged=false;TriggerCustomEvent('lightboxImageDisplayed');}
2594function VieweImgSizeRetrieved(w,h,item,n){item.imageWidth=w;item.imageHeight=h;if(G.VOM.content.current.NGY2Item()==item){G.VOM.content.current.$media.children().eq(0).attr('class','nGY2ViewerMediaLoaderHidden');ViewerSetMediaVisibility(G.VOM.content.current,1);G.VOM.zoom.userFactor=1;}
2595if(G.VOM.content.next.NGY2Item()==item){G.VOM.content.next.$media.children().eq(0).attr('class','nGY2ViewerMediaLoaderHidden');}
2596if(G.VOM.content.previous.NGY2Item()==item){G.VOM.content.previous.$media.children().eq(0).attr('class','nGY2ViewerMediaLoaderHidden');}
2597ViewerMediaSetPosAndZoom();}
2598function ViewerSetMediaVisibility(content_item,opacity){var item=content_item.NGY2Item();var $media=content_item.$media;if(item.mediaKind=='img'&&item.imageWidth==0){$media.children().eq(1).css({opacity:0,visibility:'hidden'});return;}
2599if(opacity==0){$media.children().css({opacity:0,visibility:'hidden'});}
2600else{$media.children().css({opacity:opacity,visibility:'visible'});}}
2601function LightboxClose(vomIdx){if(vomIdx==undefined){vomIdx=G.VOM.content.current.vIdx;}
2602G.VOM.viewerMediaIsChanged=false;if(G.VOM.viewerDisplayed){jQuery("body").removeClass("nGY2_body_scrollbar");jQuery("#nGY2_body_scrollbar_style").remove();if(G.VOM.playSlideshow){window.clearTimeout(G.VOM.playSlideshowTimerID);G.VOM.playSlideshow=false;}
2603G.VOM.hammertime.destroy();G.VOM.hammertime=null;if(ngscreenfull.enabled&&G.VOM.viewerIsFullscreen){G.VOM.viewerIsFullscreen=false;ngscreenfull.exit();}
2604jQuery('.nGY2ViewerContainer').remove();G.VOM.$baseCont=null;G.VOM.viewerDisplayed=false;if(G.O.lightboxStandalone){return;}
2605if(G.O.thumbnailAlbumDisplayImage){if(vomIdx==null){}
2606else{var item=G.I[G.VOM.items[vomIdx].ngy2ItemIdx];var parent=NGY2Item.Get(G,item.albumID);if(G.GOM.albumIdx!=parent.albumID){DisplayAlbum('-1',parent.albumID);}
2607else{GalleryResize();SetLocationHash('','');ThumbnailHoverReInitAll();}}}
2608else{if(vomIdx!=null){if(G.GOM.albumIdx==-1){DisplayAlbum('',G.I[G.VOM.items[vomIdx].ngy2ItemIdx].albumID);}
2609else{GalleryResize();SetLocationHash(G.I[G.VOM.items[vomIdx].ngy2ItemIdx].albumID,'');ThumbnailHoverReInitAll();}}}
2610G.VOM.timeImgChanged=new Date().getTime();}}
2611function ResizeLightbox(forceUpdate){forceUpdate=typeof forceUpdate!=='undefined'?forceUpdate:false;if(G.VOM.$toolbar===null){return;}
2612var windowsW=G.VOM.$viewer.width();var windowsH=G.VOM.$viewer.height();var $elt=G.VOM.content.current.$media.children().eq(1);if($elt==null||G.VOM.content.current.vIdx==-1){return;}
2613if(!forceUpdate&&G.VOM.window.lastWidth==windowsW&&G.VOM.window.lastHeight==windowsH){return;}
2614G.VOM.window.lastWidth=windowsW;G.VOM.window.lastHeight=windowsH;var galleryHeight=0;var cBottom=0;if(G.O.viewerGallery!='none'){galleryHeight=G.O.viewerGalleryTHeight+10;}
2615if(G.O.viewerGallery=='bottom'){cBottom=galleryHeight;}
2616switch(G.O.viewerToolbar.position){case'top':case'topOverImage':G.VOM.$content.css({height:windowsH,width:windowsW,top:0});G.VOM.$toolbar.css({top:0,bottom:''});break;case'bottom':case'bottomOverImage':default:windowsH-=cBottom;G.VOM.$content.css({height:windowsH,width:windowsW,bottom:-cBottom,top:0});G.VOM.$toolbar.css({bottom:galleryHeight});break;}
2617if(!G.VOM.viewerMediaIsChanged&&G.VOM.zoom.isZooming){ViewerMediaSetPosAndZoom();}
2618else{if(!G.VOM.zoom.isZooming&&(G.VOM.zoom.userFactor!=0||G.VOM.panPosX!=0||G.VOM.panPosY!=0||G.VOM.zoom.posX!=0||G.VOM.zoom.posY!=0)){G.VOM.zoom.isZooming=true;new NGTweenable().tween({from:{userFactor:G.VOM.zoom.userFactor,panPosX:G.VOM.panPosX,panPosY:G.VOM.panPosY,zoomPosX:G.VOM.zoom.posX,zoomPosY:G.VOM.zoom.posY},to:{userFactor:1,panPosX:0,panPosY:0,zoomPosX:0,zoomPosY:0},easing:'easeInOutSine',delay:0,duration:150,step:function(state){G.VOM.zoom.userFactor=state.userFactor;G.VOM.panPosX=state.panPosX;G.VOM.panPosY=state.panPosY;G.VOM.zoom.posX=state.zoomPosX;G.VOM.zoom.posY=state.zoomPosY;ViewerMediaSetPosAndZoom();},finish:function(state){G.VOM.zoom.isZooming=false;}});}
2619else{G.VOM.zoom.userFactor=1;G.VOM.zoom.isZooming=false;G.VOM.panPosX=0;G.VOM.panPosY=0;G.VOM.zoom.posX=0;G.VOM.zoom.posY=0;ViewerMediaSetPosAndZoom();}}}
2620function getScrollableParent(node){const regex=/(auto|scroll)/;const parents=(_node,ps)=>{if(_node.parentNode===null){return ps;}
2621return parents(_node.parentNode,ps.concat([_node]));};const style=(_node,prop)=>getComputedStyle(_node,null).getPropertyValue(prop);const overflow=_node=>style(_node,'overflow')+style(_node,'overflow-y')+style(_node,'overflow-x');const scroll=_node=>regex.test(overflow(_node));const scrollParent=(_node)=>{if(!(_node instanceof HTMLElement||_node instanceof SVGElement)){return undefined;}
2622const ps=parents(_node.parentNode,[]);for(let i=0;i<ps.length;i+=1){if(ps[i]===document.body){return null;}
2623if(scroll(ps[i])){return ps[i];}}
2624return document.scrollingElement||document.documentElement;};return scrollParent(node);};function BuildSkeleton(){var $elements=G.$E.base.children();if($elements.length>0){G.O.$markup=$elements;}
2625if(!G.O.lightboxStandalone){G.$E.base.text('');G.$E.base.addClass('ngy2_container');G.$E.base.addClass(G.O.theme)
2626SetGalleryTheme();if(G.O.thumbnailLabel.get('hideIcons')){G.O.icons.thumbnailAlbum='';G.O.icons.thumbnailImage='';}
2627var styleNavigation="";if(G.O.navigationFontSize!=undefined&&G.O.navigationFontSize!=''){styleNavigation=' style="font-size:'+G.O.navigationFontSize+';"';}
2628G.$E.conNavigationBar=jQuery('<div class="nGY2Navigationbar" '+styleNavigation+'></div>').appendTo(G.$E.base);G.$E.conLoadingB=jQuery('<div class="nanoGalleryLBarOff"><div></div><div></div><div></div><div></div><div></div></div>').appendTo(G.$E.base);G.$E.conTnParent=jQuery('<div class="nGY2Gallery"></div>').appendTo(G.$E.base);G.$E.conTn=jQuery('<div class="nGY2GallerySub"></div>').appendTo(G.$E.conTnParent);switch(G.O.thumbnailAlignment){case'left':G.$E.conTnParent.css({'text-align':'left'});break;case'right':G.$E.conTnParent.css({'text-align':'right'});break;}
2629if(G.O.galleryBuildInit2!==undefined){var t1=G.O.galleryBuildInit2.split('|');for(var i=0;i<t1.length;i++){var o1=t1[i].split('_');if(o1.length==2){G.$E.conTn.css(o1[0],o1[1]);}}}
2630var effects=G.tn.hoverEffects.std.concat(G.tn.hoverEffects.level1);for(var j=0;j<effects.length;j++){switch(effects[j].type){case'scale':case'rotateZ':case'rotateX':case'rotateY':case'translateX':case'translateY':if(effects[j].element=='.nGY2GThumbnail'){G.$E.base.css('overflow','visible');G.$E.base.find('.nGY2GallerySub').css('overflow','visible');G.$E.conTnParent.css('overflow','visible');}
2631break;}}
2632G.$E.conTnBottom=jQuery('<div class="nGY2GalleryBottom" '+styleNavigation+'></div>').appendTo(G.$E.conTnParent);if(G.O.portable){var logo='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAYCAYAAACbU/80AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH4QgDBCAWVVC/hwAABRxJREFUSMetll9oVFcexz/nnDvJRBmSzWTrmD9uNGZsHta0/qFIFQTxRcnCBgTFNlX0YR8W+1AK9lGwCBJYgn0KKr5136S4gpUQTR4caJRslcxYWV3iaphQapJJppO5957z60Mmk4mN1q75wg/OPefc+/v9vt/fueenKEFEqICqsNWAVNiCA7XwaS0iZeejo6OIiCltdIBdJXMLOYp5/PjxsoTVS5nr0mYDJIE/lObeBhaYAn4oJbboAwBvBedHJicnPx8YGGh/8eJF1dvKoJSShoYGf//+/Zl4PP4l8M2yIEoSLErx6c2bN6W1tXVRglWzLVu2SCqVEhE5LiI457SIoEREW2udMaZtcnLy+2QyWZ3L5XRHR4f+4MNdoBUahUJhcWilmZ/NE4ZhOQHn3LIi1lqjtS6vjY6O8uTJE9vc3MyDBw+mYrHYn0Uk63me8gCtlHLA7uHh4bW5XC7oePddPTQ8xHffDjM/PYe3thqMws35iAcHPj5ENBp9Yxmy2Sw7d+40z549C+7du9ewb9++D6y13wDaK+kE0DAzMyNKKbXtvfd5EfzM+Ef/4C+8x23+wzPm+IhtfMf3/Ksuyl+7u9FaY63l+vXrpFIpCoUCmzdvpquri9bWVoIgQClFIpFg48aNPH/+XE9NTQkQLTGmvEXKRERprZWIEIYhQRjQbN6hmUb+tCaPNnM055v40f3If7XBGMPT8af0fNLD0NDQsozPnDlDb28vx44dIwxDRARrLSKCKmUbiUQQkWWnoLJ20UpjFYAjVA6rBJTFV5ZIJIIfBBw4eICxsTHq6uo4dOgQ8XicgYEB7t69y/Hjx4nH43R1dVHB8q+w4hlXSmGd5edwmjCco5DLkZ+aJvTnyIdTrFmzhn9+/TVjY2M0NTVx+/Zt+vv7OXfuHKlUip6eHgBOnz6N7/vlYl0JKzIw78/T+sdGbn6yjf5ZS2HtJgIP+mcC5kySI1uSXPjqAlprTp06RWdnJ8ViEaUUVVVVnD9/nqtXr5LJZHj48CFbt279fQEEYUisZi2fXel9bWU750gmkwRBgNYaz/Ow1lJfX088Hmd2dpZcLvdaBl4pgQChH4B1iHU4a8E6Qj9ARGhpaUFrzeDgIJFIBGMM1lqMMWQyGSYmJohEIqxfv/7314CIoADtGTAaZTTaLI2VUhw+fBjnHBcvXuTy5cs45/A8j3Q6zcmTJ/F9n71799LW1rbgSOs3D+B1lBljcM7R3d3N0aNHKRQKnDhxgs7OTnbt2sX27dsZGRkhHo/T19e3+Kt/fQ1YawFwzolSCs/zUEqVtX1VcJcuXSKRSNDf3086nS6v79mzh76+Pjo6OigWi1RXV2OMWZC29PL8/PxSAL7vE41Gf4rFYkpEePToEb7vU1VVxW+ht7eXs2fPcv/+fQqFAps2baKlpaW8Xl1dTS6XY3x8HBFxtbW1BiiW4hAlInp8fNxt2LChPZvN/ru9vT2Sz+e93bt3qx07diwrzJWYcM5RU1NDNBots5bP53HOlS+kO3fuMDIy4hKJhKTT6ena2tqtxWJxoqamRr98HX9x7do1qaurExYaiXCVzK5bt04GBwdFRP728nVcWZAO+Hsmk/nsxo0bTTMzM5FXHZ83hYhQX1/vHzx48H9tbW1ngSsVvpYCmJ2dJRaLKRbapjpgOxB7K+9LmAbuAnOAnpiYcI2NjUsRLlo2myUMQ1M5t5rmnDO3bt1aNlfmd4W2XL/0/H8pUDF2rNCW/wLRuCkxx8V6wgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wOC0wM1QwNDozMjoyMi0wNDowMO7mdkwAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDgtMDNUMDQ6MzI6MjItMDQ6MDCfu87wAAAAAElFTkSuQmCC';var st="font-weight:bold !important;color: #FF0075 !important;font-size: 14px !important;text-transform: lowercase !important;cursor:pointer !important;text-align: center !important;Text-Shadow: #000000 1px 0px 0px, #000000 1px 1px 0px, #000000 1px -1px 0px, #000000 -1px 1px 0px, #000000 -1px 0px 0px, #000000 -1px -1px 0px, #000000 0px 1px 0px, #000000 0px -1px 0px !important;";G.$E.ngy2i=jQuery('<div class="nGY2PortInfo"><a href="http://nano.gallery" target="_blank" title="nanogallery2 | easy photo gallery for your website" style="'+st+'"><img src="'+logo+'" style="height:32px !important;width:initial !important;box-shadow: none !important;vertical-align: middle !important;"/> &nbsp; nanogallery2</a></div>').appendTo(G.$E.base);G.$E.ngy2i.find('a').on({mouseenter:function(){jQuery(this).attr('style',st);},mouseleave:function(){jQuery(this).attr('style',st);}});}}
2633G.$E.conConsole=jQuery('<div class="nGY2ConsoleParent"></div>').appendTo(G.$E.base);i18n();if(!G.O.lightboxStandalone){ThumbnailDefCaches();switch(G.tn.opt.Get('displayTransition')){case'SCALEDOWN':case'RANDOMSCALE':default:G.$E.base.css('overflow','visible');G.$E.conTnParent.css('overflow','visible');G.$E.conTn.css('overflow','visible');break;}}}
2634function TriggerCustomEvent(eventName){var eN=eventName+'.nanogallery2';var event=null;try{event=new Event(eN);}catch(e){event=document.createEvent('Event');event.initEvent(eN,false,false);}
2635G.$E.base.trigger(eN,event);}
2636function SetGlobalEvents(){if(!G.O.lightboxStandalone){G.$E.conTnParent.on({mouseenter:GalleryMouseEnter,mouseleave:GalleryMouseLeave},".nGY2GThumbnail");G.GOM.hammertime=new NGHammer(G.$E.conTn[0]);G.GOM.hammertime.on('pan',function(ev){if(!G.VOM.viewerDisplayed){if(G.O.paginationSwipe&&G.layout.support.rows&&G.galleryDisplayMode.Get()=='PAGINATION'){if(Math.abs(ev.deltaY)>G.GOM.panThreshold){G.GOM.panYOnly=true;}
2637if(!G.GOM.panYOnly){G.$E.conTn.css(G.CSStransformName,'translate('+(ev.deltaX)+'px,0px)');}}}});G.GOM.hammertime.on('panend',function(ev){if(!G.VOM.viewerDisplayed){if(G.O.paginationSwipe&&G.layout.support.rows&&G.galleryDisplayMode.Get()=='PAGINATION'){if(!G.GOM.panYOnly){if(ev.deltaX>50){paginationPreviousPage();return;}
2638if(ev.deltaX<-50){paginationNextPage();return;}}
2639G.GOM.panYOnly=false;G.$E.conTn.css(G.CSStransformName,'translate(0px,0px)');}}});G.GOM.hammertime.on('tap',function(ev){if(!G.VOM.viewerDisplayed){ev.srcEvent.stopPropagation();ev.srcEvent.preventDefault();if(ev.pointerType=='mouse'){if(GalleryClicked(ev.srcEvent)=='exit'){return;}}
2640else{var r=GalleryEventRetrieveElementl(ev.srcEvent,false);if(r.GOMidx==-1){return;}
2641if(r.action!='NONE'&&r.action!='OPEN'){GalleryClicked(ev.srcEvent);return;}
2642if(G.GOM.slider.hostIdx==r.GOMidx){ThumbnailHoverOutAll();ThumbnailOpen(G.GOM.items[G.GOM.slider.currentIdx].thumbnailIdx,true);return;}
2643if((G.GOM.curNavLevel=='l1'&&G.O.touchAnimationL1==false)||(G.GOM.curNavLevel=='lN'&&G.O.touchAnimation==false)){ThumbnailOpen(G.GOM.items[r.GOMidx].thumbnailIdx,true);return;}
2644if(G.O.touchAutoOpenDelay>0){ThumbnailHoverOutAll();ThumbnailHover(r.GOMidx);window.clearInterval(G.touchAutoOpenDelayTimerID);G.touchAutoOpenDelayTimerID=window.setInterval(function(){window.clearInterval(G.touchAutoOpenDelayTimerID);ThumbnailOpen(G.GOM.items[r.GOMidx].thumbnailIdx,true);},G.O.touchAutoOpenDelay);}
2645else{if(!G.I[G.GOM.items[r.GOMidx].thumbnailIdx].hovered){ThumbnailHoverOutAll();ThumbnailHover(r.GOMidx);}
2646else{ThumbnailOpen(G.GOM.items[r.GOMidx].thumbnailIdx,true);}}}}});if(G.O.locationHash){jQuery(window).on('hashchange.nanogallery2.'+G.baseEltID,function(){ProcessLocationHash();});}}
2647jQuery(window).on('resize.nanogallery2.'+G.baseEltID+' orientationChange.nanogallery2.'+G.baseEltID,debounce(ResizeWindowEvent,G.O.eventsDebounceDelay,false));jQuery(window).on('scroll.nanogallery2.'+G.baseEltID,debounce(OnScrollEvent,G.O.eventsDebounceDelay,false));if(!G.O.lightboxStandalone){G.$E.scrollableParent=getScrollableParent(G.$E.base[0]);var sp=getScrollableParent(G.$E.base[0]);if(sp!==null){G.$E.scrollableParent=jQuery(sp);G.$E.scrollableParent.on('scroll.nanogallery2.'+G.baseEltID,debounce(OnScrollEvent,G.O.eventsDebounceDelay,false));}}
2648G.VOM.toolsHide=debounce(ViewerToolsHide,G.O.viewerHideToolsDelay,false);jQuery(document).keyup(function(e){if(G.popup.isDisplayed){switch(e.keyCode){case 27:G.popup.close();break;}}
2649else{if(G.VOM.viewerDisplayed){ViewerToolsUnHide();switch(e.keyCode){case 27:case 40:case 38:LightboxClose();break;case 32:case 13:SlideshowToggle();break;case 39:case 33:DisplayNextMedia();break;case 37:case 34:DisplayPreviousMedia();break;case 35:case 36:}}}});jQuery(window).bind('mousewheel wheel',function(e){if(G.VOM.viewerDisplayed&&G.VOM.content.current.NGY2Item().mediaKind=='img'){var deltaY=0;e.preventDefault();if(ViewerZoomStart()){if(e.originalEvent.deltaY){deltaY=e.originalEvent.deltaY;}else if(e.originalEvent.wheelDelta){deltaY=-e.originalEvent.wheelDelta;}
2650ViewerZoomIn(deltaY<=0?true:false);}}});jQuery(window).bind('mousemove',function(e){if(G.VOM.viewerDisplayed){if(G.VOM.toolbarsDisplayed==false){G.VOM.singletapTime=new Date().getTime();debounce(ViewerToolsUnHide,100,false)();}}});if(ngscreenfull.enabled){ngscreenfull.onchange(function(){if(G.VOM.viewerDisplayed){if(ngscreenfull.isFullscreen){G.VOM.viewerIsFullscreen=true;G.VOM.$viewer.find('.fullscreenButton').html(G.O.icons.viewerFullscreenOff);}
2651else{G.VOM.viewerIsFullscreen=false;G.VOM.$viewer.find('.fullscreenButton').html(G.O.icons.viewerFullscreenOn);}}});}}
2652function ProcessLocationHash(){if(!G.O.locationHash){return false;}
2653var curGal='#nanogallery/'+G.baseEltID+'/',newLocationHash=location.hash;if(G.O.debugMode){console.log('------------------------ PROCESS LOCATION HASH');console.log('newLocationHash1: '+newLocationHash);console.log('G.locationHashLastUsed: '+G.locationHashLastUsed);}
2654if(newLocationHash==''){if(G.locationHashLastUsed!==''){if(G.O.debugMode){console.log('display root album');}
2655G.locationHashLastUsed='';if(G.O.debugMode){console.log('new3 G.locationHashLastUsed: '+G.locationHashLastUsed);}
2656DisplayAlbum('','0');return true;}}
2657if(newLocationHash==G.locationHashLastUsed){return;}
2658if(newLocationHash.indexOf(curGal)==0){var IDs=parseIDs(newLocationHash.substring(curGal.length));if(IDs.imageID!='0'){if(G.O.debugMode){console.log('display image: '+IDs.albumID+'-'+IDs.imageID);}
2659DisplayPhoto(IDs.imageID,IDs.albumID);return true;}
2660else{if(G.O.debugMode){console.log('display album: '+IDs.albumID);}
2661DisplayAlbum('-1',IDs.albumID);return true;}}
2662return false;}
2663function SetLocationHash(albumID,imageID){if(!G.O.locationHash||G.O.lightboxStandalone){return false;}
2664if(G.O.debugMode){console.log('------------------------ SET LOCATION HASH');}
2665if(imageID==''&&(albumID=='-1'||albumID=='0'||G.O.album==albumID)){if(location.hash!=''){if("pushState" in history){}
2666else{}}
2667G.locationHashLastUsed='';if(G.O.debugMode){console.log('new2 G.locationHashLastUsed: '+G.locationHashLastUsed);}
2668return;}
2669var newLocationHash='#'+'nanogallery/'+G.baseEltID+'/'+albumID;if(imageID!=''){newLocationHash+='/'+imageID;}
2670var lH=location.hash;if(G.O.debugMode){console.log('newLocationHash2: '+newLocationHash);console.log('location.hash: '+lH);}
2671G.locationHashLastUsed=newLocationHash;if(G.O.debugMode){console.log('new G.locationHashLastUsed: '+G.locationHashLastUsed);}
2672if(lH==''||lH!=newLocationHash){try{top.location.hash=newLocationHash;}
2673catch(e){G.O.locationHash=false;}}}
2674function ResizeWindowEvent(){CacheViewport();var l=G.GOM.curNavLevel;var w=G.GOM.curWidth;if(G.VOM.viewerDisplayed){ResizeLightbox();G.VOM.gallery.Resize();}
2675else{if(G.galleryResizeEventEnabled){var nw=RetrieveCurWidth();if(G.GOM.albumIdx!=-1){var s=G.tn.settings;if(G.layout.engine=="MOSAIC"){if(JSON.stringify(s.mosaic[l][w])!==JSON.stringify(s.mosaic[l][nw])){G.GOM.curWidth=nw;G.GOM.pagination.currentPage=0;GalleryRender(G.GOM.albumIdx);return;}}
2676else{if(s.height[l][w]!=s.height[l][nw]||s.width[l][w]!=s.width[l][nw]||s.gutterHeight[l][w]!=s.gutterHeight[l][nw]||s.gutterWidth[l][w]!=s.gutterWidth[l][nw]){G.GOM.curWidth=nw;G.GOM.pagination.currentPage=0;GalleryRender(G.GOM.albumIdx);return;}}}
2677GalleryResize();}}}
2678function OnScrollEvent(){if(!G.VOM.viewerDisplayed){GalleryResizeOnScrollEvent();}}
2679function GalleryResizeOnScrollEvent(){if(G.galleryResizeEventEnabled==false){window.setTimeout(GalleryResizeOnScrollEvent,10);}else{GalleryResize();}}
2680function i18n(){G.i18nLang=(navigator.language||navigator.userLanguage).toUpperCase();if(G.i18nLang==='UNDEFINED'){G.i18nLang='';}
2681var llang=-('_'+G.i18nLang).length;if(toType(G.O.i18n)=='object'){for(var key in G.O.i18n){var s=key.substr(llang);if(s==('_'+G.i18nLang)){G.i18nTranslations[key.substr(0,key.length-s.length)]=G.O.i18n[key];}
2682else{G.i18nTranslations[key]=G.O.i18n[key];}}}}
2683function GetI18nItem(item,property){var s='';if(G.i18nLang!=''){if(item[property+'_'+G.i18nLang]!==undefined&&item[property+'_'+G.i18nLang].length>0){s=item[property+'_'+G.i18nLang];return s;}}
2684s=item[property];return s;}
2685function RetrieveCurWidth(){var vpW=G.GOM.cache.viewport.w;if(G.O.breakpointSizeSM>0&&vpW<G.O.breakpointSizeSM){return'xs';}
2686if(G.O.breakpointSizeME>0&&vpW<G.O.breakpointSizeME){return'sm';}
2687if(G.O.breakpointSizeLA>0&&vpW<G.O.breakpointSizeLA){return'me';}
2688if(G.O.breakpointSizeXL>0&&vpW<G.O.breakpointSizeXL){return'la';}
2689return'xl';}
2690function browserNotification(){var m='Your browser version is not supported anymore. The image gallery cannot be displayed. <br><br>Please update to a more recent one. Download:<br>';m+='&nbsp;&nbsp;&nbsp; <a href="http://www.google.com/chrome/?hl=en-US)">Chrome</a><br>';m+='&nbsp;&nbsp;&nbsp; <a href="http://www.mozilla.com/firefox/)">Firefox</a><br>';m+='&nbsp;&nbsp;&nbsp; <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Internet Explorer</a><br>';m+='&nbsp;&nbsp;&nbsp; <a href="http://www.apple.com/safari/download/">Safari</a>';NanoAlert(G,m,false);}
2691function FirstSupportedPropertyName(prefixedPropertyNames){var tempDiv=document.createElement("div");for(var i=0;i<prefixedPropertyNames.length;++i){if(typeof tempDiv.style[prefixedPropertyNames[i]]!='undefined')
2692return prefixedPropertyNames[i];}
2693return null;}}
2694(function(global,factory){global.ngEvEmitter=factory();}(typeof window!='undefined'?window:this,function(){function ngEvEmitter(){}
2695var proto=ngEvEmitter.prototype;proto.on=function(eventName,listener){if(!eventName||!listener){return;}
2696var events=this._events=this._events||{};var listeners=events[eventName]=events[eventName]||[];if(listeners.indexOf(listener)==-1){listeners.push(listener);}
2697return this;};proto.once=function(eventName,listener){if(!eventName||!listener){return;}
2698this.on(eventName,listener);var onceEvents=this._onceEvents=this._onceEvents||{};var onceListeners=onceEvents[eventName]=onceEvents[eventName]||{};onceListeners[listener]=true;return this;};proto.off=function(eventName,listener){var listeners=this._events&&this._events[eventName];if(!listeners||!listeners.length){return;}
2699var index=listeners.indexOf(listener);if(index!=-1){listeners.splice(index,1);}
2700return this;};proto.emitEvent=function(eventName,args){var listeners=this._events&&this._events[eventName];if(!listeners||!listeners.length){return;}
2701var i=0;var listener=listeners[i];args=args||[];var onceListeners=this._onceEvents&&this._onceEvents[eventName];while(listener){var isOnce=onceListeners&&onceListeners[listener];if(isOnce){this.off(eventName,listener);delete onceListeners[listener];}
2702listener.apply(this,args);i+=isOnce?0:1;listener=listeners[i];}
2703return this;};return ngEvEmitter;}));(function(window,factory){'use strict';window.ngimagesLoaded=factory(window,window.ngEvEmitter);})(window,function factory(window,ngEvEmitter){var $=jQuery;var console=window.console;function extend(a,b){for(var prop in b){a[prop]=b[prop];}
2704return a;}
2705function makeArray(obj){var ary=[];if(Array.isArray(obj)){ary=obj;}else if(typeof obj.length=='number'){for(var i=0;i<obj.length;i++){ary.push(obj[i]);}}else{ary.push(obj);}
2706return ary;}
2707function ngImagesLoaded(elem,options,onAlways){if(!(this instanceof ngImagesLoaded)){return new ngImagesLoaded(elem,options,onAlways);}
2708if(typeof elem=='string'){elem=document.querySelectorAll(elem);}
2709this.elements=makeArray(elem);this.options=extend({},this.options);if(typeof options=='function'){onAlways=options;}else{extend(this.options,options);}
2710if(onAlways){this.on('always',onAlways);}
2711this.getImages();if($){this.jqDeferred=new $.Deferred();}
2712setTimeout(function(){this.check();}.bind(this));}
2713ngImagesLoaded.prototype=Object.create(ngEvEmitter.prototype);ngImagesLoaded.prototype.options={};ngImagesLoaded.prototype.getImages=function(){this.images=[];this.elements.forEach(this.addElementImages,this);};ngImagesLoaded.prototype.addElementImages=function(elem){if(elem.nodeName=='IMG'){this.addImage(elem);}
2714if(this.options.background===true){this.addElementBackgroundImages(elem);}
2715var nodeType=elem.nodeType;if(!nodeType||!elementNodeTypes[nodeType]){return;}
2716var childImgs=elem.querySelectorAll('img');for(var i=0;i<childImgs.length;i++){var img=childImgs[i];this.addImage(img);}
2717if(typeof this.options.background=='string'){var children=elem.querySelectorAll(this.options.background);for(i=0;i<children.length;i++){var child=children[i];this.addElementBackgroundImages(child);}}};var elementNodeTypes={1:true,9:true,11:true};ngImagesLoaded.prototype.addElementBackgroundImages=function(elem){var style=getComputedStyle(elem);if(!style){return;}
2718var reURL=/url\((['"])?(.*?)\1\)/gi;var matches=reURL.exec(style.backgroundImage);while(matches!==null){var url=matches&&matches[2];if(url){this.addBackground(url,elem);}
2719matches=reURL.exec(style.backgroundImage);}};ngImagesLoaded.prototype.addImage=function(img){var loadingImage=new LoadingImage(img);this.images.push(loadingImage);};ngImagesLoaded.prototype.addBackground=function(url,elem){var background=new Background(url,elem);this.images.push(background);};ngImagesLoaded.prototype.check=function(){var _this=this;this.progressedCount=0;this.hasAnyBroken=false;if(!this.images.length){this.complete();return;}
2720function onProgress(image,elem,message){setTimeout(function(){_this.progress(image,elem,message);});}
2721this.images.forEach(function(loadingImage){loadingImage.once('progress',onProgress);loadingImage.check();});};ngImagesLoaded.prototype.progress=function(image,elem,message){this.progressedCount++;this.hasAnyBroken=this.hasAnyBroken||!image.isLoaded;this.emitEvent('progress',[this,image,elem]);if(this.jqDeferred&&this.jqDeferred.notify){this.jqDeferred.notify(this,image);}
2722if(this.progressedCount==this.images.length){this.complete();}
2723if(this.options.debug&&console){console.log('progress: '+message,image,elem);}};ngImagesLoaded.prototype.complete=function(){var eventName=this.hasAnyBroken?'fail':'done';this.isComplete=true;this.emitEvent(eventName,[this]);this.emitEvent('always',[this]);if(this.jqDeferred){var jqMethod=this.hasAnyBroken?'reject':'resolve';this.jqDeferred[jqMethod](this);}};function LoadingImage(img){this.img=img;}
2724LoadingImage.prototype=Object.create(ngEvEmitter.prototype);LoadingImage.prototype.check=function(){var isComplete=this.getIsImageComplete();if(isComplete){this.confirm(this.img.naturalWidth!==0,'naturalWidth');return;}
2725this.proxyImage=new Image();this.proxyImage.addEventListener('load',this);this.proxyImage.addEventListener('error',this);this.img.addEventListener('load',this);this.img.addEventListener('error',this);this.proxyImage.src=this.img.src;};LoadingImage.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth!==undefined;};LoadingImage.prototype.confirm=function(isLoaded,message){this.isLoaded=isLoaded;this.emitEvent('progress',[this,this.img,message]);};LoadingImage.prototype.handleEvent=function(event){var method='on'+event.type;if(this[method]){this[method](event);}};LoadingImage.prototype.onload=function(){this.confirm(true,'onload');this.unbindEvents();};LoadingImage.prototype.onerror=function(){this.confirm(false,'onerror');this.unbindEvents();};LoadingImage.prototype.unbindEvents=function(){this.proxyImage.removeEventListener('load',this);this.proxyImage.removeEventListener('error',this);this.img.removeEventListener('load',this);this.img.removeEventListener('error',this);};function Background(url,element){this.url=url;this.element=element;this.img=new Image();}
2726Background.prototype=Object.create(LoadingImage.prototype);Background.prototype.check=function(){this.img.addEventListener('load',this);this.img.addEventListener('error',this);this.img.src=this.url;var isComplete=this.getIsImageComplete();if(isComplete){this.confirm(this.img.naturalWidth!==0,'naturalWidth');this.unbindEvents();}};Background.prototype.unbindEvents=function(){this.img.removeEventListener('load',this);this.img.removeEventListener('error',this);};Background.prototype.confirm=function(isLoaded,message){this.isLoaded=isLoaded;this.emitEvent('progress',[this,this.element,message]);};ngImagesLoaded.makeJQueryPlugin=function(jQuery){jQuery=jQuery||window.jQuery;if(!jQuery){return;}
2727$=jQuery;$.fn.ngimagesLoaded=function(options,callback){var instance=new ngImagesLoaded(this,options,callback);return instance.jqDeferred.promise($(this));};};ngImagesLoaded.makeJQueryPlugin();return ngImagesLoaded;});(function(){'use strict';var document=typeof window!=='undefined'&&typeof window.document!=='undefined'?window.document:{};var isCommonjs=typeof module!=='undefined'&&module.exports;var keyboardAllowed=typeof Element!=='undefined'&&'ALLOW_KEYBOARD_INPUT' in Element;var fn=(function(){var val;var fnMap=[['requestFullscreen','exitFullscreen','fullscreenElement','fullscreenEnabled','fullscreenchange','fullscreenerror'],['webkitRequestFullscreen','webkitExitFullscreen','webkitFullscreenElement','webkitFullscreenEnabled','webkitfullscreenchange','webkitfullscreenerror'],['webkitRequestFullScreen','webkitCancelFullScreen','webkitCurrentFullScreenElement','webkitCancelFullScreen','webkitfullscreenchange','webkitfullscreenerror'],['mozRequestFullScreen','mozCancelFullScreen','mozFullScreenElement','mozFullScreenEnabled','mozfullscreenchange','mozfullscreenerror'],['msRequestFullscreen','msExitFullscreen','msFullscreenElement','msFullscreenEnabled','MSFullscreenChange','MSFullscreenError']];var i=0;var l=fnMap.length;var ret={};for(;i<l;i++){val=fnMap[i];if(val&&val[1]in document){for(i=0;i<val.length;i++){ret[fnMap[0][i]]=val[i];}
2728return ret;}}
2729return false;})();var eventNameMap={change:fn.fullscreenchange,error:fn.fullscreenerror};var ngscreenfull={request:function(elem){return new Promise(function(resolve){var request=fn.requestFullscreen;var onFullScreenEntered=function(){this.off('change',onFullScreenEntered);resolve();}.bind(this);elem=elem||document.documentElement;if(/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)){elem[request]();}else{elem[request](keyboardAllowed?Element.ALLOW_KEYBOARD_INPUT:{});}
2730this.on('change',onFullScreenEntered);}.bind(this));},exit:function(){return new Promise(function(resolve){if(!this.isFullscreen){resolve();return;}
2731var onFullScreenExit=function(){this.off('change',onFullScreenExit);resolve();}.bind(this);document[fn.exitFullscreen]();this.on('change',onFullScreenExit);}.bind(this));},toggle:function(elem){return this.isFullscreen?this.exit():this.request(elem);},onchange:function(callback){this.on('change',callback);},onerror:function(callback){this.on('error',callback);},on:function(event,callback){var eventName=eventNameMap[event];if(eventName){document.addEventListener(eventName,callback,false);}},off:function(event,callback){var eventName=eventNameMap[event];if(eventName){document.removeEventListener(eventName,callback,false);}},raw:fn};if(!fn){if(isCommonjs){module.exports=false;}else{window.ngscreenfull=false;}
2732return;}
2733Object.defineProperties(ngscreenfull,{isFullscreen:{get:function(){return Boolean(document[fn.fullscreenElement]);}},element:{enumerable:true,get:function(){return document[fn.fullscreenElement];}},enabled:{enumerable:true,get:function(){return Boolean(document[fn.fullscreenEnabled]);}}});if(isCommonjs){module.exports=ngscreenfull;}else{window.ngscreenfull=ngscreenfull;}})();;(function(){const root=typeof window!=='undefined'?window:global
2734var NGTweenable=(function(){'use strict';var formula;var DEFAULT_SCHEDULE_FUNCTION;var DEFAULT_EASING='linear';var DEFAULT_DURATION=500;var UPDATE_TIME=1000/60;var _now=Date.now?Date.now:function(){return+new Date();};var now=typeof SHIFTY_DEBUG_NOW!=='undefined'?SHIFTY_DEBUG_NOW:_now;if(typeof window!=='undefined'){DEFAULT_SCHEDULE_FUNCTION=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||(window.mozCancelRequestAnimationFrame&&window.mozRequestAnimationFrame)||setTimeout;}else{DEFAULT_SCHEDULE_FUNCTION=setTimeout;}
2735function noop(){}
2736function each(obj,fn){var key;for(key in obj){if(Object.hasOwnProperty.call(obj,key)){fn(key);}}}
2737function shallowCopy(targetObj,srcObj){each(srcObj,function(prop){targetObj[prop]=srcObj[prop];});return targetObj;}
2738function defaults(target,src){each(src,function(prop){if(typeof target[prop]==='undefined'){target[prop]=src[prop];}});}
2739function tweenProps(forPosition,currentState,originalState,targetState,duration,timestamp,easing){var normalizedPosition=forPosition<timestamp?0:(forPosition-timestamp)/duration;var prop;var easingObjectProp;var easingFn;for(prop in currentState){if(currentState.hasOwnProperty(prop)){easingObjectProp=easing[prop];easingFn=typeof easingObjectProp==='function'?easingObjectProp:formula[easingObjectProp];currentState[prop]=tweenProp(originalState[prop],targetState[prop],easingFn,normalizedPosition);}}
2740return currentState;}
2741function tweenProp(start,end,easingFunc,position){return start+(end-start)*easingFunc(position);}
2742function applyFilter(tweenable,filterName){var filters=NGTweenable.prototype.filter;var args=tweenable._filterArgs;each(filters,function(name){if(typeof filters[name][filterName]!=='undefined'){filters[name][filterName].apply(tweenable,args);}});}
2743var timeoutHandler_endTime;var timeoutHandler_currentTime;var timeoutHandler_isEnded;var timeoutHandler_offset;function timeoutHandler(tweenable,timestamp,delay,duration,currentState,originalState,targetState,easing,step,schedule,opt_currentTimeOverride){timeoutHandler_endTime=timestamp+delay+duration;timeoutHandler_currentTime=Math.min(opt_currentTimeOverride||now(),timeoutHandler_endTime);timeoutHandler_isEnded=timeoutHandler_currentTime>=timeoutHandler_endTime;timeoutHandler_offset=duration-(timeoutHandler_endTime-timeoutHandler_currentTime);if(tweenable.isPlaying()){if(timeoutHandler_isEnded){step(targetState,tweenable._attachment,timeoutHandler_offset);tweenable.stop(true);}else{tweenable._scheduleId=schedule(tweenable._timeoutHandler,UPDATE_TIME);applyFilter(tweenable,'beforeTween');if(timeoutHandler_currentTime<(timestamp+delay)){tweenProps(1,currentState,originalState,targetState,1,1,easing);}else{tweenProps(timeoutHandler_currentTime,currentState,originalState,targetState,duration,timestamp+delay,easing);}
2744applyFilter(tweenable,'afterTween');step(currentState,tweenable._attachment,timeoutHandler_offset);}}}
2745function composeEasingObject(fromTweenParams,easing){var composedEasing={};var typeofEasing=typeof easing;if(typeofEasing==='string'||typeofEasing==='function'){each(fromTweenParams,function(prop){composedEasing[prop]=easing;});}else{each(fromTweenParams,function(prop){if(!composedEasing[prop]){composedEasing[prop]=easing[prop]||DEFAULT_EASING;}});}
2746return composedEasing;}
2747function NGTweenable(opt_initialState,opt_config){this._currentState=opt_initialState||{};this._configured=false;this._scheduleFunction=DEFAULT_SCHEDULE_FUNCTION;if(typeof opt_config!=='undefined'){this.setConfig(opt_config);}}
2748NGTweenable.prototype.tween=function(opt_config){if(this._isTweening){return this;}
2749if(opt_config!==undefined||!this._configured){this.setConfig(opt_config);}
2750this._timestamp=now();this._start(this.get(),this._attachment);return this.resume();};NGTweenable.prototype.setConfig=function(config){config=config||{};this._configured=true;this._attachment=config.attachment;this._pausedAtTime=null;this._scheduleId=null;this._delay=config.delay||0;this._start=config.start||noop;this._step=config.step||noop;this._finish=config.finish||noop;this._duration=config.duration||DEFAULT_DURATION;this._currentState=shallowCopy({},config.from||this.get());this._originalState=this.get();this._targetState=shallowCopy({},config.to||this.get());var self=this;this._timeoutHandler=function(){timeoutHandler(self,self._timestamp,self._delay,self._duration,self._currentState,self._originalState,self._targetState,self._easing,self._step,self._scheduleFunction);};var currentState=this._currentState;var targetState=this._targetState;defaults(targetState,currentState);this._easing=composeEasingObject(currentState,config.easing||DEFAULT_EASING);this._filterArgs=[currentState,this._originalState,targetState,this._easing];applyFilter(this,'tweenCreated');return this;};NGTweenable.prototype.get=function(){return shallowCopy({},this._currentState);};NGTweenable.prototype.set=function(state){this._currentState=state;};NGTweenable.prototype.pause=function(){this._pausedAtTime=now();this._isPaused=true;return this;};NGTweenable.prototype.resume=function(){if(this._isPaused){this._timestamp+=now()-this._pausedAtTime;}
2751this._isPaused=false;this._isTweening=true;this._timeoutHandler();return this;};NGTweenable.prototype.seek=function(millisecond){millisecond=Math.max(millisecond,0);var currentTime=now();if((this._timestamp+millisecond)===0){return this;}
2752this._timestamp=currentTime-millisecond;if(!this.isPlaying()){this._isTweening=true;this._isPaused=false;timeoutHandler(this,this._timestamp,this._delay,this._duration,this._currentState,this._originalState,this._targetState,this._easing,this._step,this._scheduleFunction,currentTime);this.pause();}
2753return this;};NGTweenable.prototype.stop=function(gotoEnd){this._isTweening=false;this._isPaused=false;this._timeoutHandler=noop;(root.cancelAnimationFrame||root.webkitCancelAnimationFrame||root.oCancelAnimationFrame||root.msCancelAnimationFrame||root.mozCancelRequestAnimationFrame||root.clearTimeout)(this._scheduleId);if(gotoEnd){applyFilter(this,'beforeTween');tweenProps(1,this._currentState,this._originalState,this._targetState,1,0,this._easing);applyFilter(this,'afterTween');applyFilter(this,'afterTweenEnd');this._finish.call(this,this._currentState,this._attachment);}
2754return this;};NGTweenable.prototype.isPlaying=function(){return this._isTweening&&!this._isPaused;};NGTweenable.prototype.setScheduleFunction=function(scheduleFunction){this._scheduleFunction=scheduleFunction;};NGTweenable.prototype.dispose=function(){var prop;for(prop in this){if(this.hasOwnProperty(prop)){delete this[prop];}}};NGTweenable.prototype.filter={};NGTweenable.prototype.formula={linear:function(pos){return pos;}};formula=NGTweenable.prototype.formula;shallowCopy(NGTweenable,{'now':now,'each':each,'tweenProps':tweenProps,'tweenProp':tweenProp,'applyFilter':applyFilter,'shallowCopy':shallowCopy,'defaults':defaults,'composeEasingObject':composeEasingObject});if(typeof SHIFTY_DEBUG_NOW==='function'){root.timeoutHandler=timeoutHandler;}
2755if(typeof exports==='object'){module.exports=NGTweenable;}else if(typeof define==='function'&&define.amdDISABLED){define(function(){return NGTweenable;});}else if(typeof root.NGTweenable==='undefined'){root.NGTweenable=NGTweenable;}
2756return NGTweenable;}());;(function(){NGTweenable.shallowCopy(NGTweenable.prototype.formula,{easeInQuad:function(pos){return Math.pow(pos,2);},easeOutQuad:function(pos){return-(Math.pow((pos-1),2)-1);},easeInOutQuad:function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,2);}
2757return-0.5*((pos-=2)*pos-2);},easeInCubic:function(pos){return Math.pow(pos,3);},easeOutCubic:function(pos){return(Math.pow((pos-1),3)+1);},easeInOutCubic:function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,3);}
2758return 0.5*(Math.pow((pos-2),3)+2);},easeInQuart:function(pos){return Math.pow(pos,4);},easeOutQuart:function(pos){return-(Math.pow((pos-1),4)-1);},easeInOutQuart:function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,4);}
2759return-0.5*((pos-=2)*Math.pow(pos,3)-2);},easeInQuint:function(pos){return Math.pow(pos,5);},easeOutQuint:function(pos){return(Math.pow((pos-1),5)+1);},easeInOutQuint:function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,5);}
2760return 0.5*(Math.pow((pos-2),5)+2);},easeInSine:function(pos){return-Math.cos(pos*(Math.PI/2))+1;},easeOutSine:function(pos){return Math.sin(pos*(Math.PI/2));},easeInOutSine:function(pos){return(-0.5*(Math.cos(Math.PI*pos)-1));},easeInExpo:function(pos){return(pos===0)?0:Math.pow(2,10*(pos-1));},easeOutExpo:function(pos){return(pos===1)?1:-Math.pow(2,-10*pos)+1;},easeInOutExpo:function(pos){if(pos===0){return 0;}
2761if(pos===1){return 1;}
2762if((pos/=0.5)<1){return 0.5*Math.pow(2,10*(pos-1));}
2763return 0.5*(-Math.pow(2,-10* --pos)+2);},easeInCirc:function(pos){return-(Math.sqrt(1-(pos*pos))-1);},easeOutCirc:function(pos){return Math.sqrt(1-Math.pow((pos-1),2));},easeInOutCirc:function(pos){if((pos/=0.5)<1){return-0.5*(Math.sqrt(1-pos*pos)-1);}
2764return 0.5*(Math.sqrt(1-(pos-=2)*pos)+1);},easeOutBounce:function(pos){if((pos)<(1/2.75)){return(7.5625*pos*pos);}else if(pos<(2/2.75)){return(7.5625*(pos-=(1.5/2.75))*pos+0.75);}else if(pos<(2.5/2.75)){return(7.5625*(pos-=(2.25/2.75))*pos+0.9375);}else{return(7.5625*(pos-=(2.625/2.75))*pos+0.984375);}},easeInBack:function(pos){var s=1.70158;return(pos)*pos*((s+1)*pos-s);},easeOutBack:function(pos){var s=1.70158;return(pos=pos-1)*pos*((s+1)*pos+s)+1;},easeInOutBack:function(pos){var s=1.70158;if((pos/=0.5)<1){return 0.5*(pos*pos*(((s*=(1.525))+1)*pos-s));}
2765return 0.5*((pos-=2)*pos*(((s*=(1.525))+1)*pos+s)+2);},elastic:function(pos){return-1*Math.pow(4,-8*pos)*Math.sin((pos*6-1)*(2*Math.PI)/2)+1;},swingFromTo:function(pos){var s=1.70158;return((pos/=0.5)<1)?0.5*(pos*pos*(((s*=(1.525))+1)*pos-s)):0.5*((pos-=2)*pos*(((s*=(1.525))+1)*pos+s)+2);},swingFrom:function(pos){var s=1.70158;return pos*pos*((s+1)*pos-s);},swingTo:function(pos){var s=1.70158;return(pos-=1)*pos*((s+1)*pos+s)+1;},bounce:function(pos){if(pos<(1/2.75)){return(7.5625*pos*pos);}else if(pos<(2/2.75)){return(7.5625*(pos-=(1.5/2.75))*pos+0.75);}else if(pos<(2.5/2.75)){return(7.5625*(pos-=(2.25/2.75))*pos+0.9375);}else{return(7.5625*(pos-=(2.625/2.75))*pos+0.984375);}},bouncePast:function(pos){if(pos<(1/2.75)){return(7.5625*pos*pos);}else if(pos<(2/2.75)){return 2-(7.5625*(pos-=(1.5/2.75))*pos+0.75);}else if(pos<(2.5/2.75)){return 2-(7.5625*(pos-=(2.25/2.75))*pos+0.9375);}else{return 2-(7.5625*(pos-=(2.625/2.75))*pos+0.984375);}},easeFromTo:function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,4);}
2766return-0.5*((pos-=2)*Math.pow(pos,3)-2);},easeFrom:function(pos){return Math.pow(pos,4);},easeTo:function(pos){return Math.pow(pos,0.25);}});}());;(function(){function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration){var ax=0,bx=0,cx=0,ay=0,by=0,cy=0;function sampleCurveX(t){return((ax*t+bx)*t+cx)*t;}
2767function sampleCurveY(t){return((ay*t+by)*t+cy)*t;}
2768function sampleCurveDerivativeX(t){return(3.0*ax*t+2.0*bx)*t+cx;}
2769function solveEpsilon(duration){return 1.0/(200.0*duration);}
2770function solve(x,epsilon){return sampleCurveY(solveCurveX(x,epsilon));}
2771function fabs(n){if(n>=0){return n;}else{return 0-n;}}
2772function solveCurveX(x,epsilon){var t0,t1,t2,x2,d2,i;for(t2=x,i=0;i<8;i++){x2=sampleCurveX(t2)-x;if(fabs(x2)<epsilon){return t2;}
2773d2=sampleCurveDerivativeX(t2);if(fabs(d2)<1e-6){break;}
2774t2=t2-x2/d2;}
2775t0=0.0;t1=1.0;t2=x;if(t2<t0){return t0;}
2776if(t2>t1){return t1;}
2777while(t0<t1){x2=sampleCurveX(t2);if(fabs(x2-x)<epsilon){return t2;}
2778if(x>x2){t0=t2;}else{t1=t2;}
2779t2=(t1-t0)*0.5+t0;}
2780return t2;}
2781cx=3.0*p1x;bx=3.0*(p2x-p1x)-cx;ax=1.0-cx-bx;cy=3.0*p1y;by=3.0*(p2y-p1y)-cy;ay=1.0-cy-by;return solve(t,solveEpsilon(duration));}
2782function getCubicBezierTransition(x1,y1,x2,y2){return function(pos){return cubicBezierAtTime(pos,x1,y1,x2,y2,1);};}
2783NGTweenable.setBezierFunction=function(name,x1,y1,x2,y2){var cubicBezierTransition=getCubicBezierTransition(x1,y1,x2,y2);cubicBezierTransition.displayName=name;cubicBezierTransition.x1=x1;cubicBezierTransition.y1=y1;cubicBezierTransition.x2=x2;cubicBezierTransition.y2=y2;return NGTweenable.prototype.formula[name]=cubicBezierTransition;};NGTweenable.unsetBezierFunction=function(name){delete NGTweenable.prototype.formula[name];};})();;(function(){function getInterpolatedValues(from,current,targetState,position,easing,delay){return NGTweenable.tweenProps(position,current,from,targetState,1,delay,easing);}
2784var mockNGTweenable=new NGTweenable();mockNGTweenable._filterArgs=[];NGTweenable.interpolate=function(from,targetState,position,easing,opt_delay){var current=NGTweenable.shallowCopy({},from);var delay=opt_delay||0;var easingObject=NGTweenable.composeEasingObject(from,easing||'linear');mockNGTweenable.set({});var filterArgs=mockNGTweenable._filterArgs;filterArgs.length=0;filterArgs[0]=current;filterArgs[1]=from;filterArgs[2]=targetState;filterArgs[3]=easingObject;NGTweenable.applyFilter(mockNGTweenable,'tweenCreated');NGTweenable.applyFilter(mockNGTweenable,'beforeTween');var interpolatedValues=getInterpolatedValues(from,current,targetState,position,easingObject,delay);NGTweenable.applyFilter(mockNGTweenable,'afterTween');return interpolatedValues;};}());;(function(NGTweenable){var formatManifest;var R_NUMBER_COMPONENT=/(\d|\-|\.)/;var R_FORMAT_CHUNKS=/([^\-0-9\.]+)/g;var R_UNFORMATTED_VALUES=/[0-9.\-]+/g;var R_RGB=new RegExp('rgb\\('+R_UNFORMATTED_VALUES.source+
2785(/,\s*/.source)+R_UNFORMATTED_VALUES.source+
2786(/,\s*/.source)+R_UNFORMATTED_VALUES.source+'\\)','g');var R_RGB_PREFIX=/^.*\(/;var R_HEX=/#([0-9]|[a-f]){3,6}/gi;var VALUE_PLACEHOLDER='VAL';function getFormatChunksFrom(rawValues,prefix){var accumulator=[];var rawValuesLength=rawValues.length;var i;for(i=0;i<rawValuesLength;i++){accumulator.push('_'+prefix+'_'+i);}
2787return accumulator;}
2788function getFormatStringFrom(formattedString){var chunks=formattedString.match(R_FORMAT_CHUNKS);if(!chunks){chunks=['',''];}else if(chunks.length===1||formattedString.charAt(0).match(R_NUMBER_COMPONENT)){chunks.unshift('');}
2789return chunks.join(VALUE_PLACEHOLDER);}
2790function sanitizeObjectForHexProps(stateObject){NGTweenable.each(stateObject,function(prop){var currentProp=stateObject[prop];if(typeof currentProp==='string'&&currentProp.match(R_HEX)){stateObject[prop]=sanitizeHexChunksToRGB(currentProp);}});}
2791function sanitizeHexChunksToRGB(str){return filterStringChunks(R_HEX,str,convertHexToRGB);}
2792function convertHexToRGB(hexString){var rgbArr=hexToRGBArray(hexString);return'rgb('+rgbArr[0]+','+rgbArr[1]+','+rgbArr[2]+')';}
2793var hexToRGBArray_returnArray=[];function hexToRGBArray(hex){hex=hex.replace(/#/,'');if(hex.length===3){hex=hex.split('');hex=hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];}
2794hexToRGBArray_returnArray[0]=hexToDec(hex.substr(0,2));hexToRGBArray_returnArray[1]=hexToDec(hex.substr(2,2));hexToRGBArray_returnArray[2]=hexToDec(hex.substr(4,2));return hexToRGBArray_returnArray;}
2795function hexToDec(hex){return parseInt(hex,16);}
2796function filterStringChunks(pattern,unfilteredString,filter){var pattenMatches=unfilteredString.match(pattern);var filteredString=unfilteredString.replace(pattern,VALUE_PLACEHOLDER);if(pattenMatches){var pattenMatchesLength=pattenMatches.length;var currentChunk;for(var i=0;i<pattenMatchesLength;i++){currentChunk=pattenMatches.shift();filteredString=filteredString.replace(VALUE_PLACEHOLDER,filter(currentChunk));}}
2797return filteredString;}
2798function sanitizeRGBChunks(formattedString){return filterStringChunks(R_RGB,formattedString,sanitizeRGBChunk);}
2799function sanitizeRGBChunk(rgbChunk){var numbers=rgbChunk.match(R_UNFORMATTED_VALUES);var numbersLength=numbers.length;var sanitizedString=rgbChunk.match(R_RGB_PREFIX)[0];for(var i=0;i<numbersLength;i++){sanitizedString+=parseInt(numbers[i],10)+',';}
2800sanitizedString=sanitizedString.slice(0,-1)+')';return sanitizedString;}
2801function getFormatManifests(stateObject){var manifestAccumulator={};NGTweenable.each(stateObject,function(prop){var currentProp=stateObject[prop];if(typeof currentProp==='string'){var rawValues=getValuesFrom(currentProp);manifestAccumulator[prop]={'formatString':getFormatStringFrom(currentProp),'chunkNames':getFormatChunksFrom(rawValues,prop)};}});return manifestAccumulator;}
2802function expandFormattedProperties(stateObject,formatManifests){NGTweenable.each(formatManifests,function(prop){var currentProp=stateObject[prop];var rawValues=getValuesFrom(currentProp);var rawValuesLength=rawValues.length;for(var i=0;i<rawValuesLength;i++){stateObject[formatManifests[prop].chunkNames[i]]=+rawValues[i];}
2803delete stateObject[prop];});}
2804function collapseFormattedProperties(stateObject,formatManifests){NGTweenable.each(formatManifests,function(prop){var currentProp=stateObject[prop];var formatChunks=extractPropertyChunks(stateObject,formatManifests[prop].chunkNames);var valuesList=getValuesList(formatChunks,formatManifests[prop].chunkNames);currentProp=getFormattedValues(formatManifests[prop].formatString,valuesList);stateObject[prop]=sanitizeRGBChunks(currentProp);});}
2805function extractPropertyChunks(stateObject,chunkNames){var extractedValues={};var currentChunkName,chunkNamesLength=chunkNames.length;for(var i=0;i<chunkNamesLength;i++){currentChunkName=chunkNames[i];extractedValues[currentChunkName]=stateObject[currentChunkName];delete stateObject[currentChunkName];}
2806return extractedValues;}
2807var getValuesList_accumulator=[];function getValuesList(stateObject,chunkNames){getValuesList_accumulator.length=0;var chunkNamesLength=chunkNames.length;for(var i=0;i<chunkNamesLength;i++){getValuesList_accumulator.push(stateObject[chunkNames[i]]);}
2808return getValuesList_accumulator;}
2809function getFormattedValues(formatString,rawValues){var formattedValueString=formatString;var rawValuesLength=rawValues.length;for(var i=0;i<rawValuesLength;i++){formattedValueString=formattedValueString.replace(VALUE_PLACEHOLDER,+rawValues[i].toFixed(4));}
2810return formattedValueString;}
2811function getValuesFrom(formattedString){return formattedString.match(R_UNFORMATTED_VALUES);}
2812function expandEasingObject(easingObject,tokenData){NGTweenable.each(tokenData,function(prop){var currentProp=tokenData[prop];var chunkNames=currentProp.chunkNames;var chunkLength=chunkNames.length;var easing=easingObject[prop];var i;if(typeof easing==='string'){var easingChunks=easing.split(' ');var lastEasingChunk=easingChunks[easingChunks.length-1];for(i=0;i<chunkLength;i++){easingObject[chunkNames[i]]=easingChunks[i]||lastEasingChunk;}}else{for(i=0;i<chunkLength;i++){easingObject[chunkNames[i]]=easing;}}
2813delete easingObject[prop];});}
2814function collapseEasingObject(easingObject,tokenData){NGTweenable.each(tokenData,function(prop){var currentProp=tokenData[prop];var chunkNames=currentProp.chunkNames;var chunkLength=chunkNames.length;var firstEasing=easingObject[chunkNames[0]];var typeofEasings=typeof firstEasing;if(typeofEasings==='string'){var composedEasingString='';for(var i=0;i<chunkLength;i++){composedEasingString+=' '+easingObject[chunkNames[i]];delete easingObject[chunkNames[i]];}
2815easingObject[prop]=composedEasingString.substr(1);}else{easingObject[prop]=firstEasing;}});}
2816NGTweenable.prototype.filter.token={'tweenCreated':function(currentState,fromState,toState,easingObject){sanitizeObjectForHexProps(currentState);sanitizeObjectForHexProps(fromState);sanitizeObjectForHexProps(toState);this._tokenData=getFormatManifests(currentState);},'beforeTween':function(currentState,fromState,toState,easingObject){expandEasingObject(easingObject,this._tokenData);expandFormattedProperties(currentState,this._tokenData);expandFormattedProperties(fromState,this._tokenData);expandFormattedProperties(toState,this._tokenData);},'afterTween':function(currentState,fromState,toState,easingObject){collapseFormattedProperties(currentState,this._tokenData);collapseFormattedProperties(fromState,this._tokenData);collapseFormattedProperties(toState,this._tokenData);collapseEasingObject(easingObject,this._tokenData);}};}(NGTweenable));}).call(null);(function(window,document,exportName,undefined){'use strict';var VENDOR_PREFIXES=['','webkit','Moz','MS','ms','o'];var TEST_ELEMENT=document.createElement('div');var TYPE_FUNCTION='function';var round=Math.round;var abs=Math.abs;var now=Date.now;function setTimeoutContext(fn,timeout,context){return setTimeout(bindFn(fn,context),timeout);}
2817function invokeArrayArg(arg,fn,context){if(Array.isArray(arg)){each(arg,context[fn],context);return true;}
2818return false;}
2819function each(obj,iterator,context){var i;if(!obj){return;}
2820if(obj.forEach){obj.forEach(iterator,context);}else if(obj.length!==undefined){i=0;while(i<obj.length){iterator.call(context,obj[i],i,obj);i++;}}else{for(i in obj){obj.hasOwnProperty(i)&&iterator.call(context,obj[i],i,obj);}}}
2821function deprecate(method,name,message){var deprecationMessage='DEPRECATED METHOD: '+name+'\n'+message+' AT \n';return function(){var e=new Error('get-stack-trace');var stack=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,'').replace(/^\s+at\s+/gm,'').replace(/^Object.<anonymous>\s*\(/gm,'{anonymous}()@'):'Unknown Stack Trace';var log=window.console&&(window.console.warn||window.console.log);if(log){log.call(window.console,deprecationMessage,stack);}
2822return method.apply(this,arguments);};}
2823var assign;if(typeof Object.assign!=='function'){assign=function assign(target){if(target===undefined||target===null){throw new TypeError('Cannot convert undefined or null to object');}
2824var output=Object(target);for(var index=1;index<arguments.length;index++){var source=arguments[index];if(source!==undefined&&source!==null){for(var nextKey in source){if(source.hasOwnProperty(nextKey)){output[nextKey]=source[nextKey];}}}}
2825return output;};}else{assign=Object.assign;}
2826var extend=deprecate(function extend(dest,src,merge){var keys=Object.keys(src);var i=0;while(i<keys.length){if(!merge||(merge&&dest[keys[i]]===undefined)){dest[keys[i]]=src[keys[i]];}
2827i++;}
2828return dest;},'extend','Use `assign`.');var merge=deprecate(function merge(dest,src){return extend(dest,src,true);},'merge','Use `assign`.');function inherit(child,base,properties){var baseP=base.prototype,childP;childP=child.prototype=Object.create(baseP);childP.constructor=child;childP._super=baseP;if(properties){assign(childP,properties);}}
2829function bindFn(fn,context){return function boundFn(){return fn.apply(context,arguments);};}
2830function boolOrFn(val,args){if(typeof val==TYPE_FUNCTION){return val.apply(args?args[0]||undefined:undefined,args);}
2831return val;}
2832function ifUndefined(val1,val2){return(val1===undefined)?val2:val1;}
2833function addEventListeners(target,types,handler){each(splitStr(types),function(type){target.addEventListener(type,handler,false);});}
2834function removeEventListeners(target,types,handler){each(splitStr(types),function(type){target.removeEventListener(type,handler,false);});}
2835function hasParent(node,parent){while(node){if(node==parent){return true;}
2836node=node.parentNode;}
2837return false;}
2838function inStr(str,find){return str.indexOf(find)>-1;}
2839function splitStr(str){return str.trim().split(/\s+/g);}
2840function inArray(src,find,findByKey){if(src.indexOf&&!findByKey){return src.indexOf(find);}else{var i=0;while(i<src.length){if((findByKey&&src[i][findByKey]==find)||(!findByKey&&src[i]===find)){return i;}
2841i++;}
2842return-1;}}
2843function toArray(obj){return Array.prototype.slice.call(obj,0);}
2844function uniqueArray(src,key,sort){var results=[];var values=[];var i=0;while(i<src.length){var val=key?src[i][key]:src[i];if(inArray(values,val)<0){results.push(src[i]);}
2845values[i]=val;i++;}
2846if(sort){if(!key){results=results.sort();}else{results=results.sort(function sortUniqueArray(a,b){return a[key]>b[key];});}}
2847return results;}
2848function prefixed(obj,property){var prefix,prop;var camelProp=property[0].toUpperCase()+property.slice(1);var i=0;while(i<VENDOR_PREFIXES.length){prefix=VENDOR_PREFIXES[i];prop=(prefix)?prefix+camelProp:property;if(prop in obj){return prop;}
2849i++;}
2850return undefined;}
2851var _uniqueId=1;function uniqueId(){return _uniqueId++;}
2852function getWindowForElement(element){var doc=element.ownerDocument||element;return(doc.defaultView||doc.parentWindow||window);}
2853var MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android/i;var SUPPORT_TOUCH=('ontouchstart' in window);var SUPPORT_POINTER_EVENTS=false;var SUPPORT_ONLY_TOUCH=SUPPORT_TOUCH&&MOBILE_REGEX.test(navigator.userAgent);var INPUT_TYPE_TOUCH='touch';var INPUT_TYPE_PEN='pen';var INPUT_TYPE_MOUSE='mouse';var INPUT_TYPE_KINECT='kinect';var COMPUTE_INTERVAL=25;var INPUT_START=1;var INPUT_MOVE=2;var INPUT_END=4;var INPUT_CANCEL=8;var DIRECTION_NONE=1;var DIRECTION_LEFT=2;var DIRECTION_RIGHT=4;var DIRECTION_UP=8;var DIRECTION_DOWN=16;
vendor: 24,710 bytes, lines 2853-2967
2853var DIRECTION_HORIZONTAL=DIRECTION_LEFT|DIRECTION_RIGHT;var DIRECTION_VERTICAL=DIRECTION_UP|DIRECTION_DOWN;var DIRECTION_ALL=DIRECTION_HORIZONTAL|DIRECTION_VERTICAL;var PROPS_XY=['x','y'];var PROPS_CLIENT_XY=['clientX','clientY'];function Input(manager,callback){var self=this;this.manager=manager;this.callback=callback;this.element=manager.element;this.target=manager.options.inputTarget;this.domHandler=function(ev){if(boolOrFn(manager.options.enable,[manager])){self.handler(ev);}};this.init();}
2854Input.prototype={handler:function(){},init:function(){this.evEl&&addEventListeners(this.element,this.evEl,this.domHandler);this.evTarget&&addEventListeners(this.target,this.evTarget,this.domHandler);this.evWin&&addEventListeners(getWindowForElement(this.element),this.evWin,this.domHandler);},destroy:function(){this.evEl&&removeEventListeners(this.element,this.evEl,this.domHandler);this.evTarget&&removeEventListeners(this.target,this.evTarget,this.domHandler);this.evWin&&removeEventListeners(getWindowForElement(this.element),this.evWin,this.domHandler);}};function createInputInstance(manager){var Type;var inputClass=manager.options.inputClass;if(inputClass){Type=inputClass;}else if(SUPPORT_POINTER_EVENTS){Type=PointerEventInput;}else if(SUPPORT_ONLY_TOUCH){Type=TouchInput;}else if(!SUPPORT_TOUCH){Type=MouseInput;}else{Type=TouchMouseInput;}
2855return new(Type)(manager,inputHandler);}
2856function inputHandler(manager,eventType,input){var pointersLen=input.pointers.length;var changedPointersLen=input.changedPointers.length;var isFirst=(eventType&INPUT_START&&(pointersLen-changedPointersLen===0));var isFinal=(eventType&(INPUT_END|INPUT_CANCEL)&&(pointersLen-changedPointersLen===0));input.isFirst=!!isFirst;input.isFinal=!!isFinal;if(isFirst){manager.session={};}
2857input.eventType=eventType;computeInputData(manager,input);manager.emit('hammer.input',input);manager.recognize(input);manager.session.prevInput=input;}
2858function computeInputData(manager,input){var session=manager.session;var pointers=input.pointers;var pointersLength=pointers.length;if(!session.firstInput){session.firstInput=simpleCloneInputData(input);}
2859if(pointersLength>1&&!session.firstMultiple){session.firstMultiple=simpleCloneInputData(input);}else if(pointersLength===1){session.firstMultiple=false;}
2860var firstInput=session.firstInput;var firstMultiple=session.firstMultiple;var offsetCenter=firstMultiple?firstMultiple.center:firstInput.center;var center=input.center=getCenter(pointers);input.timeStamp=now();input.deltaTime=input.timeStamp-firstInput.timeStamp;input.angle=getAngle(offsetCenter,center);input.distance=getDistance(offsetCenter,center);computeDeltaXY(session,input);input.offsetDirection=getDirection(input.deltaX,input.deltaY);var overallVelocity=getVelocity(input.deltaTime,input.deltaX,input.deltaY);input.overallVelocityX=overallVelocity.x;input.overallVelocityY=overallVelocity.y;input.overallVelocity=(abs(overallVelocity.x)>abs(overallVelocity.y))?overallVelocity.x:overallVelocity.y;input.scale=firstMultiple?getScale(firstMultiple.pointers,pointers):1;input.rotation=firstMultiple?getRotation(firstMultiple.pointers,pointers):0;input.maxPointers=!session.prevInput?input.pointers.length:((input.pointers.length>session.prevInput.maxPointers)?input.pointers.length:session.prevInput.maxPointers);computeIntervalInputData(session,input);var target=manager.element;if(hasParent(input.srcEvent.target,target)){target=input.srcEvent.target;}
2861input.target=target;}
2862function computeDeltaXY(session,input){var center=input.center;var offset=session.offsetDelta||{};var prevDelta=session.prevDelta||{};var prevInput=session.prevInput||{};if(input.eventType===INPUT_START||prevInput.eventType===INPUT_END){prevDelta=session.prevDelta={x:prevInput.deltaX||0,y:prevInput.deltaY||0};offset=session.offsetDelta={x:center.x,y:center.y};}
2863input.deltaX=prevDelta.x+(center.x-offset.x);input.deltaY=prevDelta.y+(center.y-offset.y);}
2864function computeIntervalInputData(session,input){var last=session.lastInterval||input,deltaTime=input.timeStamp-last.timeStamp,velocity,velocityX,velocityY,direction;if(input.eventType!=INPUT_CANCEL&&(deltaTime>COMPUTE_INTERVAL||last.velocity===undefined)){var deltaX=input.deltaX-last.deltaX;var deltaY=input.deltaY-last.deltaY;var v=getVelocity(deltaTime,deltaX,deltaY);velocityX=v.x;velocityY=v.y;velocity=(abs(v.x)>abs(v.y))?v.x:v.y;direction=getDirection(deltaX,deltaY);session.lastInterval=input;}else{velocity=last.velocity;velocityX=last.velocityX;velocityY=last.velocityY;direction=last.direction;}
2865input.velocity=velocity;input.velocityX=velocityX;input.velocityY=velocityY;input.direction=direction;}
2866function simpleCloneInputData(input){var pointers=[];var i=0;while(i<input.pointers.length){pointers[i]={clientX:round(input.pointers[i].clientX),clientY:round(input.pointers[i].clientY)};i++;}
2867return{timeStamp:now(),pointers:pointers,center:getCenter(pointers),deltaX:input.deltaX,deltaY:input.deltaY};}
2868function getCenter(pointers){var pointersLength=pointers.length;if(pointersLength===1){return{x:round(pointers[0].clientX),y:round(pointers[0].clientY)};}
2869var x=0,y=0,i=0;while(i<pointersLength){x+=pointers[i].clientX;y+=pointers[i].clientY;i++;}
2870return{x:round(x/pointersLength),y:round(y/pointersLength)};}
2871function getVelocity(deltaTime,x,y){return{x:x/deltaTime||0,y:y/deltaTime||0};}
2872function getDirection(x,y){if(x===y){return DIRECTION_NONE;}
2873if(abs(x)>=abs(y)){return x<0?DIRECTION_LEFT:DIRECTION_RIGHT;}
2874return y<0?DIRECTION_UP:DIRECTION_DOWN;}
2875function getDistance(p1,p2,props){if(!props){props=PROPS_XY;}
2876var x=p2[props[0]]-p1[props[0]],y=p2[props[1]]-p1[props[1]];return Math.sqrt((x*x)+(y*y));}
2877function getAngle(p1,p2,props){if(!props){props=PROPS_XY;}
2878var x=p2[props[0]]-p1[props[0]],y=p2[props[1]]-p1[props[1]];return Math.atan2(y,x)*180/Math.PI;}
2879function getRotation(start,end){return getAngle(end[1],end[0],PROPS_CLIENT_XY)+getAngle(start[1],start[0],PROPS_CLIENT_XY);}
2880function getScale(start,end){return getDistance(end[0],end[1],PROPS_CLIENT_XY)/getDistance(start[0],start[1],PROPS_CLIENT_XY);}
2881var MOUSE_INPUT_MAP={mousedown:INPUT_START,mousemove:INPUT_MOVE,mouseup:INPUT_END};var MOUSE_ELEMENT_EVENTS='mousedown';var MOUSE_WINDOW_EVENTS='mousemove mouseup';function MouseInput(){this.evEl=MOUSE_ELEMENT_EVENTS;this.evWin=MOUSE_WINDOW_EVENTS;this.pressed=false;Input.apply(this,arguments);}
2882inherit(MouseInput,Input,{handler:function MEhandler(ev){var eventType=MOUSE_INPUT_MAP[ev.type];if(eventType&INPUT_START&&ev.button===0){this.pressed=true;}
2883if(eventType&INPUT_MOVE&&ev.which!==1){eventType=INPUT_END;}
2884if(!this.pressed){return;}
2885if(eventType&INPUT_END){this.pressed=false;}
2886this.callback(this.manager,eventType,{pointers:[ev],changedPointers:[ev],pointerType:INPUT_TYPE_MOUSE,srcEvent:ev});}});var POINTER_INPUT_MAP={pointerdown:INPUT_START,pointermove:INPUT_MOVE,pointerup:INPUT_END,pointercancel:INPUT_CANCEL,pointerout:INPUT_CANCEL};var IE10_POINTER_TYPE_ENUM={2:INPUT_TYPE_TOUCH,3:INPUT_TYPE_PEN,4:INPUT_TYPE_MOUSE,5:INPUT_TYPE_KINECT};var POINTER_ELEMENT_EVENTS='pointerdown';var POINTER_WINDOW_EVENTS='pointermove pointerup pointercancel';if(window.MSPointerEvent&&!window.PointerEvent){POINTER_ELEMENT_EVENTS='MSPointerDown';POINTER_WINDOW_EVENTS='MSPointerMove MSPointerUp MSPointerCancel';}
2887function PointerEventInput(){this.evEl=POINTER_ELEMENT_EVENTS;this.evWin=POINTER_WINDOW_EVENTS;Input.apply(this,arguments);this.store=(this.manager.session.pointerEvents=[]);}
2888inherit(PointerEventInput,Input,{handler:function PEhandler(ev){var store=this.store;var removePointer=false;var eventTypeNormalized=ev.type.toLowerCase().replace('ms','');var eventType=POINTER_INPUT_MAP[eventTypeNormalized];var pointerType=IE10_POINTER_TYPE_ENUM[ev.pointerType]||ev.pointerType;var isTouch=(pointerType==INPUT_TYPE_TOUCH);var storeIndex=inArray(store,ev.pointerId,'pointerId');if(eventType&INPUT_START&&(ev.button===0||isTouch)){if(storeIndex<0){store.push(ev);storeIndex=store.length-1;}}else if(eventType&(INPUT_END|INPUT_CANCEL)){removePointer=true;}
2889if(storeIndex<0){return;}
2890store[storeIndex]=ev;this.callback(this.manager,eventType,{pointers:store,changedPointers:[ev],pointerType:pointerType,srcEvent:ev});if(removePointer){store.splice(storeIndex,1);}}});var SINGLE_TOUCH_INPUT_MAP={touchstart:INPUT_START,touchmove:INPUT_MOVE,touchend:INPUT_END,touchcancel:INPUT_CANCEL};var SINGLE_TOUCH_TARGET_EVENTS='touchstart';var SINGLE_TOUCH_WINDOW_EVENTS='touchstart touchmove touchend touchcancel';function SingleTouchInput(){this.evTarget=SINGLE_TOUCH_TARGET_EVENTS;this.evWin=SINGLE_TOUCH_WINDOW_EVENTS;this.started=false;Input.apply(this,arguments);}
2891inherit(SingleTouchInput,Input,{handler:function TEhandler(ev){var type=SINGLE_TOUCH_INPUT_MAP[ev.type];if(type===INPUT_START){this.started=true;}
2892if(!this.started){return;}
2893var touches=normalizeSingleTouches.call(this,ev,type);if(type&(INPUT_END|INPUT_CANCEL)&&touches[0].length-touches[1].length===0){this.started=false;}
2894this.callback(this.manager,type,{pointers:touches[0],changedPointers:touches[1],pointerType:INPUT_TYPE_TOUCH,srcEvent:ev});}});function normalizeSingleTouches(ev,type){var all=toArray(ev.touches);var changed=toArray(ev.changedTouches);if(type&(INPUT_END|INPUT_CANCEL)){all=uniqueArray(all.concat(changed),'identifier',true);}
2895return[all,changed];}
2896var TOUCH_INPUT_MAP={touchstart:INPUT_START,touchmove:INPUT_MOVE,touchend:INPUT_END,touchcancel:INPUT_CANCEL};var TOUCH_TARGET_EVENTS='touchstart touchmove touchend touchcancel';function TouchInput(){this.evTarget=TOUCH_TARGET_EVENTS;this.targetIds={};Input.apply(this,arguments);}
2897inherit(TouchInput,Input,{handler:function MTEhandler(ev){var type=TOUCH_INPUT_MAP[ev.type];var touches=getTouches.call(this,ev,type);if(!touches){return;}
2898this.callback(this.manager,type,{pointers:touches[0],changedPointers:touches[1],pointerType:INPUT_TYPE_TOUCH,srcEvent:ev});}});function getTouches(ev,type){var allTouches=toArray(ev.touches);var targetIds=this.targetIds;if(type&(INPUT_START|INPUT_MOVE)&&allTouches.length===1){targetIds[allTouches[0].identifier]=true;return[allTouches,allTouches];}
2899var i,targetTouches,changedTouches=toArray(ev.changedTouches),changedTargetTouches=[],target=this.target;targetTouches=allTouches.filter(function(touch){return hasParent(touch.target,target);});if(type===INPUT_START){i=0;while(i<targetTouches.length){targetIds[targetTouches[i].identifier]=true;i++;}}
2900i=0;while(i<changedTouches.length){if(targetIds[changedTouches[i].identifier]){changedTargetTouches.push(changedTouches[i]);}
2901if(type&(INPUT_END|INPUT_CANCEL)){delete targetIds[changedTouches[i].identifier];}
2902i++;}
2903if(!changedTargetTouches.length){return;}
2904return[uniqueArray(targetTouches.concat(changedTargetTouches),'identifier',true),changedTargetTouches];}
2905var DEDUP_TIMEOUT=2500;var DEDUP_DISTANCE=25;function TouchMouseInput(){Input.apply(this,arguments);var handler=bindFn(this.handler,this);this.touch=new TouchInput(this.manager,handler);this.mouse=new MouseInput(this.manager,handler);this.primaryTouch=null;this.lastTouches=[];}
2906inherit(TouchMouseInput,Input,{handler:function TMEhandler(manager,inputEvent,inputData){var isTouch=(inputData.pointerType==INPUT_TYPE_TOUCH),isMouse=(inputData.pointerType==INPUT_TYPE_MOUSE);if(isMouse&&inputData.sourceCapabilities&&inputData.sourceCapabilities.firesTouchEvents){return;}
2907if(isTouch){recordTouches.call(this,inputEvent,inputData);}else if(isMouse&&isSyntheticEvent.call(this,inputData)){return;}
2908this.callback(manager,inputEvent,inputData);},destroy:function destroy(){this.touch.destroy();this.mouse.destroy();}});function recordTouches(eventType,eventData){if(eventType&INPUT_START){this.primaryTouch=eventData.changedPointers[0].identifier;setLastTouch.call(this,eventData);}else if(eventType&(INPUT_END|INPUT_CANCEL)){setLastTouch.call(this,eventData);}}
2909function setLastTouch(eventData){var touch=eventData.changedPointers[0];if(touch.identifier===this.primaryTouch){var lastTouch={x:touch.clientX,y:touch.clientY};this.lastTouches.push(lastTouch);var lts=this.lastTouches;var removeLastTouch=function(){var i=lts.indexOf(lastTouch);if(i>-1){lts.splice(i,1);}};setTimeout(removeLastTouch,DEDUP_TIMEOUT);}}
2910function isSyntheticEvent(eventData){var x=eventData.srcEvent.clientX,y=eventData.srcEvent.clientY;for(var i=0;i<this.lastTouches.length;i++){var t=this.lastTouches[i];var dx=Math.abs(x-t.x),dy=Math.abs(y-t.y);if(dx<=DEDUP_DISTANCE&&dy<=DEDUP_DISTANCE){return true;}}
2911return false;}
2912var PREFIXED_TOUCH_ACTION=prefixed(TEST_ELEMENT.style,'touchAction');var NATIVE_TOUCH_ACTION=PREFIXED_TOUCH_ACTION!==undefined;var TOUCH_ACTION_COMPUTE='compute';var TOUCH_ACTION_AUTO='auto';var TOUCH_ACTION_MANIPULATION='manipulation';var TOUCH_ACTION_NONE='none';var TOUCH_ACTION_PAN_X='pan-x';var TOUCH_ACTION_PAN_Y='pan-y';var TOUCH_ACTION_MAP=getTouchActionProps();function TouchAction(manager,value){this.manager=manager;this.set(value);}
2913TouchAction.prototype={set:function(value){if(value==TOUCH_ACTION_COMPUTE){value=this.compute();}
2914if(NATIVE_TOUCH_ACTION&&this.manager.element.style&&TOUCH_ACTION_MAP[value]){this.manager.element.style[PREFIXED_TOUCH_ACTION]=value;}
2915this.actions=value.toLowerCase().trim();},update:function(){this.set(this.manager.options.touchAction);},compute:function(){var actions=[];each(this.manager.recognizers,function(recognizer){if(boolOrFn(recognizer.options.enable,[recognizer])){actions=actions.concat(recognizer.getTouchAction());}});return cleanTouchActions(actions.join(' '));},preventDefaults:function(input){var srcEvent=input.srcEvent;var direction=input.offsetDirection;if(this.manager.session.prevented){srcEvent.preventDefault();return;}
2916var actions=this.actions;var hasNone=inStr(actions,TOUCH_ACTION_NONE)&&!TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];var hasPanY=inStr(actions,TOUCH_ACTION_PAN_Y)&&!TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];var hasPanX=inStr(actions,TOUCH_ACTION_PAN_X)&&!TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];if(hasNone){var isTapPointer=input.pointers.length===1;var isTapMovement=input.distance<2;var isTapTouchTime=input.deltaTime<250;if(isTapPointer&&isTapMovement&&isTapTouchTime){return;}}
2917if(hasPanX&&hasPanY){return;}
2918if(hasNone||(hasPanY&&direction&DIRECTION_HORIZONTAL)||(hasPanX&&direction&DIRECTION_VERTICAL)){return this.preventSrc(srcEvent);}},preventSrc:function(srcEvent){this.manager.session.prevented=true;srcEvent.preventDefault();}};function cleanTouchActions(actions){if(inStr(actions,TOUCH_ACTION_NONE)){return TOUCH_ACTION_NONE;}
2919var hasPanX=inStr(actions,TOUCH_ACTION_PAN_X);var hasPanY=inStr(actions,TOUCH_ACTION_PAN_Y);if(hasPanX&&hasPanY){return TOUCH_ACTION_NONE;}
2920if(hasPanX||hasPanY){return hasPanX?TOUCH_ACTION_PAN_X:TOUCH_ACTION_PAN_Y;}
2921if(inStr(actions,TOUCH_ACTION_MANIPULATION)){return TOUCH_ACTION_MANIPULATION;}
2922return TOUCH_ACTION_AUTO;}
2923function getTouchActionProps(){if(!NATIVE_TOUCH_ACTION){return false;}
2924var touchMap={};var cssSupports=window.CSS&&window.CSS.supports;['auto','manipulation','pan-y','pan-x','pan-x pan-y','none'].forEach(function(val){touchMap[val]=cssSupports?window.CSS.supports('touch-action',val):true;});return touchMap;}
2925var STATE_POSSIBLE=1;var STATE_BEGAN=2;var STATE_CHANGED=4;var STATE_ENDED=8;var STATE_RECOGNIZED=STATE_ENDED;var STATE_CANCELLED=16;var STATE_FAILED=32;function Recognizer(options){this.options=assign({},this.defaults,options||{});this.id=uniqueId();this.manager=null;this.options.enable=ifUndefined(this.options.enable,true);this.state=STATE_POSSIBLE;this.simultaneous={};this.requireFail=[];}
2926Recognizer.prototype={defaults:{},set:function(options){assign(this.options,options);this.manager&&this.manager.touchAction.update();return this;},recognizeWith:function(otherRecognizer){if(invokeArrayArg(otherRecognizer,'recognizeWith',this)){return this;}
2927var simultaneous=this.simultaneous;otherRecognizer=getRecognizerByNameIfManager(otherRecognizer,this);if(!simultaneous[otherRecognizer.id]){simultaneous[otherRecognizer.id]=otherRecognizer;otherRecognizer.recognizeWith(this);}
2928return this;},dropRecognizeWith:function(otherRecognizer){if(invokeArrayArg(otherRecognizer,'dropRecognizeWith',this)){return this;}
2929otherRecognizer=getRecognizerByNameIfManager(otherRecognizer,this);delete this.simultaneous[otherRecognizer.id];return this;},requireFailure:function(otherRecognizer){if(invokeArrayArg(otherRecognizer,'requireFailure',this)){return this;}
2930var requireFail=this.requireFail;otherRecognizer=getRecognizerByNameIfManager(otherRecognizer,this);if(inArray(requireFail,otherRecognizer)===-1){requireFail.push(otherRecognizer);otherRecognizer.requireFailure(this);}
2931return this;},dropRequireFailure:function(otherRecognizer){if(invokeArrayArg(otherRecognizer,'dropRequireFailure',this)){return this;}
2932otherRecognizer=getRecognizerByNameIfManager(otherRecognizer,this);var index=inArray(this.requireFail,otherRecognizer);if(index>-1){this.requireFail.splice(index,1);}
2933return this;},hasRequireFailures:function(){return this.requireFail.length>0;},canRecognizeWith:function(otherRecognizer){return!!this.simultaneous[otherRecognizer.id];},emit:function(input){var self=this;var state=this.state;function emit(event){self.manager.emit(event,input);}
2934if(state<STATE_ENDED){emit(self.options.event+stateStr(state));}
2935emit(self.options.event);if(input.additionalEvent){emit(input.additionalEvent);}
2936if(state>=STATE_ENDED){emit(self.options.event+stateStr(state));}},tryEmit:function(input){if(this.canEmit()){return this.emit(input);}
2937this.state=STATE_FAILED;},canEmit:function(){var i=0;while(i<this.requireFail.length){if(!(this.requireFail[i].state&(STATE_FAILED|STATE_POSSIBLE))){return false;}
2938i++;}
2939return true;},recognize:function(inputData){var inputDataClone=assign({},inputData);if(!boolOrFn(this.options.enable,[this,inputDataClone])){this.reset();this.state=STATE_FAILED;return;}
2940if(this.state&(STATE_RECOGNIZED|STATE_CANCELLED|STATE_FAILED)){this.state=STATE_POSSIBLE;}
2941this.state=this.process(inputDataClone);if(this.state&(STATE_BEGAN|STATE_CHANGED|STATE_ENDED|STATE_CANCELLED)){this.tryEmit(inputDataClone);}},process:function(inputData){},getTouchAction:function(){},reset:function(){}};function stateStr(state){if(state&STATE_CANCELLED){return'cancel';}else if(state&STATE_ENDED){return'end';}else if(state&STATE_CHANGED){return'move';}else if(state&STATE_BEGAN){return'start';}
2942return'';}
2943function directionStr(direction){if(direction==DIRECTION_DOWN){return'down';}else if(direction==DIRECTION_UP){return'up';}else if(direction==DIRECTION_LEFT){return'left';}else if(direction==DIRECTION_RIGHT){return'right';}
2944return'';}
2945function getRecognizerByNameIfManager(otherRecognizer,recognizer){var manager=recognizer.manager;if(manager){return manager.get(otherRecognizer);}
2946return otherRecognizer;}
2947function AttrRecognizer(){Recognizer.apply(this,arguments);}
2948inherit(AttrRecognizer,Recognizer,{defaults:{pointers:1},attrTest:function(input){var optionPointers=this.options.pointers;return optionPointers===0||input.pointers.length===optionPointers;},process:function(input){var state=this.state;var eventType=input.eventType;var isRecognized=state&(STATE_BEGAN|STATE_CHANGED);var isValid=this.attrTest(input);if(isRecognized&&(eventType&INPUT_CANCEL||!isValid)){return state|STATE_CANCELLED;}else if(isRecognized||isValid){if(eventType&INPUT_END){return state|STATE_ENDED;}else if(!(state&STATE_BEGAN)){return STATE_BEGAN;}
2949return state|STATE_CHANGED;}
2950return STATE_FAILED;}});function PanRecognizer(){AttrRecognizer.apply(this,arguments);this.pX=null;this.pY=null;}
2951inherit(PanRecognizer,AttrRecognizer,{defaults:{event:'pan',threshold:10,pointers:1,direction:DIRECTION_ALL},getTouchAction:function(){var direction=this.options.direction;var actions=[];if(direction&DIRECTION_HORIZONTAL){actions.push(TOUCH_ACTION_PAN_Y);}
2952if(direction&DIRECTION_VERTICAL){actions.push(TOUCH_ACTION_PAN_X);}
2953return actions;},directionTest:function(input){var options=this.options;var hasMoved=true;var distance=input.distance;var direction=input.direction;var x=input.deltaX;var y=input.deltaY;if(!(direction&options.direction)){if(options.direction&DIRECTION_HORIZONTAL){direction=(x===0)?DIRECTION_NONE:(x<0)?DIRECTION_LEFT:DIRECTION_RIGHT;hasMoved=x!=this.pX;distance=Math.abs(input.deltaX);}else{direction=(y===0)?DIRECTION_NONE:(y<0)?DIRECTION_UP:DIRECTION_DOWN;hasMoved=y!=this.pY;distance=Math.abs(input.deltaY);}}
2954input.direction=direction;return hasMoved&&distance>options.threshold&&direction&options.direction;},attrTest:function(input){return AttrRecognizer.prototype.attrTest.call(this,input)&&(this.state&STATE_BEGAN||(!(this.state&STATE_BEGAN)&&this.directionTest(input)));},emit:function(input){this.pX=input.deltaX;this.pY=input.deltaY;var direction=directionStr(input.direction);if(direction){input.additionalEvent=this.options.event+direction;}
2955this._super.emit.call(this,input);}});function PinchRecognizer(){AttrRecognizer.apply(this,arguments);}
2956inherit(PinchRecognizer,AttrRecognizer,{defaults:{event:'pinch',threshold:0,pointers:2},getTouchAction:function(){return[TOUCH_ACTION_NONE];},attrTest:function(input){return this._super.attrTest.call(this,input)&&(Math.abs(input.scale-1)>this.options.threshold||this.state&STATE_BEGAN);},emit:function(input){if(input.scale!==1){var inOut=input.scale<1?'in':'out';input.additionalEvent=this.options.event+inOut;}
2957this._super.emit.call(this,input);}});function PressRecognizer(){Recognizer.apply(this,arguments);this._timer=null;this._input=null;}
2958inherit(PressRecognizer,Recognizer,{defaults:{event:'press',pointers:1,time:251,threshold:9},getTouchAction:function(){return[TOUCH_ACTION_AUTO];},process:function(input){var options=this.options;var validPointers=input.pointers.length===options.pointers;var validMovement=input.distance<options.threshold;var validTime=input.deltaTime>options.time;this._input=input;if(!validMovement||!validPointers||(input.eventType&(INPUT_END|INPUT_CANCEL)&&!validTime)){this.reset();}else if(input.eventType&INPUT_START){this.reset();this._timer=setTimeoutContext(function(){this.state=STATE_RECOGNIZED;this.tryEmit();},options.time,this);}else if(input.eventType&INPUT_END){return STATE_RECOGNIZED;}
2959return STATE_FAILED;},reset:function(){clearTimeout(this._timer);},emit:function(input){if(this.state!==STATE_RECOGNIZED){return;}
2960if(input&&(input.eventType&INPUT_END)){this.manager.emit(this.options.event+'up',input);}else{this._input.timeStamp=now();this.manager.emit(this.options.event,this._input);}}});function RotateRecognizer(){AttrRecognizer.apply(this,arguments);}
2961inherit(RotateRecognizer,AttrRecognizer,{defaults:{event:'rotate',threshold:0,pointers:2},getTouchAction:function(){return[TOUCH_ACTION_NONE];},attrTest:function(input){return this._super.attrTest.call(this,input)&&(Math.abs(input.rotation)>this.options.threshold||this.state&STATE_BEGAN);}});function SwipeRecognizer(){AttrRecognizer.apply(this,arguments);}
2962inherit(SwipeRecognizer,AttrRecognizer,{defaults:{event:'swipe',threshold:10,velocity:0.3,direction:DIRECTION_HORIZONTAL|DIRECTION_VERTICAL,pointers:1},getTouchAction:function(){return PanRecognizer.prototype.getTouchAction.call(this);},attrTest:function(input){var direction=this.options.direction;var velocity;if(direction&(DIRECTION_HORIZONTAL|DIRECTION_VERTICAL)){velocity=input.overallVelocity;}else if(direction&DIRECTION_HORIZONTAL){velocity=input.overallVelocityX;}else if(direction&DIRECTION_VERTICAL){velocity=input.overallVelocityY;}
2963return this._super.attrTest.call(this,input)&&direction&input.offsetDirection&&input.distance>this.options.threshold&&input.maxPointers==this.options.pointers&&abs(velocity)>this.options.velocity&&input.eventType&INPUT_END;},emit:function(input){var direction=directionStr(input.offsetDirection);if(direction){this.manager.emit(this.options.event+direction,input);}
2964this.manager.emit(this.options.event,input);}});function TapRecognizer(){Recognizer.apply(this,arguments);this.pTime=false;this.pCenter=false;this._timer=null;this._input=null;this.count=0;}
2965inherit(TapRecognizer,Recognizer,{defaults:{event:'tap',pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[TOUCH_ACTION_MANIPULATION];},process:function(input){var options=this.options;var validPointers=input.pointers.length===options.pointers;var validMovement=input.distance<options.threshold;var validTouchTime=input.deltaTime<options.time;this.reset();if((input.eventType&INPUT_START)&&(this.count===0)){return this.failTimeout();}
2966if(validMovement&&validTouchTime&&validPointers){if(input.eventType!=INPUT_END){return this.failTimeout();}
2967var validInterval=this.pTime?(input.timeStamp-this.pTime<options.interval):true;
vendor: 10,322 bytes, lines 2967-3006
2967var validMultiTap=!this.pCenter||getDistance(this.pCenter,input.center)<options.posThreshold;this.pTime=input.timeStamp;this.pCenter=input.center;if(!validMultiTap||!validInterval){this.count=1;}else{this.count+=1;}
2968this._input=input;var tapCount=this.count%options.taps;if(tapCount===0){if(!this.hasRequireFailures()){return STATE_RECOGNIZED;}else{this._timer=setTimeoutContext(function(){this.state=STATE_RECOGNIZED;this.tryEmit();},options.interval,this);return STATE_BEGAN;}}}
2969return STATE_FAILED;},failTimeout:function(){this._timer=setTimeoutContext(function(){this.state=STATE_FAILED;},this.options.interval,this);return STATE_FAILED;},reset:function(){clearTimeout(this._timer);},emit:function(){if(this.state==STATE_RECOGNIZED){this._input.tapCount=this.count;this.manager.emit(this.options.event,this._input);}}});function NGHammer(element,options){options=options||{};options.recognizers=ifUndefined(options.recognizers,NGHammer.defaults.preset);return new Manager(element,options);}
2970NGHammer.VERSION='2.0.7';NGHammer.defaults={domEvents:false,touchAction:TOUCH_ACTION_COMPUTE,enable:true,inputTarget:null,inputClass:null,preset:[[RotateRecognizer,{enable:false}],[PinchRecognizer,{enable:false},['rotate']],[SwipeRecognizer,{direction:DIRECTION_HORIZONTAL}],[PanRecognizer,{direction:DIRECTION_HORIZONTAL},['swipe']],[TapRecognizer],[TapRecognizer,{event:'doubletap',taps:2},['tap']],[PressRecognizer]],cssProps:{userSelect:'none',touchSelect:'none',touchCallout:'none',contentZooming:'none',userDrag:'none',tapHighlightColor:'rgba(0,0,0,0)'}};var STOP=1;var FORCED_STOP=2;function Manager(element,options){this.options=assign({},NGHammer.defaults,options||{});this.options.inputTarget=this.options.inputTarget||element;this.handlers={};this.session={};this.recognizers=[];this.oldCssProps={};this.element=element;this.input=createInputInstance(this);this.touchAction=new TouchAction(this,this.options.touchAction);toggleCssProps(this,true);each(this.options.recognizers,function(item){var recognizer=this.add(new(item[0])(item[1]));item[2]&&recognizer.recognizeWith(item[2]);item[3]&&recognizer.requireFailure(item[3]);},this);}
2971Manager.prototype={set:function(options){assign(this.options,options);if(options.touchAction){this.touchAction.update();}
2972if(options.inputTarget){this.input.destroy();this.input.target=options.inputTarget;this.input.init();}
2973return this;},stop:function(force){this.session.stopped=force?FORCED_STOP:STOP;},recognize:function(inputData){var session=this.session;if(session.stopped){return;}
2974this.touchAction.preventDefaults(inputData);var recognizer;var recognizers=this.recognizers;var curRecognizer=session.curRecognizer;if(!curRecognizer||(curRecognizer&&curRecognizer.state&STATE_RECOGNIZED)){curRecognizer=session.curRecognizer=null;}
2975var i=0;while(i<recognizers.length){recognizer=recognizers[i];if(session.stopped!==FORCED_STOP&&(!curRecognizer||recognizer==curRecognizer||recognizer.canRecognizeWith(curRecognizer))){recognizer.recognize(inputData);}else{recognizer.reset();}
2976if(!curRecognizer&&recognizer.state&(STATE_BEGAN|STATE_CHANGED|STATE_ENDED)){curRecognizer=session.curRecognizer=recognizer;}
2977i++;}},get:function(recognizer){if(recognizer instanceof Recognizer){return recognizer;}
2978var recognizers=this.recognizers;for(var i=0;i<recognizers.length;i++){if(recognizers[i].options.event==recognizer){return recognizers[i];}}
2979return null;},add:function(recognizer){if(invokeArrayArg(recognizer,'add',this)){return this;}
2980var existing=this.get(recognizer.options.event);if(existing){this.remove(existing);}
2981this.recognizers.push(recognizer);recognizer.manager=this;this.touchAction.update();return recognizer;},remove:function(recognizer){if(invokeArrayArg(recognizer,'remove',this)){return this;}
2982recognizer=this.get(recognizer);if(recognizer){var recognizers=this.recognizers;var index=inArray(recognizers,recognizer);if(index!==-1){recognizers.splice(index,1);this.touchAction.update();}}
2983return this;},on:function(events,handler){if(events===undefined){return;}
2984if(handler===undefined){return;}
2985var handlers=this.handlers;each(splitStr(events),function(event){handlers[event]=handlers[event]||[];handlers[event].push(handler);});return this;},off:function(events,handler){if(events===undefined){return;}
2986var handlers=this.handlers;each(splitStr(events),function(event){if(!handler){delete handlers[event];}else{handlers[event]&&handlers[event].splice(inArray(handlers[event],handler),1);}});return this;},emit:function(event,data){if(this.options.domEvents){triggerDomEvent(event,data);}
2987var handlers=this.handlers[event]&&this.handlers[event].slice();if(!handlers||!handlers.length){return;}
2988data.type=event;data.preventDefault=function(){data.srcEvent.preventDefault();};var i=0;while(i<handlers.length){handlers[i](data);i++;}},destroy:function(){this.element&&toggleCssProps(this,false);this.handlers={};this.session={};this.input.destroy();this.element=null;}};function toggleCssProps(manager,add){var element=manager.element;if(!element.style){return;}
2989var prop;each(manager.options.cssProps,function(value,name){prop=prefixed(element.style,name);if(add){manager.oldCssProps[prop]=element.style[prop];element.style[prop]=value;}else{element.style[prop]=manager.oldCssProps[prop]||'';}});if(!add){manager.oldCssProps={};}}
2990function triggerDomEvent(event,data){var gestureEvent=document.createEvent('Event');gestureEvent.initEvent(event,true,true);gestureEvent.gesture=data;data.target.dispatchEvent(gestureEvent);}
2991assign(NGHammer,{INPUT_START:INPUT_START,INPUT_MOVE:INPUT_MOVE,INPUT_END:INPUT_END,INPUT_CANCEL:INPUT_CANCEL,STATE_POSSIBLE:STATE_POSSIBLE,STATE_BEGAN:STATE_BEGAN,STATE_CHANGED:STATE_CHANGED,STATE_ENDED:STATE_ENDED,STATE_RECOGNIZED:STATE_RECOGNIZED,STATE_CANCELLED:STATE_CANCELLED,STATE_FAILED:STATE_FAILED,DIRECTION_NONE:DIRECTION_NONE,DIRECTION_LEFT:DIRECTION_LEFT,DIRECTION_RIGHT:DIRECTION_RIGHT,DIRECTION_UP:DIRECTION_UP,DIRECTION_DOWN:DIRECTION_DOWN,DIRECTION_HORIZONTAL:DIRECTION_HORIZONTAL,DIRECTION_VERTICAL:DIRECTION_VERTICAL,DIRECTION_ALL:DIRECTION_ALL,Manager:Manager,Input:Input,TouchAction:TouchAction,TouchInput:TouchInput,MouseInput:MouseInput,PointerEventInput:PointerEventInput,TouchMouseInput:TouchMouseInput,SingleTouchInput:SingleTouchInput,Recognizer:Recognizer,AttrRecognizer:AttrRecognizer,Tap:TapRecognizer,Pan:PanRecognizer,Swipe:SwipeRecognizer,Pinch:PinchRecognizer,Rotate:RotateRecognizer,Press:PressRecognizer,on:addEventListeners,off:removeEventListeners,each:each,merge:merge,extend:extend,assign:assign,inherit:inherit,bindFn:bindFn,prefixed:prefixed});var freeGlobal=(typeof window!=='undefined'?window:(typeof self!=='undefined'?self:{}));freeGlobal.NGHammer=NGHammer;if(typeof define==='function'&&define.amdDISABLED){define(function(){return NGHammer;});}else if(typeof module!='undefined'&&module.exports){module.exports=NGHammer;}else{window[exportName]=NGHammer;}})(window,document,'NGHammer');}));(function(){'use strict';function document_ready(callback){if(document.readyState!='loading')callback();else if(document.addEventListener)document.addEventListener('DOMContentLoaded',callback);else document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete')callback();});}
2992document_ready(function(){var t=document.querySelectorAll('[data-nanogallery2]');for(var i=0;i<t.length;i++){jQuery(t[i]).nanogallery2(jQuery(t[i]).data('nanogallery2'));}
2993var t=document.querySelectorAll('[data-nanogallery2-lightbox]');for(var i=0;i<t.length;i++){t[i].classList.add('NGY2ThumbnailLightbox');t[i].addEventListener('click',function(e){e.preventDefault();var options={lightboxStandalone:true,viewerToolbar:{display:false}};var g=this.dataset.nanogallery2Lgroup;var t=document.querySelectorAll('[data-nanogallery2-lightbox]');for(var i=0;i<t.length;i++){if(t[i].dataset.nanogallery2Lgroup==g){if(t[i].dataset.nanogallery2Lightbox!==""){options=jQuery.extend(true,{},options,jQuery(t[i]).data('nanogallery2Lightbox'));break;}}}
2994jQuery(this).nanogallery2(options);});}});}).call(null);;;
2995if(typeof Object.create!=='function'){Object.create=function(obj){function F(){}
2996F.prototype=obj;return new F();};}
2997(function($,window,document){var EZP={init:function(options,elem){var self=this;self.elem=elem;self.$elem=$(elem);self.options=$.extend({},$.fn.ezPlus.options,self.responsiveConfig(options||{}));self.imageSrc=self.$elem.attr('data-'+self.options.attrImageZoomSrc)?self.$elem.attr('data-'+self.options.attrImageZoomSrc):self.$elem.attr('src');if(!self.options.enabled){return;}
2998if(self.options.tint){self.options.lensColour='transparent';self.options.lensOpacity='1';}
2999if(self.options.zoomType==='inner'){self.options.showLens=false;}
3000if(self.options.zoomType==='lens'){self.options.zoomWindowWidth=0;}
3001if(self.options.zoomId===-1){self.options.zoomId=generateUUID();}
3002self.$elem.parent().removeAttr('title').removeAttr('alt');self.zoomImage=self.imageSrc;self.refresh(1);var galleryEvent=self.options.galleryEvent+'.ezpspace';galleryEvent+=self.options.touchEnabled?' touchend.ezpspace':'';self.$galleries=$(self.options.gallery?('#'+self.options.gallery):self.options.gallerySelector);self.$galleries.on(galleryEvent,self.options.galleryItem,function(e){if(self.options.galleryActiveClass){$(self.options.galleryItem,self.$galleries).removeClass(self.options.galleryActiveClass);$(this).addClass(self.options.galleryActiveClass);}
3003if(this.tagName==='A'){e.preventDefault();}
3004if($(this).data(self.options.attrImageZoomSrc)){self.zoomImagePre=$(this).data(self.options.attrImageZoomSrc);}
3005else{self.zoomImagePre=$(this).data('image');}
3006self.swaptheimage($(this).data('image'),self.zoomImagePre);if(this.tagName==='A'){return false;}});function generateUUID(){var d=new Date().getTime();var uuid='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=(d+Math.random()*16)%16|0;d=Math.floor(d/16);return(c==='x'?r:(r&0x3|0x8)).toString(16);});return uuid;}},refresh:function(length){var self=this;setTimeout(function(){self.fetch(self.imageSrc,self.$elem,self.options.minZoomLevel);},length||self.options.refresh);},fetch:function(imgsrc,element,minZoom){var self=this;var newImg=new Image();newImg.onload=function(){if(newImg.width/element.width()<=minZoom){self.largeWidth=element.width()*minZoom;}else{self.largeWidth=newImg.width;}
3007if(newImg.height/element.height()<=minZoom){self.largeHeight=element.height()*minZoom;}else{self.largeHeight=newImg.height;}
3008self.startZoom();self.currentImage=self.imageSrc;self.options.onZoomedImageLoaded(self.$elem);};self.setImageSource(newImg,imgsrc);return;},setImageSource:function(image,src){image.src=src;},startZoom:function(){var self=this;self.nzWidth=self.$elem.width();self.nzHeight=self.$elem.height();self.isWindowActive=false;self.isLensActive=false;self.isTintActive=false;self.overWindow=false;if(self.options.imageCrossfade){var elementZoomWrapper=$('<div class="zoomWrapper"/>').css({height:self.nzHeight,width:self.nzWidth});if(self.$elem.parent().hasClass('zoomWrapper')){self.$elem.unwrap();}
3009self.zoomWrap=self.$elem.wrap(elementZoomWrapper);self.$elem.css({position:'absolute'});}
3010self.zoomLock=1;self.scrollingLock=false;self.changeBgSize=false;self.currentZoomLevel=self.options.zoomLevel;self.updateOffset(self);self.widthRatio=(self.largeWidth/self.currentZoomLevel)/self.nzWidth;self.heightRatio=(self.largeHeight/self.currentZoomLevel)/self.nzHeight;function getWindowZoomStyle(){return{display:'none',position:'absolute',height:self.options.zoomWindowHeight,width:self.options.zoomWindowWidth,border:''+self.options.borderSize+'px solid '+self.options.borderColour,backgroundSize:''+(self.largeWidth/self.currentZoomLevel)+'px '+(self.largeHeight/self.currentZoomLevel)+'px',backgroundPosition:'0px 0px',backgroundRepeat:'no-repeat',backgroundColor:''+self.options.zoomWindowBgColour,overflow:'hidden',zIndex:100};}
3011if(self.options.zoomType==='window'){self.zoomWindowStyle=getWindowZoomStyle();}
3012function getInnerZoomStyle(){var borderWidth=self.$elem.css('border-left-width');if(self.options.scrollZoom)
3013self.zoomLens=$('<div class="zoomLens"/>');return{display:'none',position:'absolute',height:self.nzHeight,width:self.nzWidth,marginTop:borderWidth,marginLeft:borderWidth,border:''+self.options.borderSize+'px solid '+self.options.borderColour,backgroundPosition:'0px 0px',backgroundRepeat:'no-repeat',cursor:self.options.cursor,overflow:'hidden',zIndex:self.options.zIndex};}
3014if(self.options.zoomType==='inner'){self.zoomWindowStyle=getInnerZoomStyle();}
3015function getWindowLensStyle(){if(self.nzHeight<self.options.zoomWindowHeight/self.heightRatio){self.lensHeight=self.nzHeight;}
3016else{self.lensHeight=self.options.zoomWindowHeight/self.heightRatio;}
3017if(self.largeWidth<self.options.zoomWindowWidth){self.lensWidth=self.nzWidth;}
3018else{self.lensWidth=self.options.zoomWindowWidth/self.widthRatio;}
3019return{display:'none',position:'absolute',height:self.lensHeight,width:self.lensWidth,border:''+self.options.lensBorderSize+'px'+' solid '+self.options.lensBorderColour,backgroundPosition:'0px 0px',backgroundRepeat:'no-repeat',backgroundColor:self.options.lensColour,opacity:self.options.lensOpacity,cursor:self.options.cursor,zIndex:999,overflow:'hidden'};}
3020if(self.options.zoomType==='window'){self.lensStyle=getWindowLensStyle();}
3021self.tintStyle={display:'block',position:'absolute',height:self.nzHeight,width:self.nzWidth,backgroundColor:self.options.tintColour,opacity:0};self.lensRound={};if(self.options.zoomType==='lens'){self.lensStyle={display:'none',position:'absolute',float:'left',height:self.options.lensSize,width:self.options.lensSize,border:''+self.options.borderSize+'px solid '+self.options.borderColour,backgroundPosition:'0px 0px',backgroundRepeat:'no-repeat',backgroundColor:self.options.lensColour,cursor:self.options.cursor};}
3022if(self.options.lensShape==='round'){self.lensRound={borderRadius:self.options.lensSize/2+self.options.borderSize};}
3023self.zoomContainer=$('<div class="'+self.options.container+'" '+'uuid="'+self.options.zoomId+'"/>');self.zoomContainer.css({position:'absolute',top:self.nzOffset.top,left:self.nzOffset.left,height:self.nzHeight,width:self.nzWidth,zIndex:self.options.zIndex});if(self.$elem.attr('id')){self.zoomContainer.attr('id',self.$elem.attr('id')+'-'+self.options.container);}
3024$('.'+self.options.container+'[uuid="'+self.options.zoomId+'"]').remove();$(self.options.zoomContainerAppendTo).append(self.zoomContainer);if(self.options.containLensZoom&&self.options.zoomType==='lens'){self.zoomContainer.css('overflow','hidden');}
3025if(self.options.zoomType!=='inner'){self.zoomLens=$('<div class="zoomLens"/>').css($.extend({},self.lensStyle,self.lensRound)).appendTo(self.zoomContainer).click(function(){self.$elem.trigger('click');});if(self.options.tint){self.tintContainer=$('<div class="tintContainer"/>');self.zoomTint=$('<div class="zoomTint"/>').css(self.tintStyle);self.zoomLens.wrap(self.tintContainer);self.zoomTintcss=self.zoomLens.after(self.zoomTint);self.zoomTintImage=$('<img src="'+self.$elem.attr('src')+'">').css({position:'absolute',top:0,left:0,height:self.nzHeight,width:self.nzWidth,maxWidth:'none'}).appendTo(self.zoomLens).click(function(){self.$elem.trigger('click');});}}
3026var targetZoomContainer=isNaN(self.options.zoomWindowPosition)?'body':self.zoomContainer;self.zoomWindow=$('<div class="zoomWindow"/>').css($.extend({zIndex:999,top:self.windowOffsetTop,left:self.windowOffsetLeft,},self.zoomWindowStyle)).appendTo(targetZoomContainer).click(function(){self.$elem.trigger('click');});self.zoomWindowContainer=$('<div class="zoomWindowContainer" />').css({width:self.options.zoomWindowWidth});self.zoomWindow.wrap(self.zoomWindowContainer);if(self.options.zoomType==='lens'){self.zoomContainer.css('display','none');self.zoomLens.css({backgroundImage:'url("'+self.imageSrc+'")'});}
3027if(self.options.zoomType==='window'){self.zoomWindow.css({backgroundImage:'url("'+self.imageSrc+'")'});}
3028if(self.options.zoomType==='inner'){self.zoomWindow.css({backgroundImage:'url("'+self.imageSrc+'")'});}
3029if(self.options.touchEnabled){self.$elem.on('touchmove.ezpspace',function(e){e.preventDefault();var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];self.setPosition(touch);});self.zoomContainer.on('touchmove.ezpspace',function(e){self.setElements('show');e.preventDefault();var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];self.setPosition(touch);});self.zoomContainer.add(self.$elem).on('touchend.ezpspace',function(e){self.showHideWindow('hide');if(self.options.showLens){self.showHideLens('hide');}
3030if(self.options.tint&&self.options.zoomType!=='inner'){self.showHideTint('hide');}});if(self.options.showLens){self.zoomLens.on('touchmove.ezpspace',function(e){e.preventDefault();var touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];self.setPosition(touch);});self.zoomLens.on('touchend.ezpspace',function(e){self.showHideWindow('hide');if(self.options.showLens){self.showHideLens('hide');}
3031if(self.options.tint&&self.options.zoomType!=='inner'){self.showHideTint('hide');}});}}
3032self.zoomContainer.on('click.ezpspace touchstart.ezpspace',self.options.onImageClick);self.zoomContainer.add(self.$elem).on('mousemove.ezpspace',function(e){if(self.overWindow===false){self.setElements('show');}
3033mouseMoveZoomHandler(e);});function mouseMoveZoomHandler(e){if(self.lastX!==e.clientX||self.lastY!==e.clientY){self.setPosition(e);self.currentLoc=e;}
3034self.lastX=e.clientX;self.lastY=e.clientY;}
3035var elementToTrack=null;if(self.options.zoomType!=='inner'){elementToTrack=self.zoomLens;}
3036if(self.options.tint&&self.options.zoomType!=='inner'){elementToTrack=self.zoomTint;}
3037if(self.options.zoomType==='inner'){elementToTrack=self.zoomWindow;}
3038if(elementToTrack){elementToTrack.on('mousemove.ezpspace',mouseMoveZoomHandler);}
3039self.zoomContainer.add(self.$elem).hover(function(){if(self.overWindow===false){self.setElements('show');}},function(){if(!self.scrollLock){self.setElements('hide');self.options.onDestroy(self.$elem);}});if(self.options.zoomType!=='inner'){self.zoomWindow.hover(function(){self.overWindow=true;self.setElements('hide');},function(){self.overWindow=false;});}
3040if(self.options.minZoomLevel){self.minZoomLevel=self.options.minZoomLevel;}
3041else{self.minZoomLevel=self.options.scrollZoomIncrement*2;}
3042if(self.options.scrollZoom){self.zoomContainer.add(self.$elem).on('wheel DOMMouseScroll MozMousePixelScroll',function(e){self.scrollLock=true;clearTimeout($.data(this,'timer'));$.data(this,'timer',setTimeout(function(){self.scrollLock=false;},250));var theEvent=e.originalEvent.deltaY||e.originalEvent.detail* -1;e.stopImmediatePropagation();e.stopPropagation();e.preventDefault();if(theEvent===0){return false;}
3043var nextZoomLevel;if(theEvent/120>0){nextZoomLevel=parseFloat(self.currentZoomLevel)-self.options.scrollZoomIncrement;if(nextZoomLevel>
3043=parseFloat(self.minZoomLevel)){self.changeZoomLevel(nextZoomLevel);}}
3044else{if((!self.fullheight&&!self.fullwidth)||!self.options.mantainZoomAspectRatio){nextZoomLevel=parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement;if(self.options.maxZoomLevel){if(nextZoomLevel<=self.options.maxZoomLevel){self.changeZoomLevel(nextZoomLevel);}}
3045else{self.changeZoomLevel(nextZoomLevel);}}}
3046return false;});}},destroy:function(){var self=this;self.$elem.off('.ezpspace');self.$galleries.off('.ezpspace');$(self.zoomContainer).remove();if(self.options.loadingIcon&&!!self.spinner&&!!self.spinner.length){self.spinner.remove();delete self.spinner;}},getIdentifier:function(){var self=this;return self.options.zoomId;},setElements:function(type){var self=this;if(!self.options.zoomEnabled){return false;}
3047if(type==='show'){if(self.isWindowSet){if(self.options.zoomType==='inner'){self.showHideWindow('show');}
3048if(self.options.zoomType==='window'){self.showHideWindow('show');}
3049if(self.options.showLens){self.showHideZoomContainer('show');self.showHideLens('show');}
3050if(self.options.tint&&self.options.zoomType!=='inner'){self.showHideTint('show');}}}
3051if(type==='hide'){if(self.options.zoomType==='window'){self.showHideWindow('hide');}
3052if(!self.options.tint){self.showHideWindow('hide');}
3053if(self.options.showLens){self.showHideZoomContainer('hide');self.showHideLens('hide');}
3054if(self.options.tint){self.showHideTint('hide');}}},setPosition:function(e){var self=this;if(!self.options.zoomEnabled||e===undefined){return false;}
3055self.nzHeight=self.$elem.height();self.nzWidth=self.$elem.width();self.updateOffset(self);if(self.options.tint&&self.options.zoomType!=='inner'){self.zoomTint.css({top:0,left:0});}
3056if(self.options.responsive&&!self.options.scrollZoom){if(self.options.showLens){var lensHeight,lensWidth;if(self.nzHeight<self.options.zoomWindowWidth/self.widthRatio){self.lensHeight=self.nzHeight;}
3057else{self.lensHeight=self.options.zoomWindowHeight/self.heightRatio;}
3058if(self.largeWidth<self.options.zoomWindowWidth){self.lensWidth=self.nzWidth;}
3059else{self.lensWidth=(self.options.zoomWindowWidth/self.widthRatio);}
3060self.widthRatio=self.largeWidth/self.nzWidth;self.heightRatio=self.largeHeight/self.nzHeight;if(self.options.zoomType!=='lens'){if(self.nzHeight<self.options.zoomWindowWidth/self.widthRatio){self.lensHeight=self.nzHeight;}
3061else{self.lensHeight=self.options.zoomWindowHeight/self.heightRatio;}
3062if(self.nzWidth<self.options.zoomWindowHeight/self.heightRatio){self.lensWidth=self.nzWidth;}
3063else{self.lensWidth=self.options.zoomWindowWidth/self.widthRatio;}
3064self.zoomLens.css({width:self.lensWidth,height:self.lensHeight});if(self.options.tint){self.zoomTintImage.css({width:self.nzWidth,height:self.nzHeight});}}
3065if(self.options.zoomType==='lens'){self.zoomLens.css({width:self.options.lensSize,height:self.options.lensSize});}}}
3066self.zoomContainer.css({top:self.nzOffset.top,left:self.nzOffset.left,width:self.nzWidth,height:self.nzHeight});self.mouseLeft=parseInt(e.pageX-self.pageOffsetX-self.nzOffset.left);self.mouseTop=parseInt(e.pageY-self.pageOffsetY-self.nzOffset.top);if(self.options.zoomType==='window'){var zoomLensHeight=self.zoomLens.height()/2;var zoomLensWidth=self.zoomLens.width()/2;self.Etoppos=(self.mouseTop<0+zoomLensHeight);self.Eboppos=(self.mouseTop>self.nzHeight-zoomLensHeight-(self.options.lensBorderSize*2));self.Eloppos=(self.mouseLeft<0+zoomLensWidth);self.Eroppos=(self.mouseLeft>(self.nzWidth-zoomLensWidth-(self.options.lensBorderSize*2)));}
3067if(self.options.zoomType==='inner'){self.Etoppos=(self.mouseTop<((self.nzHeight/2)/self.heightRatio));self.Eboppos=(self.mouseTop>(self.nzHeight-((self.nzHeight/2)/self.heightRatio)));self.Eloppos=(self.mouseLeft<0+(((self.nzWidth/2)/self.widthRatio)));self.Eroppos=(self.mouseLeft>(self.nzWidth-(self.nzWidth/2)/self.widthRatio-(self.options.lensBorderSize*2)));}
3068if(self.mouseLeft<0||self.mouseTop<0||self.mouseLeft>self.nzWidth||self.mouseTop>self.nzHeight){self.setElements('hide');return;}
3069else{if(self.options.showLens){self.lensLeftPos=Math.floor(self.mouseLeft-self.zoomLens.width()/2);self.lensTopPos=Math.floor(self.mouseTop-self.zoomLens.height()/2);}
3070if(self.Etoppos){self.lensTopPos=0;}
3071if(self.Eloppos){self.windowLeftPos=0;self.lensLeftPos=0;self.tintpos=0;}
3072if(self.options.zoomType==='window'){if(self.Eboppos){self.lensTopPos=Math.max((self.nzHeight)-self.zoomLens.height()-(self.options.lensBorderSize*2),0);}
3073if(self.Eroppos){self.lensLeftPos=(self.nzWidth-(self.zoomLens.width())-(self.options.lensBorderSize*2));}}
3074if(self.options.zoomType==='inner'){if(self.Eboppos){self.lensTopPos=Math.max(((self.nzHeight)-(self.options.lensBorderSize*2)),0);}
3075if(self.Eroppos){self.lensLeftPos=(self.nzWidth-(self.nzWidth)-(self.options.lensBorderSize*2));}}
3076if(self.options.zoomType==='lens'){self.windowLeftPos=((e.pageX-self.pageOffsetX-self.nzOffset.left)*self.widthRatio-self.zoomLens.width()/2)* -1;self.windowTopPos=((e.pageY-self.pageOffsetY-self.nzOffset.top)*self.heightRatio-self.zoomLens.height()/2)* -1;self.zoomLens.css({backgroundPosition:''+self.windowLeftPos+'px '+self.windowTopPos+'px'});if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType==='lens'){self.zoomLens.css({backgroundSize:''+
3077(self.largeWidth/self.newvalueheight)+'px '+
3078(self.largeHeight/self.newvalueheight)+'px'});}
3079self.zoomWindow.css({backgroundSize:''+
3080(self.largeWidth/self.newvalueheight)+'px '+
3081(self.largeHeight/self.newvalueheight)+'px'});}
3082else{if(self.options.zoomType==='lens'){self.zoomLens.css({backgroundSize:''+
3083(self.largeWidth/self.newvaluewidth)+'px '+
3084(self.largeHeight/self.newvaluewidth)+'px'});}
3085self.zoomWindow.css({backgroundSize:''+
3086(self.largeWidth/self.newvaluewidth)+'px '+
3087(self.largeHeight/self.newvaluewidth)+'px'});}
3088self.changeBgSize=false;}
3089self.setWindowPosition(e);}
3090if(self.options.tint&&self.options.zoomType!=='inner'){self.setTintPosition(e);}
3091if(self.options.zoomType==='window'){self.setWindowPosition(e);}
3092if(self.options.zoomType==='inner'){self.setWindowPosition(e);}
3093if(self.options.showLens){if(self.fullwidth&&self.options.zoomType!=='lens'){self.lensLeftPos=0;}
3094self.zoomLens.css({left:self.lensLeftPos,top:self.lensTopPos});}}}
3094,showHideZoomContainer:function(change){var self=this;if(change==='show'){if(self.zoomContainer){self.zoomContainer.show();}}
3095if(change==='hide'){if(self.zoomContainer){self.zoomContainer.hide();}}},showHideWindow:function(change){var self=this;if(change==='show'){if(!self.isWindowActive&&self.zoomWindow){self.options.onShow(self);if(self.options.zoomWindowFadeIn){self.zoomWindow.stop(true,true,false).fadeIn(self.options.zoomWindowFadeIn);}
3096else{self.zoomWindow.show();}
3097self.isWindowActive=true;}}
3098if(change==='hide'){if(self.isWindowActive){if(self.options.zoomWindowFadeOut){self.zoomWindow.stop(true,true).fadeOut(self.options.zoomWindowFadeOut,function(){if(self.loop){clearInterval(self.loop);self.loop=false;}});}
3099else{self.zoomWindow.hide();}
3100self.options.onHide(self);self.isWindowActive=false;}}},showHideLens:function(change){var self=this;if(change==='show'){if(!self.isLensActive){if(self.zoomLens){if(self.options.lensFadeIn){self.zoomLens.stop(true,true,false).fadeIn(self.options.lensFadeIn);}
3101else{self.zoomLens.show();}}
3102self.isLensActive=true;}}
3103if(change==='hide'){if(self.isLensActive){if(self.zoomLens){if(self.options.lensFadeOut){self.zoomLens.stop(true,true).fadeOut(self.options.lensFadeOut);}
3104else{self.zoomLens.hide();}}
3105self.isLensActive=false;}}},showHideTint:function(change){var self=this;if(change==='show'){if(!self.isTintActive&&self.zoomTint){if(self.options.zoomTintFadeIn){self.zoomTint.css('opacity',self.options.tintOpacity).animate().stop(true,true).fadeIn('slow');}
3106else{self.zoomTint.css('opacity',self.options.tintOpacity).animate();self.zoomTint.show();}
3107self.isTintActive=true;}}
3108if(change==='hide'){if(self.isTintActive){if(self.options.zoomTintFadeOut){self.zoomTint.stop(true,true).fadeOut(self.options.zoomTintFadeOut);}
3109else{self.zoomTint.hide();}
3110self.isTintActive=false;}}},setLensPosition:function(e){},setWindowPosition:function(e){var self=this;if(!isNaN(self.options.zoomWindowPosition)){switch(self.options.zoomWindowPosition){case 1:self.windowOffsetTop=(self.options.zoomWindowOffsetY);self.windowOffsetLeft=(+self.nzWidth);break;case 2:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1);self.windowOffsetLeft=(self.nzWidth);}
3111else{$.noop();}
3112break;case 3:self.windowOffsetTop=(self.nzHeight-self.zoomWindow.height()-(self.options.borderSize*2));self.windowOffsetLeft=(self.nzWidth);break;case 4:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=(self.nzWidth);break;case 5:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2));break;case 6:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1);}
3113else{$.noop();}
3114break;case 7:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=0;break;case 8:self.windowOffsetTop=(self.nzHeight);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 9:self.windowOffsetTop=(self.nzHeight-self.zoomWindow.height()-(self.options.borderSize*2));self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 10:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);}
3115else{$.noop();}
3116break;case 11:self.windowOffsetTop=(self.options.zoomWindowOffsetY);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 12:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(self.zoomWindow.width()+(self.options.borderSize*2))*(-1);break;case 13:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(0);break;case 14:if(self.options.zoomWindowHeight>self.nzHeight){self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1);}
3117else{$.noop();}
3118break;case 15:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2));break;case 16:self.windowOffsetTop=(self.zoomWindow.height()+(self.options.borderSize*2))*(-1);self.windowOffsetLeft=(self.nzWidth);break;default:self.windowOffsetTop=(self.options.zoomWindowOffsetY);self.windowOffsetLeft=(self.nzWidth);}}
3119else{self.externalContainer=$(self.options.zoomWindowPosition);if(!self.externalContainer.length){self.externalContainer=$('#'+self.options.zoomWindowPosition);}
3120self.externalContainerWidth=self.externalContainer.width();self.externalContainerHeight=self.externalContainer.height();self.externalContainerOffset=self.externalContainer.offset();self.windowOffsetTop=self.externalContainerOffset.top;self.windowOffsetLeft=self.externalContainerOffset.left;}
3121self.isWindowSet=true;self.windowOffsetTop=self.windowOffsetTop+self.options.zoomWindowOffsetY;self.windowOffsetLeft=self.windowOffsetLeft+self.options.zoomWindowOffsetX;self.zoomWindow.css({top:self.windowOffsetTop,left:self.windowOffsetLeft});if(self.options.zoomType==='inner'){self.zoomWindow.css({top:0,left:0});}
3122self.windowLeftPos=((e.pageX-self.pageOffsetX-self.nzOffset.left)*self.widthRatio-self.zoomWindow.width()/2)* -1;self.windowTopPos=((e.pageY-self.pageOffsetY-self.nzOffset.top)*self.heightRatio-self.zoomWindow.height()/2)* -1;if(self.Etoppos){self.windowTopPos=0;}
3123if(self.Eloppos){self.windowLeftPos=0;}
3124if(self.Eboppos){self.windowTopPos=(self.largeHeight/self.currentZoomLevel-self.zoomWindow.height())*(-1);}
3125if(self.Eroppos){self.windowLeftPos=((self.largeWidth/self.currentZoomLevel-self.zoomWindow.width())*(-1));}
3126if(self.fullheight){self.windowTopPos=0;}
3127if(self.fullwidth){self.windowLeftPos=0;}
3128if(self.options.zoomType==='window'||self.options.zoomType==='inner'){if(self.zoomLock===1){if(self.widthRatio<=1){self.windowLeftPos=0;}
3129if(self.heightRatio<=1){self.windowTopPos=0;}}
3130if(self.options.easing){if(!self.xp){self.xp=0;}
3131if(!self.yp){self.yp=0;}
3132var interval=16;var easingInterval=parseInt(self.options.easing);if(typeof easingInterval==='number'&&isFinite(easingInterval)&&Math.floor(easingInterval)===easingInterval){interval=easingInterval;}
3133if(!self.loop){self.loop=setInterval(function(){self.xp+=(self.windowLeftPos-self.xp)/self.options.easingAmou
3133nt;self.yp+=(self.windowTopPos-self.yp)/self.options.easingAmount;if(self.scrollingLock){clearInterval(self.loop);self.xp=self.windowLeftPos;self.yp=self.windowTopPos;self.xp=((e.pageX-self.pageOffsetX-self.nzOffset.left)*self.widthRatio-self.zoomWindow.width()/2)*(-1);self.yp=(((e.pageY-self.pageOffsetY-self.nzOffset.top)*self.heightRatio-self.zoomWindow.height()/2)*(-1));if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType==='lens'){self.zoomLens.css({backgroundSize:''+
3134(self.largeWidth/self.newvalueheight)+'px '+
3135(self.largeHeight/self.newvalueheight)+'px'});}
3136self.zoomWindow.css({backgroundSize:''+
3137(self.largeWidth/self.newvalueheight)+'px '+
3138(self.largeHeight/self.newvalueheight)+'px'});}
3139else{if(self.options.zoomType!=='lens'){self.zoomLens.css({backgroundSize:''+
3140(self.largeWidth/self.newvaluewidth)+'px '+
3141(self.largeHeight/self.newvalueheight)+'px'});}
3142self.zoomWindow.css({backgroundSize:''+
3143(self.largeWidth/self.newvaluewidth)+'px '+
3144(self.largeHeight/self.newvaluewidth)+'px'});}
3145self.changeBgSize=false;}
3146self.zoomWindow.css({backgroundPosition:''+self.windowLeftPos+'px '+self.windowTopPos+'px'});self.scrollingLock=false;self.loop=false;}
3147else if(Math.round(Math.abs(self.xp-self.windowLeftPos)+Math.abs(self.yp-self.windowTopPos))<1){clearInterval(self.loop);self.zoomWindow.css({backgroundPosition:''+self.windowLeftPos+'px '+self.windowTopPos+'px'});self.loop=false;}
3148else{if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType==='lens'){self.zoomLens.css({backgroundSize:''+
3149(self.largeWidth/self.newvalueheight)+'px '+
3150(self.largeHeight/self.newvalueheight)+'px'});}
3151self.zoomWindow.css({backgroundSize:''+
3152(self.largeWidth/self.newvalueheight)+'px '+
3153(self.largeHeight/self.newvalueheight)+'px'});}
3154else{if(self.options.zoomType!=='lens'){self.zoomLens.css({backgroundSize:''+
3155(self.largeWidth/self.newvaluewidth)+'px '+
3156(self.largeHeight/self.newvaluewidth)+'px'});}
3157self.zoomWindow.css({backgroundSize:''+
3158(self.largeWidth/self.newvaluewidth)+'px '+
3159(self.largeHeight/self.newvaluewidth)+'px'});}
3160self.changeBgSize=false;}
3161self.zoomWindow.css({backgroundPosition:''+self.xp+'px '+self.yp+'px'});}},interval);}}
3162else{if(self.changeBgSize){if(self.nzHeight>self.nzWidth){if(self.options.zoomType==='lens'){self.zoomLens.css({backgroundSize:''+
3163(self.largeWidth/self.newvalueheight)+'px '+
3164(self.largeHeight/self.newvalueheight)+'px'});}
3165self.zoomWindow.css({backgroundSize:''+
3166(self.largeWidth/self.newvalueheight)+'px '+
3167(self.largeHeight/self.newvalueheight)+'px'});}
3168else{if(self.options.zoomType==='lens'){self.zoomLens.css({backgroundSize:''+
3169(self.largeWidth/self.newvaluewidth)+'px '+
3170(self.largeHeight/self.newvaluewidth)+'px'});}
3171if((self.largeHeight/self.newvaluewidth)<self.options.zoomWindowHeight){self.zoomWindow.css({backgroundSize:''+
3172(self.largeWidth/self.newvaluewidth)+'px '+
3173(self.largeHeight/self.newvaluewidth)+'px'});}
3174else{self.zoomWindow.css({backgroundSize:''+
3175(self.largeWidth/self.newvalueheight)+'px '+
3176(self.largeHeight/self.newvalueheight)+'px'});}}
3177self.changeBgSize=false;}
3178self.zoomWindow.css({backgroundPosition:''+
3179self.windowLeftPos+'px '+
3180self.windowTopPos+'px'});}}},setTintPosition:function(e){var self=this;var zoomLensWidth=self.zoomLens.width();var zoomLensHeight=self.zoomLens.height();self.updateOffset(self);self.tintpos=((e.pageX-self.pageOffsetX-self.nzOffset.left)-(zoomLensWidth/2))* -1;self.tintposy=((e.pageY-self.pageOffsetY-self.nzOffset.top)-zoomLensHeight/2)* -1;if(self.Etoppos){self.tintposy=0;}
3181if(self.Eloppos){self.tintpos=0;}
3182if(self.Eboppos){self.tintposy=(self.nzHeight-zoomLensHeight-(self.options.lensBorderSize*2))*(-1);}
3183if(self.Eroppos){self.tintpos=((self.nzWidth-zoomLensWidth-(self.options.lensBorderSize*2))*(-1));}
3184if(self.options.tint){if(self.fullheight){self.tintposy=0;}
3185if(self.fullwidth){self.tintpos=0;}
3186self.zoomTintImage.css({left:self.tintpos,top:self.tintposy});}},swaptheimage:function(smallimage,largeimage){var self=this;var newImg=new Image();if(self.options.loadingIcon&&!self.spinner){var styleAttr={background:'url("'+self.options.loadingIcon+'") no-repeat',height:self.nzHeight,width:self.nzWidth,zIndex:2000,position:'absolute',backgroundPosition:'center center',};if(self.options.zoomType==='inner'){styleAttr.setProperty('top',0);}
3187self.spinner=$('<div class="ezp-spinner"></div>').css(styleAttr);self.$elem.after(self.spinner);}else if(self.spinner){self.spinner.show();}
3188self.options.onImageSwap(self.$elem);newImg.onload=function(){self.largeWidth=newImg.width;
3188self.largeHeight=newImg.height;self.zoomImage=largeimage;self.zoomWindow.css({backgroundSize:''+self.largeWidth+'px '+self.largeHeight+'px'});self.swapAction(smallimage,largeimage);return;};self.setImageSource(newImg,largeimage);},swapAction:function(smallimage,largeimage){var self=this;var elemWidth=self.$elem.width();var elemHeight=self.$elem.height();var newImg2=new Image();newImg2.onload=function(){self.nzHeight=newImg2.height;self.nzWidth=newImg2.width;self.options.onImageSwapComplete(self.$elem);self.doneCallback();return;};self.setImageSource(newImg2,smallimage);self.currentZoomLevel=self.options.zoomLevel;self.options.maxZoomLevel=false;if(self.options.zoomType==='lens'){self.zoomLens.css('background-image','url("'+largeimage+'")');}
3189if(self.options.zoomType==='window'){self.zoomWindow.css('background-image','url("'+largeimage+'")');}
3190if(self.options.zoomType==='inner'){self.zoomWindow.css('background-image','url("'+largeimage+'")');}
3191self.currentImage=largeimage;if(self.options.imageCrossfade){var oldImg=self.$elem;var newImg=oldImg.clone();self.$elem.attr('src',smallimage);self.$elem.after(newImg);newImg.stop(true).fadeOut(self.options.imageCrossfade,function(){$(this).remove();});self.$elem.width('auto').removeAttr('width');self.$elem.height('auto').removeAttr('height');oldImg.fadeIn(self.options.imageCrossfade);if(self.options.tint&&self.options.zoomType!=='inner'){var oldImgTint=self.zoomTintImage;var newImgTint=oldImgTint.clone();self.zoomTintImage.attr('src',largeimage);self.zoomTintImage.after(newImgTint);newImgTint.stop(true).fadeOut(self.options.imageCrossfade,function(){$(this).remove();});oldImgTint.fadeIn(self.options.imageCrossfade);self.zoomTint.css({height:elemHeight,width:elemWidth});}
3192self.zoomContainer.css({'height':elemHeight,'width':elemWidth});if(self.options.zoomType==='inner'){if(!self.options.constrainType){self.zoomWrap.parent().css({'height':elemHeight,'width':elemWidth});self.zoomWindow.css({'height':elemHeight,'width':elemWidth});}}
3193if(self.options.imageCrossfade){self.zoomWrap.css({'height':elemHeight,'width':elemWidth});}}
3194else{self.$elem.attr('src',smallimage);if(self.options.tint){self.zoomTintImage.attr('src',largeimage);self.zoomTintImage.attr('height',elemHeight);self.zoomTintImage.css('height',elemHeight);self.zoomTint.css('height',elemHeight);}
3195self.zoomContainer.css({'height':elemHeight,'width':elemWidth});if(self.options.imageCrossfade){self.zoomWrap.css({'height':elemHeight,'width':elemWidth});}}
3196if(self.options.constrainType){if(self.options.constrainType==='height'){var autoWDimension={'height':self.options.constrainSize,'width':'auto'};self.zoomContainer.css(autoWDimension);if(self.options.imageCrossfade){self.zoomWrap.css(autoWDimension);self.constwidth=self.zoomWrap.width();}
3197else{self.$elem.css(autoWDimension);self.constwidth=elemWidth;}
3198var constWDim={'height':self.options.constrainSize,'width':self.constwidth};if(self.options.zoomType==='inner'){self.zoomWrap.parent().css(constWDim);self.zoomWindow.css(constWDim);}
3199if(self.options.tint){self.tintContainer.css(constWDim);self.zoomTint.css(constWDim);self.zoomTintImage.css(constWDim);}}
3200if(self.options.constrainType==='width'){var autoHDimension={'height':'auto','width':self.options.constrainSize};self.zoomContainer.css(autoHDimension);if(self.options.imageCrossfade){self.zoomWrap.css(autoHDimension);self.constheight=self.zoomWrap.height();}
3201else{self.$elem.css(autoHDimension);self.constheight=elemHeight;}
3202var constHDim={'height':self.constheight,'width':self.options.constrainSize};if(self.options.zoomType==='inner'){self.zoomWrap.parent().css(constHDim);self.zoomWindow.css(constHDim);}
3203if(self.options.tint){self.tintContainer.css(constHDim);self.zoomTint.css(constHDim);self.zoomTintImage.css(constHDim);}}}},doneCallback:function(){var self=this;if(self.options.loadingIcon&&!!self.spinner&&!!self.spinner.length){self.spinner.hide();}
3204self.updateOffset(self);self.nzWidth=self.$elem.width();self.nzHeight=self.$elem.height();self.currentZoomLevel=self.options.zoomLevel;self.widthRatio=self.largeWidth/self.nzWidth;self.heightRatio=self.largeHeight/self.nzHeight;if(self.options.zoomType==='window'){if(self.nzHeight<self.options.zoomWindowHeight/self.heightRatio){self.lensHeight=self.nzHeight;}
3205else{self.lensHeight=self.options.zoomWindowHeight/self.heightRatio;}
3206if(self.nzWidth<self.options.zoomWindowWidth){self.lensWidth=self.nzWidth;}
3207else{self.lensWidth=self.options.zoomWindowWidth/self.widthRatio;}
3208if(self.zoomLens){self.zoomLens.css({'width':self.lensWidth,'height':self.lensHeight});}}},getCurrentImage:function(){var self=this;return self.zoomImage;},getGalleryList:function(){var self=this;self.gallerylist=[];
3208if(self.options.gallery){$('#'+self.options.gallery+' a').each(function(){var imgSrc='';if($(this).data(self.options.attrImageZoomSrc)){imgSrc=$(this).data(self.options.attrImageZoomSrc);}
3209else if($(this).data('image')){imgSrc=$(this).data('image');}
3210if(imgSrc===self.zoomImage){self.gallerylist.unshift({href:''+imgSrc+'',title:$(this).find('img').attr('title')});}
3211else{self.gallerylist.push({href:''+imgSrc+'',title:$(this).find('img').attr('title')});}});}
3212else{self.gallerylist.push({href:''+self.zoomImage+'',title:$(this).find('img').attr('title')});}
3213return self.gallerylist;},changeZoomLevel:function(value){var self=this;self.scrollingLock=true;self.newvalue=parseFloat(value).toFixed(2);var newvalue=self.newvalue;var maxheightnewvalue=self.largeHeight/((self.options.zoomWindowHeight/self.nzHeight)*self.nzHeight);var maxwidthtnewvalue=self.largeWidth/((self.options.zoomWindowWidth/self.nzWidth)*self.nzWidth);if(self.options.zoomType!=='inner'){if(maxheightnewvalue<=newvalue){self.heightRatio=(self.largeHeight/maxheightnewvalue)/self.nzHeight;self.newvalueheight=maxheightnewvalue;self.fullheight=true;}
3214else{self.heightRatio=(self.largeHeight/newvalue)/self.nzHeight;self.newvalueheight=newvalue;self.fullheight=false;}
3215if(maxwidthtnewvalue<=newvalue){self.widthRatio=(self.largeWidth/maxwidthtnewvalue)/self.nzWidth;self.newvaluewidth=maxwidthtnewvalue;self.fullwidth=true;}
3216else{self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;self.newvaluewidth=newvalue;self.fullwidth=false;}
3217if(self.options.zoomType==='lens'){if(maxheightnewvalue<=newvalue){self.fullwidth=true;self.newvaluewidth=maxheightnewvalue;}else{self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;self.newvaluewidth=newvalue;self.fullwidth=false;}}}
3218if(self.options.zoomType==='inner'){maxheightnewvalue=parseFloat(self.largeHeight/self.nzHeight).toFixed(2);maxwidthtnewvalue=parseFloat(self.largeWidth/self.nzWidth).toFixed(2);if(newvalue>maxheightnewvalue){newvalue=maxheightnewvalue;}
3219if(newvalue>maxwidthtnewvalue){newvalue=maxwidthtnewvalue;}
3220if(maxheightnewvalue<=newvalue){self.heightRatio=(self.largeHeight/newvalue)/self.nzHeight;if(newvalue>maxheightnewvalue){self.newvalueheight=maxheightnewvalue;}else{self.newvalueheight=newvalue;}
3221self.fullheight=true;}
3222else{self.heightRatio=(self.largeHeight/newvalue)/self.nzHeight;if(newvalue>maxheightnewvalue){self.newvalueheight=maxheightnewvalue;}else{self.newvalueheight=newvalue;}
3223self.fullheight=false;}
3224if(maxwidthtnewvalue<=newvalue){self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;if(newvalue>maxwidthtnewvalue){self.newvaluewidth=maxwidthtnewvalue;}else{self.newvaluewidth=newvalue;}
3225self.fullwidth=true;}
3226else{self.widthRatio=(self.largeWidth/newvalue)/self.nzWidth;self.newvaluewidth=newvalue;self.fullwidth=false;}}
3227var scrcontinue=false;if(self.options.zoomType==='inner'){if(self.nzWidth>=self.nzHeight){if(self.newvaluewidth<=maxwidthtnewvalue){scrcontinue=true;}
3228else{scrcontinue=false;self.fullheight=true;self.fullwidth=true;}}
3229if(self.nzHeight>self.nzWidth){if(self.newvaluewidth<=maxwidthtnewvalue){scrcontinue=true;}
3230else{scrcontinue=false;self.fullheight=true;self.fullwidth=true;}}}
3231if(self.options.zoomType!=='inner'){scrcontinue=true;}
3232if(scrcontinue){self.zoomLock=0;self.changeZoom=true;if(((self.options.zoomWindowHeight)/self.heightRatio)<=self.nzHeight){self.currentZoomLevel=self.newvalueheight;if(self.options.zoomType!=='lens'&&self.options.zoomType!=='inner'){self.changeBgSize=true;self.zoomLens.css({height:self.options.zoomWindowHeight/self.heightRatio});}
3233if(self.options.zoomType==='lens'||self.options.zoomType==='inner'){self.changeBgSize=true;}}
3234if((self.options.zoomWindowWidth/self.widthRatio)<=self.nzWidth){if(self.options.zoomType!=='inner'){if(self.newvaluewidth>self.newvalueheight){self.currentZoomLevel=self.newvaluewidth;}}
3235if(self.options.zoomType!=='lens'&&self.options.zoomType!=='inner'){self.changeBgSize=true;self.zoomLens.css({width:self.options.zoomWindowWidth/self.widthRatio});}
3236if(self.options.zoomType==='lens'||self.options.zoomType==='inner'){self.changeBgSize=true;}}
3237if(self.options.zoomType==='inner'){self.changeBgSize=true;if(self.nzWidth>self.nzHeight){self.currentZoomLevel=self.newvaluewidth;}
3238else if(self.nzHeight>=self.nzWidth){self.currentZoomLevel=self.newvaluewidth;}}}
3239self.setPosition(self.currentLoc);},closeAll:function(){var self=this;if(self.zoomWindow){self.zoomWindow.hide();}
3240if(self.zoomLens){self.zoomLens.hide();}
3241if(self.zoomTint){self.zoomTint.hide();}},updateOffset:function(self){if(self.options.zoomContainerAppendTo!=='body'){self.nzOffset=self.$elem.offset();var appendedPosition=$(self.options.zoomContainerAppendTo).offset();self.nzOffset.top=self.$elem.offset().top-appendedPosition.top;self.nzOffset.left=self.$elem.offset().left-appendedPosition.left;self.pageOffsetX=appendedPosition.left;self.pageOffsetY=appendedPosition.top;}else{self.nzOffset=self.$elem.offset();self.pageOffsetX=0;self.pageOffsetY=0;}},changeState:function(value){var self=this;if(value==='enable'){self.options.zoomEnabled=true;}
3242if(value==='disable'){self.options.zoomEnabled=false;}},responsiveConfig:function(options){if(options.respond&&options.respond.length>0){return $.extend({},options,this.configByScreenWidth(options));}
3243return options;}
3243,configByScreenWidth:function(options){var screenWidth=$(window).width();var config=$.grep(options.respond,function(item){var range=item.range.split('-');return(screenWidth>=range[0])&&(screenWidth<=range[1]);});if(config.length>0){return config[0];}else{return options;}}};$.fn.ezPlus=function(options){return this.each(function(){var elevate=Object.create(EZP);elevate.init(options,this);$.data(this,'ezPlus',elevate);});};$.fn.ezPlus.options={container:'ZoomContainer',attrImageZoomSrc:'zoom-image',borderColour:'#888',borderSize:4,constrainSize:false,constrainType:false,containLensZoom:false,cursor:'inherit',debug:false,easing:false,easingAmount:12,enabled:true,gallery:false,galleryActiveClass:'zoomGalleryActive',gallerySelector:false,galleryItem:'a',galleryEvent:'click',imageCrossfade:false,lensBorderColour:'#000',lensBorderSize:1,lensColour:'white',lensFadeIn:false,lensFadeOut:false,lensOpacity:0.4,lensShape:'square',lensSize:200,lenszoom:false,loadingIcon:false,mantainZoomAspectRatio:false,maxZoomLevel:false,minZoomLevel:1.01,onComplete:$.noop,onDestroy:$.noop,onImageClick:$.noop,onImageSwap:$.noop,onImageSwapComplete:$.noop,onShow:$.noop,onHide:$.noop,onZoomedImageLoaded:$.noop,preloading:1,respond:[],responsive:true,scrollZoom:false,scrollZoomIncrement:0.1,showLens:true,tint:false,tintColour:'#333',tintOpacity:0.4,touchEnabled:true,zoomActivation:'hover',zoomContainerAppendTo:'body',zoomId:-1,zoomLevel:1,zoomTintFadeIn:false,zoomTintFadeOut:false,zoomType:'window',zoomWindowAlwaysShow:false,zoomWindowBgColour:'#fff',zoomWindowFadeIn:false,zoomWindowFadeOut:false,zoomWindowHeight:400,zoomWindowOffsetX:0,zoomWindowOffsetY:0,zoomWindowPosition:1,zoomWindowWidth:400,zoomEnabled:true,zIndex:999};})(window.jQuery,window,document);;;
3244var Utils={};Utils.tileBorderInBetween=function(){$(document).ready(function(){$('.row').each(function(){var $tiles=$(this).find('.col-md-4 .tile--one-third'),tileCount=$tiles.length;if(tileCount===3){$($tiles[1]).addClass('one-third--in-between');}});})};Utils.lazyLoadImages=function(){$(document).ready(function(){$("img").unveil();})};Utils.openRegisterBidModal=function(){$('#registerBidModal').modal('show');};Utils.showNavigation=function(){var mobileNavHeight=$(".mobile-nav").height()
3245var navHeight=$(".top-nav__container").height()
3246$(".top-nav__container").css("top","0")
3247$(".mobile-nav").css("top","0")
3248$(".sidebar-affix").css("top",$(".mobile-nav").is(":visible")?mobileNavHeight:navHeight)}
3249Utils.hideNavigation=function(){var mobileNavHeight=$(".mobile-nav").height()
3250var navHeight=$(".top-nav__container").height()
3251$(".top-nav__container").css("top",navHeight* -1)
3252$(".mobile-nav").css("top",mobileNavHeight* -1)
3253$(".sidebar-affix").css("top","0");};;
3254function handleResize(){var scrollbarWidth=window.innerWidth-document.documentElement.clientWidth;if(scrollbarWidth>0){document.documentElement.style.setProperty('--scrollbarWidth',scrollbarWidth+'px');}}
3255$(document).ready(function(){handleResize();var lastScrollY=window.scrollY;window.onscroll=function(){if(lastScrollY>window.scrollY||window.scrollY<=0){Utils.showNavigation();}else{Utils.hideNavigation();}
3256if(window.scrollY<=0){lastScrollY=0;}else{lastScrollY=window.scrollY;}}
3257Utils.tileBorderInBetween();Utils.lazyLoadImages();var tag=document.createElement('script');tag.src='https://www.youtube.com/player_api';var firstScriptTag=document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);$("a[data-parent='#accordion']").on("click",function(){var active=$(this).attr("href");var second=$($(this).attr("data-href"));active=$(active);$('.arrow-up').addClass('hidden');var arrow=$(this).parent().parent().siblings('.arrow-up');second.on('show.bs.collapse',function(){$(second.find("a[data-copy]")[0]).click();arrow.removeClass('hidden');});second.on('hidden.bs.collapse',function(){arrow.addClass('hidden');});second.collapse("toggle");$(".collapse").each(function(){if(!$(this).is(active)||!$(this).is(second)){$(this).collapse('hide');}});});$("a[data-copy]").on("click",function(){var target=$(this).attr("href");$(target+' picture').remove();$(target+' .lot__titles').remove();$(this).children("picture").clone().prependTo("div"+target);$(this).siblings(".lot__titles").clone().appendTo("div"+target).removeClass("visible-xs");});});;;
3258if(typeof(rms)=="undefined")rms={}
3259rms.Lang=(function(){var _initLanguagePicker=function(picker)
3260{picker.change(function(){$(location).attr('href',this.value)});}
3261var _setLanguageCookie=function(lang)
3262{var d=new Date();d.setTime(d.getTime()+(365*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie="preferredLanguage=code="+lang.toLowerCase()+"; "+expires;}
3263return{InitLanguagePicker:_initLanguagePicker,SetLanguageCookie:_setLanguageCookie,}})();rms.Lang.InitLanguagePicker($("#lang"));;;
3264if(typeof(rms)=="undefined")rms={}
3265rms.Results=(function(){var _initResultsYearPicker=function(picker)
3266{picker.change(function()
3267{$(location).attr('href',picker.val())});}
3268return{InitResultsYearPicker:_initResultsYearPicker,}})();rms.Results.InitResultsYearPicker($("#resultsYear"));;;
3269!function(){'use strict';var isTouchDevice='ontouchstart' in window||'onmsgesturechange' in window;var mutable=['vertical','reverse','cycle','speed','playSpeed'];function Circlr(options){options.mouse=options.mouse||true;options.scroll=options.scroll||false;options.vertical=options.vertical||false;options.reverse=options.reverse||false;options.cycle=options.cycle||true;options.start=options.start||0;options.speed=options.speed||50;var autoplay=options.autoplay||false;options.playSpeed=options.playSpeed||100;options.reversePlay=options.reversePlay||false;var el=this.el=options.element;el.setAttribute('data-circlr',true);var loader=options.loader?document.getElementById(options.loader):undefined;var length=this.length=el.getElementsByTagName('img').length;var height=options.height||undefined;var width=options.width||undefined;var movable=false;var loaded=[];var errored=[];var current;var pre={};pre.Y=null;pre.X=null;pre.frame=0;var callbacks={};callbacks.ready=options.ready||undefined;callbacks.change=options.change||undefined;var scrollEvents=['wheel','mousewheel','scroll','DOMMouseScroll'];function onEventListener(target,event,fn){if(target.addEventListener){target.addEventListener(event,fn,false);}else{target.attachEvent('on'+event,function(){fn.call(target,window.event);});}}
3270function preventDefault(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}}
3271function preMove(e){autoplay=false;if(!isTouchDevice)preventDefault(e);e=e.type==='touchstart'?e.changedTouches[0]:e;movable=true;if(options.vertical){pre.Y=e.clientY-el.offsetTop;}else{pre.X=e.clientX-el.offsetLeft;}}
3272function normalize(cur){if(cur<0){cur=options.cycle?cur+length:0;}else if(cur>length-1){cur=options.cycle?cur-length:length-1;}
3273return cur;}
3274function isMove(e){if(movable){if(!isTouchDevice)preventDefault(e);e=e.type==='touchmove'?e.changedTouches[0]:e;var offset=(options.vertical)?((e.clientY-el.offsetTop)-pre.Y):((e.clientX-el.offsetLeft)-pre.X);offset=options.reverse?-offset:offset;var step=width/length;var previous=current;offset=Math.floor(offset/step);if(offset!==current){current=normalize(pre.frame+offset);if(previous!==current){el.getElementsByTagName('img')[previous].style.display='none';el.getElementsByTagName('img')[current].style.display='block';if(typeof callbacks.change==='function'){callbacks.change(current,length);}}}}}
3275function stopMove(e){if(!isTouchDevice)preventDefault(e);movable=false;pre.frame=current;}
3276function scrollMove(e){autoplay=false;if(!isTouchDevice)preventDefault(e);var delta=e.deltaY||e.detail||(-e.wheelDelta);delta=delta/Math.abs(delta);delta=options.reverse?-delta:delta;current=normalize(current+delta);el.getElementsByTagName('img')[pre.frame].style.display='none';el.getElementsByTagName('img')[current].style.display='block';pre.frame=current;if(typeof callbacks.change==='function'){callbacks.change(current,length);}}
3277function initEvents(){if(loader){loader.style.display='none';}
3278if(errored.length===0){var start=normalize(options.start);el.getElementsByTagName('img')[start].style.display='block';current=start;el.style.position='relative';el.style.width='100%';if(isTouchDevice){if(options.mouse||options.scroll){onEventListener(el,'touchstart',preMove);onEventListener(el,'touchmove',isMove);onEventListener(el,'touchend',stopMove);}}else{if(options.mouse){onEventListener(el,'mousedown',preMove);onEventListener(el,'mousemove',isMove);onEventListener(document,'mouseup',stopMove);}
3279if(options.scroll){for(var e=0;e<scrollEvents.length;e++){if('on'+scrollEvents[e]in window){onEventListener(el,scrollEvents[e],scrollMove);break;}}}}
3280if(autoplay){play();}}
3281if(typeof callbacks.ready==='function'){callbacks.ready(errored);}}
3282function loadImagesEvents(img){img.onload=function(){loaded.push(this.src);if(loaded.length+errored.length===length){initEvents();}};img.onerror=function(){errored.push(this.src);if(loaded.length+errored.length===length){initEvents();}};img.onreadystatechange=function(){this.onload();};}
3283function loadImages(){var img;if(loader){loader.style.display='block';}
3284for(var i=0;i<length;i++){img=el.getElementsByTagName('img')[i];img.style.display='none';img.style.width='100%';img.setAttribute('src',img.getAttribute('data-src'));img.setAttribute('data-index',i);img.removeAttribute('data-src');loadImagesEvents(img);}
3285height=height||el.clientHeight;width=width||el.clientWidth;}
3286loadImages();
3286function setFrame(i){el.getElementsByTagName('img')[current].style.display='none';el.getElementsByTagName('img')[i].style.display='block';pre.frame=current=i;}
3287var turn=this.turn=function(i){i=normalize(i);autoplay=true;(function turnInterval(){if(i!==current&&autoplay){setFrame(normalize(i<current||options.reversePlay?current-1:current+1));setTimeout(turnInterval,typeof i==='undefined'?options.playSpeed:options.speed);}else if(i===current){pre.frame=current=i;autoplay=false;if(typeof callbacks.change==='function'){callbacks.change(current,length);}}})();};this.go=function(i){if(i!==current){setFrame(i);if(typeof callbacks.change==='function'){callbacks.change(current,length);}}};var play=this.play=function(){autoplay=true;turn();};this.stop=function(){autoplay=false;};this.show=function(){el.style.display='block';};this.hide=function(){el.style.display='none';};this.set=function(set){for(var i=0,key;i<mutable.length;i++){key=mutable[i];options[key]=typeof set[key]!=='undefined'?set[key]:options[key];}};}
3288function Creator(element,options){element=document.getElementById(element);if(element.getAttribute('data-circlr')){return;}
3289options=options||{};options.element=element;return new Circlr(options);}
3290if(typeof define==='function'&&define.amd){define([],function(){return Creator;});}else if(typeof module!=='undefined'&&module.exports){module.exports=Creator;}else{this.circlr=Creator;}}.call(this);;;
3291(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==='object'&&typeof module==='object')
3292module.exports=factory();else if(typeof define==='function'&&define.amd)
3293define([],factory);else if(typeof exports==='object')
3294exports["signalR"]=factory();else
3295root["signalR"]=factory();})(self,()=>{return(()=>{"use strict";var __webpack_require__={};(()=>{__webpack_require__.d=(exports,definition)=>{for(var key in definition){if(__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)){Object.defineProperty(exports,key,{enumerable:true,get:definition[key]});}}};})();(()=>{__webpack_require__.g=(function(){if(typeof globalThis==='object')return globalThis;try{return this||new Function('return this')();}catch(e){if(typeof window==='object')return window;}})();})();(()=>{__webpack_require__.o=(obj,prop)=>(Object.prototype.hasOwnProperty.call(obj,prop))})();(()=>{__webpack_require__.r=(exports)=>{if(typeof Symbol!=='undefined'&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});}
3296Object.defineProperty(exports,'__esModule',{value:true});};})();var __webpack_exports__={};__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{"AbortError":()=>(AbortError),"DefaultHttpClient":()=>(DefaultHttpClient),"HttpClient":()=>(HttpClient),"HttpError":()=>(HttpError),"HttpResponse":()=>(HttpResponse),"HttpTransportType":()=>(HttpTransportType),"HubConnection":()=>(HubConnection),"HubConnectionBuilder":()=>(HubConnectionBuilder),"HubConnectionState":()=>(HubConnectionState),"JsonHubProtocol":()=>(JsonHubProtocol),"LogLevel":()=>(LogLevel),"MessageType":()=>(MessageType),"NullLogger":()=>(NullLogger),"Subject":()=>(Subject),"TimeoutError":()=>(TimeoutError),"TransferFormat":()=>(TransferFormat),"VERSION":()=>(VERSION)});;class HttpError extends Error{constructor(errorMessage,statusCode){const trueProto=new.target.prototype;super(`${errorMessage}: Status code '${statusCode}'`);this.statusCode=statusCode;this.__proto__=trueProto;}}
3297class TimeoutError extends Error{constructor(errorMessage="A timeout occurred."){const trueProto=new.target.prototype;super(errorMessage);this.__proto__=trueProto;}}
3298class AbortError extends Error{constructor(errorMessage="An abort occurred."){const trueProto=new.target.prototype;super(errorMessage);this.__proto__=trueProto;}}
3299class UnsupportedTransportError extends Error{constructor(message,transport){const trueProto=new.target.prototype;super(message);this.transport=transport;this.errorType='UnsupportedTransportError';this.__proto__=trueProto;}}
3300class DisabledTransportError extends Error{constructor(message,transport){const trueProto=new.target.prototype;super(message);this.transport=transport;this.errorType='DisabledTransportError';this.__proto__=trueProto;}}
vendor: 76,949 bytes, lines 3301-3788
3301class FailedToStartTransportError extends Error{constructor(message,transport){const trueProto=new.target.prototype;super(message);this.transport=transport;this.errorType='FailedToStartTransportError';this.__proto__=trueProto;}}
3302class FailedToNegotiateWithServerError extends Error{constructor(message){const trueProto=new.target.prototype;super(message);this.errorType='FailedToNegotiateWithServerError';this.__proto__=trueProto;}}
3303class AggregateErrors extends Error{constructor(message,innerErrors){const trueProto=new.target.prototype;super(message);this.innerErrors=innerErrors;this.__proto__=trueProto;}};class HttpResponse{constructor(statusCode,statusText,content){this.statusCode=statusCode;this.statusText=statusText;this.content=content;}}
3304class HttpClient{get(url,options){return this.send({...options,method:"GET",url,});}
3305post(url,options){return this.send({...options,method:"POST",url,});}
3306delete(url,options){return this.send({...options,method:"DELETE",url,});}
3307getCookieString(url){return"";}};var LogLevel;(function(LogLevel){LogLevel[LogLevel["Trace"]=0]="Trace";LogLevel[LogLevel["Debug"]=1]="Debug";LogLevel[LogLevel["Information"]=2]="Information";LogLevel[LogLevel["Warning"]=3]="Warning";LogLevel[LogLevel["Error"]=4]="Error";LogLevel[LogLevel["Critical"]=5]="Critical";LogLevel[LogLevel["None"]=6]="None";})(LogLevel||(LogLevel={}));;class NullLogger{constructor(){}
3308log(_logLevel,_message){}}
3309NullLogger.instance=new NullLogger();;const VERSION="8.0.0";class Arg{static isRequired(val,name){if(val===null||val===undefined){throw new Error(`The '${name}' argument is required.`);}}
3310static isNotEmpty(val,name){if(!val||val.match(/^\s*$/)){throw new Error(`The '${name}' argument should not be empty.`);}}
3311static isIn(val,values,name){if(!(val in values)){throw new Error(`Unknown ${name} value: ${val}.`);}}}
3312class Platform{static get isBrowser(){return!Platform.isNode&&typeof window==="object"&&typeof window.document==="object";}
3313static get isWebWorker(){return!Platform.isNode&&typeof self==="object"&&"importScripts" in self;}
3314static get isReactNative(){return!Platform.isNode&&typeof window==="object"&&typeof window.document==="undefined";}
3315static get isNode(){return typeof process!=="undefined"&&process.release&&process.release.name==="node";}}
3316function getDataDetail(data,includeContent){let detail="";if(isArrayBuffer(data)){detail=`Binary data of length ${data.byteLength}`;if(includeContent){detail+=`. Content: '${formatArrayBuffer(data)}'`;}}
3317else if(typeof data==="string"){detail=`String data of length ${data.length}`;if(includeContent){detail+=`. Content: '${data}'`;}}
3318return detail;}
3319function formatArrayBuffer(data){const view=new Uint8Array(data);let str="";view.forEach((num)=>{const pad=num<16?"0":"";str+=`0x${pad}${num.toString(16)} `;});return str.substr(0,str.length-1);}
3320function isArrayBuffer(val){return val&&typeof ArrayBuffer!=="undefined"&&(val instanceof ArrayBuffer||(val.constructor&&val.constructor.name==="ArrayBuffer"));}
3321async function sendMessage(logger,transportName,httpClient,url,content,options){const headers={};const[name,value]=getUserAgentHeader();headers[name]=value;logger.log(LogLevel.Trace,`(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent)}.`);const responseType=isArrayBuffer(content)?"arraybuffer":"text";const response=await httpClient.post(url,{content,headers:{...headers,...options.headers},responseType,timeout:options.timeout,withCredentials:options.withCredentials,});logger.log(LogLevel.Trace,`(${transportName} transport) request complete. Response status: ${response.statusCode}.`);}
3322function createLogger(logger){if(logger===undefined){return new ConsoleLogger(LogLevel.Information);}
3323if(logger===null){return NullLogger.instance;}
3324if(logger.log!==undefined){return logger;}
3325return new ConsoleLogger(logger);}
3326class SubjectSubscription{constructor(subject,observer){this._subject=subject;this._observer=observer;}
3327dispose(){const index=this._subject.observers.indexOf(this._observer);if(index>-1){this._subject.observers.splice(index,1);}
3328if(this._subject.observers.length===0&&this._subject.cancelCallback){this._subject.cancelCallback().catch((_)=>{});}}}
3329class ConsoleLogger{constructor(minimumLogLevel){this._minLevel=minimumLogLevel;this.out=console;}
3330log(logLevel,message){if(logLevel>=this._minLevel){const msg=`[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;switch(logLevel){case LogLevel.Critical:case LogLevel.Error:this.out.error(msg);break;case LogLevel.Warning:this.out.warn(msg);break;case LogLevel.Information:this.out.info(msg);break;default:this.out.log(msg);break;}}}}
3331function getUserAgentHeader(){let userAgentHeaderName="X-SignalR-User-Agent";if(Platform.isNode){userAgentHeaderName="User-Agent";}
3332return[userAgentHeaderName,constructUserAgent(VERSION,getOsName(),getRuntime(),getRuntimeVersion())];}
3333function constructUserAgent(version,os,runtime,runtimeVersion){let userAgent="Microsoft SignalR/";const majorAndMinor=version.split(".");userAgent+=`${majorAndMinor[0]}.${majorAndMinor[1]}`;userAgent+=` (${version}; `;if(os&&os!==""){userAgent+=`${os}; `;}
3334else{userAgent+="Unknown OS; ";}
3335userAgent+=`${runtime}`;if(runtimeVersion){userAgent+=`; ${runtimeVersion}`;}
3336else{userAgent+="; Unknown Runtime Version";}
3337userAgent+=")";return userAgent;}
3338function getOsName(){if(Platform.isNode){switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform;}}
3339else{return"";}}
3340function getRuntimeVersion(){if(Platform.isNode){return process.versions.node;}
3341return undefined;}
3342function getRuntime(){if(Platform.isNode){return"NodeJS";}
3343else{return"Browser";}}
3344function getErrorString(e){if(e.stack){return e.stack;}
3345else if(e.message){return e.message;}
3346return`${e}`;}
3347function getGlobalThis(){if(typeof globalThis!=="undefined"){return globalThis;}
3348if(typeof self!=="undefined"){return self;}
3349if(typeof window!=="undefined"){return window;}
3350if(typeof __webpack_require__.g!=="undefined"){return __webpack_require__.g;}
3351throw new Error("could not find global");};function configureFetch(){return false;}
3352function configureAbortController(){return false;}
3353function getWS(){throw new Error("Trying to import 'ws' in the browser.");}
3354function getEventSource(){throw new Error("Trying to import 'eventsource' in the browser.");};class FetchHttpClient extends HttpClient{constructor(logger){super();this._logger=logger;const fetchObj={_fetchType:undefined,_jar:undefined};if(configureFetch(fetchObj)){this._fetchType=fetchObj._fetchType;this._jar=fetchObj._jar;}
3355else{this._fetchType=fetch.bind(getGlobalThis());}
3356this._abortControllerType=AbortController;const abortObj={_abortControllerType:this._abortControllerType};if(configureAbortController(abortObj)){this._abortControllerType=abortObj._abortControllerType;}}
3357async send(request){if(request.abortSignal&&request.abortSignal.aborted){throw new AbortError();}
3358if(!request.method){throw new Error("No method defined.");}
3359if(!request.url){throw new Error("No url defined.");}
3360const abortController=new this._abortControllerType();let error;if(request.abortSignal){request.abortSignal.onabort=()=>{abortController.abort();error=new AbortError();};}
3361let timeoutId=null;if(request.timeout){const msTimeout=request.timeout;timeoutId=setTimeout(()=>{abortController.abort();this._logger.log(LogLevel.Warning,`Timeout from HTTP request.`);error=new TimeoutError();},msTimeout);}
3362if(request.content===""){request.content=undefined;}
3363if(request.content){request.headers=request.headers||{};if(isArrayBuffer(request.content)){request.headers["Content-Type"]="application/octet-stream";}
3364else{request.headers["Content-Type"]="text/plain;charset=UTF-8";}}
3365let response;try{response=await this._fetchType(request.url,{body:request.content,cache:"no-cache",credentials:request.withCredentials===true?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...request.headers,},method:request.method,mode:"cors",redirect:"follow",signal:abortController.signal,});}
3366catch(e){if(error){throw error;}
3367this._logger.log(LogLevel.Warning,`Error from HTTP request. ${e}.`);throw e;}
3368finally{if(timeoutId){clearTimeout(timeoutId);}
3369if(request.abortSignal){request.abortSignal.onabort=null;}}
3370if(!response.ok){const errorMessage=await deserializeContent(response,"text");throw new HttpError(errorMessage||response.statusText,response.status);}
3371const content=deserializeContent(response,request.responseType);const payload=await content;return new HttpResponse(response.status,response.statusText,payload);}
3372getCookieString(url){let cookies="";if(Platform.isNode&&this._jar){this._jar.getCookies(url,(e,c)=>cookies=c.join("; "));}
3373return cookies;}}
3374function deserializeContent(response,responseType){let content;switch(responseType){case"arraybuffer":content=response.arrayBuffer();break;case"text":content=response.text();break;case"blob":case"document":case"json":throw new Error(`${responseType} is not supported.`);default:content=response.text();break;}
3375return content;};class XhrHttpClient extends HttpClient{constructor(logger){super();this._logger=logger;}
3376send(request){if(request.abortSignal&&request.abortSignal.aborted){return Promise.reject(new AbortError());}
3377if(!request.method){return Promise.reject(new Error("No method defined."));}
3378if(!request.url){return Promise.reject(new Error("No url defined."));}
3379return new Promise((resolve,reject)=>{const xhr=new XMLHttpRequest();xhr.open(request.method,request.url,true);xhr.withCredentials=request.withCredentials===undefined?true:request.withCredentials;xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");if(request.content===""){request.content=undefined;}
3380if(request.content){if(isArrayBuffer(request.content)){xhr.setRequestHeader("Content-Type","application/octet-stream");}
3381else{xhr.setRequestHeader("Content-Type","text/plain;charset=UTF-8");}}
3382const headers=request.headers;if(headers){Object.keys(headers).forEach((header)=>{xhr.setRequestHeader(header,headers[header]);});}
3383if(request.responseType){xhr.responseType=request.responseType;}
3384if(request.abortSignal){request.abortSignal.onabort=()=>{xhr.abort();reject(new AbortError());};}
3385if(request.timeout){xhr.timeout=request.timeout;}
3386xhr.onload=()=>{if(request.abortSignal){request.abortSignal.onabort=null;}
3387if(xhr.status>=200&&xhr.status<300){resolve(new HttpResponse(xhr.status,xhr.statusText,xhr.response||xhr.responseText));}
3388else{reject(new HttpError(xhr.response||xhr.responseText||xhr.statusText,xhr.status));}};xhr.onerror=()=>{this._logger.log(LogLevel.Warning,`Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);reject(new HttpError(xhr.statusText,xhr.status));};xhr.ontimeout=()=>{this._logger.log(LogLevel.Warning,`Timeout from HTTP request.`);reject(new TimeoutError());};xhr.send(request.content);});}};class DefaultHttpClient extends HttpClient{constructor(logger){super();if(typeof fetch!=="undefined"||Platform.isNode){this._httpClient=new FetchHttpClient(logger);}
3389else if(typeof XMLHttpRequest!=="undefined"){this._httpClient=new XhrHttpClient(logger);}
3390else{throw new Error("No usable HttpClient found.");}}
3391send(request){if(request.abortSignal&&request.abortSignal.aborted){return Promise.reject(new AbortError());}
3392if(!request.method){return Promise.reject(new Error("No method defined."));}
3393if(!request.url){return Promise.reject(new Error("No url defined."));}
3394return this._httpClient.send(request);}
3395getCookieString(url){return this._httpClient.getCookieString(url);}};class TextMessageFormat{static write(output){return`${output}${TextMessageFormat.RecordSeparator}`;}
3396static parse(input){if(input[input.length-1]!==TextMessageFormat.RecordSeparator){throw new Error("Message is incomplete.");}
3397const messages=input.split(TextMessageFormat.RecordSeparator);messages.pop();return messages;}}
3398TextMessageFormat.RecordSeparatorCode=0x1e;TextMessageFormat.RecordSeparator=String.fromCharCode(TextMessageFormat.RecordSeparatorCode);;class HandshakeProtocol{writeHandshakeRequest(handshakeRequest){return TextMessageFormat.write(JSON.stringify(handshakeRequest));}
3399parseHandshakeResponse(data){let messageData;let remainingData;if(isArrayBuffer(data)){const binaryData=new Uint8Array(data);const separatorIndex=binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);if(separatorIndex===-1){throw new Error("Message is incomplete.");}
3400const responseLength=separatorIndex+1;messageData=String.fromCharCode.apply(null,Array.prototype.slice.call(binaryData.slice(0,responseLength)));remainingData=(binaryData.byteLength>responseLength)?binaryData.slice(responseLength).buffer:null;}
3401else{const textData=data;const separatorIndex=textData.indexOf(TextMessageFormat.RecordSeparator);if(separatorIndex===-1){throw new Error("Message is incomplete.");}
3402const responseLength=separatorIndex+1;messageData=textData.substring(0,responseLength);remainingData=(textData.length>responseLength)?textData.substring(responseLength):null;}
3403const messages=TextMessageFormat.parse(messageData);const response=JSON.parse(messages[0]);if(response.type){throw new Error("Expected a handshake response from the server.");}
3404const responseMessage=response;return[remainingData,responseMessage];}};var MessageType;(function(MessageType){MessageType[MessageType["Invocation"]=1]="Invocation";MessageType[MessageType["StreamItem"]=2]="StreamItem";MessageType[MessageType["Completion"]=3]="Completion";MessageType[MessageType["StreamInvocation"]=4]="StreamInvocation";MessageType[MessageType["CancelInvocation"]=5]="CancelInvocation";MessageType[MessageType["Ping"]=6]="Ping";MessageType[MessageType["Close"]=7]="Close";MessageType[MessageType["Ack"]=8]="Ack";MessageType[MessageType["Sequence"]=9]="Sequence";})(MessageType||(MessageType={}));;class Subject{constructor(){this.observers=[];}
3405next(item){for(const observer of this.observers){observer.next(item);}}
3406error(err){for(const observer of this.observers){if(observer.error){observer.error(err);}}}
3407complete(){for(const observer of this.observers){if(observer.complete){observer.complete();}}}
3408subscribe(observer){this.observers.push(observer);return new SubjectSubscription(this,observer);}};class MessageBuffer{constructor(protocol,connection,bufferSize){this._bufferSize=100000;this._messages=[];this._totalMessageCount=0;this._waitForSequenceMessage=false;this._nextReceivingSequenceId=1;this._latestReceivedSequenceId=0;this._bufferedByteCount=0;this._reconnectInProgress=false;this._protocol=protocol;this._connection=connection;this._bufferSize=bufferSize;}
3409async _send(message){const serializedMessage=this._protocol.writeMessage(message);let backpressurePromise=Promise.resolve();if(this._isInvocationMessage(message)){this._totalMessageCount++;let backpressurePromiseResolver=()=>{};let backpressurePromiseRejector=()=>{};if(isArrayBuffer(serializedMessage)){this._bufferedByteCount+=serializedMessage.byteLength;}
3410else{this._bufferedByteCount+=serializedMessage.length;}
3411if(this._bufferedByteCount>=this._bufferSize){backpressurePromise=new Promise((resolve,reject)=>{backpressurePromiseResolver=resolve;backpressurePromiseRejector=reject;});}
3412this._messages.push(new BufferedItem(serializedMessage,this._totalMessageCount,backpressurePromiseResolver,backpressurePromiseRejector));}
3413try{if(!this._reconnectInProgress){await this._connection.send(serializedMessage);}}
3414catch{this._disconnected();}
3415await backpressurePromise;}
3416_ack(ackMessage){let newestAckedMessage=-1;for(let index=0;index<this._messages.length;index++){const element=this._messages[index];if(element._id<=ackMessage.sequenceId){newestAckedMessage=index;if(isArrayBuffer(element._message)){this._bufferedByteCount-=element._message.byteLength;}
3417else{this._bufferedByteCount-=element._message.length;}
3418element._resolver();}
3419else if(this._bufferedByteCount<this._bufferSize){element._resolver();}
3420else{break;}}
3421if(newestAckedMessage!==-1){this._messages=this._messages.slice(newestAckedMessage+1);}}
3422_shouldProcessMessage(message){if(this._waitForSequenceMessage){if(message.type!==MessageType.Sequence){return false;}
3423else{this._waitForSequenceMessage=false;return true;}}
3424if(!this._isInvocationMessage(message)){return true;}
3425const currentId=this._nextReceivingSequenceId;this._nextReceivingSequenceId++;if(currentId<=this._latestReceivedSequenceId){if(currentId===this._latestReceivedSequenceId){this._ackTimer();}
3426return false;}
3427this._latestReceivedSequenceId=currentId;this._ackTimer();return true;}
3428_resetSequence(message){if(message.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return;}
3429this._nextReceivingSequenceId=message.sequenceId;}
3430_disconnected(){this._reconnectInProgress=true;this._waitForSequenceMessage=true;}
3431async _resend(){const sequenceId=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:MessageType.Sequence,sequenceId}));const messages=this._messages;for(const element of messages){await this._connection.send(element._message);}
3432this._reconnectInProgress=false;}
3433_dispose(error){error!==null&&error!==void 0?error:(error=new Error("Unable to reconnect to server."));for(const element of this._messages){element._rejector(error);}}
3434_isInvocationMessage(message){switch(message.type){case MessageType.Invocation:case MessageType.StreamItem:case MessageType.Completion:case MessageType.StreamInvocation:case MessageType.CancelInvocation:return true;case MessageType.Close:case MessageType.Sequence:case MessageType.Ping:case MessageType.Ack:return false;}}
3435_ackTimer(){if(this._ackTimerHandle===undefined){this._ackTimerHandle=setTimeout(async()=>{try{if(!this._reconnectInProgress){await this._connection.send(this._protocol.writeMessage({type:MessageType.Ack,sequenceId:this._latestReceivedSequenceId}));}}
3436catch{}
3437clearTimeout(this._ackTimerHandle);this._ackTimerHandle=undefined;},1000);}}}
3438class BufferedItem{constructor(message,id,resolver,rejector){this._message=message;this._id=id;this._resolver=resolver;this._rejector=rejector;}};const DEFAULT_TIMEOUT_IN_MS=30*1000;const DEFAULT_PING_INTERVAL_IN_MS=15*1000;const DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE=100000;var HubConnectionState;(function(HubConnectionState){HubConnectionState["Disconnected"]="Disconnected";HubConnectionState["Connecting"]="Connecting";HubConnectionState["Connected"]="Connected";HubConnectionState["Disconnecting"]="Disconnecting";HubConnectionState["Reconnecting"]="Reconnecting";})(HubConnectionState||(HubConnectionState={}));class HubConnection{static create(connection,logger,protocol,reconnectPolicy,serverTimeoutInMilliseconds,keepAliveIntervalInMilliseconds,statefulReconnectBufferSize){return new HubConnection(connection,logger,protocol,reconnectPolicy,serverTimeoutInMilliseconds,keepAliveIntervalInMilliseconds,statefulReconnectBufferSize);}
3439constructor(connection,logger,protocol,reconnectPolicy,serverTimeoutInMilliseconds,keepAliveIntervalInMilliseconds,statefulReconnectBufferSize){this._nextKeepAlive=0;this._freezeEventListener=()=>{this._logger.log(LogLevel.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep");};Arg.isRequired(connection,"connection");Arg.isRequired(logger,"logger");Arg.isRequired(protocol,"protocol");this.serverTimeoutInMilliseconds=serverTimeoutInMilliseconds!==null&&serverTimeoutInMilliseconds!==void 0?serverTimeoutInMilliseconds:DEFAULT_TIMEOUT_IN_MS;this.keepAliveIntervalInMilliseconds=keepAliveIntervalInMilliseconds!==null&&keepAliveIntervalInMilliseconds!==void 0?keepAliveIntervalInMilliseconds:DEFAULT_PING_INTERVAL_IN_MS;this._statefulReconnectBufferSize=statefulReconnectBufferSize!==null&&statefulReconnectBufferSize!==void 0?statefulReconnectBufferSize:DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE;this._logger=logger;this._protocol=protocol;this.connection=connection;this._reconnectPolicy=reconnectPolicy;this._handshakeProtocol=new HandshakeProtocol();this.connection.onreceive=(data)=>this._processIncomingData(data);this.connection.onclose=(error)=>this._connectionClosed(error);this._callbacks={};this._methods={};this._closedCallbacks=[];this._reconnectingCallbacks=[];this._reconnectedCallbacks=[];this._invocationId=0;this._receivedHandshakeResponse=false;this._connectionState=HubConnectionState.Disconnected;this._connectionStarted=false;this._cachedPingMessage=this._protocol.writeMessage({type:MessageType.Ping});}
3440get state(){return this._connectionState;}
3441get connectionId(){return this.connection?(this.connection.connectionId||null):null;}
3442get baseUrl(){return this.connection.baseUrl||"";}
3443set baseUrl(url){if(this._connectionState!==HubConnectionState.Disconnected&&this._connectionState!==HubConnectionState.Reconnecting){throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");}
3444if(!url){throw new Error("The HubConnection url must be a valid url.");}
3445this.connection.baseUrl=url;}
3446start(){this._startPromise=this._startWithStateTransitions();return this._startPromise;}
3447async _startWithStateTransitions(){if(this._connectionState!==HubConnectionState.Disconnected){return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));}
3448this._connectionState=HubConnectionState.Connecting;this._logger.log(LogLevel.Debug,"Starting HubConnection.");try{await this._startInternal();if(Platform.isBrowser){window.document.addEventListener("freeze",this._freezeEventListener);}
3449this._connectionState=HubConnectionState.Connected;this._connectionStarted=true;this._logger.log(LogLevel.Debug,"HubConnection connected successfully.");}
3450catch(e){this._connectionState=HubConnectionState.Disconnected;this._logger.log(LogLevel.Debug,`HubConnection failed to start successfully because of error '${e}'.`);return Promise.reject(e);}}
3451async _startInternal(){this._stopDuringStartError=undefined;this._receivedHandshakeResponse=false;const handshakePromise=new Promise((resolve,reject)=>{this._handshakeResolver=resolve;this._handshakeRejecter=reject;});await this.connection.start(this._protocol.transferFormat);try{let version=this._protocol.version;if(!this.connection.features.reconnect){version=1;}
3452const handshakeRequest={protocol:this._protocol.name,version,};this._logger.log(LogLevel.Debug,"Sending handshake request.");await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));this._logger.log(LogLevel.Information,`Using HubProtocol '${this._protocol.name}'.`);this._cleanupTimeout();this._resetTimeoutPeriod();this._resetKeepAliveInterval();await handshakePromise;if(this._stopDuringStartError){throw this._stopDuringStartError;}
3453const useStatefulReconnect=this.connection.features.reconnect||false;if(useStatefulReconnect){this._messageBuffer=new MessageBuffer(this._protocol,this.connection,this._statefulReconnectBufferSize);this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer);this.connection.features.resend=()=>{if(this._messageBuffer){return this._messageBuffer._resend();}};}
3454if(!this.connection.features.inherentKeepAlive){await this._sendMessage(this._cachedPingMessage);}}
3455catch(e){this._logger.log(LogLevel.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);this._cleanupTimeout();this._cleanupPingTimer();await this.connection.stop(e);throw e;}}
3456async stop(){const startPromise=this._startPromise;this.connection.features.reconnect=false;this._stopPromise=this._stopInternal();await this._stopPromise;try{await startPromise;}
3457catch(e){}}
3458_stopInternal(error){if(this._connectionState===HubConnectionState.Disconnected){this._logger.log(LogLevel.Debug,`Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);return Promise.resolve();}
3459if(this._connectionState===HubConnectionState.Disconnecting){this._logger.log(LogLevel.Debug,`Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);return this._stopPromise;}
3460const state=this._connectionState;this._connectionState=HubConnectionState.Disconnecting;this._logger.log(LogLevel.Debug,"Stopping HubConnection.");if(this._reconnectDelayHandle){this._logger.log(LogLevel.Debug,"Connection stopped during reconnect delay. Done reconnecting.");clearTimeout(this._reconnectDelayHandle);this._reconnectDelayHandle=undefined;this._completeClose();return Promise.resolve();}
3461if(state===HubConnectionState.Connected){this._sendCloseMessage();}
3462this._cleanupTimeout();this._cleanupPingTimer();this._stopDuringStartError=error||new AbortError("The connection was stopped before the hub handshake could complete.");return this.connection.stop(error);}
3463async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage());}
3464catch{}}
3465stream(methodName,...args){const[streams,streamIds]=this._replaceStreamingParams(args);const invocationDescriptor=this._createStreamInvocation(methodName,args,streamIds);let promiseQueue;const subject=new Subject();subject.cancelCallback=()=>{const cancelInvocation=this._createCancelInvocation(invocationDescriptor.invocationId);delete this._callbacks[invocationDescriptor.invocationId];return promiseQueue.then(()=>{return this._sendWithProtocol(cancelInvocation);});};this._callbacks[invocationDescriptor.invocationId]=(invocationEvent,error)=>{if(error){subject.error(error);return;}
3466else if(invocationEvent){if(invocationEvent.type===MessageType.Completion){if(invocationEvent.error){subject.error(new Error(invocationEvent.error));}
3467else{subject.complete();}}
3468else{subject.next((invocationEvent.item));}}};promiseQueue=this._sendWithProtocol(invocationDescriptor).catch((e)=>{subject.error(e);delete this._callbacks[invocationDescriptor.invocationId];});this._launchStreams(streams,promiseQueue);return subject;}
3469_sendMessage(message){this._resetKeepAliveInterval();return this.connection.send(message);}
3470_sendWithProtocol(message){if(this._messageBuffer){return this._messageBuffer._send(message);}
3471else{return this._sendMessage(this._protocol.writeMessage(message));}}
3472send(methodName,...args){const[streams,streamIds]=this._replaceStreamingParams(args);const sendPromise=this._sendWithProtocol(this._createInvocation(methodName,args,true,streamIds));this._launchStreams(streams,sendPromise);return sendPromise;}
3473invoke(methodName,...args){const[streams,streamIds]=this._replaceStreamingParams(args);const invocationDescriptor=this._createInvocation(methodName,args,false,streamIds);const p=new Promise((resolve,reject)=>{this._callbacks[invocationDescriptor.invocationId]=(invocationEvent,error)=>{if(error){reject(error);return;}
3474else if(invocationEvent){if(invocationEvent.type===MessageType.Completion){if(invocationEvent.error){reject(new Error(invocationEvent.error));}
3475else{resolve(invocationEvent.result);}}
3476else{reject(new Error(`Unexpected message type: ${invocationEvent.type}`));}}};const promiseQueue=this._sendWithProtocol(invocationDescriptor).catch((e)=>{reject(e);delete this._callbacks[invocationDescriptor.invocationId];});this._launchStreams(streams,promiseQueue);});return p;}
3477on(methodName,newMethod){if(!methodName||!newMethod){return;}
3478methodName=methodName.toLowerCase();if(!this._methods[methodName]){this._methods[methodName]=[];}
3479if(this._methods[methodName].indexOf(newMethod)!==-1){return;}
3480this._methods[methodName].push(newMethod);}
3481off(methodName,method){if(!methodName){return;}
3482methodName=methodName.toLowerCase();const handlers=this._methods[methodName];if(!handlers){return;}
3483if(method){const removeIdx=handlers.indexOf(method);if(removeIdx!==-1){handlers.splice(removeIdx,1);if(handlers.length===0){delete this._methods[methodName];}}}
3484else{delete this._methods[methodName];}}
3485onclose(callback){if(callback){this._closedCallbacks.push(callback);}}
3486onreconnecting(callback){if(callback){this._reconnectingCallbacks.push(callback);}}
3487onreconnected(callback){if(callback){this._reconnectedCallbacks.push(callback);}}
3488_processIncomingData(data){this._cleanupTimeout();if(!this._receivedHandshakeResponse){data=this._processHandshakeResponse(data);this._receivedHandshakeResponse=true;}
3489if(data){const messages=this._protocol.parseMessages(data,this._logger);for(const message of messages){if(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(message)){continue;}
3490switch(message.type){case MessageType.Invocation:this._invokeClientMethod(message);break;case MessageType.StreamItem:case MessageType.Completion:{const callback=this._callbacks[message.invocationId];if(callback){if(message.type===MessageType.Completion){delete this._callbacks[message.invocationId];}
3491try{callback(message);}
3492catch(e){this._logger.log(LogLevel.Error,`Stream callback threw error: ${getErrorString(e)}`);}}
3493break;}
3494case MessageType.Ping:break;case MessageType.Close:{this._logger.log(LogLevel.Information,"Close message received from server.");const error=message.error?new Error("Server returned an error on close: "+message.error):undefined;if(message.allowReconnect===true){this.connection.stop(error);}
3495else{this._stopPromise=this._stopInternal(error);}
3496break;}
3497case MessageType.Ack:if(this._messageBuffer){this._messageBuffer._ack(message);}
3498break;case MessageType.Sequence:if(this._messageBuffer){this._messageBuffer._resetSequence(message);}
3499break;default:this._logger.log(LogLevel.Warning,`Invalid message type: ${message.type}.`);break;}}}
3500this._resetTimeoutPeriod();}
3501_processHandshakeResponse(data){let responseMessage;let remainingData;try{[remainingData,responseMessage]=this._handshakeProtocol.parseHandshakeResponse(data);}
3502catch(e){const message="Error parsing handshake response: "+e;this._logger.log(LogLevel.Error,message);const error=new Error(message);this._handshakeRejecter(error);throw error;}
3503if(responseMessage.error){const message="Server returned handshake error: "+responseMessage.error;this._logger.log(LogLevel.Error,message);const error=new Error(message);this._handshakeRejecter(error);throw error;}
3504else{this._logger.log(LogLevel.Debug,"Server handshake complete.");}
3505this._handshakeResolver();return remainingData;}
3506_resetKeepAliveInterval(){if(this.connection.features.inherentKeepAlive){return;}
3507this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds;this._cleanupPingTimer();}
3508_resetTimeoutPeriod(){if(!this.connection.features||!this.connection.features.inherentKeepAlive){this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds);if(this._pingServerHandle===undefined){let nextPing=this._nextKeepAlive-new Date().getTime();if(nextPing<0){nextPing=0;}
3509this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===HubConnectionState.Connected){try{await this._sendMessage(this._cachedPingMessage);}
3510catch{this._cleanupPingTimer();}}},nextPing);}}}
3511serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."));}
3512async _invokeClientMethod(invocationMessage){const methodName=invocationMessage.target.toLowerCase();const methods=this._methods[methodName];if(!methods){this._logger.log(LogLevel.Warning,`No client method with the name '${methodName}' found.`);if(invocationMessage.invocationId){this._logger.log(LogLevel.Warning,`No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);await this._sendWithProtocol(this._createCompletionMessage(invocationMessage.invocationId,"Client didn't provide a result.",null));}
3513return;}
3514const methodsCopy=methods.slice();const expectsResponse=invocationMessage.invocationId?true:false;let res;let exception;let completionMessage;for(const m of methodsCopy){try{const prevRes=res;res=await m.apply(this,invocationMessage.arguments);if(expectsResponse&&res&&prevRes){this._logger.log(LogLevel.Error,`Multiple results provided for '${methodName}'. Sending error to server.`);completionMessage=this._createCompletionMessage(invocationMessage.invocationId,`Client provided multiple results.`,null);}
3515exception=undefined;}
3516catch(e){exception=e;this._logger.log(LogLevel.Error,`A callback for the method '${methodName}' threw error '${e}'.`);}}
3517if(completionMessage){await this._sendWithProtocol(completionMessage);}
3518else if(expectsResponse){if(exception){completionMessage=this._createCompletionMessage(invocationMessage.invocationId,`${exception}`,null);}
3519else if(res!==undefined){completionMessage=this._createCompletionMessage(invocationMessage.invocationId,null,res);}
3520else{this._logger.log(LogLevel.Warning,`No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);completionMessage=this._createCompletionMessage(invocationMessage.invocationId,"Client didn't provide a result.",null);}
3521await this._sendWithProtocol(completionMessage);}
3522else{if(res){this._logger.log(LogLevel.Error,`Result given for '${methodName}' method but server is not expecting a result.`);}}}
3523_connectionClosed(error){this._logger.log(LogLevel.Debug,`HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);this._stopDuringStartError=this._stopDuringStartError||error||new AbortError("The underlying connection was closed before the hub handshake could complete.");if(this._handshakeResolver){this._handshakeResolver();}
3524this._cancelCallbacksWithError(error||new Error("Invocation canceled due to the underlying connection being closed."));this._cleanupTimeout();this._cleanupPingTimer();if(this._connectionState===HubConnectionState.Disconnecting){this._completeClose(error);}
3525else if(this._connectionState===HubConnectionState.Connected&&this._reconnectPolicy){this._reconnect(error);}
3526else if(this._connectionState===HubConnectionState.Connected){this._completeClose(error);}}
3527_completeClose(error){if(this._connectionStarted){this._connectionState=HubConnectionState.Disconnected;this._connectionStarted=false;if(this._messageBuffer){this._messageBuffer._dispose(error!==null&&error!==void 0?error:new Error("Connection closed."));this._messageBuffer=undefined;}
3528if(Platform.isBrowser){window.document.removeEventListener("freeze",this._freezeEventListener);}
3529try{this._closedCallbacks.forEach((c)=>c.apply(this,[error]));}
3530catch(e){this._logger.log(LogLevel.Error,`An onclose callback called with error '${error}' threw error '${e}'.`);}}}
3531async _reconnect(error){const reconnectStartTime=Date.now();let previousReconnectAttempts=0;let retryError=error!==undefined?error:new Error("Attempting to reconnect due to a unknown error.");let nextRetryDelay=this._getNextRetryDelay(previousReconnectAttempts++,0,retryError);if(nextRetryDelay===null){this._logger.log(LogLevel.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.");this._completeClose(error);return;}
3532this._connectionState=HubConnectionState.Reconnecting;if(error){this._logger.log(LogLevel.Information,`Connection reconnecting because of error '${error}'.`);}
3533else{this._logger.log(LogLevel.Information,"Connection reconnecting.");}
3534if(this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach((c)=>c.apply(this,[error]));}
3535catch(e){this._logger.log(LogLevel.Error,`An onreconnecting callback called with error '${error}' threw error '${e}'.`);}
3536if(this._connectionState!==HubConnectionState.Reconnecting){this._logger.log(LogLevel.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return;}}
3537while(nextRetryDelay!==null){this._logger.log(LogLevel.Information,`Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);await new Promise((resolve)=>{this._reconnectDelayHandle=setTimeout(resolve,nextRetryDelay);});this._reconnectDelayHandle=undefined;if(this._connectionState!==HubConnectionState.Reconnecting){this._logger.log(LogLevel.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return;}
3538try{await this._startInternal();this._connectionState=HubConnectionState.Connected;this._logger.log(LogLevel.Information,"HubConnection reconnected successfully.");if(this._reconnectedCallbacks.length!==0){try{this._reconnectedCallbacks.forEach((c)=>c.apply(this,[this.connection.connectionId]));}
3539catch(e){this._logger.log(LogLevel.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);}}
3540return;}
3541catch(e){this._logger.log(LogLevel.Information,`Reconnect attempt failed because of error '${e}'.`);if(this._connectionState!==HubConnectionState.Reconnecting){this._logger.log(LogLevel.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);if(this._connectionState===HubConnectionState.Disconnecting){this._completeClose();}
3542return;}
3543retryError=e instanceof Error?e:new Error(e.toString());nextRetryDelay=this._getNextRetryDelay(previousReconnectAttempts++,Date.now()-reconnectStartTime,retryError);}}
3544this._logger.log(LogLevel.Information,`Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);this._completeClose();}
3545_getNextRetryDelay(previousRetryCount,elapsedMilliseconds,retryReason){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds,previousRetryCount,retryReason,});}
3546catch(e){this._logger.log(LogLevel.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);return null;}}
3547_cancelCallbacksWithError(error){const callbacks=this._callbacks;this._callbacks={};Object.keys(callbacks).forEach((key)=>{const callback=callbacks[key];try{callback(null,error);}
3548catch(e){this._logger.log(LogLevel.Error,`Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);}});}
3549_cleanupPingTimer(){if(this._pingServerHandle){clearTimeout(this._pingServerHandle);this._pingServerHandle=undefined;}}
3550_cleanupTimeout(){if(this._timeoutHandle){clearTimeout(this._timeoutHandle);}}
3551_createInvocation(methodName,args,nonblocking,streamIds){if(nonblocking){if(streamIds.length!==0){return{arguments:args,streamIds,target:methodName,type:MessageType.Invocation,};}
3552else{return{arguments:args,target:methodName,type:MessageType.Invocation,};}}
3553else{const invocationId=this._invocationId;this._invocationId++;if(streamIds.length!==0){return{arguments:args,invocationId:invocationId.toString(),streamIds,target:methodName,type:MessageType.Invocation,};}
3554else{return{arguments:args,invocationId:invocationId.toString(),target:methodName,type:MessageType.Invocation,};}}}
3555_launchStreams(streams,promiseQueue){if(streams.length===0){return;}
3556if(!promiseQueue){promiseQueue=Promise.resolve();}
3557for(const streamId in streams){streams[streamId].subscribe({complete:()=>{promiseQueue=promiseQueue.then(()=>this._sendWithProtocol(this._createCompletionMessage(streamId)));},error:(err)=>{let message;if(err instanceof Error){message=err.message;}
3558else if(err&&err.toString){message=err.toString();}
3559else{message="Unknown error";}
3560promiseQueue=promiseQueue.then(()=>this._sendWithProtocol(this._createCompletionMessage(streamId,message)));},next:(item)=>{promiseQueue=promiseQueue.then(()=>this._sendWithProtocol(this._createStreamItemMessage(streamId,item)));},});}}
3561_replaceStreamingParams(args){const streams=[];const streamIds=[];for(let i=0;i<args.length;i++){const argument=args[i];if(this._isObservable(argument)){const streamId=this._invocationId;this._invocationId++;streams[streamId]=argument;streamIds.push(streamId.toString());args.splice(i,1);}}
3562return[streams,streamIds];}
3563_isObservable(arg){return arg&&arg.subscribe&&typeof arg.subscribe==="function";}
3564_createStreamInvocation(methodName,args,streamIds){const invocationId=this._invocationId;this._invocationId++;if(streamIds.length!==0){return{arguments:args,invocationId:invocationId.toString(),streamIds,target:methodName,type:MessageType.StreamInvocation,};}
3565else{return{arguments:args,invocationId:invocationId.toString(),target:methodName,type:MessageType.StreamInvocation,};}}
3566_createCancelInvocation(id){return{invocationId:id,type:MessageType.CancelInvocation,};}
3567_createStreamItemMessage(id,item){return{invocationId:id,item,type:MessageType.StreamItem,};}
3568_createCompletionMessage(id,error,result){if(error){return{error,invocationId:id,type:MessageType.Completion,};}
3569return{invocationId:id,result,type:MessageType.Completion,};}
3570_createCloseMessage(){return{type:MessageType.Close};}};const DEFAULT_RETRY_DELAYS_IN_MILLISECONDS=[0,2000,10000,30000,null];class DefaultReconnectPolicy{constructor(retryDelays){this._retryDelays=retryDelays!==undefined?[...retryDelays,null]:DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;}
3571nextRetryDelayInMilliseconds(retryContext){return this._retryDelays[retryContext.previousRetryCount];}};class HeaderNames{}
3572HeaderNames.Authorization="Authorization";HeaderNames.Cookie="Cookie";;class AccessTokenHttpClient extends HttpClient{constructor(innerClient,accessTokenFactory){super();this._innerClient=innerClient;this._accessTokenFactory=accessTokenFactory;}
3573async send(request){let allowRetry=true;if(this._accessTokenFactory&&(!this._accessToken||(request.url&&request.url.indexOf("/negotiate?")>0))){allowRetry=false;this._accessToken=await this._accessTokenFactory();}
3574this._setAuthorizationHeader(request);const response=await this._innerClient.send(request);if(allowRetry&&response.statusCode===401&&this._accessTokenFactory){this._accessToken=await this._accessTokenFactory();this._setAuthorizationHeader(request);return await this._innerClient.send(request);}
3575return response;}
3576_setAuthorizationHeader(request){if(!request.headers){request.headers={};}
3577if(this._accessToken){request.headers[HeaderNames.Authorization]=`Bearer ${this._accessToken}`;}
3578else if(this._accessTokenFactory){if(request.headers[HeaderNames.Authorization]){delete request.headers[HeaderNames.Authorization];}}}
3579getCookieString(url){return this._innerClient.getCookieString(url);}};var HttpTransportType;(function(HttpTransportType){HttpTransportType[HttpTransportType["None"]=0]="None";HttpTransportType[HttpTransportType["WebSockets"]=1]="WebSockets";HttpTransportType[HttpTransportType["ServerSentEvents"]=2]="ServerSentEvents";HttpTransportType[HttpTransportType["LongPolling"]=4]="LongPolling";})(HttpTransportType||(HttpTransportType={}));var TransferFormat;(function(TransferFormat){TransferFormat[TransferFormat["Text"]=1]="Text";TransferFormat[TransferFormat["Binary"]=2]="Binary";})(TransferFormat||(TransferFormat={}));;class AbortController_AbortController{constructor(){this._isAborted=false;this.onabort=null;}
3580abort(){if(!this._isAborted){this._isAborted=true;if(this.onabort){this.onabort();}}}
3581get signal(){return this;}
3582get aborted(){return this._isAborted;}};class LongPollingTransport{get pollAborted(){return this._pollAbort.aborted;}
3583constructor(httpClient,logger,options){this._httpClient=httpClient;this._logger=logger;this._pollAbort=new AbortController_AbortController();this._options=options;this._running=false;this.onreceive=null;this.onclose=null;}
3584async connect(url,transferFormat){Arg.isRequired(url,"url");Arg.isRequired(transferFormat,"transferFormat");Arg.isIn(transferFormat,TransferFormat,"transferFormat");this._url=url;this._logger.log(LogLevel.Trace,"(LongPolling transport) Connecting.");if(transferFormat===TransferFormat.Binary&&(typeof XMLHttpRequest!=="undefined"&&typeof new XMLHttpRequest().responseType!=="string")){throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");}
3585const[name,value]=getUserAgentHeader();const headers={[name]:value,...this._options.headers};const pollOptions={abortSignal:this._pollAbort.signal,headers,timeout:100000,withCredentials:this._options.withCredentials,};if(transferFormat===TransferFormat.Binary){pollOptions.responseType="arraybuffer";}
3586const pollUrl=`${url}&_=${Date.now()}`;this._logger.log(LogLevel.Trace,`(LongPolling transport) polling: ${pollUrl}.`);const response=await this._httpClient.get(pollUrl,pollOptions);if(response.statusCode!==200){this._logger.log(LogLevel.Error,`(LongPolling transport) Unexpected response code: ${response.statusCode}.`);this._closeError=new HttpError(response.statusText||"",response.statusCode);this._running=false;}
3587else{this._running=true;}
3588this._receiving=this._poll(this._url,pollOptions);}
3589async _poll(url,pollOptions){try{while(this._running){try{const pollUrl=`${url}&_=${Date.now()}`;this._logger.log(LogLevel.Trace,`(LongPolling transport) polling: ${pollUrl}.`);const response=await this._httpClient.get(pollUrl,pollOptions);if(response.statusCode===204){this._logger.log(LogLevel.Information,"(LongPolling transport) Poll terminated by server.");this._running=false;}
3590else if(response.statusCode!==200){this._logger.log(LogLevel.Error,`(LongPolling transport) Unexpected response code: ${response.statusCode}.`);this._closeError=new HttpError(response.statusText||"",response.statusCode);this._running=false;}
3591else{if(response.content){this._logger.log(LogLevel.Trace,`(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent)}.`);if(this.onreceive){this.onreceive(response.content);}}
3592else{this._logger.log(LogLevel.Trace,"(LongPolling transport) Poll timed out, reissuing.");}}}
3593catch(e){if(!this._running){this._logger.log(LogLevel.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`);}
3594else{if(e instanceof TimeoutError){this._logger.log(LogLevel.Trace,"(LongPolling transport) Poll timed out, reissuing.");}
3595else{this._closeError=e;this._running=false;}}}}}
3596finally{this._logger.log(LogLevel.Trace,"(LongPolling transport) Polling complete.");if(!this.pollAborted){this._raiseOnClose();}}}
3597async send(data){if(!this._running){return Promise.reject(new Error("Cannot send until the transport is connected"));}
3598return sendMessage(this._logger,"LongPolling",this._httpClient,this._url,data,this._options);}
3599async stop(){this._logger.log(LogLevel.Trace,"(LongPolling transport) Stopping polling.");this._running=false;this._pollAbort.abort();try{await this._receiving;this._logger.log(LogLevel.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const headers={};const[name,value]=getUserAgentHeader();headers[name]=value;const deleteOptions={headers:{...headers,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials,};let error;try{await this._httpClient.delete(this._url,deleteOptions);}
3600catch(err){error=err;}
3601if(error){if(error instanceof HttpError){if(error.statusCode===404){this._logger.log(LogLevel.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request.");}
3602else{this._logger.log(LogLevel.Trace,`(LongPolling transport) Error sending a DELETE request: ${error}`);}}}
3603else{this._logger.log(LogLevel.Trace,"(LongPolling transport) DELETE request accepted.");}}
3604finally{this._logger.log(LogLevel.Trace,"(LongPolling transport) Stop finished.");this._raiseOnClose();}}
3605_raiseOnClose(){if(this.onclose){let logMessage="(LongPolling transport) Firing onclose event.";if(this._closeError){logMessage+=" Error: "+this._closeError;}
3606this._logger.log(LogLevel.Trace,logMessage);this.onclose(this._closeError);}}};class ServerSentEventsTransport{constructor(httpClient,accessToken,logger,options){this._httpClient=httpClient;this._accessToken=accessToken;this._logger=logger;this._options=options;this.onreceive=null;this.onclose=null;}
3607async connect(url,transferFormat){Arg.isRequired(url,"url");Arg.isRequired(transferFormat,"transferFormat");Arg.isIn(transferFormat,TransferFormat,"transferFormat");this._logger.log(LogLevel.Trace,"(SSE transport) Connecting.");this._url=url;if(this._accessToken){url+=(url.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`;}
3608return new Promise((resolve,reject)=>{let opened=false;if(transferFormat!==TransferFormat.Text){reject(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return;}
3609let eventSource;if(Platform.isBrowser||Platform.isWebWorker){eventSource=new this._options.EventSource(url,{withCredentials:this._options.withCredentials});}
3610else{const cookies=this._httpClient.getCookieString(url);const headers={};headers.Cookie=cookies;const[name,value]=getUserAgentHeader();headers[name]=value;eventSource=new this._options.EventSource(url,{withCredentials:this._options.withCredentials,headers:{...headers,...this._options.headers}});}
3611try{eventSource.onmessage=(e)=>{if(this.onreceive){try{this._logger.log(LogLevel.Trace,`(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent)}.`);this.onreceive(e.data);}
3612catch(error){this._close(error);return;}}};eventSource.onerror=(e)=>{if(opened){this._close();}
3613else{reject(new Error("EventSource failed to connect. The connection could not be found on the server,"
3614+" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection."
3615+" If you have multiple servers check that sticky sessions are enabled."));}};eventSource.onopen=()=>{this._logger.log(LogLevel.Information,`SSE connected to ${this._url}`);this._eventSource=eventSource;opened=true;resolve();};}
3616catch(e){reject(e);return;}});}
3617async send(data){if(!this._eventSource){return Promise.reject(new Error("Cannot send until the transport is connected"));}
3618return sendMessage(this._logger,"SSE",this._httpClient,this._url,data,this._options);}
3619stop(){this._close();return Promise.resolve();}
3620_close(e){if(this._eventSource){this._eventSource.close();this._eventSource=undefined;if(this.onclose){this.onclose(e);}}}};class WebSocketTransport{constructor(httpClient,accessTokenFactory,logger,logMessageContent,webSocketConstructor,headers){this._logger=logger;this._accessTokenFactory=accessTokenFactory;this._logMessageContent=logMessageContent;this._webSocketConstructor=webSocketConstructor;this._httpClient=httpClient;this.onreceive=null;this.onclose=null;this._headers=headers;}
3621async connect(url,transferFormat){Arg.isRequired(url,"url");Arg.isRequired(transferFormat,"transferFormat");Arg.isIn(transferFormat,TransferFormat,"transferFormat");this._logger.log(LogLevel.Trace,"(WebSockets transport) Connecting.");let token;if(this._accessTokenFactory){token=await this._accessTokenFactory();}
3622return new Promise((resolve,reject)=>{url=url.replace(/^http/,"ws");let webSocket;const cookies=this._httpClient.getCookieString(url);let opened=false;if(Platform.isNode||Platform.isReactNative){const headers={};const[name,value]=getUserAgentHeader();headers[name]=value;if(token){headers[HeaderNames.Authorization]=`Bearer ${token}`;}
3623if(cookies){headers[HeaderNames.Cookie]=cookies;}
3624webSocket=new this._webSocketConstructor(url,undefined,{headers:{...headers,...this._headers},});}
3625else{if(token){url+=(url.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(token)}`;}}
3626if(!webSocket){webSocket=new this._webSocketConstructor(url);}
3627if(transferFormat===TransferFormat.Binary){webSocket.binaryType="arraybuffer";}
3628webSocket.onopen=(_event)=>{this._logger.log(LogLevel.Information,`WebSocket connected to ${url}.`);this._webSocket=webSocket;opened=true;resolve();};webSocket.onerror=(event)=>{let error=null;if(typeof ErrorEvent!=="undefined"&&event instanceof ErrorEvent){error=event.error;}
3629else{error="There was an error with the transport";}
3630this._logger.log(LogLevel.Information,`(WebSockets transport) ${error}.`);};webSocket.onmessage=(message)=>{this._logger.log(LogLevel.Trace,`(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);if(this.onreceive){try{this.onreceive(message.data);}
3631catch(error){this._close(error);return;}}};webSocket.onclose=(event)=>{if(opened){this._close(event);}
3632else{let error=null;if(typeof ErrorEvent!=="undefined"&&event instanceof ErrorEvent){error=event.error;}
3633else{error="WebSocket failed to connect. The connection could not be found on the server,"
3634+" either the endpoint may not be a SignalR endpoint,"
3635+" the connection ID is not present on the server, or there is a proxy blocking WebSockets."
3636+" If you have multiple servers check that sticky sessions are enabled.";}
3637reject(new Error(error));}};});}
3638send(data){if(this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN){this._logger.log(LogLevel.Trace,`(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);this._webSocket.send(data);return Promise.resolve();}
3639return Promise.reject("WebSocket is not in the OPEN state");}
3640stop(){if(this._webSocket){this._close(undefined);}
3641return Promise.resolve();}
3642_close(event){if(this._webSocket){this._webSocket.onclose=()=>{};this._webSocket.onmessage=()=>{};this._webSocket.onerror=()=>{};this._webSocket.close();this._webSocket=undefined;}
3643this._logger.log(LogLevel.Trace,"(WebSockets transport) socket closed.");if(this.onclose){if(this._isCloseEvent(event)&&(event.wasClean===false||event.code!==1000)){this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || "no reason given"}).`));}
3644else if(event instanceof Error){this.onclose(event);}
3645else{this.onclose();}}}
3646_isCloseEvent(event){return event&&typeof event.wasClean==="boolean"&&typeof event.code==="number";}};const MAX_REDIRECTS=100;class HttpConnection{constructor(url,options={}){this._stopPromiseResolver=()=>{};this.features={};this._negotiateVersion=1;Arg.isRequired(url,"url");this._logger=createLogger(options.logger);this.baseUrl=this._resolveUrl(url);options=options||{};options.logMessageContent=options.logMessageContent===undefined?false:options.logMessageContent;if(typeof options.withCredentials==="boolean"||options.withCredentials===undefined){options.withCredentials=options.withCredentials===undefined?true:options.withCredentials;}
3647else{throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");}
3648options.timeout=options.timeout===undefined?100*1000:options.timeout;let webSocketModule=null;let eventSourceModule=null;if(Platform.isNode&&"function"!=="undefined"){webSocketModule=getWS();eventSourceModule=getEventSource();}
3649if(!Platform.isNode&&typeof WebSocket!=="undefined"&&!options.WebSocket){options.WebSocket=WebSocket;}
3650else if(Platform.isNode&&!options.WebSocket){if(webSocketModule){options.WebSocket=webSocketModule;}}
3651if(!Platform.isNode&&typeof EventSource!=="undefined"&&!options.EventSource){options.EventSource=EventSource;}
3652else if(Platform.isNode&&!options.EventSource){if(typeof eventSourceModule!=="undefined"){options.EventSource=eventSourceModule;}}
3653this._httpClient=new AccessTokenHttpClient(options.httpClient||new DefaultHttpClient(this._logger),options.accessTokenFactory);this._connectionState="Disconnected";this._connectionStarted=false;this._options=options;this.onreceive=null;this.onclose=null;}
3654async start(transferFormat){transferFormat=transferFormat||TransferFormat.Binary;Arg.isIn(transferFormat,TransferFormat,"transferFormat");this._logger.log(LogLevel.Debug,`Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);if(this._connectionState!=="Disconnected"){return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));}
3655this._connectionState="Connecting";this._startInternalPromise=this._startInternal(transferFormat);await this._startInternalPromise;if(this._connectionState==="Disconnecting"){const message="Failed to start the HttpConnection before stop() was called.";this._logger.log(LogLevel.Error,message);await this._stopPromise;return Promise.reject(new AbortError(message));}
3656else if(this._connectionState!=="Connected"){const message="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";this._logger.log(LogLevel.Error,message);return Promise.reject(new AbortError(message));}
3657this._connectionStarted=true;}
3658send(data){if(this._connectionState!=="Connected"){return Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State."));}
3659if(!this._sendQueue){this._sendQueue=new TransportSendQueue(this.transport);}
3660return this._sendQueue.send(data);}
3661async stop(error){if(this._connectionState==="Disconnected"){this._logger.log(LogLevel.Debug,`Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);return Promise.resolve();}
3662if(this._connectionState==="Disconnecting"){this._logger.log(LogLevel.Debug,`Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);return this._stopPromise;}
3663this._connectionState="Disconnecting";this._stopPromise=new Promise((resolve)=>{this._stopPromiseResolver=resolve;});await this._stopInternal(error);await this._stopPromise;}
3664async _stopInternal(error){this._stopError=error;try{await this._startInternalPromise;}
3665catch(e){}
3666if(this.transport){try{await this.transport.stop();}
3667catch(e){this._logger.log(LogLevel.Error,`HttpConnection.transport.stop() threw error '${e}'.`);this._stopConnection();}
3668this.transport=undefined;}
3669else{this._logger.log(LogLevel.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.");}}
3670async _startInternal(transferFormat){let url=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport===HttpTransportType.WebSockets){this.transport=this._constructTransport(HttpTransportType.WebSockets);await this._startTransport(url,transferFormat);}
3671else{throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");}}
3672else{let negotiateResponse=null;let redirects=0;do{negotiateResponse=await this._getNegotiationResponse(url);if(this._connectionState==="Disconnecting"||this._connectionState==="Disconnected"){throw new AbortError("The connection was stopped during negotiation.");}
3673if(negotiateResponse.error){throw new Error(negotiateResponse.error);}
3674if(negotiateResponse.ProtocolVersion){throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");}
3675if(negotiateResponse.url){url=negotiateResponse.url;}
3676if(negotiateResponse.accessToken){const accessToken=negotiateResponse.accessToken;this._accessTokenFactory=()=>accessToken;this._httpClient._accessToken=accessToken;this._httpClient._accessTokenFactory=undefined;}
3677redirects++;}while(negotiateResponse.url&&redirects<MAX_REDIRECTS);if(redirects===MAX_REDIRECTS&&negotiateResponse.url){throw new Error("Negotiate redirection limit exceeded.");}
3678await this._createTransport(url,this._options.transport,negotiateResponse,transferFormat);}
3679if(this.transport instanceof LongPollingTransport){this.features.inherentKeepAlive=true;}
3680if(this._connectionState==="Connecting"){this._logger.log(LogLevel.Debug,"The HttpConnection connected successfully.");this._connectionState="Connected";}}
3681catch(e){this._logger.log(LogLevel.Error,"Failed to start the connection: "+e);this._connectionState="Disconnected";this.transport=undefined;this._stopPromiseResolver();return Promise.reject(e);}}
3682async _getNegotiationResponse(url){const headers={};const[name,value]=getUserAgentHeader();headers[name]=value;const negotiateUrl=this._resolveNegotiateUrl(url);this._logger.log(LogLevel.Debug,`Sending negotiation request: ${negotiateUrl}.`);try{const response=await this._httpClient.post(negotiateUrl,{content:"",headers:{...headers,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials,});if(response.statusCode!==200){return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));}
3683const negotiateResponse=JSON.parse(response.content);if(!negotiateResponse.negotiateVersion||negotiateResponse.negotiateVersion<1){negotiateResponse.connectionToken=negotiateResponse.connectionId;}
3684if(negotiateResponse.useStatefulReconnect&&this._options._useStatefulReconnect!==true){return Promise.reject(new FailedToNegotiateWithServerError("Client didn't negotiate Stateful Reconnect but the server did."));}
3685return negotiateResponse;}
3686catch(e){let errorMessage="Failed to complete negotiation with the server: "+e;if(e instanceof HttpError){if(e.statusCode===404){errorMessage=errorMessage+" Either this is not a SignalR endpoint or there is a proxy blocking the connection.";}}
3687this._logger.log(LogLevel.Error,errorMessage);return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));}}
3688_createConnectUrl(url,connectionToken){if(!connectionToken){return url;}
3689return url+(url.indexOf("?")===-1?"?":"&")+`id=${connectionToken}`;}
3690async _createTransport(url,requestedTransport,negotiateResponse,requestedTransferFormat){let connectUrl=this._createConnectUrl(url,negotiateResponse.connectionToken);if(this._isITransport(requestedTransport)){this._logger.log(LogLevel.Debug,"Connection was provided an instance of ITransport, using that directly.");this.transport=requestedTransport;await this._startTransport(connectUrl,requestedTransferFormat);this.connectionId=negotiateResponse.connectionId;return;}
3691const transportExceptions=[];const transports=negotiateResponse.availableTransports||[];let negotiate=negotiateResponse;for(const endpoint of transports){const transportOrError=this._resolveTransportOrError(endpoint,requestedTransport,requestedTransferFormat,(negotiate===null||negotiate===void 0?void 0:negotiate.useStatefulReconnect)===true);if(transportOrError instanceof Error){transportExceptions.push(`${endpoint.transport} failed:`);transportExceptions.push(transportOrError);}
3692else if(this._isITransport(transportOrError)){this.transport=transportOrError;if(!negotiate){try{negotiate=await this._getNegotiationResponse(url);}
3693catch(ex){return Promise.reject(ex);}
3694connectUrl=this._createConnectUrl(url,negotiate.connectionToken);}
3695try{await this._startTransport(connectUrl,requestedTransferFormat);this.connectionId=negotiate.connectionId;return;}
3696catch(ex){this._logger.log(LogLevel.Error,`Failed to start the transport '${endpoint.transport}': ${ex}`);negotiate=undefined;transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`,HttpTransportType[endpoint.transport]));if(this._connectionState!=="Connecting"){const message="Failed to select transport before stop() was called.";this._logger.log(LogLevel.Debug,message);return Promise.reject(new AbortError(message));}}}}
3697if(transportExceptions.length>0){return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(" ")}`,transportExceptions));}
3698return Promise.reject(new Error("None of the transports supported by the client are supported by the server."));}
3699_constructTransport(transport){switch(transport){case HttpTransportType.WebSockets:if(!this._options.WebSocket){throw new Error("'WebSocket' is not supported in your environment.");}
3700return new WebSocketTransport(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case HttpTransportType.ServerSentEvents:if(!this._options.EventSource){throw new Error("'EventSource' is not supported in your environment.");}
3701return new ServerSentEventsTransport(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case HttpTransportType.LongPolling:return new LongPollingTransport(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${transport}.`);}}
3702_startTransport(url,transferFormat){this.transport.onreceive=this.onreceive;if(this.features.reconnect){this.transport.onclose=async(e)=>{let callStop=false;if(this.features.reconnect){try{this.features.disconnected();await this.transport.connect(url,transferFormat);await this.features.resend();}
3703catch{callStop=true;}}
3704else{this._stopConnection(e);return;}
3705if(callStop){this._stopConnection(e);}};}
3706else{this.transport.onclose=(e)=>this._stopConnection(e);}
3707return this.transport.connect(url,transferFormat);}
3708_resolveTransportOrError(endpoint,requestedTransport,requestedTransferFormat,useStatefulReconnect){const transport=HttpTransportType[endpoint.transport];if(transport===null||transport===undefined){this._logger.log(LogLevel.Debug,`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);}
3709else{if(transportMatches(requestedTransport,transport)){const transferFormats=endpoint.transferFormats.map((s)=>TransferFormat[s]);if(transferFormats.indexOf(requestedTransferFormat)>=0){if((transport===HttpTransportType.WebSockets&&!this._options.WebSocket)||(transport===HttpTransportType.ServerSentEvents&&!this._options.EventSource)){this._logger.log(LogLevel.Debug,`Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`,transport);}
3710else{this._logger.log(LogLevel.Debug,`Selecting transport '${HttpTransportType[transport]}'.`);try{this.features.reconnect=transport===HttpTransportType.WebSockets?useStatefulReconnect:undefined;return this._constructTransport(transport);}
3711catch(ex){return ex;}}}
3712else{this._logger.log(LogLevel.Debug,`Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);}}
3713else{this._logger.log(LogLevel.Debug,`Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`,transport);}}}
3714_isITransport(transport){return transport&&typeof(transport)==="object"&&"connect" in transport;}
3715_stopConnection(error){this._logger.log(LogLevel.Debug,`HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);this.transport=undefined;error=this._stopError||error;this._stopError=undefined;if(this._connectionState==="Disconnected"){this._logger.log(LogLevel.Debug,`Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);return;}
3716if(this._connectionState==="Connecting"){this._logger.log(LogLevel.Warning,`Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);}
3717if(this._connectionState==="Disconnecting"){this._stopPromiseResolver();}
3718if(error){this._logger.log(LogLevel.Error,`Connection disconnected with error '${error}'.`);}
3719else{this._logger.log(LogLevel.Information,"Connection disconnected.");}
3720if(this._sendQueue){this._sendQueue.stop().catch((e)=>{this._logger.log(LogLevel.Error,`TransportSendQueue.stop() threw error '${e}'.`);});this._sendQueue=undefined;}
3721this.connectionId=undefined;this._connectionState="Disconnected";if(this._connectionStarted){this._connectionStarted=false;try{if(this.onclose){this.onclose(error);}}
3722catch(e){this._logger.log(LogLevel.Error,`HttpConnection.onclose(${error}) threw error '${e}'.`);}}}
3723_resolveUrl(url){if(url.lastIndexOf("https://",0)===0||url.lastIndexOf("http://",0)===0){return url;}
3724if(!Platform.isBrowser){throw new Error(`Cannot resolve '${url}'.`);}
3725const aTag=window.document.createElement("a");aTag.href=url;this._logger.log(LogLevel.Information,`Normalizing '${url}' to '${aTag.href}'.`);return aTag.href;}
3726_resolveNegotiateUrl(url){const negotiateUrl=new URL(url);if(negotiateUrl.pathname.endsWith('/')){negotiateUrl.pathname+="negotiate";}
3727else{negotiateUrl.pathname+="/negotiate";}
3728const searchParams=new URLSearchParams(negotiateUrl.searchParams);if(!searchParams.has("negotiateVersion")){searchParams.append("negotiateVersion",this._negotiateVersion.toString());}
3729if(searchParams.has("useStatefulReconnect")){if(searchParams.get("useStatefulReconnect")==="true"){this._options._useStatefulReconnect=true;}}
3730else if(this._options._useStatefulReconnect===true){searchParams.append("useStatefulReconnect","true");}
3731negotiateUrl.search=searchParams.toString();return negotiateUrl.toString();}}
3732function transportMatches(requestedTransport,actualTransport){return!requestedTransport||((actualTransport&requestedTransport)!==0);}
3733class TransportSendQueue{constructor(_transport){this._transport=_transport;this._buffer=[];this._executing=true;this._sendBufferedData=new PromiseSource();this._transportResult=new PromiseSource();this._sendLoopPromise=this._sendLoop();}
3734send(data){this._bufferData(data);if(!this._transportResult){this._transportResult=new PromiseSource();}
3735return this._transportResult.promise;}
3736stop(){this._executing=false;this._sendBufferedData.resolve();return this._sendLoopPromise;}
3737_bufferData(data){if(this._buffer.length&&typeof(this._buffer[0])!==typeof(data)){throw new Error(`Expected data to be of type ${typeof (this._buffer)} but was of type ${typeof (data)}`);}
3738this._buffer.push(data);this._sendBufferedData.resolve();}
3739async _sendLoop(){while(true){await this._sendBufferedData.promise;if(!this._executing){if(this._transportResult){this._transportResult.reject("Connection stopped.");}
3740break;}
3741this._sendBufferedData=new PromiseSource();const transportResult=this._transportResult;this._transportResult=undefined;const data=typeof(this._buffer[0])==="string"?this._buffer.join(""):TransportSendQueue._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(data);transportResult.resolve();}
3742catch(error){transportResult.reject(error);}}}
3743static _concatBuffers(arrayBuffers){const totalLength=arrayBuffers.map((b)=>b.byteLength).reduce((a,b)=>a+b);const result=new Uint8Array(totalLength);let offset=0;for(const item of arrayBuffers){result.set(new Uint8Array(item),offset);offset+=item.byteLength;}
3744return result.buffer;}}
3745class PromiseSource{constructor(){this.promise=new Promise((resolve,reject)=>[this._resolver,this._rejecter]=[resolve,reject]);}
3746resolve(){this._resolver();}
3747reject(reason){this._rejecter(reason);}};const JSON_HUB_PROTOCOL_NAME="json";class JsonHubProtocol{constructor(){this.name=JSON_HUB_PROTOCOL_NAME;this.version=2;this.transferFormat=TransferFormat.Text;}
3748parseMessages(input,logger){if(typeof input!=="string"){throw new Error("Invalid input for JSON hub protocol. Expected a string.");}
3749if(!input){return[];}
3750if(logger===null){logger=NullLogger.instance;}
3751const messages=TextMessageFormat.parse(input);const hubMessages=[];for(const message of messages){const parsedMessage=JSON.parse(message);if(typeof parsedMessage.type!=="number"){throw new Error("Invalid payload.");}
3752switch(parsedMessage.type){case MessageType.Invocation:this._isInvocationMessage(parsedMessage);break;case MessageType.StreamItem:this._isStreamItemMessage(parsedMessage);break;case MessageType.Completion:this._isCompletionMessage(parsedMessage);break;case MessageType.Ping:break;case MessageType.Close:break;case MessageType.Ack:this._isAckMessage(parsedMessage);break;case MessageType.Sequence:this._isSequenceMessage(parsedMessage);break;default:logger.log(LogLevel.Information,"Unknown message type '"+parsedMessage.type+"' ignored.");continue;}
3753hubMessages.push(parsedMessage);}
3754return hubMessages;}
3755writeMessage(message){return TextMessageFormat.write(JSON.stringify(message));}
3756_isInvocationMessage(message){this._assertNotEmptyString(message.target,"Invalid payload for Invocation message.");if(message.invocationId!==undefined){this._assertNotEmptyString(message.invocationId,"Invalid payload for Invocation message.");}}
3757_isStreamItemMessage(message){this._assertNotEmptyString(message.invocationId,"Invalid payload for StreamItem message.");if(message.item===undefined){throw new Error("Invalid payload for StreamItem message.");}}
3758_isCompletionMessage(message){if(message.result&&message.error){throw new Error("Invalid payload for Completion message.");}
3759if(!message.result&&message.error){this._assertNotEmptyString(message.error,"Invalid payload for Completion message.");}
3760this._assertNotEmptyString(message.invocationId,"Invalid payload for Completion message.");}
3761_isAckMessage(message){if(typeof message.sequenceId!=='number'){throw new Error("Invalid SequenceId for Ack message.");}}
3762_isSequenceMessage(message){if(typeof message.sequenceId!=='number'){throw new Error("Invalid SequenceId for Sequence message.");}}
3763_assertNotEmptyString(value,errorMessage){if(typeof value!=="string"||value===""){throw new Error(errorMessage);}}};const LogLevelNameMapping={trace:LogLevel.Trace,debug:LogLevel.Debug,info:LogLevel.Information,information:LogLevel.Information,warn:LogLevel.Warning,warning:LogLevel.Warning,error:LogLevel.Error,critical:LogLevel.Critical,none:LogLevel.None,};function parseLogLevel(name){const mapping=LogLevelNameMapping[name.toLowerCase()];if(typeof mapping!=="undefined"){return mapping;}
3764else{throw new Error(`Unknown log level: ${name}`);}}
3765class HubConnectionBuilder{configureLogging(logging){Arg.isRequired(logging,"logging");if(isLogger(logging)){this.logger=logging;}
3766else if(typeof logging==="string"){const logLevel=parseLogLevel(logging);this.logger=new ConsoleLogger(logLevel);}
3767else{this.logger=new ConsoleLogger(logging);}
3768return this;}
3769withUrl(url,transportTypeOrOptions){Arg.isRequired(url,"url");Arg.isNotEmpty(url,"url");this.url=url;if(typeof transportTypeOrOptions==="object"){this.httpConnectionOptions={...this.httpConnectionOptions,...transportTypeOrOptions};}
3770else{this.httpConnectionOptions={...this.httpConnectionOptions,transport:transportTypeOrOptions,};}
3771return this;}
3772withHubProtocol(protocol){Arg.isRequired(protocol,"protocol");this.protocol=protocol;return this;}
3773withAutomaticReconnect(retryDelaysOrReconnectPolicy){if(this.reconnectPolicy){throw new Error("A reconnectPolicy has already been set.");}
3774if(!retryDelaysOrReconnectPolicy){this.reconnectPolicy=new DefaultReconnectPolicy();}
3775else if(Array.isArray(retryDelaysOrReconnectPolicy)){this.reconnectPolicy=new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);}
3776else{this.reconnectPolicy=retryDelaysOrReconnectPolicy;}
3777return this;}
3778withServerTimeout(milliseconds){Arg.isRequired(milliseconds,"milliseconds");this._serverTimeoutInMilliseconds=milliseconds;return this;}
3779withKeepAliveInterval(milliseconds){Arg.isRequired(milliseconds,"milliseconds");this._keepAliveIntervalInMilliseconds=milliseconds;return this;}
3780withStatefulReconnect(options){if(this.httpConnectionOptions===undefined){this.httpConnectionOptions={};}
3781this.httpConnectionOptions._useStatefulReconnect=true;this._statefulReconnectBufferSize=options===null||options===void 0?void 0:options.bufferSize;return this;}
3782build(){const httpConnectionOptions=this.httpConnectionOptions||{};if(httpConnectionOptions.logger===undefined){httpConnectionOptions.logger=this.logger;}
3783if(!this.url){throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");}
3784const connection=new HttpConnection(this.url,httpConnectionOptions);return HubConnection.create(connection,this.logger||NullLogger.instance,this.protocol||new JsonHubProtocol(),this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize);}}
3785function isLogger(logger){return logger.log!==undefined;};;if(!Uint8Array.prototype.indexOf){Object.defineProperty(Uint8Array.prototype,"indexOf",{value:Array.prototype.indexOf,writable:true,});}
3786if(!Uint8Array.prototype.slice){Object.defineProperty(Uint8Array.prototype,"slice",{value:function(start,end){return new Uint8Array(Array.prototype.slice.call(this,start,end));},writable:true,});}
3787if(!Uint8Array.prototype.forEach){Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach,writable:true,});}
3788return __webpack_exports__;})();});;;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.