!function(global,factory){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){"use strict";function DOMEval(code,doc,node){doc=doc||document;var i,script=doc.createElement("script");if(script.text=code,node)for(i in preservedScriptAttributes)node[i]&&(script[i]=node[i]);doc.head.appendChild(script).parentNode.removeChild(script)}function toType(obj){return null==obj?obj+"":"object"==typeof obj||"function"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj}function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);return!isFunction(obj)&&!isWindow(obj)&&("array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj)}function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()}function winnow(elements,qualifier,not){return isFunction(qualifier)?jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not}):qualifier.nodeType?jQuery.grep(elements,function(elem){return elem===qualifier!==not}):"string"!=typeof qualifier?jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not}):jQuery.filter(qualifier,elements,not)}function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}function createOptions(options){var object={};return jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=!0}),object}function Identity(v){return v}function Thrower(ex){throw ex}function adoptValue(value,resolve,reject,noValue){var method;try{value&&isFunction(method=value.promise)?method.call(value).done(resolve).fail(reject):value&&isFunction(method=value.then)?method.call(value,resolve,reject):resolve.apply(void 0,[value].slice(noValue))}catch(value){reject.apply(void 0,[value])}}function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}function fcamelCase(all,letter){return letter.toUpperCase()}function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)}function Data(){this.expando=jQuery.expando+Data.uid++}function getData(data){return"true"===data||"false"!==data&&("null"===data?null:data===+data+""?+data:rbrace.test(data)?JSON.parse(data):data)}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$&").toLowerCase(),"string"==typeof(data=elem.getAttribute(name))){try{data=getData(data)}catch(e){}dataUser.set(elem,key,data)}else data=void 0;return data}function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,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]||"px"!==unit&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){for(initial/=2,unit=unit||initialInUnit[3],initialInUnit=+initial||1;maxIterations--;)jQuery.style(elem,prop,initialInUnit+unit),(1-scale)*(1-(scale=currentValue()/initial||.5))<=0&&(maxIterations=0),initialInUnit/=scale;initialInUnit*=2,jQuery.style(elem,prop,initialInUnit+unit),valueParts=valueParts||[]}return valueParts&&(initialInUnit=+initialInUnit||+initial||0,adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2],tween&&(tween.unit=unit,tween.start=initialInUnit,tween.end=adjusted)),adjusted}function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];return display||(temp=doc.body.appendChild(doc.createElement(nodeName)),display=jQuery.css(temp,"display"),temp.parentNode.removeChild(temp),"none"===display&&(display="block"),defaultDisplayMap[nodeName]=display,display)}function showHide(elements,show){for(var display,elem,values=[],index=0,length=elements.length;index<length;index++)elem=elements[index],elem.style&&(display=elem.style.display,show?("none"===display&&(values[index]=dataPriv.get(elem,"display")||null,values[index]||(elem.style.display="")),""===elem.style.display&&isHiddenWithinTree(elem)&&(values[index]=getDefaultDisplay(elem))):"none"!==display&&(values[index]="none",dataPriv.set(elem,"display",display)));for(index=0;index<length;index++)null!=values[index]&&(elements[index].style.display=values[index]);return elements}function getAll(context,tag){var ret;return ret=void 0!==context.getElementsByTagName?context.getElementsByTagName(tag||"*"):void 0!==context.querySelectorAll?context.querySelectorAll(tag||"*"):[],void 0===tag||tag&&nodeName(context,tag)?jQuery.merge([context],ret):ret}function setGlobalEval(elems,refElements){for(var i=0,l=elems.length;i<l;i++)dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"))}function buildFragment(elems,context,scripts,selection,ignored){for(var elem,tmp,tag,wrap,contains,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;i<l;i++)if((elem=elems[i])||0===elem)if("object"===toType(elem))jQuery.merge(nodes,elem.nodeType?[elem]:elem);else if(rhtml.test(elem)){for(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];j--;)tmp=tmp.lastChild;jQuery.merge(nodes,tmp.childNodes),tmp=fragment.firstChild,tmp.textContent=""}else nodes.push(context.createTextNode(elem));for(fragment.textContent="",i=0;elem=nodes[i++];)if(selection&&jQuery.inArray(elem,selection)>-1)ignored&&ignored.push(elem);else if(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(fragment.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts)for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return fragment}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,type;if("object"==typeof types){"string"!=typeof selector&&(data=data||selector,selector=void 0);for(type in types)on(elem,type,selector,data,types[type],one);return elem}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),!1===fn)fn=returnFalse;else if(!fn)return elem;return 1===one&&(origFn=fn,fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)},fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)),elem.each(function(){jQuery.event.add(this,types,fn,data,selector)})}function manipulationTarget(elem,content){return nodeName(elem,"table")&&nodeName(11!==content.nodeType?content:content.firstChild,"tr")?jQuery(elem).children("tbody")[0]||elem:elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){return"true/"===(elem.type||"").slice(0,5)?elem.type=elem.type.slice(5):elem.removeAttribute("type"),elem}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(1===dest.nodeType){if(dataPriv.hasData(src)&&(pdataOld=dataPriv.access(src),pdataCur=dataPriv.set(dest,pdataOld),events=pdataOld.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])}dataUser.hasData(src)&&(udataOld=dataUser.access(src),udataCur=jQuery.extend({},udataOld),dataUser.set(dest,udataCur))}}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();"input"===nodeName&&rcheckableType.test(src.type)?dest.checked=src.checked:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}function 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],valueIsFunction=isFunction(value);if(valueIsFunction||l>1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return collection.each(function(index){var self=collection.eq(index);valueIsFunction&&(args[0]=value.call(this,index,self.html())),domManip(self,args,callback,ignored)});if(l&&(fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored),first=fragment.firstChild,1===fragment.childNodes.length&&(fragment=first),first||ignored)){for(scripts=jQuery.map(getAll(fragment,"script"),disableScript),hasScripts=scripts.length;i<l;i++)node=fragment,i!==iNoClone&&(node=jQuery.clone(node,!0,!0),hasScripts&&jQuery.merge(scripts,getAll(node,"script"))),callback.call(collection[i],node,i);if(hasScripts)for(doc=scripts[scripts.length-1].ownerDocument,jQuery.map(scripts,restoreScript),i=0;i<hasScripts;i++)node=scripts[i],rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)&&(node.src&&"module"!==(node.type||"").toLowerCase()?jQuery._evalUrl&&jQuery._evalUrl(node.src):DOMEval(node.textContent.replace(rcleanScript,""),doc,node))}return collection}function remove(elem,selector,keepData){for(var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;null!=(node=nodes[i]);i++)keepData||1!==node.nodeType||jQuery.cleanData(getAll(node)),node.parentNode&&(keepData&&jQuery.contains(node.ownerDocument,node)&&setGlobalEval(getAll(node,"script")),node.parentNode.removeChild(node));return elem}function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;return computed=computed||getStyles(elem),computed&&(ret=computed.getPropertyValue(name)||computed[name],""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.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)),void 0!==ret?ret+"":ret}function addGetHookIf(conditionFn,hookFn){return{get:function(){return conditionFn()?void delete this.get:(this.get=hookFn).apply(this,arguments)}}}function vendorPropName(name){if(name in emptyStyle)return name;for(var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;i--;)if((name=cssPrefixes[i]+capName)in emptyStyle)return name}function finalPropName(name){var ret=jQuery.cssProps[name];return ret||(ret=jQuery.cssProps[name]=vendorPropName(name)||name),ret}function setPositiveNumber(elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value}function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i="width"===dimension?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content"))return 0;for(;i<4;i+=2)"margin"===box&&(delta+=jQuery.css(elem,box+cssExpand[i],!0,styles)),isBorderBox?("content"===box&&(delta-=jQuery.css(elem,"padding"+cssExpand[i],!0,styles)),"margin"!==box&&(delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles))):(delta+=jQuery.css(elem,"padding"+cssExpand[i],!0,styles),"padding"!==box?delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles):extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles));return!isBorderBox&&computedVal>=0&&(delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-computedVal-delta-extra-.5))),delta}function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),val=curCSS(elem,dimension,styles),isBorderBox="border-box"===jQuery.css(elem,"boxSizing",!1,styles),valueIsBorderBox=isBorderBox;if(rnumnonpx.test(val)){if(!extra)return val;val="auto"}return valueIsBorderBox=valueIsBorderBox&&(support.boxSizingReliable()||val===elem.style[dimension]),("auto"===val||!parseFloat(val)&&"inline"===jQuery.css(elem,"display",!1,styles))&&(val=elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)],valueIsBorderBox=!0),(val=parseFloat(val)||0)+boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val)+"px"}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}function schedule(){inProgress&&(!1===document.hidden&&window.requestAnimationFrame?window.requestAnimationFrame(schedule):window.setTimeout(schedule,jQuery.fx.interval),jQuery.fx.tick())}function createFxNow(){return window.setTimeout(function(){fxNow=void 0}),fxNow=Date.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};for(includeWidth=includeWidth?1:0;i<4;i+=2-includeWidth)which=cssExpand[i],attrs["margin"+which]=attrs["padding"+which]=type;return includeWidth&&(attrs.opacity=attrs.width=type),attrs}function createTween(value,prop,animation){for(var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;index<length;index++)if(tween=collection[index].call(animation,prop,value))return tween}function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");opts.queue||(hooks=jQuery._queueHooks(elem,"fx"),null==hooks.unqueued&&(hooks.unqueued=0,oldfire=hooks.empty.fire,hooks.empty.fire=function(){hooks.unqueued||oldfire()}),hooks.unqueued++,anim.always(function(){anim.always(function(){hooks.unqueued--,jQuery.queue(elem,"fx").length||hooks.empty.fire()})}));for(prop in props)if(value=props[prop],rfxtypes.test(value)){if(delete props[prop],toggle=toggle||"toggle"===value,value===(hidden?"hide":"show")){if("show"!==value||!dataShow||void 0===dataShow[prop])continue;hidden=!0}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}if((propTween=!jQuery.isEmptyObject(props))||!jQuery.isEmptyObject(orig)){isBox&&1===elem.nodeType&&(opts.overflow=[style.overflow,style.overflowX,style.overflowY],restoreDisplay=dataShow&&dataShow.display,null==restoreDisplay&&(restoreDisplay=dataPriv.get(elem,"display")),display=jQuery.css(elem,"display"),"none"===display&&(restoreDisplay?display=restoreDisplay:(showHide([elem],!0),restoreDisplay=elem.style.display||restoreDisplay,display=jQuery.css(elem,"display"),showHide([elem]))),("inline"===display||"inline-block"===display&&null!=restoreDisplay)&&"none"===jQuery.css(elem,"float")&&(propTween||(anim.done(function(){style.display=restoreDisplay}),null==restoreDisplay&&(display=style.display,restoreDisplay="none"===display?"":display)),style.display="inline-block")),opts.overflow&&(style.overflow="hidden",anim.always(function(){style.overflow=opts.overflow[0],style.overflowX=opts.overflow[1],style.overflowY=opts.overflow[2]})),propTween=!1;for(prop in orig)propTween||(dataShow?"hidden"in dataShow&&(hidden=dataShow.hidden):dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay}),toggle&&(dataShow.hidden=!hidden),hidden&&showHide([elem],!0),anim.done(function(){hidden||showHide([elem]),dataPriv.remove(elem,"fxshow");for(prop in orig)jQuery.style(elem,prop,orig[prop])})),propTween=createTween(hidden?dataShow[prop]:0,prop,anim),prop in dataShow||(dataShow[prop]=propTween.start,hidden&&(propTween.end=propTween.start,propTween.start=0))}}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props)if(name=camelCase(index),easing=specialEasing[name],value=props[index],Array.isArray(value)&&(easing=value[1],value=props[index]=value[0]),index!==name&&(props[name]=value,delete props[index]),(hooks=jQuery.cssHooks[name])&&"expand"in hooks){value=hooks.expand(value),delete props[name];for(index in value)index in props||(props[index]=value[index],specialEasing[index]=easing)}else specialEasing[name]=easing}function 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!1;for(var 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;index<length;index++)animation.tweens[index].run(percent);return deferred.notifyWith(elem,[animation,percent,remaining]),percent<1&&length?remaining:(length||deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation]),!1)},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{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);return animation.tweens.push(tween),tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped)return this;for(stopped=!0;index<length;index++)animation.tweens[index].run(1);return gotoEnd?(deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation,gotoEnd])):deferred.rejectWith(elem,[animation,gotoEnd]),this}}),props=animation.props;for(propFilter(props,animation.opts.specialEasing);index<length;index++)if(result=Animation.prefilters[index].call(animation,elem,props,animation.opts))return isFunction(result.stop)&&(jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result)),result;return jQuery.map(props,createTween,animation),isFunction(animation.opts.start)&&animation.opts.start.call(elem,animation),animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always),jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue})),animation}function stripAndCollapse(value){return(value.match(rnothtmlwhite)||[]).join(" ")}function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||""}function classesToArray(value){return Array.isArray(value)?value:"string"==typeof value?value.match(rnothtmlwhite)||[]:[]}function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v&&null!=v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==toType(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)void 0!==src[key]&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){for(var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;"*"===dataTypes[0];)dataTypes.shift(),void 0===ct&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function 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];for(current=dataTypes.shift();current;)if(s.responseFields[current]&&(jqXHR[s.responseFields[current]]=response),!prev&&isSuccess&&s.dataFilter&&(response=s.dataFilter(response,s.dataType)),prev=current,current=dataTypes.shift())if("*"===current)current=prev;else if("*"!==prev&&prev!==current){if(!(conv=converters[prev+" "+current]||converters["* "+current]))for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){!0===conv?conv=converters[conv2]:!0!==converters[conv2]&&(current=tmp[0],dataTypes.unshift(tmp[1]));break}if(!0!==conv)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}}}return{state:"success",data:response}}var arr=[],document=window.document,getProto=Object.getPrototypeOf,slice=arr.slice,concat=arr.concat,push=arr.push,indexOf=arr.indexOf,class2type={},toString=class2type.toString,hasOwn=class2type.hasOwnProperty,fnToString=hasOwn.toString,ObjectFunctionString=fnToString.call(Object),support={},isFunction=function(obj){return"function"==typeof obj&&"number"!=typeof obj.nodeType},isWindow=function(obj){return null!=obj&&obj===obj.window},preservedScriptAttributes={type:!0,src:!0,noModule:!0},jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;jQuery.fn=jQuery.prototype={jquery:"3.3.1",constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){return null==num?slice.call(this):num<0?this[num+this.length]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,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=!1;for("boolean"==typeof target&&(deep=target,target=arguments[i]||{},i++),"object"==typeof target||isFunction(target)||(target={}),i===length&&(target=this,i--);i<length;i++)if(null!=(options=arguments[i]))for(name in options)src=target[name],copy=options[name],target!==copy&&(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&Array.isArray(src)?src:[]):clone=src&&jQuery.isPlainObject(src)?src:{},target[name]=jQuery.extend(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target},jQuery.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(msg){throw new Error(msg)},noop:function(){},isPlainObject:function(obj){var proto,Ctor;return!(!obj||"[object Object]"!==toString.call(obj))&&(!(proto=getProto(obj))||"function"==typeof(Ctor=hasOwn.call(proto,"constructor")&&proto.constructor)&&fnToString.call(Ctor)===ObjectFunctionString)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},globalEval:function(code){DOMEval(code)},each:function(obj,callback){var length,i=0;if(isArrayLike(obj))for(length=obj.length;i<length&&!1!==callback.call(obj[i],i,obj[i]);i++);else for(i in obj)if(!1===callback.call(obj[i],i,obj[i]))break;return obj},trim:function(text){return null==text?"":(text+"").replace(rtrim,"")},makeArray:function(arr,results){var ret=results||[];return null!=arr&&(isArrayLike(Object(arr))?jQuery.merge(ret,"string"==typeof arr?[arr]:arr):push.call(ret,arr)),ret},inArray:function(elem,arr,i){return null==arr?-1:indexOf.call(arr,elem,i)},merge:function(first,second){for(var len=+second.length,j=0,i=first.length;j<len;j++)first[i++]=second[j];return first.length=i,first},grep:function(elems,callback,invert){for(var matches=[],i=0,length=elems.length,callbackExpect=!invert;i<length;i++)!callback(elems[i],i)!==callbackExpect&&matches.push(elems[i]);return matches},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems))for(length=elems.length;i<length;i++)null!=(value=callback(elems[i],i,arg))&&ret.push(value);else for(i in elems)null!=(value=callback(elems[i],i,arg))&&ret.push(value);return concat.apply([],ret)},guid:1,support:support}),"function"==typeof Symbol&&(jQuery.fn[Symbol.iterator]=arr[Symbol.iterator]),jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});var Sizzle=function(window){function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;if(results=results||[],"string"!=typeof selector||!selector||1!==nodeType&&9!==nodeType&&11!==nodeType)return results;if(!seed&&((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,documentIsHTML)){if(11!==nodeType&&(match=rquickExpr.exec(selector)))if(m=match[1]){if(9===nodeType){if(!(elem=context.getElementById(m)))return results;if(elem.id===m)return results.push(elem),results}else if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,context.getElementsByTagName(selector)),results;if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName)return push.apply(results,context.getElementsByClassName(m)),results}if(support.qsa&&!compilerCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(1!==nodeType)newContext=context,newSelector=selector;else if("object"!==context.nodeName.toLowerCase()){for((nid=context.getAttribute("id"))?nid=nid.replace(rcssescape,fcssescape):context.setAttribute("id",nid=expando),groups=tokenize(selector),i=groups.length;i--;)groups[i]="#"+nid+" "+toSelector(groups[i]);newSelector=groups.join(","),newContext=rsibling.test(selector)&&testContext(context.parentNode)||context}if(newSelector)try{return push.apply(results,newContext.querySelectorAll(newSelector)),results}catch(qsaError){}finally{nid===expando&&context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){function cache(key,value){return keys.push(key+" ")>Expr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}var keys=[];return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){return!1}finally{el.parentNode&&el.parentNode.removeChild(el),el=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=arr.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createDisabledPseudo(disabled){return function(elem){return"form"in elem?elem.parentNode&&!1===elem.disabled?"label"in elem?"label"in elem.parentNode?elem.parentNode.disabled===disabled:elem.disabled===disabled:elem.isDisabled===disabled||elem.isDisabled!==!disabled&&disabledAncestor(elem)===disabled:elem.disabled===disabled:"label"in elem&&elem.disabled===disabled}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function testContext(context){return context&&void 0!==context.getElementsByTagName&&context}function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i<len;i++)selector+=tokens[i].value;return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&"parentNode"===key,doneName=done++;return combinator.first?function(elem,context,xml){for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)return matcher(elem,context,xml);return!1}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){for(;elem=elem[dir];)if((1===elem.nodeType||checkNonElements)&&matcher(elem,context,xml))return!0}else for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)if(outerCache=elem[expando]||(elem[expando]={}),uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={}),skip&&skip===elem.nodeName.toLowerCase())elem=elem[dir]||elem;else{if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName)return newCache[2]=oldCache[2];if(uniqueCache[key]=newCache,newCache[2]=matcher(elem,context,xml))return!0}return!1}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i<len;i++)Sizzle(selector,contexts[i],results);return results}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i<len;i++)(elem=unmatched[i])&&(filter&&!filter(elem,context,xml)||(newUnmatched.push(elem),mapped&&map.push(i)));return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){return postFilter&&!postFilter[expando]&&(postFilter=setMatcher(postFilter)),postFinder&&!postFinder[expando]&&(postFinder=setMatcher(postFinder,postSelector)),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?elems:condense(elems,preMap,preFilter,context,xml),matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher&&matcher(matcherIn,matcherOut,context,xml),postFilter)for(temp=condense(matcherOut,postMap),postFilter(temp,[],context,xml),i=temp.length;i--;)(elem=temp[i])&&(matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem));if(seed){if(postFinder||preFilter){if(postFinder){for(temp=[],i=matcherOut.length;i--;)(elem=matcherOut[i])&&temp.push(matcherIn[i]=elem);postFinder(null,matcherOut=[],temp,xml)}
for(i=matcherOut.length;i--;)(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),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(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,!0),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));return checkContext=null,ret}];i<len;i++)if(matcher=Expr.relative[tokens[i].type])matchers=[addCombinator(elementMatcher(matchers),matcher)];else{if(matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches),matcher[expando]){for(j=++i;j<len&&!Expr.relative[tokens[j].type];j++);return 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))}matchers.push(matcher)}return elementMatcher(matchers)}function 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+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context===document||context||outermost);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0,context||elem.ownerDocument===document||(setDocument(elem),xml=!documentIsHTML);matcher=elementMatchers[j++];)if(matcher(elem,context||document,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}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){return a===b&&(hasDuplicate=!0),0},hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){for(var i=0,len=list.length;i<len;i++)if(list[i]===elem)return i;return-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-]|[^\0-\\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)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){return asCodePoint?"\0"===ch?"�":ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ":"\\"+ch},unloadHandler=function(){setDocument()},disabledAncestor=addCombinator(function(elem){return!0===elem.disabled&&("form"in elem||"label"in elem)},{dir:"parentNode",next:"legend"});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){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=document.documentElement,documentIsHTML=!isXML(document),preferredDoc!==document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow&&(subWindow.addEventListener?subWindow.addEventListener("unload",unloadHandler,!1):subWindow.attachEvent&&subWindow.attachEvent("onunload",unloadHandler)),support.attributes=assert(function(el){return el.className="i",!el.getAttribute("className")}),support.getElementsByTagName=assert(function(el){return el.appendChild(document.createComment("")),!el.getElementsByTagName("*").length}),support.getElementsByClassName=rnative.test(document.getElementsByClassName),support.getById=assert(function(el){return docElem.appendChild(el).id=expando,!document.getElementsByName||!document.getElementsByName(expando).length}),support.getById?(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}},Expr.find.ID=function(id,context){if(void 0!==context.getElementById&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[]}}):(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=void 0!==elem.getAttributeNode&&elem.getAttributeNode("id");return node&&node.value===attrId}},Expr.find.ID=function(id,context){if(void 0!==context.getElementById&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){if((node=elem.getAttributeNode("id"))&&node.value===id)return[elem];for(elems=context.getElementsByName(id),i=0;elem=elems[i++];)if((node=elem.getAttributeNode("id"))&&node.value===id)return[elem]}return[]}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){return void 0!==context.getElementsByTagName?context.getElementsByTagName(tag):support.qsa?context.querySelectorAll(tag):void 0}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){if(void 0!==context.getElementsByClassName&&documentIsHTML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(document.querySelectorAll))&&(assert(function(el){docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a><select id='"+expando+"-\r\\' msallowcapture=''><option selected=''></option></select>",el.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),el.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),el.querySelectorAll("[id~="+expando+"-]").length||rbuggyQSA.push("~="),el.querySelectorAll(":checked").length||rbuggyQSA.push(":checked"),el.querySelectorAll("a#"+expando+"+*").length||rbuggyQSA.push(".#.+[+~]")}),assert(function(el){el.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden"),el.appendChild(input).setAttribute("name","D"),el.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),2!==el.querySelectorAll(":enabled").length&&rbuggyQSA.push(":enabled",":disabled"),docElem.appendChild(el).disabled=!0,2!==el.querySelectorAll(":disabled").length&&rbuggyQSA.push(":enabled",":disabled"),el.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(el){support.disconnectedMatch=matches.call(el,"*"),matches.call(el,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=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=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare||(compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&compare||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)?-1:b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var 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;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),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&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!==document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):void 0;return void 0!==val?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape)},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}: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("string"==typeof elem.className&&elem.className||void 0!==elem.getAttribute&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===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+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?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=!1;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(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];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++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),!1===diff)for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&(outerCache=node[expando]||(node[expando]={}),uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={}),uniqueCache[type]=[dirruns,diff]),node!==elem)););return(diff-=last)===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);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),input[0]=null,!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return(elemLang=elemLang.toLowerCase())===lang||0===elemLang.indexOf(lang+"-")}while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),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:createDisabledPseudo(!1),disabled:createDisabledPseudo(!0),checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,!0===elem.selected},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},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"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},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){for(var i=0;i<length;i+=2)matchIndexes.push(i);return matchIndexes}),odd:createPositionalPseudo(function(matchIndexes,length){for(var i=1;i<length;i+=2)matchIndexes.push(i);return matchIndexes}),lt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;--i>=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i<length;)matchIndexes.push(i);return matchIndexes})}},Expr.pseudos.nth=Expr.pseudos.eq;for(i in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Expr.pseudos[i]=function(type){return function(elem){return"input"===elem.nodeName.toLowerCase()&&elem.type===type}}(i);for(i in{submit:!0,reset:!0})Expr.pseudos[i]=function(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}(i);return setFilters.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);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(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));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)},compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){for(match||(match=tokenize(selector)),i=match.length;i--;)cached=matcherFromTokens(match[i]),cached[expando]?setMatchers.push(cached):elementMatchers.push(cached);cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers)),cached.selector=selector}return cached},select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled="function"==typeof selector&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);if(results=results||[],1===match.length){if(tokens=match[0]=match[0].slice(0),tokens.length>2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(!(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0]))return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),!(selector=seed.length&&toSelector(tokens)))return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert(function(el){return 1&el.compareDocumentPosition(document.createElement("fieldset"))}),assert(function(el){return el.innerHTML="<a href='#'></a>","#"===el.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML)return elem.getAttribute(name,"type"===name.toLowerCase()?1:2)}),support.attributes&&assert(function(el){return el.innerHTML="<input/>",el.firstChild.setAttribute("value",""),""===el.firstChild.getAttribute("value")})||addHandle("value",function(elem,name,isXML){if(!isXML&&"input"===elem.nodeName.toLowerCase())return elem.defaultValue}),assert(function(el){return null==el.getAttribute("disabled")})||addHandle(booleans,function(elem,name,isXML){var val;if(!isXML)return!0===elem[name]?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}),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,jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){for(var matched=[],truncate=void 0!==until;(elem=elem[dir])&&9!==elem.nodeType;)if(1===elem.nodeType){if(truncate&&jQuery(elem).is(until))break;matched.push(elem)}return matched},siblings=function(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched},rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;jQuery.filter=function(expr,elems,not){var elem=elems[0];return not&&(expr=":not("+expr+")"),1===elems.length&&1===elem.nodeType?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return 1===elem.nodeType}))},jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if("string"!=typeof selector)return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++)if(jQuery.contains(self[i],this))return!0}));for(ret=this.pushStack([]),i=0;i<len;i++)jQuery.find(selector,self[i],ret);return len>1?jQuery.uniqueSort(ret):ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,"string"==typeof selector&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector)return this;if(root=root||rootjQuery,"string"==typeof selector){if(!(match="<"===selector[0]&&">"===selector[selector.length-1]&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector))||!match[1]&&context)return!context||context.jquery?(context||root).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}return elem=document.getElementById(match[2]),elem&&(this[0]=elem,this.length=1),this}return selector.nodeType?(this[0]=selector,this.length=1,this):isFunction(selector)?void 0!==root.ready?root.ready(selector):selector(jQuery):jQuery.makeArray(selector,this)}).prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){for(var i=0;i<l;i++)if(jQuery.contains(this,targets[i]))return!0})},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets="string"!=typeof selectors&&jQuery(selectors);if(!rneedsContext.test(selectors))for(;i<l;i++)for(cur=this[i];cur&&cur!==context;cur=cur.parentNode)if(cur.nodeType<11&&(targets?targets.index(cur)>-1:1===cur.nodeType&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched)},index:function(elem){return elem?"string"==typeof elem?indexOf.call(jQuery(elem),this[0]):indexOf.call(this,elem.jquery?elem[0]:elem):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?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 nodeName(elem,"iframe")?elem.contentDocument:(nodeName(elem,"template")&&(elem=elem.content||elem),jQuery.merge([],elem.childNodes))}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);return"Until"!==name.slice(-5)&&(selector=until),selector&&"string"==typeof selector&&(matched=jQuery.filter(selector,matched)),this.length>1&&(guaranteedUnique[name]||jQuery.uniqueSort(matched),rparentsprev.test(name)&&matched.reverse()),this.pushStack(matched)}});var rnothtmlwhite=/[^\x20\t\r\n\f]+/g;jQuery.Callbacks=function(options){options="string"==typeof options?createOptions(options):jQuery.extend({},options);var firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){for(locked=locked||options.once,fired=firing=!0;queue.length;firingIndex=-1)for(memory=queue.shift();++firingIndex<list.length;)!1===list[firingIndex].apply(memory[0],memory[1])&&options.stopOnFalse&&(firingIndex=list.length,memory=!1);options.memory||(memory=!1),firing=!1,locked&&(list=memory?[]:"")},self={add:function(){return list&&(memory&&!firing&&(firingIndex=list.length-1,queue.push(memory)),function add(args){jQuery.each(args,function(_,arg){isFunction(arg)?options.unique&&self.has(arg)||list.push(arg):arg&&arg.length&&"string"!==toType(arg)&&add(arg)})}(arguments),memory&&!firing&&fire()),this},remove:function(){return jQuery.each(arguments,function(_,arg){for(var index;(index=jQuery.inArray(arg,list,index))>-1;)list.splice(index,1),index<=firingIndex&&firingIndex--}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},empty:function(){return list&&(list=[]),this},disable:function(){return locked=queue=[],list=memory="",this},disabled:function(){return!list},lock:function(){return locked=queue=[],memory||firing||(list=memory=""),this},locked:function(){return!!locked},fireWith:function(context,args){return locked||(args=args||[],args=[context,args.slice?args.slice():args],queue.push(args),firing||fire()),this},fire:function(){
return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},catch:function(fn){return promise.then(null,fn)},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&isFunction(returned.promise)?returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject):newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)})}),fns=null}).promise()},then:function(onFulfilled,onRejected,onProgress){function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(!(depth<maxDepth)){if((returned=handler.apply(that,args))===deferred.promise())throw new TypeError("Thenable self-resolution");then=returned&&("object"==typeof returned||"function"==typeof returned)&&returned.then,isFunction(then)?special?then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special)):(maxDepth++,then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith))):(handler!==Identity&&(that=void 0,args=[returned]),(special||deferred.resolveWith)(that,args))}},process=special?mightThrow:function(){try{mightThrow()}catch(e){jQuery.Deferred.exceptionHook&&jQuery.Deferred.exceptionHook(e,process.stackTrace),depth+1>=maxDepth&&(handler!==Thrower&&(that=void 0,args=[e]),deferred.rejectWith(that,args))}};depth?process():(jQuery.Deferred.getStackHook&&(process.stackTrace=jQuery.Deferred.getStackHook()),window.setTimeout(process))}}var maxDepth=0;return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith)),tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity)),tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower))}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock),list.add(tuple[3].fire),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?void 0:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(singleValue){var remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this,resolveValues[i]=arguments.length>1?slice.call(arguments):value,--remaining||master.resolveWith(resolveContexts,resolveValues)}};if(remaining<=1&&(adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject,!remaining),"pending"===master.state()||isFunction(resolveValues[i]&&resolveValues[i].then)))return master.then();for(;i--;)adoptValue(resolveValues[i],updateFunc(i),master.reject);return master.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){window.console&&window.console.warn&&error&&rerrorNames.test(error.name)&&window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack)},jQuery.readyException=function(error){window.setTimeout(function(){throw error})};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){return readyList.then(fn).catch(function(error){jQuery.readyException(error)}),this},jQuery.extend({isReady:!1,readyWait:1,ready:function(wait){(!0===wait?--jQuery.readyWait:jQuery.isReady)||(jQuery.isReady=!0,!0!==wait&&--jQuery.readyWait>0||readyList.resolveWith(document,[jQuery]))}}),jQuery.ready.then=readyList.then,"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed));var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=null==key;if("object"===toType(key)){chainable=!0;for(i in key)access(elems,fn,i,key[i],!0,emptyGet,raw)}else if(void 0!==value&&(chainable=!0,isFunction(value)||(raw=!0),bulk&&(raw?(fn.call(elems,value),fn=null):(bulk=fn,fn=function(elem,key,value){return bulk.call(jQuery(elem),value)})),fn))for(;i<len;i++)fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet},rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g,acceptData=function(owner){return 1===owner.nodeType||9===owner.nodeType||!+owner.nodeType};Data.uid=1,Data.prototype={cache:function(owner){var value=owner[this.expando];return value||(value={},acceptData(owner)&&(owner.nodeType?owner[this.expando]=value:Object.defineProperty(owner,this.expando,{value:value,configurable:!0}))),value},set:function(owner,data,value){var prop,cache=this.cache(owner);if("string"==typeof data)cache[camelCase(data)]=value;else for(prop in data)cache[camelCase(prop)]=data[prop];return cache},get:function(owner,key){return void 0===key?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)]},access:function(owner,key,value){return void 0===key||key&&"string"==typeof key&&void 0===value?this.get(owner,key):(this.set(owner,key,value),void 0!==value?value:key)},remove:function(owner,key){var i,cache=owner[this.expando];if(void 0!==cache){if(void 0!==key){Array.isArray(key)?key=key.map(camelCase):(key=camelCase(key),key=key in cache?[key]:key.match(rnothtmlwhite)||[]),i=key.length;for(;i--;)delete cache[key[i]]}(void 0===key||jQuery.isEmptyObject(cache))&&(owner.nodeType?owner[this.expando]=void 0:delete owner[this.expando])}},hasData:function(owner){var cache=owner[this.expando];return void 0!==cache&&!jQuery.isEmptyObject(cache)}};var dataPriv=new Data,dataUser=new Data,rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;jQuery.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(void 0===key){if(this.length&&(data=dataUser.get(elem),1===elem.nodeType&&!dataPriv.get(elem,"hasDataAttrs"))){for(i=attrs.length;i--;)attrs[i]&&(name=attrs[i].name,0===name.indexOf("data-")&&(name=camelCase(name.slice(5)),dataAttr(elem,name,data[name])));dataPriv.set(elem,"hasDataAttrs",!0)}return data}return"object"==typeof key?this.each(function(){dataUser.set(this,key)}):access(this,function(value){var data;if(elem&&void 0===value){if(void 0!==(data=dataUser.get(elem,key)))return data;if(void 0!==(data=dataAttr(elem,key)))return data}else this.each(function(){dataUser.set(this,key,value)})},null,value,arguments.length>1,null,!0)},removeData:function(key){return this.each(function(){dataUser.remove(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=dataPriv.get(elem,type),data&&(!queue||Array.isArray(data)?queue=dataPriv.access(elem,type,jQuery.makeArray(data)):queue.push(data)),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)};"inprogress"===fn&&(fn=queue.shift(),startLength--),fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!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;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length<setter?jQuery.queue(this[0],type):void 0===data?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type),"fx"===type&&"inprogress"!==queue[0]&&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(){--count||defer.resolveWith(elements,[elements])};for("string"!=typeof type&&(obj=type,type=void 0),type=type||"fx";i--;)(tmp=dataPriv.get(elements[i],type+"queueHooks"))&&tmp.empty&&(count++,tmp.empty.add(resolve));return resolve(),defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),cssExpand=["Top","Right","Bottom","Left"],isHiddenWithinTree=function(elem,el){return elem=el||elem,"none"===elem.style.display||""===elem.style.display&&jQuery.contains(elem.ownerDocument,elem)&&"none"===jQuery.css(elem,"display")},swap=function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret},defaultDisplayMap={};jQuery.fn.extend({show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){return"boolean"==typeof state?state?this.show():this.hide():this.each(function(){isHiddenWithinTree(this)?jQuery(this).show():jQuery(this).hide()})}});var rcheckableType=/^(?:checkbox|radio)$/i,rtagName=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,rscriptType=/^$|^module$|\/(?:java|ecma)script/i,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;var rhtml=/<|&#?\w+;/;!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(!0).cloneNode(!0).lastChild.checked,div.innerHTML="<textarea>x</textarea>",support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue}();var documentElement=document.documentElement,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;jQuery.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)for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),selector&&jQuery.find.matchesSelector(documentElement,selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return void 0!==jQuery&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):void 0}),types=(types||"").match(rnothtmlwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type&&(special=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),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&!1!==special.setup.call(elem,data,namespaces,eventHandle)||elem.addEventListener&&elem.addEventListener(type,eventHandle)),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0)},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)){for(types=(types||"").match(rnothtmlwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=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;j--;)handleObj=handlers[j],!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),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&!1!==special.teardown.call(elem,namespaces,elemData.handle)||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&dataPriv.remove(elem,"handle events")}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,event=jQuery.event.fix(nativeEvent),args=new Array(arguments.length),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};for(args[0]=event,i=1;i<arguments.length;i++)args[i]=arguments[i];if(event.delegateTarget=this,!special.preDispatch||!1!==special.preDispatch.call(this,event)){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)event.rnamespace&&!event.rnamespace.test(handleObj.namespace)||(event.handleObj=handleObj,event.data=handleObj.data,void 0!==(ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args))&&!1===(event.result=ret)&&(event.preventDefault(),event.stopPropagation()));return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!("click"===event.type&&event.button>=1))for(;cur!==this;cur=cur.parentNode||this)if(1===cur.nodeType&&("click"!==event.type||!0!==cur.disabled)){for(matchedHandlers=[],matchedSelectors={},i=0;i<delegateCount;i++)handleObj=handlers[i],sel=handleObj.selector+" ",void 0===matchedSelectors[sel]&&(matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length),matchedSelectors[sel]&&matchedHandlers.push(handleObj);matchedHandlers.length&&handlerQueue.push({elem:cur,handlers:matchedHandlers})}return cur=this,delegateCount<handlers.length&&handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)}),handlerQueue},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:!0,configurable:!0,get:isFunction(hook)?function(){if(this.originalEvent)return hook(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[name]},set:function(value){Object.defineProperty(this,name,{enumerable:!0,configurable:!0,writable:!0,value:value})}})},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&nodeName(this,"input"))return this.click(),!1},_default:function(event){return nodeName(event.target,"a")}},beforeunload:{postDispatch:function(event){void 0!==event.result&&event.originalEvent&&(event.originalEvent.returnValue=event.result)}}}},jQuery.removeEvent=function(elem,type,handle){elem.removeEventListener&&elem.removeEventListener(type,handle)},jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event))return new jQuery.Event(src,props);src&&src.type?(this.originalEvent=src,this.type=src.type,this.isDefaultPrevented=src.defaultPrevented||void 0===src.defaultPrevented&&!1===src.returnValue?returnTrue:returnFalse,this.target=src.target&&3===src.target.nodeType?src.target.parentNode:src.target,this.currentTarget=src.currentTarget,this.relatedTarget=src.relatedTarget):this.type=src,props&&jQuery.extend(this,props),this.timeStamp=src&&src.timeStamp||Date.now(),this[jQuery.expando]=!0},jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},jQuery.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(event){var button=event.button;return null==event.which&&rkeyEvent.test(event.type)?null!=event.charCode?event.charCode:event.keyCode:!event.which&&void 0!==button&&rmouseEvent.test(event.type)?1&button?1:2&button?3:4&button?2:0:event.which}},jQuery.event.addProp),jQuery.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;return related&&(related===target||jQuery.contains(target,related))||(event.type=handleObj.origType,ret=handleObj.handler.apply(this,arguments),event.type=fix),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)return handleObj=types.handleObj,jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler),this;if("object"==typeof types){for(type in types)this.off(type,selector,types[type]);return this}return!1!==selector&&"function"!=typeof selector||(fn=selector,selector=void 0),!1===fn&&(fn=returnFalse),this.each(function(){jQuery.event.remove(this,types,fn,selector)})}});var rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;jQuery.extend({htmlPrefilter:function(html){return html.replace(rxhtmlTag,"<$1></$2>")},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(!0),inPage=jQuery.contains(elem.ownerDocument,elem);if(!(support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0,l=srcElements.length;i<l;i++)fixInput(srcElements[i],destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0,l=srcElements.length;i<l;i++)cloneCopyEvent(srcElements[i],destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),clone},cleanData:function(elems){for(var data,elem,type,special=jQuery.event.special,i=0;void 0!==(elem=elems[i]);i++)if(acceptData(elem)){if(data=elem[dataPriv.expando]){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);elem[dataPriv.expando]=void 0}elem[dataUser.expando]&&(elem[dataUser.expando]=void 0)}}}),jQuery.fn.extend({detach:function(selector){return remove(this,selector,!0)},remove:function(selector){return remove(this,selector)},text:function(value){return access(this,function(value){return void 0===value?jQuery.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=value)})},null,value,arguments.length)},append:function(){return domManip(this,arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){manipulationTarget(this,elem).appendChild(elem)}})},prepend:function(){return domManip(this,arguments,function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}})},before:function(){return domManip(this,arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return domManip(this,arguments,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++)1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.textContent="");return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,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(void 0===value&&1===elem.nodeType)return elem.innerHTML;if("string"==typeof value&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++)elem=this[i]||{},1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.innerHTML=value);elem=0}catch(e){}}elem&&this.empty().append(value)},null,value,arguments.length)},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;jQuery.inArray(this,ignored)<0&&(jQuery.cleanData(getAll(this)),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){for(var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;i<=last;i++)elems=i===last?this:this.clone(!0),jQuery(insert[i])[original](elems),push.apply(ret,elems.get());return this.pushStack(ret)}});var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i"),getStyles=function(elem){var view=elem.ownerDocument.defaultView;return view&&view.opener||(view=window),view.getComputedStyle(elem)},rboxStyle=new RegExp(cssExpand.join("|"),"i");!function(){function computeStyleTests(){if(div){container.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal="1%"!==divStyle.top,reliableMarginLeftVal=12===roundPixelMeasures(divStyle.marginLeft),div.style.right="60%",pixelBoxStylesVal=36===roundPixelMeasures(divStyle.right),boxSizingReliableVal=36===roundPixelMeasures(divStyle.width),div.style.position="absolute",scrollboxSizeVal=36===div.offsetWidth||"absolute",documentElement.removeChild(container),div=null}}function roundPixelMeasures(measure){return Math.round(parseFloat(measure))}var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");div.style&&(div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery.extend(support,{boxSizingReliable:function(){return computeStyleTests(),boxSizingReliableVal},pixelBoxStyles:function(){return computeStyleTests(),pixelBoxStylesVal},pixelPosition:function(){return computeStyleTests(),pixelPositionVal},reliableMarginLeft:function(){return computeStyleTests(),reliableMarginLeftVal},scrollboxSize:function(){return computeStyleTests(),scrollboxSizeVal}}))}();var rdisplayswap=/^(none|table(?!-c[ea]).+)/,rcustomProp=/^--/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style;jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(isCustomProp||(name=finalPropName(origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],void 0===value)return hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,!1,extra))?ret:style[name];type=typeof value,"string"===type&&(ret=rcssNum.exec(value))&&ret[1]&&(value=adjustCSS(elem,name,ret),type="number"),null!=value&&value===value&&("number"===type&&(value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px")),support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&void 0===(value=hooks.set(elem,value,extra))||(isCustomProp?style.setProperty(name,value):style[name]=value))}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name);return rcustomProp.test(name)||(name=finalPropName(origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),void 0===val&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),!0===extra||isFinite(num)?num||0:val):val}}),jQuery.each(["height","width"],function(i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed)return!rdisplayswap.test(jQuery.css(elem,"display"))||elem.getClientRects().length&&elem.getBoundingClientRect().width?getWidthOrHeight(elem,dimension,extra):swap(elem,cssShow,function(){return getWidthOrHeight(elem,dimension,extra)})},set:function(elem,value,extra){var matches,styles=getStyles(elem),isBorderBox="border-box"===jQuery.css(elem,"boxSizing",!1,styles),subtract=extra&&boxModelAdjustment(elem,dimension,extra,isBorderBox,styles);return isBorderBox&&support.scrollboxSize()===styles.position&&(subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-parseFloat(styles[dimension])-boxModelAdjustment(elem,dimension,"border",!1,styles)-.5)),subtract&&(matches=rcssNum.exec(value))&&"px"!==(matches[3]||"px")&&(elem.style[dimension]=value,value=jQuery.css(elem,dimension)),setPositiveNumber(elem,value,subtract)}}}),jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed)return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left}))+"px"}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},"margin"!==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(Array.isArray(name)){for(styles=getStyles(elem),len=name.length;i<len;i++)map[name[i]]=jQuery.css(elem,name[i],!1,styles);return map}return void 0!==value?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)}}),jQuery.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];return this.options.duration?this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration):this.pos=eased=percent,this.now=(this.end-this.start)*eased+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),hooks&&hooks.set?hooks.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(tween){var result;return 1!==tween.elem.nodeType||null!=tween.elem[tween.prop]&&null==tween.elem.style[tween.prop]?tween.elem[tween.prop]:(result=jQuery.css(tween.elem,tween.prop,""),result&&"auto"!==result?result:0)},set:function(tween){jQuery.fx.step[tween.prop]?jQuery.fx.step[tween.prop](tween):1!==tween.elem.nodeType||null==tween.elem.style[jQuery.cssProps[tween.prop]]&&!jQuery.cssHooks[tween.prop]?tween.elem[tween.prop]=tween.now:jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){tween.elem.nodeType&&tween.elem.parentNode&&(tween.elem[tween.prop]=tween.now)}},jQuery.easing={linear:function(p){return p},swing:function(p){
return.5-Math.cos(p*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);return adjustCSS(tween.elem,prop,rcssNum.exec(value),tween),tween}]},tweener:function(props,callback){isFunction(props)?(callback=props,props=["*"]):props=props.match(rnothtmlwhite);for(var prop,index=0,length=props.length;index<length;index++)prop=props[index],Animation.tweeners[prop]=Animation.tweeners[prop]||[],Animation.tweeners[prop].unshift(callback)},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){prepend?Animation.prefilters.unshift(callback):Animation.prefilters.push(callback)}}),jQuery.speed=function(speed,easing,fn){var opt=speed&&"object"==typeof speed?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};return jQuery.fx.off?opt.duration=0:"number"!=typeof opt.duration&&(opt.duration in jQuery.fx.speeds?opt.duration=jQuery.fx.speeds[opt.duration]:opt.duration=jQuery.fx.speeds._default),null!=opt.queue&&!0!==opt.queue||(opt.queue="fx"),opt.old=opt.complete,opt.complete=function(){isFunction(opt.old)&&opt.old.call(this),opt.queue&&jQuery.dequeue(this,opt.queue)},opt},jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).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);(empty||dataPriv.get(this,"finish"))&&anim.stop(!0)};return doAnimation.finish=doAnimation,empty||!1===optall.queue?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)};return"string"!=typeof type&&(gotoEnd=clearQueue,clearQueue=type,type=void 0),clearQueue&&!1!==type&&this.queue(type||"fx",[]),this.each(function(){var dequeue=!0,index=null!=type&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index)data[index]&&data[index].stop&&stopQueue(data[index]);else for(index in data)data[index]&&data[index].stop&&rrun.test(index)&&stopQueue(data[index]);for(index=timers.length;index--;)timers[index].elem!==this||null!=type&&timers[index].queue!==type||(timers[index].anim.stop(gotoEnd),dequeue=!1,timers.splice(index,1));!dequeue&&gotoEnd||jQuery.dequeue(this,type)})},finish:function(type){return!1!==type&&(type=type||"fx"),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;for(data.finish=!0,jQuery.queue(this,type,[]),hooks&&hooks.stop&&hooks.stop.call(this,!0),index=timers.length;index--;)timers[index].elem===this&&timers[index].queue===type&&(timers[index].anim.stop(!0),timers.splice(index,1));for(index=0;index<length;index++)queue[index]&&queue[index].finish&&queue[index].finish.call(this);delete data.finish})}}),jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return null==speed||"boolean"==typeof speed?cssFn.apply(this,arguments):this.animate(genFx(name,!0),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;for(fxNow=Date.now();i<timers.length;i++)(timer=timers[i])()||timers[i]!==timer||timers.splice(i--,1);timers.length||jQuery.fx.stop(),fxNow=void 0},jQuery.fx.timer=function(timer){jQuery.timers.push(timer),jQuery.fx.start()},jQuery.fx.interval=13,jQuery.fx.start=function(){inProgress||(inProgress=!0,schedule())},jQuery.fx.stop=function(){inProgress=null},jQuery.fx.speeds={slow:600,fast:200,_default:400},jQuery.fn.delay=function(time,type){return time=jQuery.fx?jQuery.fx.speeds[time]||time:time,type=type||"fx",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,input=document.createElement("input"),input.value="t",input.type="radio",support.radioValue="t"===input.value}();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(3!==nType&&8!==nType&&2!==nType)return void 0===elem.getAttribute?jQuery.prop(elem,name,value):(1===nType&&jQuery.isXMLDoc(elem)||(hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:void 0)),void 0!==value?null===value?void jQuery.removeAttr(elem,name):hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:(elem.setAttribute(name,value+""),value):hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(ret=jQuery.find.attr(elem,name),null==ret?void 0:ret))},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&"radio"===value&&nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)elem.removeAttribute(name)}}),boolHook={set:function(elem,value,name){return!1===value?jQuery.removeAttr(elem,name):elem.setAttribute(name,name),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,lowercaseName=name.toLowerCase();return isXML||(handle=attrHandle[lowercaseName],attrHandle[lowercaseName]=ret,ret=null!=getter(elem,name,isXML)?lowercaseName:null,attrHandle[lowercaseName]=handle),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(3!==nType&&8!==nType&&2!==nType)return 1===nType&&jQuery.isXMLDoc(elem)||(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),void 0!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret: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"}}),support.optSelected||(jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;return parent&&parent.parentNode&&parent.parentNode.selectedIndex,null},set:function(elem){var parent=elem.parentNode;parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this}),jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)))});if(classes=classesToArray(value),classes.length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)cur.indexOf(" "+clazz+" ")<0&&(cur+=clazz+" ");finalValue=stripAndCollapse(cur),curValue!==finalValue&&elem.setAttribute("class",finalValue)}return this},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))});if(!arguments.length)return this.attr("class","");if(classes=classesToArray(value),classes.length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)for(;cur.indexOf(" "+clazz+" ")>-1;)cur=cur.replace(" "+clazz+" "," ");finalValue=stripAndCollapse(cur),curValue!==finalValue&&elem.setAttribute("class",finalValue)}return this},toggleClass:function(value,stateVal){var type=typeof value,isValidValue="string"===type||Array.isArray(value);return"boolean"==typeof stateVal&&isValidValue?stateVal?this.addClass(value):this.removeClass(value):isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)}):this.each(function(){var className,i,self,classNames;if(isValidValue)for(i=0,self=jQuery(this),classNames=classesToArray(value);className=classNames[i++];)self.hasClass(className)?self.removeClass(className):self.addClass(className);else void 0!==value&&"boolean"!==type||(className=getClass(this),className&&dataPriv.set(this,"__className__",className),this.setAttribute&&this.setAttribute("class",className||!1===value?"":dataPriv.get(this,"__className__")||""))})},hasClass:function(selector){var className,elem,i=0;for(className=" "+selector+" ";elem=this[i++];)if(1===elem.nodeType&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1)return!0;return!1}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];{if(arguments.length)return valueIsFunction=isFunction(value),this.each(function(i){var val;1===this.nodeType&&(val=valueIsFunction?value.call(this,i,jQuery(this).val()):value,null==val?val="":"number"==typeof val?val+="":Array.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),(hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()])&&"set"in hooks&&void 0!==hooks.set(this,val,"value")||(this.value=val))});if(elem)return(hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()])&&"get"in hooks&&void 0!==(ret=hooks.get(elem,"value"))?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return null!=val?val:stripAndCollapse(jQuery.text(elem))}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type,values=one?null:[],max=one?index+1:options.length;for(i=index<0?max:one?index:0;i<max;i++)if(option=options[i],(option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){if(value=jQuery(option).val(),one)return value;values.push(value)}return values},set:function(elem,value){for(var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;i--;)option=options[i],(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1)&&(optionSet=!0);return optionSet||(elem.selectedIndex=-1),values}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(elem){return null===elem.getAttribute("value")?"on":elem.value})}),support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation()};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=lastElement=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>-1&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=onlyHandlers?2:3,event.namespace=namespaces.join("."),event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=void 0,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||!1!==special.trigger.apply(elem,data))){if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)lastElement=cur,event.type=i>1?bubbleType:special.bindType||type,handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle"),handle&&handle.apply(cur,data),(handle=ontype&&cur[ontype])&&handle.apply&&acceptData(cur)&&(event.result=handle.apply(cur,data),!1===event.result&&event.preventDefault());return event.type=type,onlyHandlers||event.isDefaultPrevented()||special._default&&!1!==special._default.apply(eventPath.pop(),data)||!acceptData(elem)||ontype&&isFunction(elem[type])&&!isWindow(elem)&&(tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type,event.isPropagationStopped()&&lastElement.addEventListener(type,stopPropagationCallback),elem[type](),event.isPropagationStopped()&&lastElement.removeEventListener(type,stopPropagationCallback),jQuery.event.triggered=void 0,tmp&&(elem[ontype]=tmp)),event.result}},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:!0});jQuery.event.trigger(e,null,elem)}}),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,!0)}}),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);attaches||doc.addEventListener(orig,handler,!0),dataPriv.access(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;attaches?dataPriv.access(doc,fix,attaches):(doc.removeEventListener(orig,handler,!0),dataPriv.remove(doc,fix))}}});var location=window.location,nonce=Date.now(),rquery=/\?/;jQuery.parseXML=function(data){var xml;if(!data||"string"!=typeof data)return null;try{xml=(new window.DOMParser).parseFromString(data,"text/xml")}catch(e){xml=void 0}return xml&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml};var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(null==value?"":value)};if(Array.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);return s.join("&")},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}).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 null==val?null:Array.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()}});var r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,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,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,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":!0,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},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){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;completed||(completed=!0,timeoutTimer&&window.clearTimeout(timeoutTimer),transport=void 0,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,isSuccess=status>=200&&status<300||304===status,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),response=ajaxConvert(s,response,jqXHR,isSuccess),isSuccess?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),(modified=jqXHR.getResponseHeader("etag"))&&(jQuery.etag[cacheURL]=modified)),204===status||"HEAD"===s.type?statusText="nocontent":304===status?statusText="notmodified":(statusText=response.state,success=response.data,error=response.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=void 0,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=void 0),options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,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={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return completed?responseHeadersString:null},setRequestHeader:function(name,value){return null==completed&&(name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return null==completed&&(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(completed)jqXHR.always(map[jqXHR.status]);else for(code in map)statusCode[code]=[statusCode[code],map[code]];return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR),s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""],null==s.crossDomain){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=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),completed)return jqXHR;fireGlobals=jQuery.event&&s.global,fireGlobals&&0==jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url.replace(rhash,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(r20,"+")):(uncached=s.url.slice(cacheURL.length),s.data&&(s.processData||"string"==typeof s.data)&&(cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),!1===s.cache&&(cacheURL=cacheURL.replace(rantiCache,"$1"),uncached=(rquery.test(cacheURL)?"&":"?")+"_="+nonce+++uncached),s.url=cacheURL+uncached),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&!1!==s.contentType||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(!1===s.beforeSend.call(callbackContext,jqXHR,s)||completed))return jqXHR.abort();if(strAbort="abort",completeDeferred.add(s.complete),jqXHR.done(s.success),jqXHR.fail(s.error),transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){if(jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),completed)return jqXHR;s.async&&s.timeout>0&&(timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{completed=!1,transport.send(requestHeaders,done)}catch(e){if(completed)throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,void 0,callback,"script")}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return isFunction(data)&&(type=type||callback,callback=data,data=void 0),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",cache:!0,async:!1,global:!1,throws:!0})},jQuery.fn.extend({wrapAll:function(html){var wrap;return this[0]&&(isFunction(html)&&(html=html.call(this[0])),wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstElementChild;)elem=elem.firstElementChild;return elem}).append(this)),this},wrapInner:function(html){return isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html)})},unwrap:function(selector){return this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes)}),this}}),jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)},jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)},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();if(xhr.open(options.type,options.url,options.async,options.username,options.password),options.xhrFields)for(i in options.xhrFields)xhr[i]=options.xhrFields[i];options.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(options.mimeType),options.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");for(i in headers)xhr.setRequestHeader(i,headers[i]);callback=function(type){return function(){callback&&(callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null,"abort"===type?xhr.abort():"error"===type?"number"!=typeof xhr.status?complete(0,"error"):complete(xhr.status,xhr.statusText):complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,"text"!==(xhr.responseType||"text")||"string"!=typeof xhr.responseText?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders()))}},xhr.onload=callback(),errorCallback=xhr.onerror=xhr.ontimeout=callback("error"),void 0!==xhr.onabort?xhr.onabort=errorCallback:xhr.onreadystatechange=function(){4===xhr.readyState&&window.setTimeout(function(){callback&&errorCallback()})},callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback)throw e}},abort:function(){callback&&callback()}}}),jQuery.ajaxPrefilter(function(s){s.crossDomain&&(s.contents.script=!1)}),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){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){void 0===s.cache&&(s.cache=!1),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,evt&&complete("error"===evt.type?404:200,evt.type)}),document.head.appendChild(script[0])},abort:function(){callback&&callback()}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=!1!==s.jsonp&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):!1!==s.jsonp&&(s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){void 0===overwritten?jQuery(window).removeProp(callbackName):window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=void 0}),"script"}),support.createHTMLDocument=function(){var body=document.implementation.createHTMLDocument("").body;return body.innerHTML="<form></form><form></form>",2===body.childNodes.length}(),jQuery.parseHTML=function(data,context,keepScripts){if("string"!=typeof data)return[];"boolean"==typeof context&&(keepScripts=context,context=!1);var base,parsed,scripts;return context||(support.createHTMLDocument?(context=document.implementation.createHTMLDocument(""),base=context.createElement("base"),base.href=document.location.href,context.head.appendChild(base)):context=document),parsed=rsingleTag.exec(data),scripts=!keepScripts&&[],parsed?[context.createElement(parsed[1])]:(parsed=buildFragment([data],context,scripts),scripts&&scripts.length&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))},jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");return off>-1&&(selector=stripAndCollapse(url.slice(off)),url=url.slice(0,off)),isFunction(params)?(callback=params,params=void 0):params&&"object"==typeof params&&(type="POST"),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(this,response||[jqXHR.responseText,status,jqXHR])})}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length},jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};"static"===position&&(elem.style.position="relative"),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=("absolute"===position||"fixed"===position)&&(curCSSTop+curCSSLeft).indexOf("auto")>-1,calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),isFunction(options)&&(options=options.call(elem,i,jQuery.extend({},curOffset))),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({offset:function(options){if(arguments.length)return void 0===options?this:this.each(function(i){jQuery.offset.setOffset(this,options,i)})
;var rect,win,elem=this[0];if(elem)return elem.getClientRects().length?(rect=elem.getBoundingClientRect(),win=elem.ownerDocument.defaultView,{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if("fixed"===jQuery.css(elem,"position"))offset=elem.getBoundingClientRect();else{for(offset=this.offset(),doc=elem.ownerDocument,offsetParent=elem.offsetParent||doc.documentElement;offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.parentNode;offsetParent&&offsetParent!==elem&&1===offsetParent.nodeType&&(parentOffset=jQuery(offsetParent).offset(),parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",!0))}return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent;offsetParent&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return 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;if(isWindow(elem)?win=elem:9===elem.nodeType&&(win=elem.defaultView),void 0===val)return win?win[prop]:elem[method];win?win.scrollTo(top?win.pageXOffset:val,top?val:win.pageYOffset):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)return computed=curCSS(elem,prop),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||"boolean"!=typeof margin),extra=defaultExtra||(!0===margin||!0===value?"margin":"border");return access(this,function(elem,type,value){var doc;return isWindow(elem)?0===funcName.indexOf("outer")?elem["inner"+name]:elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):void 0===value?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:void 0,chainable)}})}),jQuery.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup 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)}}),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 1===arguments.length?this.off(selector,"**"):this.off(types,selector||"**",fn)}}),jQuery.proxy=function(fn,context){var tmp,args,proxy;if("string"==typeof context&&(tmp=fn[context],context=fn,fn=tmp),isFunction(fn))return args=slice.call(arguments,2),proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))},proxy.guid=fn.guid=fn.guid||jQuery.guid++,proxy},jQuery.holdReady=function(hold){hold?jQuery.readyWait++:jQuery.ready(!0)},jQuery.isArray=Array.isArray,jQuery.parseJSON=JSON.parse,jQuery.nodeName=nodeName,jQuery.isFunction=isFunction,jQuery.isWindow=isWindow,jQuery.camelCase=camelCase,jQuery.type=toType,jQuery.now=Date.now,jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return("number"===type||"string"===type)&&!isNaN(obj-parseFloat(obj))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return jQuery});var _jQuery=window.jQuery,_$=window.$;return jQuery.noConflict=function(deep){return window.$===jQuery&&(window.$=_$),deep&&window.jQuery===jQuery&&(window.jQuery=_jQuery),jQuery},noGlobal||(window.jQuery=window.$=jQuery),jQuery});
!function($,window,document,undefined){"use strict";var window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();$.api=$.fn.api=function(parameters){var returnedValue,$allModules=$($.isFunction(this)?window:this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $allModules.each(function(){var ajaxSettings,requestSettings,url,requestStartTime,module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.api.settings,parameters):$.extend({},$.fn.api.settings),namespace=settings.namespace,metadata=settings.metadata,selector=settings.selector,error=settings.error,className=settings.className,eventNamespace="."+namespace,moduleNamespace="module-"+namespace,$module=$(this),$form=$module.closest(selector.form),$context=settings.stateContext?$(settings.stateContext):$module,element=this,context=$context[0],instance=$module.data(moduleNamespace);module={initialize:function(){methodInvoked||module.bind.events(),module.instantiate()},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,instance)},destroy:function(){module.verbose("Destroying previous module for",element),$module.removeData(moduleNamespace).off(eventNamespace)},bind:{events:function(){var triggerEvent=module.get.event();triggerEvent?(module.verbose("Attaching API events to element",triggerEvent),$module.on(triggerEvent+eventNamespace,module.event.trigger)):"now"==settings.on&&(module.debug("Querying API endpoint immediately"),module.query())}},decode:{json:function(response){if(void 0!==response&&"string"==typeof response)try{response=JSON.parse(response)}catch(e){}return response}},read:{cachedResponse:function(url){var response;return void 0===window.Storage?void module.error(error.noStorage):(response=sessionStorage.getItem(url),module.debug("Using cached response",url,response),response=module.decode.json(response))}},write:{cachedResponse:function(url,response){return response&&""===response?void module.debug("Response empty, not caching",response):void 0===window.Storage?void module.error(error.noStorage):($.isPlainObject(response)&&(response=JSON.stringify(response)),sessionStorage.setItem(url,response),void module.verbose("Storing cached response for url",url,response))}},query:function(){if(module.is.disabled())return void module.debug("Element is disabled API request aborted");if(module.is.loading()){if(!settings.interruptRequests)return void module.debug("Cancelling request, previous request is still pending");module.debug("Interrupting previous request"),module.abort()}if(settings.defaultData&&$.extend(!0,settings.urlData,module.get.defaultData()),settings.serializeForm&&(settings.data=module.add.formData(settings.data)),!1===(requestSettings=module.get.settings()))return module.cancelled=!0,void module.error(error.beforeSend);if(module.cancelled=!1,!(url=module.get.templatedURL())&&!module.is.mocked())return void module.error(error.missingURL);if((url=module.add.urlData(url))||module.is.mocked()){if(requestSettings.url=settings.base+url,ajaxSettings=$.extend(!0,{},settings,{type:settings.method||settings.type,data:void 0,url:settings.base+url,beforeSend:settings.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),module.debug("Querying URL",ajaxSettings.url),module.verbose("Using AJAX settings",ajaxSettings),"local"===settings.cache&&module.read.cachedResponse(url))return module.debug("Response returned from local cache"),module.request=module.create.request(),void module.request.resolveWith(context,[module.read.cachedResponse(url)]);settings.throttle?settings.throttleFirstRequest||module.timer?(module.debug("Throttling request",settings.throttle),clearTimeout(module.timer),module.timer=setTimeout(function(){module.timer&&delete module.timer,module.debug("Sending throttled request",void 0,ajaxSettings.method),module.send.request()},settings.throttle)):(module.debug("Sending request",void 0,ajaxSettings.method),module.send.request(),module.timer=setTimeout(function(){},settings.throttle)):(module.debug("Sending request",void 0,ajaxSettings.method),module.send.request())}},should:{removeError:function(){return!0===settings.hideError||"auto"===settings.hideError&&!module.is.form()}},is:{disabled:function(){return $module.filter(selector.disabled).length>0},expectingJSON:function(){return"json"===settings.dataType||"jsonp"===settings.dataType},form:function(){return $module.is("form")||$context.is("form")},mocked:function(){return settings.mockResponse||settings.mockResponseAsync||settings.response||settings.responseAsync},input:function(){return $module.is("input")},loading:function(){return!!module.request&&"pending"==module.request.state()},abortedRequest:function(xhr){return xhr&&void 0!==xhr.readyState&&0===xhr.readyState?(module.verbose("XHR request determined to be aborted"),!0):(module.verbose("XHR request was not aborted"),!1)},validResponse:function(response){return module.is.expectingJSON()&&$.isFunction(settings.successTest)?(module.debug("Checking JSON returned success",settings.successTest,response),settings.successTest(response)?(module.debug("Response passed success test",response),!0):(module.debug("Response failed success test",response),!1)):(module.verbose("Response is not JSON, skipping validation",settings.successTest,response),!0)}},was:{cancelled:function(){return module.cancelled||!1},succesful:function(){return module.request&&"resolved"==module.request.state()},failure:function(){return module.request&&"rejected"==module.request.state()},complete:function(){return module.request&&("resolved"==module.request.state()||"rejected"==module.request.state())}},add:{urlData:function(url,urlData){var requiredVariables,optionalVariables;return url&&(requiredVariables=url.match(settings.regExp.required),optionalVariables=url.match(settings.regExp.optional),urlData=urlData||settings.urlData,requiredVariables&&(module.debug("Looking for required URL variables",requiredVariables),$.each(requiredVariables,function(index,templatedString){var variable=-1!==templatedString.indexOf("$")?templatedString.substr(2,templatedString.length-3):templatedString.substr(1,templatedString.length-2),value=$.isPlainObject(urlData)&&void 0!==urlData[variable]?urlData[variable]:void 0!==$module.data(variable)?$module.data(variable):void 0!==$context.data(variable)?$context.data(variable):urlData[variable];if(void 0===value)return module.error(error.requiredParameter,variable,url),url=!1,!1;module.verbose("Found required variable",variable,value),value=settings.encodeParameters?module.get.urlEncodedValue(value):value,url=url.replace(templatedString,value)})),optionalVariables&&(module.debug("Looking for optional URL variables",requiredVariables),$.each(optionalVariables,function(index,templatedString){var variable=-1!==templatedString.indexOf("$")?templatedString.substr(3,templatedString.length-4):templatedString.substr(2,templatedString.length-3),value=$.isPlainObject(urlData)&&void 0!==urlData[variable]?urlData[variable]:void 0!==$module.data(variable)?$module.data(variable):void 0!==$context.data(variable)?$context.data(variable):urlData[variable];void 0!==value?(module.verbose("Optional variable Found",variable,value),url=url.replace(templatedString,value)):(module.verbose("Optional variable not found",variable),url=-1!==url.indexOf("/"+templatedString)?url.replace("/"+templatedString,""):url.replace(templatedString,""))}))),url},formData:function(data){var hasOtherData,canSerialize=void 0!==$.fn.serializeObject,formData=canSerialize?$form.serializeObject():$form.serialize();return data=data||settings.data,hasOtherData=$.isPlainObject(data),hasOtherData?canSerialize?(module.debug("Extending existing data with form data",data,formData),data=$.extend(!0,{},data,formData)):(module.error(error.missingSerialize),module.debug("Cant extend data. Replacing data with form data",data,formData),data=formData):(module.debug("Adding form data",formData),data=formData),data}},send:{request:function(){module.set.loading(),module.request=module.create.request(),module.is.mocked()?module.mockedXHR=module.create.mockedXHR():module.xhr=module.create.xhr(),settings.onRequest.call(context,module.request,module.xhr)}},event:{trigger:function(event){module.query(),"submit"!=event.type&&"click"!=event.type||event.preventDefault()},xhr:{always:function(){},done:function(response,textStatus,xhr){var context=this,elapsedTime=(new Date).getTime()-requestStartTime,timeLeft=settings.loadingDuration-elapsedTime,translatedResponse=!!$.isFunction(settings.onResponse)&&(module.is.expectingJSON()?settings.onResponse.call(context,$.extend(!0,{},response)):settings.onResponse.call(context,response));timeLeft=timeLeft>0?timeLeft:0,translatedResponse&&(module.debug("Modified API response in onResponse callback",settings.onResponse,translatedResponse,response),response=translatedResponse),timeLeft>0&&module.debug("Response completed early delaying state change by",timeLeft),setTimeout(function(){module.is.validResponse(response)?module.request.resolveWith(context,[response,xhr]):module.request.rejectWith(context,[xhr,"invalid"])},timeLeft)},fail:function(xhr,status,httpMessage){var context=this,elapsedTime=(new Date).getTime()-requestStartTime,timeLeft=settings.loadingDuration-elapsedTime;timeLeft=timeLeft>0?timeLeft:0,timeLeft>0&&module.debug("Response completed early delaying state change by",timeLeft),setTimeout(function(){module.is.abortedRequest(xhr)?module.request.rejectWith(context,[xhr,"aborted",httpMessage]):module.request.rejectWith(context,[xhr,"error",status,httpMessage])},timeLeft)}},request:{done:function(response,xhr){module.debug("Successful API Response",response),"local"===settings.cache&&url&&(module.write.cachedResponse(url,response),module.debug("Saving server response locally",module.cache)),settings.onSuccess.call(context,response,$module,xhr)},complete:function(firstParameter,secondParameter){var xhr,response;module.was.succesful()?(response=firstParameter,xhr=secondParameter):(xhr=firstParameter,response=module.get.responseFromXHR(xhr)),module.remove.loading(),settings.onComplete.call(context,response,$module,xhr)},fail:function(xhr,status,httpMessage){var response=module.get.responseFromXHR(xhr),errorMessage=module.get.errorFromRequest(response,status,httpMessage);if("aborted"==status)return module.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",status,httpMessage),settings.onAbort.call(context,status,$module,xhr),!0;"invalid"==status?module.debug("JSON did not pass success test. A server-side error has most likely occurred",response):"error"==status&&void 0!==xhr&&(module.debug("XHR produced a server error",status,httpMessage),200!=xhr.status&&void 0!==httpMessage&&""!==httpMessage&&module.error(error.statusMessage+httpMessage,ajaxSettings.url),settings.onError.call(context,errorMessage,$module,xhr)),settings.errorDuration&&"aborted"!==status&&(module.debug("Adding error state"),module.set.error(),module.should.removeError()&&setTimeout(module.remove.error,settings.errorDuration)),module.debug("API Request failed",errorMessage,xhr),settings.onFailure.call(context,response,$module,xhr)}}},create:{request:function(){return $.Deferred().always(module.event.request.complete).done(module.event.request.done).fail(module.event.request.fail)},mockedXHR:function(){var asyncCallback,response,mockedXHR,responder=settings.mockResponse||settings.response,asyncResponder=settings.mockResponseAsync||settings.responseAsync;return mockedXHR=$.Deferred().always(module.event.xhr.complete).done(module.event.xhr.done).fail(module.event.xhr.fail),responder?($.isFunction(responder)?(module.debug("Using specified synchronous callback",responder),response=responder.call(context,requestSettings)):(module.debug("Using settings specified response",responder),response=responder),mockedXHR.resolveWith(context,[response,!1,{responseText:response}])):$.isFunction(asyncResponder)&&(asyncCallback=function(response){module.debug("Async callback returned response",response),response?mockedXHR.resolveWith(context,[response,!1,{responseText:response}]):mockedXHR.rejectWith(context,[{responseText:response},!1,!1])},module.debug("Using specified async response callback",asyncResponder),asyncResponder.call(context,requestSettings,asyncCallback)),mockedXHR},xhr:function(){var xhr;return xhr=$.ajax(ajaxSettings).always(module.event.xhr.always).done(module.event.xhr.done).fail(module.event.xhr.fail),module.verbose("Created server request",xhr,ajaxSettings),xhr}},set:{error:function(){module.verbose("Adding error state to element",$context),$context.addClass(className.error)},loading:function(){module.verbose("Adding loading state to element",$context),$context.addClass(className.loading),requestStartTime=(new Date).getTime()}},remove:{error:function(){module.verbose("Removing error state from element",$context),$context.removeClass(className.error)},loading:function(){module.verbose("Removing loading state from element",$context),$context.removeClass(className.loading)}},get:{responseFromXHR:function(xhr){return!!$.isPlainObject(xhr)&&(module.is.expectingJSON()?module.decode.json(xhr.responseText):xhr.responseText)},errorFromRequest:function(response,status,httpMessage){return $.isPlainObject(response)&&void 0!==response.error?response.error:void 0!==settings.error[status]?settings.error[status]:httpMessage},request:function(){return module.request||!1},xhr:function(){return module.xhr||!1},settings:function(){var runSettings;return runSettings=settings.beforeSend.call(context,settings),runSettings&&(void 0!==runSettings.success&&(module.debug("Legacy success callback detected",runSettings),module.error(error.legacyParameters,runSettings.success),runSettings.onSuccess=runSettings.success),void 0!==runSettings.failure&&(module.debug("Legacy failure callback detected",runSettings),module.error(error.legacyParameters,runSettings.failure),runSettings.onFailure=runSettings.failure),void 0!==runSettings.complete&&(module.debug("Legacy complete callback detected",runSettings),module.error(error.legacyParameters,runSettings.complete),runSettings.onComplete=runSettings.complete)),void 0===runSettings&&module.error(error.noReturnedValue),!1===runSettings?runSettings:void 0!==runSettings?$.extend(!0,{},runSettings):$.extend(!0,{},settings)},urlEncodedValue:function(value){var decodedValue=window.decodeURIComponent(value),encodedValue=window.encodeURIComponent(value);return decodedValue!==value?(module.debug("URL value is already encoded, avoiding double encoding",value),value):(module.verbose("Encoding value using encodeURIComponent",value,encodedValue),encodedValue)},defaultData:function(){var data={};return $.isWindow(element)||(module.is.input()?data.value=$module.val():module.is.form()||(data.text=$module.text())),data},event:function(){return $.isWindow(element)||"now"==settings.on?(module.debug("API called without element, no events attached"),!1):"auto"==settings.on?$module.is("input")?void 0!==element.oninput?"input":void 0!==element.onpropertychange?"propertychange":"keyup":$module.is("form")?"submit":"click":settings.on},templatedURL:function(action){if(action=action||$module.data(metadata.action)||settings.action||!1,url=$module.data(metadata.url)||settings.url||!1)return module.debug("Using specified url",url),url;if(action){if(module.debug("Looking up url for action",action,settings.api),void 0===settings.api[action]&&!module.is.mocked())return void module.error(error.missingAction,settings.action,settings.api);url=settings.api[action]}else module.is.form()&&(url=$module.attr("action")||$context.attr("action")||!1,module.debug("No url or action specified, defaulting to form action",url));return url}},abort:function(){var xhr=module.get.xhr();xhr&&"resolved"!==xhr.state()&&(module.debug("Cancelling API request"),xhr.abort())},reset:function(){module.remove.error(),module.remove.loading()},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"","Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]?(found=object[value],!1):(module.error(error.method,query),!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,beforeSend:function(settings){return settings},beforeXHR:function(xhr){},onRequest:function(promise,xhr){},onResponse:!1,onSuccess:function(response,$module){},onComplete:function(response,$module){},onFailure:function(response,$module){},onError:function(errorMessage,$module){},onAbort:function(errorMessage,$module){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document);
!function(window,factory){"use strict";"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(jQuery){factory(window,jQuery)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("jquery")):window.jQueryBridget=factory(window,window.jQuery)}(window,function(window,jQuery){"use strict";function jQueryBridget(namespace,PluginClass,$){function methodCall($elems,methodName,args){var returnValue,pluginMethodStr="$()."+namespace+'("'+methodName+'")';return $elems.each(function(i,elem){var instance=$.data(elem,namespace);if(!instance)return void logError(namespace+" not initialized. Cannot call methods, i.e. "+pluginMethodStr);var method=instance[methodName];if(!method||"_"==methodName.charAt(0))return void logError(pluginMethodStr+" is not a valid method");var value=method.apply(instance,args);returnValue=void 0===returnValue?value:returnValue}),void 0!==returnValue?returnValue:$elems}function plainCall($elems,options){$elems.each(function(i,elem){var instance=$.data(elem,namespace);instance?(instance.option(options),instance._init()):(instance=new PluginClass(elem,options),$.data(elem,namespace,instance))})}($=$||jQuery||window.jQuery)&&(PluginClass.prototype.option||(PluginClass.prototype.option=function(opts){$.isPlainObject(opts)&&(this.options=$.extend(!0,this.options,opts))}),$.fn[namespace]=function(arg0){if("string"==typeof arg0){return methodCall(this,arg0,arraySlice.call(arguments,1))}return plainCall(this,arg0),this},updateJQuery($))}function updateJQuery($){!$||$&&$.bridget||($.bridget=jQueryBridget)}var arraySlice=Array.prototype.slice,console=window.console,logError=void 0===console?function(){}:function(message){console.error(message)};return updateJQuery(jQuery||window.jQuery),jQueryBridget}),function(global,factory){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",factory):"object"==typeof module&&module.exports?module.exports=factory():global.EvEmitter=factory()}("undefined"!=typeof window?window:this,function(){function EvEmitter(){}var proto=EvEmitter.prototype;return proto.on=function(eventName,listener){if(eventName&&listener){var events=this._events=this._events||{},listeners=events[eventName]=events[eventName]||[];return-1==listeners.indexOf(listener)&&listeners.push(listener),this}},proto.once=function(eventName,listener){if(eventName&&listener){this.on(eventName,listener);var onceEvents=this._onceEvents=this._onceEvents||{};return(onceEvents[eventName]=onceEvents[eventName]||{})[listener]=!0,this}},proto.off=function(eventName,listener){var listeners=this._events&&this._events[eventName];if(listeners&&listeners.length){var index=listeners.indexOf(listener);return-1!=index&&listeners.splice(index,1),this}},proto.emitEvent=function(eventName,args){var listeners=this._events&&this._events[eventName];if(listeners&&listeners.length){var i=0,listener=listeners[i];args=args||[];for(var onceListeners=this._onceEvents&&this._onceEvents[eventName];listener;){var isOnce=onceListeners&&onceListeners[listener];isOnce&&(this.off(eventName,listener),delete onceListeners[listener]),listener.apply(this,args),i+=isOnce?0:1,listener=listeners[i]}return this}},EvEmitter}),function(window,factory){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return factory()}):"object"==typeof module&&module.exports?module.exports=factory():window.getSize=factory()}(window,function(){"use strict";function getStyleSize(value){var num=parseFloat(value);return-1==value.indexOf("%")&&!isNaN(num)&&num}function noop(){}function getZeroSize(){for(var size={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;i<measurementsLength;i++){size[measurements[i]]=0}return size}function getStyle(elem){var style=getComputedStyle(elem);return style||logError("Style returned "+style+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),style}function setup(){if(!isSetup){isSetup=!0;var div=document.createElement("div");div.style.width="200px",div.style.padding="1px 2px 3px 4px",div.style.borderStyle="solid",div.style.borderWidth="1px 2px 3px 4px",div.style.boxSizing="border-box";var body=document.body||document.documentElement;body.appendChild(div);var style=getStyle(div);getSize.isBoxSizeOuter=isBoxSizeOuter=200==getStyleSize(style.width),body.removeChild(div)}}function getSize(elem){if(setup(),"string"==typeof elem&&(elem=document.querySelector(elem)),elem&&"object"==typeof elem&&elem.nodeType){var style=getStyle(elem);if("none"==style.display)return getZeroSize();var size={};size.width=elem.offsetWidth,size.height=elem.offsetHeight;for(var isBorderBox=size.isBorderBox="border-box"==style.boxSizing,i=0;i<measurementsLength;i++){var measurement=measurements[i],value=style[measurement],num=parseFloat(value);size[measurement]=isNaN(num)?0:num}var paddingWidth=size.paddingLeft+size.paddingRight,paddingHeight=size.paddingTop+size.paddingBottom,marginWidth=size.marginLeft+size.marginRight,marginHeight=size.marginTop+size.marginBottom,borderWidth=size.borderLeftWidth+size.borderRightWidth,borderHeight=size.borderTopWidth+size.borderBottomWidth,isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter,styleWidth=getStyleSize(style.width);!1!==styleWidth&&(size.width=styleWidth+(isBorderBoxSizeOuter?0:paddingWidth+borderWidth));var styleHeight=getStyleSize(style.height);return!1!==styleHeight&&(size.height=styleHeight+(isBorderBoxSizeOuter?0:paddingHeight+borderHeight)),size.innerWidth=size.width-(paddingWidth+borderWidth),size.innerHeight=size.height-(paddingHeight+borderHeight),size.outerWidth=size.width+marginWidth,size.outerHeight=size.height+marginHeight,size}}var isBoxSizeOuter,logError="undefined"==typeof console?noop:function(message){console.error(message)},measurements=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],measurementsLength=measurements.length,isSetup=!1;return getSize}),function(window,factory){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",factory):"object"==typeof module&&module.exports?module.exports=factory():window.matchesSelector=factory()}(window,function(){"use strict";var matchesMethod=function(){var ElemProto=Element.prototype;if(ElemProto.matches)return"matches";if(ElemProto.matchesSelector)return"matchesSelector";for(var prefixes=["webkit","moz","ms","o"],i=0;i<prefixes.length;i++){var prefix=prefixes[i],method=prefix+"MatchesSelector";if(ElemProto[method])return method}}();return function(elem,selector){return elem[matchesMethod](selector)}}),function(window,factory){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(matchesSelector){return factory(window,matchesSelector)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("desandro-matches-selector")):window.fizzyUIUtils=factory(window,window.matchesSelector)}(window,function(window,matchesSelector){var utils={};utils.extend=function(a,b){for(var prop in b)a[prop]=b[prop];return a},utils.modulo=function(num,div){return(num%div+div)%div},utils.makeArray=function(obj){var ary=[];if(Array.isArray(obj))ary=obj;else if(obj&&"number"==typeof obj.length)for(var i=0;i<obj.length;i++)ary.push(obj[i]);else ary.push(obj);return ary},utils.removeFrom=function(ary,obj){var index=ary.indexOf(obj);-1!=index&&ary.splice(index,1)},utils.getParent=function(elem,selector){for(;elem!=document.body;)if(elem=elem.parentNode,matchesSelector(elem,selector))return elem},utils.getQueryElement=function(elem){return"string"==typeof elem?document.querySelector(elem):elem},utils.handleEvent=function(event){var method="on"+event.type;this[method]&&this[method](event)},utils.filterFindElements=function(elems,selector){elems=utils.makeArray(elems);var ffElems=[];return elems.forEach(function(elem){if(elem instanceof HTMLElement){if(!selector)return void ffElems.push(elem);matchesSelector(elem,selector)&&ffElems.push(elem);for(var childElems=elem.querySelectorAll(selector),i=0;i<childElems.length;i++)ffElems.push(childElems[i])}}),ffElems},utils.debounceMethod=function(_class,methodName,threshold){var method=_class.prototype[methodName],timeoutName=methodName+"Timeout";_class.prototype[methodName]=function(){var timeout=this[timeoutName];timeout&&clearTimeout(timeout);var args=arguments,_this=this;this[timeoutName]=setTimeout(function(){method.apply(_this,args),delete _this[timeoutName]},threshold||100)}},utils.docReady=function(callback){var readyState=document.readyState;"complete"==readyState||"interactive"==readyState?callback():document.addEventListener("DOMContentLoaded",callback)},utils.toDashed=function(str){return str.replace(/(.)([A-Z])/g,function(match,$1,$2){return $1+"-"+$2}).toLowerCase()};var console=window.console;return utils.htmlInit=function(WidgetClass,namespace){utils.docReady(function(){var dashedNamespace=utils.toDashed(namespace),dataAttr="data-"+dashedNamespace,dataAttrElems=document.querySelectorAll("["+dataAttr+"]"),jsDashElems=document.querySelectorAll(".js-"+dashedNamespace),elems=utils.makeArray(dataAttrElems).concat(utils.makeArray(jsDashElems)),dataOptionsAttr=dataAttr+"-options",jQuery=window.jQuery;elems.forEach(function(elem){var options,attr=elem.getAttribute(dataAttr)||elem.getAttribute(dataOptionsAttr);try{options=attr&&JSON.parse(attr)}catch(error){return void(console&&console.error("Error parsing "+dataAttr+" on "+elem.className+": "+error))}var instance=new WidgetClass(elem,options);jQuery&&jQuery.data(elem,namespace,instance)})})},utils}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/cell",["get-size/get-size"],function(getSize){return factory(window,getSize)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("get-size")):(window.Flickity=window.Flickity||{},window.Flickity.Cell=factory(window,window.getSize))}(window,function(window,getSize){function Cell(elem,parent){this.element=elem,this.parent=parent,this.create()}var proto=Cell.prototype;return proto.create=function(){this.element.style.position="absolute",this.x=0,this.shift=0},proto.destroy=function(){this.element.style.position="";var side=this.parent.originSide;this.element.style[side]=""},proto.getSize=function(){this.size=getSize(this.element)},proto.setPosition=function(x){this.x=x,this.updateTarget(),this.renderPosition(x)},proto.updateTarget=proto.setDefaultTarget=function(){var marginProperty="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[marginProperty]+this.size.width*this.parent.cellAlign},proto.renderPosition=function(x){var side=this.parent.originSide;this.element.style[side]=this.parent.getPositionValue(x)},proto.wrapShift=function(shift){this.shift=shift,this.renderPosition(this.x+this.parent.slideableWidth*shift)},proto.remove=function(){this.element.parentNode.removeChild(this.element)},Cell}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/slide",factory):"object"==typeof module&&module.exports?module.exports=factory():(window.Flickity=window.Flickity||{},window.Flickity.Slide=factory())}(window,function(){"use strict";function Slide(parent){this.parent=parent,this.isOriginLeft="left"==parent.originSide,this.cells=[],this.outerWidth=0,this.height=0}var proto=Slide.prototype;return proto.addCell=function(cell){if(this.cells.push(cell),this.outerWidth+=cell.size.outerWidth,this.height=Math.max(cell.size.outerHeight,this.height),1==this.cells.length){this.x=cell.x;var beginMargin=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=cell.size[beginMargin]}},proto.updateTarget=function(){var endMargin=this.isOriginLeft?"marginRight":"marginLeft",lastCell=this.getLastCell(),lastMargin=lastCell?lastCell.size[endMargin]:0,slideWidth=this.outerWidth-(this.firstMargin+lastMargin);this.target=this.x+this.firstMargin+slideWidth*this.parent.cellAlign},proto.getLastCell=function(){return this.cells[this.cells.length-1]},proto.select=function(){this.changeSelectedClass("add")},proto.unselect=function(){this.changeSelectedClass("remove")},proto.changeSelectedClass=function(method){this.cells.forEach(function(cell){cell.element.classList[method]("is-selected")})},proto.getCellElements=function(){return this.cells.map(function(cell){return cell.element})},Slide}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/animate",["fizzy-ui-utils/utils"],function(utils){return factory(window,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("fizzy-ui-utils")):(window.Flickity=window.Flickity||{},window.Flickity.animatePrototype=factory(window,window.fizzyUIUtils))}(window,function(window,utils){var requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame,lastTime=0;requestAnimationFrame||(requestAnimationFrame=function(callback){var currTime=(new Date).getTime(),timeToCall=Math.max(0,16-(currTime-lastTime)),id=setTimeout(callback,timeToCall);return lastTime=currTime+timeToCall,id});var proto={};proto.startAnimation=function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},proto.animate=function(){this.applyDragForce(),this.applySelectedAttraction();var previousX=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(previousX),this.isAnimating){var _this=this;requestAnimationFrame(function(){_this.animate()})}};var transformProperty=function(){return"string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform"}();return proto.positionSlider=function(){var x=this.x;this.options.wrapAround&&this.cells.length>1&&(x=utils.modulo(x,this.slideableWidth),x-=this.slideableWidth,this.shiftWrapCells(x)),x+=this.cursorPosition,x=this.options.rightToLeft&&transformProperty?-x:x;var value=this.getPositionValue(x);this.slider.style[transformProperty]=this.isAnimating?"translate3d("+value+",0,0)":"translateX("+value+")";var firstSlide=this.slides[0];if(firstSlide){var positionX=-this.x-firstSlide.target,progress=positionX/this.slidesWidth;this.dispatchEvent("scroll",null,[progress,positionX])}},proto.positionSliderAtSelected=function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.positionSlider())},proto.getPositionValue=function(position){return this.options.percentPosition?.01*Math.round(position/this.size.innerWidth*1e4)+"%":Math.round(position)+"px"},proto.settle=function(previousX){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*previousX)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle"))},proto.shiftWrapCells=function(x){var beforeGap=this.cursorPosition+x;this._shiftCells(this.beforeShiftCells,beforeGap,-1);var afterGap=this.size.innerWidth-(x+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,afterGap,1)},proto._shiftCells=function(cells,gap,shift){for(var i=0;i<cells.length;i++){var cell=cells[i],cellShift=gap>0?shift:0;cell.wrapShift(cellShift),gap-=cell.size.outerWidth}},proto._unshiftCells=function(cells){if(cells&&cells.length)for(var i=0;i<cells.length;i++)cells[i].wrapShift(0)},proto.integratePhysics=function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},proto.applyForce=function(force){this.velocity+=force},proto.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},proto.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())},proto.applyDragForce=function(){if(this.isPointerDown){var dragVelocity=this.dragX-this.x,dragForce=dragVelocity-this.velocity;this.applyForce(dragForce)}},proto.applySelectedAttraction=function(){if(!this.isPointerDown&&!this.isFreeScrolling&&this.cells.length){var distance=-1*this.selectedSlide.target-this.x,force=distance*this.options.selectedAttraction;this.applyForce(force)}},proto}),function(window,factory){if("function"==typeof define&&define.amd)define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(EvEmitter,getSize,utils,Cell,Slide,animatePrototype){return factory(window,EvEmitter,getSize,utils,Cell,Slide,animatePrototype)});else if("object"==typeof module&&module.exports)module.exports=factory(window,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"));else{var _Flickity=window.Flickity;window.Flickity=factory(window,window.EvEmitter,window.getSize,window.fizzyUIUtils,_Flickity.Cell,_Flickity.Slide,_Flickity.animatePrototype)}}(window,function(window,EvEmitter,getSize,utils,Cell,Slide,animatePrototype){function moveElements(elems,toElem){for(elems=utils.makeArray(elems);elems.length;)toElem.appendChild(elems.shift())}function Flickity(element,options){var queryElement=utils.getQueryElement(element);if(!queryElement)return void(console&&console.error("Bad element for Flickity: "+(queryElement||element)));this.element=queryElement,jQuery&&(this.$element=jQuery(this.element)),this.options=utils.extend({},this.constructor.defaults),this.option(options),this._create()}var jQuery=window.jQuery,getComputedStyle=window.getComputedStyle,console=window.console,GUID=0,instances={};Flickity.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},Flickity.createMethods=[];var proto=Flickity.prototype;utils.extend(proto,EvEmitter.prototype),proto._create=function(){var id=this.guid=++GUID;this.element.flickityGUID=id,instances[id]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&window.addEventListener("resize",this),Flickity.createMethods.forEach(function(method){this[method]()},this),this.options.watchCSS?this.watchCSS():this.activate()},proto.option=function(opts){utils.extend(this.options,opts)},proto.activate=function(){if(!this.isActive){this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();moveElements(this._filterFindCellElements(this.element.children),this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate");var index,initialIndex=this.options.initialIndex;index=this.isInitActivated?this.selectedIndex:void 0!==initialIndex&&this.cells[initialIndex]?initialIndex:0,this.select(index,!1,!0),this.isInitActivated=!0}},proto._createSlider=function(){var slider=document.createElement("div");slider.className="flickity-slider",slider.style[this.originSide]=0,this.slider=slider},proto._filterFindCellElements=function(elems){return utils.filterFindElements(elems,this.options.cellSelector)},proto.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},proto._makeCells=function(elems){return this._filterFindCellElements(elems).map(function(cellElem){return new Cell(cellElem,this)},this)},proto.getLastCell=function(){return this.cells[this.cells.length-1]},proto.getLastSlide=function(){return this.slides[this.slides.length-1]},proto.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},proto._positionCells=function(index){index=index||0,this.maxCellHeight=index?this.maxCellHeight||0:0;var cellX=0;if(index>0){var startCell=this.cells[index-1];cellX=startCell.x+startCell.size.outerWidth}for(var len=this.cells.length,i=index;i<len;i++){var cell=this.cells[i];cell.setPosition(cellX),cellX+=cell.size.outerWidth,this.maxCellHeight=Math.max(cell.size.outerHeight,this.maxCellHeight)}this.slideableWidth=cellX,this.updateSlides(),this._containSlides(),this.slidesWidth=len?this.getLastSlide().target-this.slides[0].target:0},proto._sizeCells=function(cells){cells.forEach(function(cell){cell.getSize()})},proto.updateSlides=function(){if(this.slides=[],this.cells.length){var slide=new Slide(this);this.slides.push(slide);var isOriginLeft="left"==this.originSide,nextMargin=isOriginLeft?"marginRight":"marginLeft",canCellFit=this._getCanCellFit();this.cells.forEach(function(cell,i){if(!slide.cells.length)return void slide.addCell(cell);var slideWidth=slide.outerWidth-slide.firstMargin+(cell.size.outerWidth-cell.size[nextMargin]);canCellFit.call(this,i,slideWidth)?slide.addCell(cell):(slide.updateTarget(),slide=new Slide(this),this.slides.push(slide),slide.addCell(cell))},this),slide.updateTarget(),this.updateSelectedSlide()}},proto._getCanCellFit=function(){var groupCells=this.options.groupCells;if(!groupCells)return function(){return!1};if("number"==typeof groupCells){var number=parseInt(groupCells,10);return function(i){return i%number!=0}}var percentMatch="string"==typeof groupCells&&groupCells.match(/^(\d+)%$/),percent=percentMatch?parseInt(percentMatch[1],10)/100:1;return function(i,slideWidth){return slideWidth<=(this.size.innerWidth+1)*percent}},proto._init=proto.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},proto.getSize=function(){this.size=getSize(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var cellAlignShorthands={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};return proto.setCellAlign=function(){var shorthand=cellAlignShorthands[this.options.cellAlign];this.cellAlign=shorthand?shorthand[this.originSide]:this.options.cellAlign},proto.setGallerySize=function(){if(this.options.setGallerySize){var height=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=height+"px"}},proto._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var gapX=this.cursorPosition,cellIndex=this.cells.length-1;this.beforeShiftCells=this._getGapCells(gapX,cellIndex,-1),gapX=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(gapX,0,1)}},proto._getGapCells=function(gapX,cellIndex,increment){for(var cells=[];gapX>0;){var cell=this.cells[cellIndex];if(!cell)break;cells.push(cell),cellIndex+=increment,gapX-=cell.size.outerWidth}return cells},proto._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var isRightToLeft=this.options.rightToLeft,beginMargin=isRightToLeft?"marginRight":"marginLeft",endMargin=isRightToLeft?"marginLeft":"marginRight",contentWidth=this.slideableWidth-this.getLastCell().size[endMargin],isContentSmaller=contentWidth<this.size.innerWidth,beginBound=this.cursorPosition+this.cells[0].size[beginMargin],endBound=contentWidth-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(slide){isContentSmaller?slide.target=contentWidth*this.cellAlign:(slide.target=Math.max(slide.target,beginBound),slide.target=Math.min(slide.target,endBound))},this)}},proto.dispatchEvent=function(type,event,args){var emitArgs=event?[event].concat(args):args;if(this.emitEvent(type,emitArgs),jQuery&&this.$element){type+=this.options.namespaceJQueryEvents?".flickity":"";var $event=type;if(event){var jQEvent=jQuery.Event(event);jQEvent.type=type,$event=jQEvent}this.$element.trigger($event,args)}},proto.select=function(index,isWrap,isInstant){this.isActive&&(index=parseInt(index,10),this._wrapSelect(index),(this.options.wrapAround||isWrap)&&(index=utils.modulo(index,this.slides.length)),this.slides[index]&&(this.selectedIndex=index,this.updateSelectedSlide(),isInstant?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select"),this.dispatchEvent("cellSelect")))},proto._wrapSelect=function(index){var len=this.slides.length;if(!(this.options.wrapAround&&len>1))return index;var wrapIndex=utils.modulo(index,len),delta=Math.abs(wrapIndex-this.selectedIndex),backWrapDelta=Math.abs(wrapIndex+len-this.selectedIndex),forewardWrapDelta=Math.abs(wrapIndex-len-this.selectedIndex);!this.isDragSelect&&backWrapDelta<delta?index+=len:!this.isDragSelect&&forewardWrapDelta<delta&&(index-=len),index<0?this.x-=this.slideableWidth:index>=len&&(this.x+=this.slideableWidth)},proto.previous=function(isWrap){this.select(this.selectedIndex-1,isWrap)},proto.next=function(isWrap){this.select(this.selectedIndex+1,isWrap)},proto.updateSelectedSlide=function(){var slide=this.slides[this.selectedIndex];slide&&(this.unselectSelectedSlide(),this.selectedSlide=slide,slide.select(),this.selectedCells=slide.cells,this.selectedElements=slide.getCellElements(),this.selectedCell=slide.cells[0],this.selectedElement=this.selectedElements[0])},proto.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},proto.selectCell=function(value,isWrap,isInstant){var cell;"number"==typeof value?cell=this.cells[value]:("string"==typeof value&&(value=this.element.querySelector(value)),cell=this.getCell(value));for(var i=0;cell&&i<this.slides.length;i++){if(-1!=this.slides[i].cells.indexOf(cell))return void this.select(i,isWrap,isInstant)}},proto.getCell=function(elem){for(var i=0;i<this.cells.length;i++){var cell=this.cells[i];if(cell.element==elem)return cell}},proto.getCells=function(elems){elems=utils.makeArray(elems);var cells=[];return elems.forEach(function(elem){var cell=this.getCell(elem);cell&&cells.push(cell)},this),cells},proto.getCellElements=function(){return this.cells.map(function(cell){return cell.element})},proto.getParentCell=function(elem){var cell=this.getCell(elem);return cell||(elem=utils.getParent(elem,".flickity-slider > *"),this.getCell(elem))},proto.getAdjacentCellElements=function(adjCount,index){if(!adjCount)return this.selectedSlide.getCellElements();index=void 0===index?this.selectedIndex:index;var len=this.slides.length;if(1+2*adjCount>=len)return this.getCellElements();for(var cellElems=[],i=index-adjCount;i<=index+adjCount;i++){var slideIndex=this.options.wrapAround?utils.modulo(i,len):i,slide=this.slides[slideIndex];slide&&(cellElems=cellElems.concat(slide.getCellElements()))}return cellElems},proto.uiChange=function(){this.emitEvent("uiChange")},proto.childUIPointerDown=function(event){this.emitEvent("childUIPointerDown",[event])},proto.onresize=function(){this.watchCSS(),this.resize()},utils.debounceMethod(Flickity,"onresize",150),proto.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=utils.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var selectedElement=this.selectedElements&&this.selectedElements[0];this.selectCell(selectedElement,!1,!0)}},proto.watchCSS=function(){this.options.watchCSS&&(-1!=getComputedStyle(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},proto.onkeydown=function(event){if(this.options.accessibility&&(!document.activeElement||document.activeElement==this.element))if(37==event.keyCode){var leftMethod=this.options.rightToLeft?"next":"previous";this.uiChange(),this[leftMethod]()}else if(39==event.keyCode){var rightMethod=this.options.rightToLeft?"previous":"next";this.uiChange(),this[rightMethod]()}},proto.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.cells.forEach(function(cell){cell.destroy()}),this.unselectSelectedSlide(),this.element.removeChild(this.viewport),moveElements(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},proto.destroy=function(){this.deactivate(),window.removeEventListener("resize",this),this.emitEvent("destroy"),jQuery&&this.$element&&jQuery.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete instances[this.guid]},utils.extend(proto,animatePrototype),Flickity.data=function(elem){elem=utils.getQueryElement(elem);var id=elem&&elem.flickityGUID;return id&&instances[id]},utils.htmlInit(Flickity,"flickity"),jQuery&&jQuery.bridget&&jQuery.bridget("flickity",Flickity),Flickity.Cell=Cell,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(EvEmitter){return factory(window,EvEmitter)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("ev-emitter")):window.Unipointer=factory(window,window.EvEmitter)}(window,function(window,EvEmitter){function noop(){}function Unipointer(){}var proto=Unipointer.prototype=Object.create(EvEmitter.prototype);proto.bindStartEvent=function(elem){this._bindStartEvent(elem,!0)},proto.unbindStartEvent=function(elem){this._bindStartEvent(elem,!1)},proto._bindStartEvent=function(elem,isBind){isBind=void 0===isBind||!!isBind;var bindMethod=isBind?"addEventListener":"removeEventListener";window.navigator.pointerEnabled?elem[bindMethod]("pointerdown",this):window.navigator.msPointerEnabled?elem[bindMethod]("MSPointerDown",this):(elem[bindMethod]("mousedown",this),elem[bindMethod]("touchstart",this))},proto.handleEvent=function(event){var method="on"+event.type;this[method]&&this[method](event)},proto.getTouch=function(touches){for(var i=0;i<touches.length;i++){var touch=touches[i];if(touch.identifier==this.pointerIdentifier)return touch}},proto.onmousedown=function(event){var button=event.button;button&&0!==button&&1!==button||this._pointerDown(event,event)},proto.ontouchstart=function(event){this._pointerDown(event,event.changedTouches[0])},proto.onMSPointerDown=proto.onpointerdown=function(event){this._pointerDown(event,event)},proto._pointerDown=function(event,pointer){this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==pointer.pointerId?pointer.pointerId:pointer.identifier,this.pointerDown(event,pointer))},proto.pointerDown=function(event,pointer){this._bindPostStartEvents(event),this.emitEvent("pointerDown",[event,pointer])};var postStartEvents={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"],MSPointerDown:["MSPointerMove","MSPointerUp","MSPointerCancel"]};return proto._bindPostStartEvents=function(event){if(event){var events=postStartEvents[event.type];events.forEach(function(eventName){window.addEventListener(eventName,this)},this),this._boundPointerEvents=events}},proto._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(eventName){window.removeEventListener(eventName,this)},this),delete this._boundPointerEvents)},proto.onmousemove=function(event){this._pointerMove(event,event)},proto.onMSPointerMove=proto.onpointermove=function(event){event.pointerId==this.pointerIdentifier&&this._pointerMove(event,event)},proto.ontouchmove=function(event){var touch=this.getTouch(event.changedTouches);touch&&this._pointerMove(event,touch)},proto._pointerMove=function(event,pointer){this.pointerMove(event,pointer)},proto.pointerMove=function(event,pointer){this.emitEvent("pointerMove",[event,pointer])},proto.onmouseup=function(event){this._pointerUp(event,event)},proto.onMSPointerUp=proto.onpointerup=function(event){event.pointerId==this.pointerIdentifier&&this._pointerUp(event,event)},proto.ontouchend=function(event){
var touch=this.getTouch(event.changedTouches);touch&&this._pointerUp(event,touch)},proto._pointerUp=function(event,pointer){this._pointerDone(),this.pointerUp(event,pointer)},proto.pointerUp=function(event,pointer){this.emitEvent("pointerUp",[event,pointer])},proto._pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this._unbindPostStartEvents(),this.pointerDone()},proto.pointerDone=noop,proto.onMSPointerCancel=proto.onpointercancel=function(event){event.pointerId==this.pointerIdentifier&&this._pointerCancel(event,event)},proto.ontouchcancel=function(event){var touch=this.getTouch(event.changedTouches);touch&&this._pointerCancel(event,touch)},proto._pointerCancel=function(event,pointer){this._pointerDone(),this.pointerCancel(event,pointer)},proto.pointerCancel=function(event,pointer){this.emitEvent("pointerCancel",[event,pointer])},Unipointer.getPointerPoint=function(pointer){return{x:pointer.pageX,y:pointer.pageY}},Unipointer}),function(window,factory){"function"==typeof define&&define.amd?define("unidragger/unidragger",["unipointer/unipointer"],function(Unipointer){return factory(window,Unipointer)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("unipointer")):window.Unidragger=factory(window,window.Unipointer)}(window,function(window,Unipointer){function noop(){}function Unidragger(){}var proto=Unidragger.prototype=Object.create(Unipointer.prototype);proto.bindHandles=function(){this._bindHandles(!0)},proto.unbindHandles=function(){this._bindHandles(!1)};var navigator=window.navigator;return proto._bindHandles=function(isBind){isBind=void 0===isBind||!!isBind;var binderExtra;binderExtra=navigator.pointerEnabled?function(handle){handle.style.touchAction=isBind?"none":""}:navigator.msPointerEnabled?function(handle){handle.style.msTouchAction=isBind?"none":""}:noop;for(var bindMethod=isBind?"addEventListener":"removeEventListener",i=0;i<this.handles.length;i++){var handle=this.handles[i];this._bindStartEvent(handle,isBind),binderExtra(handle),handle[bindMethod]("click",this)}},proto.pointerDown=function(event,pointer){if("INPUT"==event.target.nodeName&&"range"==event.target.type)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(event,pointer);var focused=document.activeElement;focused&&focused.blur&&focused.blur(),this._bindPostStartEvents(event),this.emitEvent("pointerDown",[event,pointer])},proto._dragPointerDown=function(event,pointer){this.pointerDownPoint=Unipointer.getPointerPoint(pointer),this.canPreventDefaultOnPointerDown(event,pointer)&&event.preventDefault()},proto.canPreventDefaultOnPointerDown=function(event){return"SELECT"!=event.target.nodeName},proto.pointerMove=function(event,pointer){var moveVector=this._dragPointerMove(event,pointer);this.emitEvent("pointerMove",[event,pointer,moveVector]),this._dragMove(event,pointer,moveVector)},proto._dragPointerMove=function(event,pointer){var movePoint=Unipointer.getPointerPoint(pointer),moveVector={x:movePoint.x-this.pointerDownPoint.x,y:movePoint.y-this.pointerDownPoint.y};return!this.isDragging&&this.hasDragStarted(moveVector)&&this._dragStart(event,pointer),moveVector},proto.hasDragStarted=function(moveVector){return Math.abs(moveVector.x)>3||Math.abs(moveVector.y)>3},proto.pointerUp=function(event,pointer){this.emitEvent("pointerUp",[event,pointer]),this._dragPointerUp(event,pointer)},proto._dragPointerUp=function(event,pointer){this.isDragging?this._dragEnd(event,pointer):this._staticClick(event,pointer)},proto._dragStart=function(event,pointer){this.isDragging=!0,this.dragStartPoint=Unipointer.getPointerPoint(pointer),this.isPreventingClicks=!0,this.dragStart(event,pointer)},proto.dragStart=function(event,pointer){this.emitEvent("dragStart",[event,pointer])},proto._dragMove=function(event,pointer,moveVector){this.isDragging&&this.dragMove(event,pointer,moveVector)},proto.dragMove=function(event,pointer,moveVector){event.preventDefault(),this.emitEvent("dragMove",[event,pointer,moveVector])},proto._dragEnd=function(event,pointer){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(event,pointer)},proto.dragEnd=function(event,pointer){this.emitEvent("dragEnd",[event,pointer])},proto.onclick=function(event){this.isPreventingClicks&&event.preventDefault()},proto._staticClick=function(event,pointer){if(!this.isIgnoringMouseUp||"mouseup"!=event.type){var nodeName=event.target.nodeName;"INPUT"!=nodeName&&"TEXTAREA"!=nodeName||event.target.focus(),this.staticClick(event,pointer),"mouseup"!=event.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400))}},proto.staticClick=function(event,pointer){this.emitEvent("staticClick",[event,pointer])},Unidragger.getPointerPoint=Unipointer.getPointerPoint,Unidragger}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(Flickity,Unidragger,utils){return factory(window,Flickity,Unidragger,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("unidragger"),require("fizzy-ui-utils")):window.Flickity=factory(window,window.Flickity,window.Unidragger,window.fizzyUIUtils)}(window,function(window,Flickity,Unidragger,utils){function getScrollPosition(){return{x:window.pageXOffset,y:window.pageYOffset}}utils.extend(Flickity.defaults,{draggable:!0,dragThreshold:3}),Flickity.createMethods.push("_createDrag");var proto=Flickity.prototype;utils.extend(proto,Unidragger.prototype),proto._createDrag=function(){this.on("activate",this.bindDrag),this.on("uiChange",this._uiChangeDrag),this.on("childUIPointerDown",this._childUIPointerDownDrag),this.on("deactivate",this.unbindDrag)},proto.bindDrag=function(){this.options.draggable&&!this.isDragBound&&(this.element.classList.add("is-draggable"),this.handles=[this.viewport],this.bindHandles(),this.isDragBound=!0)},proto.unbindDrag=function(){this.isDragBound&&(this.element.classList.remove("is-draggable"),this.unbindHandles(),delete this.isDragBound)},proto._uiChangeDrag=function(){delete this.isFreeScrolling},proto._childUIPointerDownDrag=function(event){event.preventDefault(),this.pointerDownFocus(event)};var cursorNodes={TEXTAREA:!0,INPUT:!0},clickTypes={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};proto.pointerDown=function(event,pointer){if(cursorNodes[event.target.nodeName]&&!clickTypes[event.target.type])return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(event,pointer);var focused=document.activeElement;focused&&focused.blur&&focused!=this.element&&focused!=document.body&&focused.blur(),this.pointerDownFocus(event),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this._bindPostStartEvents(event),this.pointerDownScroll=getScrollPosition(),window.addEventListener("scroll",this),this.dispatchEvent("pointerDown",event,[pointer])};var touchStartEvents={touchstart:!0,MSPointerDown:!0},focusNodes={INPUT:!0,SELECT:!0};return proto.pointerDownFocus=function(event){if(this.options.accessibility&&!touchStartEvents[event.type]&&!focusNodes[event.target.nodeName]){var prevScrollY=window.pageYOffset;this.element.focus(),window.pageYOffset!=prevScrollY&&window.scrollTo(window.pageXOffset,prevScrollY)}},proto.canPreventDefaultOnPointerDown=function(event){var isTouchstart="touchstart"==event.type,targetNodeName=event.target.nodeName;return!isTouchstart&&"SELECT"!=targetNodeName},proto.hasDragStarted=function(moveVector){return Math.abs(moveVector.x)>this.options.dragThreshold},proto.pointerUp=function(event,pointer){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",event,[pointer]),this._dragPointerUp(event,pointer)},proto.pointerDone=function(){window.removeEventListener("scroll",this),delete this.pointerDownScroll},proto.dragStart=function(event,pointer){this.dragStartPosition=this.x,this.startAnimation(),this.dispatchEvent("dragStart",event,[pointer])},proto.pointerMove=function(event,pointer){var moveVector=this._dragPointerMove(event,pointer);this.dispatchEvent("pointerMove",event,[pointer,moveVector]),this._dragMove(event,pointer,moveVector)},proto.dragMove=function(event,pointer,moveVector){event.preventDefault(),this.previousDragX=this.dragX;var direction=this.options.rightToLeft?-1:1,dragX=this.dragStartPosition+moveVector.x*direction;if(!this.options.wrapAround&&this.slides.length){var originBound=Math.max(-this.slides[0].target,this.dragStartPosition);dragX=dragX>originBound?.5*(dragX+originBound):dragX;var endBound=Math.min(-this.getLastSlide().target,this.dragStartPosition);dragX=dragX<endBound?.5*(dragX+endBound):dragX}this.dragX=dragX,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",event,[pointer,moveVector])},proto.dragEnd=function(event,pointer){this.options.freeScroll&&(this.isFreeScrolling=!0);var index=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var restingX=this.getRestingPosition();this.isFreeScrolling=-restingX>this.slides[0].target&&-restingX<this.getLastSlide().target}else this.options.freeScroll||index!=this.selectedIndex||(index+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(index),delete this.isDragSelect,this.dispatchEvent("dragEnd",event,[pointer])},proto.dragEndRestingSelect=function(){var restingX=this.getRestingPosition(),distance=Math.abs(this.getSlideDistance(-restingX,this.selectedIndex)),positiveResting=this._getClosestResting(restingX,distance,1),negativeResting=this._getClosestResting(restingX,distance,-1);return positiveResting.distance<negativeResting.distance?positiveResting.index:negativeResting.index},proto._getClosestResting=function(restingX,distance,increment){for(var index=this.selectedIndex,minDistance=1/0,condition=this.options.contain&&!this.options.wrapAround?function(d,md){return d<=md}:function(d,md){return d<md};condition(distance,minDistance)&&(index+=increment,minDistance=distance,null!==(distance=this.getSlideDistance(-restingX,index)));)distance=Math.abs(distance);return{distance:minDistance,index:index-increment}},proto.getSlideDistance=function(x,index){var len=this.slides.length,isWrapAround=this.options.wrapAround&&len>1,slideIndex=isWrapAround?utils.modulo(index,len):index,slide=this.slides[slideIndex];if(!slide)return null;var wrap=isWrapAround?this.slideableWidth*Math.floor(index/len):0;return x-(slide.target+wrap)},proto.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var distance=this.getSlideDistance(-this.dragX,this.selectedIndex),delta=this.previousDragX-this.dragX;return distance>0&&delta>0?1:distance<0&&delta<0?-1:0},proto.staticClick=function(event,pointer){var clickedCell=this.getParentCell(event.target),cellElem=clickedCell&&clickedCell.element,cellIndex=clickedCell&&this.cells.indexOf(clickedCell);this.dispatchEvent("staticClick",event,[pointer,cellElem,cellIndex])},proto.onscroll=function(){var scroll=getScrollPosition(),scrollMoveX=this.pointerDownScroll.x-scroll.x,scrollMoveY=this.pointerDownScroll.y-scroll.y;(Math.abs(scrollMoveX)>3||Math.abs(scrollMoveY)>3)&&this._pointerDone()},Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("tap-listener/tap-listener",["unipointer/unipointer"],function(Unipointer){return factory(window,Unipointer)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("unipointer")):window.TapListener=factory(window,window.Unipointer)}(window,function(window,Unipointer){function TapListener(elem){this.bindTap(elem)}var proto=TapListener.prototype=Object.create(Unipointer.prototype);return proto.bindTap=function(elem){elem&&(this.unbindTap(),this.tapElement=elem,this._bindStartEvent(elem,!0))},proto.unbindTap=function(){this.tapElement&&(this._bindStartEvent(this.tapElement,!0),delete this.tapElement)},proto.pointerUp=function(event,pointer){if(!this.isIgnoringMouseUp||"mouseup"!=event.type){var pointerPoint=Unipointer.getPointerPoint(pointer),boundingRect=this.tapElement.getBoundingClientRect(),scrollX=window.pageXOffset,scrollY=window.pageYOffset;if(pointerPoint.x>=boundingRect.left+scrollX&&pointerPoint.x<=boundingRect.right+scrollX&&pointerPoint.y>=boundingRect.top+scrollY&&pointerPoint.y<=boundingRect.bottom+scrollY&&this.emitEvent("tap",[event,pointer]),"mouseup"!=event.type){this.isIgnoringMouseUp=!0;var _this=this;setTimeout(function(){delete _this.isIgnoringMouseUp},400)}}},proto.destroy=function(){this.pointerDone(),this.unbindTap()},TapListener}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/prev-next-button",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(Flickity,TapListener,utils){return factory(window,Flickity,TapListener,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.TapListener,window.fizzyUIUtils)}(window,function(window,Flickity,TapListener,utils){"use strict";function PrevNextButton(direction,parent){this.direction=direction,this.parent=parent,this._create()}function getArrowMovements(shape){return"string"==typeof shape?shape:"M "+shape.x0+",50 L "+shape.x1+","+(shape.y1+50)+" L "+shape.x2+","+(shape.y2+50)+" L "+shape.x3+",50  L "+shape.x2+","+(50-shape.y2)+" L "+shape.x1+","+(50-shape.y1)+" Z"}var svgURI="http://www.w3.org/2000/svg";PrevNextButton.prototype=new TapListener,PrevNextButton.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var leftDirection=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==leftDirection;var element=this.element=document.createElement("button");element.className="flickity-prev-next-button",element.className+=this.isPrevious?" previous":" next",element.setAttribute("type","button"),this.disable(),element.setAttribute("aria-label",this.isPrevious?"previous":"next");var svg=this.createSVG();element.appendChild(svg),this.parent.on("select",function(){this.update()}.bind(this)),this.on("tap",this.onTap),this.on("pointerDown",function(button,event){this.parent.childUIPointerDown(event)}.bind(this))},PrevNextButton.prototype.activate=function(){this.bindTap(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},PrevNextButton.prototype.deactivate=function(){this.parent.element.removeChild(this.element),TapListener.prototype.destroy.call(this),this.element.removeEventListener("click",this)},PrevNextButton.prototype.createSVG=function(){var svg=document.createElementNS(svgURI,"svg");svg.setAttribute("viewBox","0 0 100 100");var path=document.createElementNS(svgURI,"path"),pathMovements=getArrowMovements(this.parent.options.arrowShape);return path.setAttribute("d",pathMovements),path.setAttribute("class","arrow"),this.isLeft||path.setAttribute("transform","translate(100, 100) rotate(180) "),svg.appendChild(path),svg},PrevNextButton.prototype.onTap=function(){if(this.isEnabled){this.parent.uiChange();var method=this.isPrevious?"previous":"next";this.parent[method]()}},PrevNextButton.prototype.handleEvent=utils.handleEvent,PrevNextButton.prototype.onclick=function(){var focused=document.activeElement;focused&&focused==this.element&&this.onTap()},PrevNextButton.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},PrevNextButton.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},PrevNextButton.prototype.update=function(){var slides=this.parent.slides;if(this.parent.options.wrapAround&&slides.length>1)return void this.enable();var lastIndex=slides.length?slides.length-1:0,boundIndex=this.isPrevious?0:lastIndex;this[this.parent.selectedIndex==boundIndex?"disable":"enable"]()},PrevNextButton.prototype.destroy=function(){this.deactivate()},utils.extend(Flickity.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),Flickity.createMethods.push("_createPrevNextButtons");var proto=Flickity.prototype;return proto._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new PrevNextButton(-1,this),this.nextButton=new PrevNextButton(1,this),this.on("activate",this.activatePrevNextButtons))},proto.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},proto.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},Flickity.PrevNextButton=PrevNextButton,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/page-dots",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(Flickity,TapListener,utils){return factory(window,Flickity,TapListener,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.TapListener,window.fizzyUIUtils)}(window,function(window,Flickity,TapListener,utils){function PageDots(parent){this.parent=parent,this._create()}PageDots.prototype=new TapListener,PageDots.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.on("tap",this.onTap)},PageDots.prototype.activate=function(){this.setDots(),this.bindTap(this.holder),this.parent.element.appendChild(this.holder)},PageDots.prototype.deactivate=function(){this.parent.element.removeChild(this.holder),TapListener.prototype.destroy.call(this)},PageDots.prototype.setDots=function(){var delta=this.parent.slides.length-this.dots.length;delta>0?this.addDots(delta):delta<0&&this.removeDots(-delta)},PageDots.prototype.addDots=function(count){for(var fragment=document.createDocumentFragment(),newDots=[];count;){var dot=document.createElement("li");dot.className="dot",fragment.appendChild(dot),newDots.push(dot),count--}this.holder.appendChild(fragment),this.dots=this.dots.concat(newDots)},PageDots.prototype.removeDots=function(count){this.dots.splice(this.dots.length-count,count).forEach(function(dot){this.holder.removeChild(dot)},this)},PageDots.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot"),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected")},PageDots.prototype.onTap=function(event){var target=event.target;if("LI"==target.nodeName){this.parent.uiChange();var index=this.dots.indexOf(target);this.parent.select(index)}},PageDots.prototype.destroy=function(){this.deactivate()},Flickity.PageDots=PageDots,utils.extend(Flickity.defaults,{pageDots:!0}),Flickity.createMethods.push("_createPageDots");var proto=Flickity.prototype;return proto._createPageDots=function(){this.options.pageDots&&(this.pageDots=new PageDots(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots),this.pageDots.on("pointerDown",function(button,event){this.childUIPointerDown(event)}.bind(this)))},proto.activatePageDots=function(){this.pageDots.activate()},proto.updateSelectedPageDots=function(){this.pageDots.updateSelected()},proto.updatePageDots=function(){this.pageDots.setDots()},proto.deactivatePageDots=function(){this.pageDots.deactivate()},Flickity.PageDots=PageDots,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(EvEmitter,utils,Flickity){return factory(EvEmitter,utils,Flickity)}):"object"==typeof module&&module.exports?module.exports=factory(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity")):factory(window.EvEmitter,window.fizzyUIUtils,window.Flickity)}(window,function(EvEmitter,utils,Flickity){function Player(parent){this.parent=parent,this.state="stopped",visibilityEvent&&(this.onVisibilityChange=function(){this.visibilityChange()}.bind(this),this.onVisibilityPlay=function(){this.visibilityPlay()}.bind(this))}var hiddenProperty,visibilityEvent;"hidden"in document?(hiddenProperty="hidden",visibilityEvent="visibilitychange"):"webkitHidden"in document&&(hiddenProperty="webkitHidden",visibilityEvent="webkitvisibilitychange"),Player.prototype=Object.create(EvEmitter.prototype),Player.prototype.play=function(){if("playing"!=this.state){var isPageHidden=document[hiddenProperty];if(visibilityEvent&&isPageHidden)return void document.addEventListener(visibilityEvent,this.onVisibilityPlay);this.state="playing",visibilityEvent&&document.addEventListener(visibilityEvent,this.onVisibilityChange),this.tick()}},Player.prototype.tick=function(){if("playing"==this.state){var time=this.parent.options.autoPlay;time="number"==typeof time?time:3e3;var _this=this;this.clear(),this.timeout=setTimeout(function(){_this.parent.next(!0),_this.tick()},time)}},Player.prototype.stop=function(){this.state="stopped",this.clear(),visibilityEvent&&document.removeEventListener(visibilityEvent,this.onVisibilityChange)},Player.prototype.clear=function(){clearTimeout(this.timeout)},Player.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},Player.prototype.unpause=function(){"paused"==this.state&&this.play()},Player.prototype.visibilityChange=function(){this[document[hiddenProperty]?"pause":"unpause"]()},Player.prototype.visibilityPlay=function(){this.play(),document.removeEventListener(visibilityEvent,this.onVisibilityPlay)},utils.extend(Flickity.defaults,{pauseAutoPlayOnHover:!0}),Flickity.createMethods.push("_createPlayer");var proto=Flickity.prototype;return proto._createPlayer=function(){this.player=new Player(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},proto.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},proto.playPlayer=function(){this.player.play()},proto.stopPlayer=function(){this.player.stop()},proto.pausePlayer=function(){this.player.pause()},proto.unpausePlayer=function(){this.player.unpause()},proto.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},proto.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},proto.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},Flickity.Player=Player,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(Flickity,utils){return factory(window,Flickity,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.fizzyUIUtils)}(window,function(window,Flickity,utils){function getCellsFragment(cells){var fragment=document.createDocumentFragment();return cells.forEach(function(cell){fragment.appendChild(cell.element)}),fragment}var proto=Flickity.prototype;return proto.insert=function(elems,index){var cells=this._makeCells(elems);if(cells&&cells.length){var len=this.cells.length;index=void 0===index?len:index;var fragment=getCellsFragment(cells),isAppend=index==len;if(isAppend)this.slider.appendChild(fragment);else{var insertCellElement=this.cells[index].element;this.slider.insertBefore(fragment,insertCellElement)}if(0===index)this.cells=cells.concat(this.cells);else if(isAppend)this.cells=this.cells.concat(cells);else{var endCells=this.cells.splice(index,len-index);this.cells=this.cells.concat(cells).concat(endCells)}this._sizeCells(cells);var selectedIndexDelta=index>this.selectedIndex?0:cells.length;this._cellAddedRemoved(index,selectedIndexDelta)}},proto.append=function(elems){this.insert(elems,this.cells.length)},proto.prepend=function(elems){this.insert(elems,0)},proto.remove=function(elems){var i,cell,cells=this.getCells(elems),selectedIndexDelta=0,len=cells.length;for(i=0;i<len;i++){cell=cells[i];selectedIndexDelta-=this.cells.indexOf(cell)<this.selectedIndex?1:0}for(i=0;i<len;i++)cell=cells[i],cell.remove(),utils.removeFrom(this.cells,cell);cells.length&&this._cellAddedRemoved(0,selectedIndexDelta)},proto._cellAddedRemoved=function(changedCellIndex,selectedIndexDelta){selectedIndexDelta=selectedIndexDelta||0,this.selectedIndex+=selectedIndexDelta,this.selectedIndex=Math.max(0,Math.min(this.slides.length-1,this.selectedIndex)),this.cellChange(changedCellIndex,!0),this.emitEvent("cellAddedRemoved",[changedCellIndex,selectedIndexDelta])},proto.cellSizeChange=function(elem){var cell=this.getCell(elem);if(cell){cell.getSize();var index=this.cells.indexOf(cell);this.cellChange(index)}},proto.cellChange=function(changedCellIndex,isPositioningSlider){var prevSlideableWidth=this.slideableWidth;if(this._positionCells(changedCellIndex),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("cellChange",[changedCellIndex]),this.options.freeScroll){var deltaX=prevSlideableWidth-this.slideableWidth;this.x+=deltaX*this.cellAlign,this.positionSlider()}else isPositioningSlider&&this.positionSliderAtSelected(),this.select(this.selectedIndex)},Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(Flickity,utils){return factory(window,Flickity,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.fizzyUIUtils)}(window,function(window,Flickity,utils){"use strict";function getCellLazyImages(cellElem){if("IMG"==cellElem.nodeName&&cellElem.getAttribute("data-flickity-lazyload"))return[cellElem];var imgs=cellElem.querySelectorAll("img[data-flickity-lazyload]");return utils.makeArray(imgs)}function LazyLoader(img,flickity){this.img=img,this.flickity=flickity,this.load()}Flickity.createMethods.push("_createLazyload");var proto=Flickity.prototype;return proto._createLazyload=function(){this.on("select",this.lazyLoad)},proto.lazyLoad=function(){var lazyLoad=this.options.lazyLoad;if(lazyLoad){var adjCount="number"==typeof lazyLoad?lazyLoad:0,cellElems=this.getAdjacentCellElements(adjCount),lazyImages=[];cellElems.forEach(function(cellElem){var lazyCellImages=getCellLazyImages(cellElem);lazyImages=lazyImages.concat(lazyCellImages)}),lazyImages.forEach(function(img){new LazyLoader(img,this)},this)}},LazyLoader.prototype.handleEvent=utils.handleEvent,LazyLoader.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.img.getAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload")},LazyLoader.prototype.onload=function(event){this.complete(event,"flickity-lazyloaded")},LazyLoader.prototype.onerror=function(event){this.complete(event,"flickity-lazyerror")},LazyLoader.prototype.complete=function(event,className){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var cell=this.flickity.getParentCell(this.img),cellElem=cell&&cell.element;this.flickity.cellSizeChange(cellElem),this.img.classList.add(className),this.flickity.dispatchEvent("lazyLoad",event,cellElem)},Flickity.LazyLoader=LazyLoader,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],factory):"object"==typeof module&&module.exports&&(module.exports=factory(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload")))}(window,function(Flickity){return Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],function(classie,Flickity,utils){return factory(window,classie,Flickity)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("flickity"),require("fizzy-ui-utils")):window.Flickity=factory(window,window.Flickity,window.fizzyUIUtils)}(window,function(window,Flickity,utils){Flickity.createMethods.push("_createAsNavFor");var proto=Flickity.prototype;return proto._createAsNavFor=function(){this.on("activate",this.activateAsNavFor),this.on("deactivate",this.deactivateAsNavFor),this.on("destroy",this.destroyAsNavFor);var asNavForOption=this.options.asNavFor;if(asNavForOption){var _this=this;setTimeout(function(){_this.setNavCompanion(asNavForOption)})}},proto.setNavCompanion=function(elem){elem=utils.getQueryElement(elem);var companion=Flickity.data(elem);if(companion&&companion!=this){this.navCompanion=companion;var _this=this;this.onNavCompanionSelect=function(){_this.navCompanionSelect()},companion.on("select",this.onNavCompanionSelect),this.on("staticClick",this.onNavStaticClick),this.navCompanionSelect()}},proto.navCompanionSelect=function(){if(this.navCompanion){var selectedCell=this.navCompanion.selectedCells[0],cellIndex=this.navCompanion.cells.indexOf(selectedCell);this.selectCell(cellIndex),this.removeNavSelectedElements(),cellIndex>=this.cells.length||(this.navSelectedElements=this.slides[this.selectedIndex].getCellElements(),this.changeNavSelectedClass("add"))}},proto.changeNavSelectedClass=function(method){this.navSelectedElements.forEach(function(navElem){navElem.classList[method]("is-nav-selected")})},proto.activateAsNavFor=function(){this.navCompanionSelect()},proto.removeNavSelectedElements=function(){this.navSelectedElements&&(this.changeNavSelectedClass("remove"),delete this.navSelectedElements)},proto.onNavStaticClick=function(event,pointer,cellElement,cellIndex){"number"==typeof cellIndex&&this.navCompanion.selectCell(cellIndex)},proto.deactivateAsNavFor=function(){this.removeNavSelectedElements()},proto.destroyAsNavFor=function(){this.navCompanion&&(this.navCompanion.off("select",this.onNavCompanionSelect),this.off("staticClick",this.onNavStaticClick),delete this.navCompanion)},Flickity}),function(window,factory){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(EvEmitter){return factory(window,EvEmitter)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("ev-emitter")):window.imagesLoaded=factory(window,window.EvEmitter)}(window,function(window,EvEmitter){function extend(a,b){for(var prop in b)a[prop]=b[prop];return a}function makeArray(obj){var ary=[];if(Array.isArray(obj))ary=obj;else if("number"==typeof obj.length)for(var i=0;i<obj.length;i++)ary.push(obj[i]);else ary.push(obj);return ary}function ImagesLoaded(elem,options,onAlways){if(!(this instanceof ImagesLoaded))return new ImagesLoaded(elem,options,onAlways);"string"==typeof elem&&(elem=document.querySelectorAll(elem)),this.elements=makeArray(elem),this.options=extend({},this.options),"function"==typeof options?onAlways=options:extend(this.options,options),onAlways&&this.on("always",onAlways),this.getImages(),$&&(this.jqDeferred=new $.Deferred),setTimeout(function(){this.check()}.bind(this))}function LoadingImage(img){this.img=img}function Background(url,element){this.url=url,this.element=element,this.img=new Image}var $=window.jQuery,console=window.console;ImagesLoaded.prototype=Object.create(EvEmitter.prototype),ImagesLoaded.prototype.options={},ImagesLoaded.prototype.getImages=function(){this.images=[],
this.elements.forEach(this.addElementImages,this)},ImagesLoaded.prototype.addElementImages=function(elem){"IMG"==elem.nodeName&&this.addImage(elem),!0===this.options.background&&this.addElementBackgroundImages(elem);var nodeType=elem.nodeType;if(nodeType&&elementNodeTypes[nodeType]){for(var childImgs=elem.querySelectorAll("img"),i=0;i<childImgs.length;i++){var img=childImgs[i];this.addImage(img)}if("string"==typeof this.options.background){var children=elem.querySelectorAll(this.options.background);for(i=0;i<children.length;i++){var child=children[i];this.addElementBackgroundImages(child)}}}};var elementNodeTypes={1:!0,9:!0,11:!0};return ImagesLoaded.prototype.addElementBackgroundImages=function(elem){var style=getComputedStyle(elem);if(style)for(var reURL=/url\((['"])?(.*?)\1\)/gi,matches=reURL.exec(style.backgroundImage);null!==matches;){var url=matches&&matches[2];url&&this.addBackground(url,elem),matches=reURL.exec(style.backgroundImage)}},ImagesLoaded.prototype.addImage=function(img){var loadingImage=new LoadingImage(img);this.images.push(loadingImage)},ImagesLoaded.prototype.addBackground=function(url,elem){var background=new Background(url,elem);this.images.push(background)},ImagesLoaded.prototype.check=function(){function onProgress(image,elem,message){setTimeout(function(){_this.progress(image,elem,message)})}var _this=this;if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();this.images.forEach(function(loadingImage){loadingImage.once("progress",onProgress),loadingImage.check()})},ImagesLoaded.prototype.progress=function(image,elem,message){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!image.isLoaded,this.emitEvent("progress",[this,image,elem]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,image),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&console&&console.log("progress: "+message,image,elem)},ImagesLoaded.prototype.complete=function(){var eventName=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(eventName,[this]),this.emitEvent("always",[this]),this.jqDeferred){var jqMethod=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[jqMethod](this)}},LoadingImage.prototype=Object.create(EvEmitter.prototype),LoadingImage.prototype.check=function(){if(this.getIsImageComplete())return void this.confirm(0!==this.img.naturalWidth,"naturalWidth");this.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&&void 0!==this.img.naturalWidth},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;this[method]&&this[method](event)},LoadingImage.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},LoadingImage.prototype.onerror=function(){this.confirm(!1,"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)},Background.prototype=Object.create(LoadingImage.prototype),Background.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"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])},ImagesLoaded.makeJQueryPlugin=function(jQuery){(jQuery=jQuery||window.jQuery)&&($=jQuery,$.fn.imagesLoaded=function(options,callback){return new ImagesLoaded(this,options,callback).jqDeferred.promise($(this))})},ImagesLoaded.makeJQueryPlugin(),ImagesLoaded}),function(window,factory){"function"==typeof define&&define.amd?define(["flickity/js/index","imagesloaded/imagesloaded"],function(Flickity,imagesLoaded){return factory(window,Flickity,imagesLoaded)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("flickity"),require("imagesloaded")):window.Flickity=factory(window,window.Flickity,window.imagesLoaded)}(window,function(window,Flickity,imagesLoaded){"use strict";Flickity.createMethods.push("_createImagesLoaded");var proto=Flickity.prototype;return proto._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)},proto.imagesLoaded=function(){function onImagesLoadedProgress(instance,image){var cell=_this.getParentCell(image.img);_this.cellSizeChange(cell&&cell.element),_this.options.freeScroll||_this.positionSliderAtSelected()}if(this.options.imagesLoaded){var _this=this;imagesLoaded(this.slider).on("progress",onImagesLoadedProgress)}},Flickity});
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.popup=function(parameters){var returnedValue,$allModules=$(this),$document=$(document),$window=$(window),$body=$("body"),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $allModules.each(function(){var $popup,$offsetParent,documentObserver,elementNamespace,id,module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.popup.settings,parameters):$.extend({},$.fn.popup.settings),selector=settings.selector,className=settings.className,error=settings.error,metadata=settings.metadata,namespace=settings.namespace,eventNamespace="."+settings.namespace,moduleNamespace="module-"+namespace,$module=$(this),$context=$(settings.context),$scrollContext=$(settings.scrollContext),$boundary=$(settings.boundary),$target=settings.target?$(settings.target):$module,searchDepth=0,triedPositions=!1,openedWithTouch=!1,element=this,instance=$module.data(moduleNamespace);module={initialize:function(){module.debug("Initializing",$module),module.createID(),module.bind.events(),!module.exists()&&settings.preserve&&module.create(),settings.observeChanges&&module.observeChanges(),module.instantiate()},instantiate:function(){module.verbose("Storing instance",module),instance=module,$module.data(moduleNamespace,instance)},observeChanges:function(){"MutationObserver"in window&&(documentObserver=new MutationObserver(module.event.documentChanged),documentObserver.observe(document,{childList:!0,subtree:!0}),module.debug("Setting up mutation observer",documentObserver))},refresh:function(){settings.popup?$popup=$(settings.popup).eq(0):settings.inline&&($popup=$target.nextAll(selector.popup).eq(0),settings.popup=$popup),settings.popup?($popup.addClass(className.loading),$offsetParent=module.get.offsetParent(),$popup.removeClass(className.loading),settings.movePopup&&module.has.popup()&&module.get.offsetParent($popup)[0]!==$offsetParent[0]&&(module.debug("Moving popup to the same offset parent as target"),$popup.detach().appendTo($offsetParent))):$offsetParent=settings.inline?module.get.offsetParent($target):module.has.popup()?module.get.offsetParent($popup):$body,$offsetParent.is("html")&&$offsetParent[0]!==$body[0]&&(module.debug("Setting page as offset parent"),$offsetParent=$body),module.get.variation()&&module.set.variation()},reposition:function(){module.refresh(),module.set.position()},destroy:function(){module.debug("Destroying previous module"),documentObserver&&documentObserver.disconnect(),$popup&&!settings.preserve&&module.removePopup(),clearTimeout(module.hideTimer),clearTimeout(module.showTimer),module.unbind.close(),module.unbind.events(),$module.removeData(moduleNamespace)},event:{start:function(event){var delay=$.isPlainObject(settings.delay)?settings.delay.show:settings.delay;clearTimeout(module.hideTimer),openedWithTouch||(module.showTimer=setTimeout(module.show,delay))},end:function(){var delay=$.isPlainObject(settings.delay)?settings.delay.hide:settings.delay;clearTimeout(module.showTimer),module.hideTimer=setTimeout(module.hide,delay)},touchstart:function(event){openedWithTouch=!0,module.show()},resize:function(){module.is.visible()&&module.set.position()},documentChanged:function(mutations){[].forEach.call(mutations,function(mutation){mutation.removedNodes&&[].forEach.call(mutation.removedNodes,function(node){(node==element||$(node).find(element).length>0)&&(module.debug("Element removed from DOM, tearing down events"),module.destroy())})})},hideGracefully:function(event){var $target=$(event.target),isInDOM=$.contains(document.documentElement,event.target),inPopup=$target.closest(selector.popup).length>0;event&&!inPopup&&isInDOM?(module.debug("Click occurred outside popup hiding popup"),module.hide()):module.debug("Click was inside popup, keeping popup open")}},create:function(){var html=module.get.html(),title=module.get.title(),content=module.get.content();html||content||title?(module.debug("Creating pop-up html"),html||(html=settings.templates.popup({title:title,content:content})),$popup=$("<div/>").addClass(className.popup).data(metadata.activator,$module).html(html),settings.inline?(module.verbose("Inserting popup element inline",$popup),$popup.insertAfter($module)):(module.verbose("Appending popup element to body",$popup),$popup.appendTo($context)),module.refresh(),module.set.variation(),settings.hoverable&&module.bind.popup(),settings.onCreate.call($popup,element)):0!==$target.next(selector.popup).length?(module.verbose("Pre-existing popup found"),settings.inline=!0,settings.popup=$target.next(selector.popup).data(metadata.activator,$module),module.refresh(),settings.hoverable&&module.bind.popup()):settings.popup?($(settings.popup).data(metadata.activator,$module),module.verbose("Used popup specified in settings"),module.refresh(),settings.hoverable&&module.bind.popup()):module.debug("No content specified skipping display",element)},createID:function(){id=(Math.random().toString(16)+"000000000").substr(2,8),elementNamespace="."+id,module.verbose("Creating unique id for element",id)},toggle:function(){module.debug("Toggling pop-up"),module.is.hidden()?(module.debug("Popup is hidden, showing pop-up"),module.unbind.close(),module.show()):(module.debug("Popup is visible, hiding pop-up"),module.hide())},show:function(callback){if(callback=callback||function(){},module.debug("Showing pop-up",settings.transition),module.is.hidden()&&(!module.is.active()||!module.is.dropdown())){if(module.exists()||module.create(),!1===settings.onShow.call($popup,element))return void module.debug("onShow callback returned false, cancelling popup animation");settings.preserve||settings.popup||module.refresh(),$popup&&module.set.position()&&(module.save.conditions(),settings.exclusive&&module.hideAll(),module.animate.show(callback))}},hide:function(callback){if(callback=callback||function(){},module.is.visible()||module.is.animating()){if(!1===settings.onHide.call($popup,element))return void module.debug("onHide callback returned false, cancelling popup animation");module.remove.visible(),module.unbind.close(),module.restore.conditions(),module.animate.hide(callback)}},hideAll:function(){$(selector.popup).filter("."+className.popupVisible).each(function(){$(this).data(metadata.activator).popup("hide")})},exists:function(){return!!$popup&&(settings.inline||settings.popup?module.has.popup():$popup.closest($context).length>=1)},removePopup:function(){module.has.popup()&&!settings.popup&&(module.debug("Removing popup",$popup),$popup.remove(),$popup=void 0,settings.onRemove.call($popup,element))},save:{conditions:function(){module.cache={title:$module.attr("title")},module.cache.title&&$module.removeAttr("title"),module.verbose("Saving original attributes",module.cache.title)}},restore:{conditions:function(){return module.cache&&module.cache.title&&($module.attr("title",module.cache.title),module.verbose("Restoring original attributes",module.cache.title)),!0}},supports:{svg:function(){return"undefined"==typeof SVGGraphicsElement}},animate:{show:function(callback){callback=$.isFunction(callback)?callback:function(){},settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")?(module.set.visible(),$popup.transition({animation:settings.transition+" in",queue:!1,debug:settings.debug,verbose:settings.verbose,duration:settings.duration,onComplete:function(){module.bind.close(),callback.call($popup,element),settings.onVisible.call($popup,element)}})):module.error(error.noTransition)},hide:function(callback){if(callback=$.isFunction(callback)?callback:function(){},module.debug("Hiding pop-up"),!1===settings.onHide.call($popup,element))return void module.debug("onHide callback returned false, cancelling popup animation");settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")?$popup.transition({animation:settings.transition+" out",queue:!1,duration:settings.duration,debug:settings.debug,verbose:settings.verbose,onComplete:function(){module.reset(),callback.call($popup,element),settings.onHidden.call($popup,element)}}):module.error(error.noTransition)}},change:{content:function(html){$popup.html(html)}},get:{html:function(){return $module.removeData(metadata.html),$module.data(metadata.html)||settings.html},title:function(){return $module.removeData(metadata.title),$module.data(metadata.title)||settings.title},content:function(){return $module.removeData(metadata.content),$module.data(metadata.content)||settings.content||$module.attr("title")},variation:function(){return $module.removeData(metadata.variation),$module.data(metadata.variation)||settings.variation},popup:function(){return $popup},popupOffset:function(){return $popup.offset()},calculations:function(){var screen,$popupOffsetParent=module.get.offsetParent($popup),targetElement=$target[0],isWindow=$boundary[0]==window,targetPosition=settings.inline||settings.popup&&settings.movePopup?$target.position():$target.offset(),screenPosition=isWindow?{top:0,left:0}:$boundary.offset(),calculations={},scroll=isWindow?{top:$window.scrollTop(),left:$window.scrollLeft()}:{top:0,left:0};if(calculations={target:{element:$target[0],width:$target.outerWidth(),height:$target.outerHeight(),top:targetPosition.top,left:targetPosition.left,margin:{}},popup:{width:$popup.outerWidth(),height:$popup.outerHeight()},parent:{width:$offsetParent.outerWidth(),height:$offsetParent.outerHeight()},screen:{top:screenPosition.top,left:screenPosition.left,scroll:{top:scroll.top,left:scroll.left},width:$boundary.width(),height:$boundary.height()}},$popupOffsetParent.get(0)!==$offsetParent.get(0)){var popupOffset=$popupOffsetParent.offset();calculations.target.top-=popupOffset.top,calculations.target.left-=popupOffset.left,calculations.parent.width=$popupOffsetParent.outerWidth(),calculations.parent.height=$popupOffsetParent.outerHeight()}return settings.setFluidWidth&&module.is.fluid()&&(calculations.container={width:$popup.parent().outerWidth()},calculations.popup.width=calculations.container.width),calculations.target.margin.top=settings.inline?parseInt(window.getComputedStyle(targetElement).getPropertyValue("margin-top"),10):0,calculations.target.margin.left=settings.inline?module.is.rtl()?parseInt(window.getComputedStyle(targetElement).getPropertyValue("margin-right"),10):parseInt(window.getComputedStyle(targetElement).getPropertyValue("margin-left"),10):0,screen=calculations.screen,calculations.boundary={top:screen.top+screen.scroll.top,bottom:screen.top+screen.scroll.top+screen.height,left:screen.left+screen.scroll.left,right:screen.left+screen.scroll.left+screen.width},calculations},id:function(){return id},startEvent:function(){return"hover"==settings.on?"mouseenter":"focus"==settings.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==settings.on?"mouseleave":"focus"==settings.on&&"blur"},distanceFromBoundary:function(offset,calculations){var popup,boundary,distanceFromBoundary={};return calculations=calculations||module.get.calculations(),popup=calculations.popup,boundary=calculations.boundary,offset&&(distanceFromBoundary={top:offset.top-boundary.top,left:offset.left-boundary.left,right:boundary.right-(offset.left+popup.width),bottom:boundary.bottom-(offset.top+popup.height)},module.verbose("Distance from boundaries determined",offset,distanceFromBoundary)),distanceFromBoundary},offsetParent:function($element){var element=void 0!==$element?$element[0]:$target[0],parentNode=element.parentNode,$node=$(parentNode);if(parentNode)for(var is2D="none"===$node.css("transform"),isStatic="static"===$node.css("position"),isBody=$node.is("body");parentNode&&!isBody&&isStatic&&is2D;)parentNode=parentNode.parentNode,$node=$(parentNode),is2D="none"===$node.css("transform"),isStatic="static"===$node.css("position"),isBody=$node.is("body");return $node&&$node.length>0?$node:$()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(position){var positions=position.split(" "),verticalPosition=positions[0],horizontalPosition=positions[1],opposite={top:"bottom",bottom:"top",left:"right",right:"left"},adjacent={left:"center",center:"right",right:"left"},backup={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"},adjacentsAvailable="top"==verticalPosition||"bottom"==verticalPosition,oppositeTried=!1,adjacentTried=!1,nextPosition=!1;return triedPositions||(module.verbose("All available positions available"),triedPositions=module.get.positions()),module.debug("Recording last position tried",position),triedPositions[position]=!0,"opposite"===settings.prefer&&(nextPosition=[opposite[verticalPosition],horizontalPosition],nextPosition=nextPosition.join(" "),oppositeTried=!0===triedPositions[nextPosition],module.debug("Trying opposite strategy",nextPosition)),"adjacent"===settings.prefer&&adjacentsAvailable&&(nextPosition=[verticalPosition,adjacent[horizontalPosition]],nextPosition=nextPosition.join(" "),adjacentTried=!0===triedPositions[nextPosition],module.debug("Trying adjacent strategy",nextPosition)),(adjacentTried||oppositeTried)&&(module.debug("Using backup position",nextPosition),nextPosition=backup[position]),nextPosition}},set:{position:function(position,calculations){if(0===$target.length||0===$popup.length)return void module.error(error.notFound);var offset,distanceAway,target,popup,parent,positioning,popupOffset,distanceFromBoundary;if(calculations=calculations||module.get.calculations(),position=position||$module.data(metadata.position)||settings.position,offset=$module.data(metadata.offset)||settings.offset,distanceAway=settings.distanceAway,target=calculations.target,popup=calculations.popup,parent=calculations.parent,module.should.centerArrow(calculations)&&(module.verbose("Adjusting offset to center arrow on small target element"),"top left"!=position&&"bottom left"!=position||(offset+=target.width/2,offset-=settings.arrowPixelsFromEdge),"top right"!=position&&"bottom right"!=position||(offset-=target.width/2,offset+=settings.arrowPixelsFromEdge)),0===target.width&&0===target.height&&!module.is.svg(target.element))return module.debug("Popup target is hidden, no action taken"),!1;switch(settings.inline&&(module.debug("Adding margin to calculation",target.margin),"left center"==position||"right center"==position?(offset+=target.margin.top,distanceAway+=-target.margin.left):"top left"==position||"top center"==position||"top right"==position?(offset+=target.margin.left,distanceAway-=target.margin.top):(offset+=target.margin.left,distanceAway+=target.margin.top)),module.debug("Determining popup position from calculations",position,calculations),module.is.rtl()&&(position=position.replace(/left|right/g,function(match){return"left"==match?"right":"left"}),module.debug("RTL: Popup position updated",position)),searchDepth==settings.maxSearchDepth&&"string"==typeof settings.lastResort&&(position=settings.lastResort),position){case"top left":positioning={top:"auto",bottom:parent.height-target.top+distanceAway,left:target.left+offset,right:"auto"};break;case"top center":positioning={bottom:parent.height-target.top+distanceAway,left:target.left+target.width/2-popup.width/2+offset,top:"auto",right:"auto"};break;case"top right":positioning={bottom:parent.height-target.top+distanceAway,right:parent.width-target.left-target.width-offset,top:"auto",left:"auto"};break;case"left center":positioning={top:target.top+target.height/2-popup.height/2+offset,right:parent.width-target.left+distanceAway,left:"auto",bottom:"auto"};break;case"right center":positioning={top:target.top+target.height/2-popup.height/2+offset,left:target.left+target.width+distanceAway,bottom:"auto",right:"auto"};break;case"bottom left":positioning={top:target.top+target.height+distanceAway,left:target.left+offset,bottom:"auto",right:"auto"};break;case"bottom center":positioning={top:target.top+target.height+distanceAway,left:target.left+target.width/2-popup.width/2+offset,bottom:"auto",right:"auto"};break;case"bottom right":positioning={top:target.top+target.height+distanceAway,right:parent.width-target.left-target.width-offset,left:"auto",bottom:"auto"}}if(void 0===positioning&&module.error(error.invalidPosition,position),module.debug("Calculated popup positioning values",positioning),$popup.css(positioning).removeClass(className.position).addClass(position).addClass(className.loading),popupOffset=module.get.popupOffset(),distanceFromBoundary=module.get.distanceFromBoundary(popupOffset,calculations),module.is.offstage(distanceFromBoundary,position)){if(module.debug("Position is outside viewport",position),searchDepth<settings.maxSearchDepth)return searchDepth++,position=module.get.nextPosition(position),module.debug("Trying new position",position),!!$popup&&module.set.position(position,calculations);if(!settings.lastResort)return module.debug("Popup could not find a position to display",$popup),module.error(error.cannotPlace,element),module.remove.attempts(),module.remove.loading(),module.reset(),settings.onUnplaceable.call($popup,element),!1;module.debug("No position found, showing with last position")}return module.debug("Position is on stage",position),module.remove.attempts(),module.remove.loading(),settings.setFluidWidth&&module.is.fluid()&&module.set.fluidWidth(calculations),!0},fluidWidth:function(calculations){calculations=calculations||module.get.calculations(),module.debug("Automatically setting element width to parent width",calculations.parent.width),$popup.css("width",calculations.container.width)},variation:function(variation){(variation=variation||module.get.variation())&&module.has.popup()&&(module.verbose("Adding variation to popup",variation),$popup.addClass(variation))},visible:function(){$module.addClass(className.visible)}},remove:{loading:function(){$popup.removeClass(className.loading)},variation:function(variation){(variation=variation||module.get.variation())&&(module.verbose("Removing variation",variation),$popup.removeClass(variation))},visible:function(){$module.removeClass(className.visible)},attempts:function(){module.verbose("Resetting all searched positions"),searchDepth=0,triedPositions=!1}},bind:{events:function(){module.debug("Binding popup events to module"),"click"==settings.on&&$module.on("click"+eventNamespace,module.toggle),"hover"==settings.on&&$module.on("touchstart"+eventNamespace,module.event.touchstart),module.get.startEvent()&&$module.on(module.get.startEvent()+eventNamespace,module.event.start).on(module.get.endEvent()+eventNamespace,module.event.end),settings.target&&module.debug("Target set to element",$target),$window.on("resize"+elementNamespace,module.event.resize)},popup:function(){module.verbose("Allowing hover events on popup to prevent closing"),$popup&&module.has.popup()&&$popup.on("mouseenter"+eventNamespace,module.event.start).on("mouseleave"+eventNamespace,module.event.end)},close:function(){(!0===settings.hideOnScroll||"auto"==settings.hideOnScroll&&"click"!=settings.on)&&module.bind.closeOnScroll(),module.is.closable()?module.bind.clickaway():"hover"==settings.on&&openedWithTouch&&module.bind.touchClose()},closeOnScroll:function(){module.verbose("Binding scroll close event to document"),$scrollContext.one(module.get.scrollEvent()+elementNamespace,module.event.hideGracefully)},touchClose:function(){module.verbose("Binding popup touchclose event to document"),$document.on("touchstart"+elementNamespace,function(event){module.verbose("Touched away from popup"),module.event.hideGracefully.call(element,event)})},clickaway:function(){module.verbose("Binding popup close event to document"),$document.on("click"+elementNamespace,function(event){module.verbose("Clicked away from popup"),module.event.hideGracefully.call(element,event)})}},unbind:{events:function(){$window.off(elementNamespace),$module.off(eventNamespace)},close:function(){$document.off(elementNamespace),$scrollContext.off(elementNamespace)}},has:{popup:function(){return $popup&&$popup.length>0}},should:{centerArrow:function(calculations){return!module.is.basic()&&calculations.target.width<=2*settings.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==settings.closable?"hover"!=settings.on:settings.closable},offstage:function(distanceFromBoundary,position){var offstage=[];return $.each(distanceFromBoundary,function(direction,distance){distance<-settings.jitter&&(module.debug("Position exceeds allowable distance from edge",direction,distance,position),offstage.push(direction))}),offstage.length>0},svg:function(element){return module.supports.svg()&&element instanceof SVGGraphicsElement},basic:function(){return $module.hasClass(className.basic)},active:function(){return $module.hasClass(className.active)},animating:function(){return void 0!==$popup&&$popup.hasClass(className.animating)},fluid:function(){return void 0!==$popup&&$popup.hasClass(className.fluid)},visible:function(){return void 0!==$popup&&$popup.hasClass(className.popupVisible)},dropdown:function(){return $module.hasClass(className.dropdown)},hidden:function(){return!module.is.visible()},rtl:function(){return"rtl"==$module.css("direction")}},reset:function(){module.remove.visible(),settings.preserve?void 0!==$.fn.transition&&$popup.transition("remove transition"):module.removePopup()},setting:function(name,value){if($.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]&&(found=object[value],!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:window,addTouchEvents:!0,position:"top left",variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:window,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(string){var badChars=/[&<>"'`]/g,shouldEscape=/[&<>"'`]/,escape={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},escapedChar=function(chr){return escape[chr]};return shouldEscape.test(string)?string.replace(badChars,escapedChar):string},popup:function(text){var html="",escape=$.fn.popup.settings.templates.escape;return void 0!==typeof text&&(void 0!==typeof text.title&&text.title&&(text.title=escape(text.title),html+='<div class="header">'+text.title+"</div>"),void 0!==typeof text.content&&text.content&&(text.content=escape(text.content),html+='<div class="content">'+text.content+"</div>")),html}}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.dropdown=function(parameters){var returnedValue,$allModules=$(this),$document=$(document),moduleSelector=$allModules.selector||"",hasTouch="ontouchstart"in document.documentElement,time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $allModules.each(function(elementIndex){var initialLoad,pageLostFocus,willRefocus,elementNamespace,id,selectObserver,menuObserver,module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.dropdown.settings,parameters):$.extend({},$.fn.dropdown.settings),className=settings.className,message=settings.message,fields=settings.fields,keys=settings.keys,metadata=settings.metadata,namespace=settings.namespace,regExp=settings.regExp,selector=settings.selector,error=settings.error,templates=settings.templates,eventNamespace="."+namespace,moduleNamespace="module-"+namespace,$module=$(this),$context=$(settings.context),$text=$module.find(selector.text),$search=$module.find(selector.search),$sizer=$module.find(selector.sizer),$input=$module.find(selector.input),$icon=$module.find(selector.icon),$combo=$module.prev().find(selector.text).length>0?$module.prev().find(selector.text):$module.prev(),$menu=$module.children(selector.menu),$item=$menu.find(selector.item),activated=!1,itemActivated=!1,internalChange=!1,element=this,instance=$module.data(moduleNamespace);module={initialize:function(){module.debug("Initializing dropdown",settings),module.is.alreadySetup()?module.setup.reference():(module.setup.layout(),settings.values&&module.change.values(settings.values),module.refreshData(),module.save.defaults(),module.restore.selected(),module.create.id(),module.bind.events(),module.observeChanges(),module.instantiate())},instantiate:function(){module.verbose("Storing instance of dropdown",module),instance=module,$module.data(moduleNamespace,module)},destroy:function(){module.verbose("Destroying previous dropdown",$module),module.remove.tabbable(),$module.off(eventNamespace).removeData(moduleNamespace),$menu.off(eventNamespace),$document.off(elementNamespace),module.disconnect.menuObserver(),module.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in window&&(selectObserver=new MutationObserver(module.event.select.mutation),menuObserver=new MutationObserver(module.event.menu.mutation),module.debug("Setting up mutation observer",selectObserver,menuObserver),module.observe.select(),module.observe.menu())},disconnect:{menuObserver:function(){menuObserver&&menuObserver.disconnect()},selectObserver:function(){selectObserver&&selectObserver.disconnect()}},observe:{select:function(){module.has.input()&&selectObserver.observe($module[0],{childList:!0,subtree:!0})},menu:function(){module.has.menu()&&menuObserver.observe($menu[0],{childList:!0,subtree:!0})}},create:{id:function(){id=(Math.random().toString(16)+"000000000").substr(2,8),elementNamespace="."+id,module.verbose("Creating unique id for element",id)},userChoice:function(values){var $userChoices,$userChoice,html;return!!(values=values||module.get.userValues())&&(values=$.isArray(values)?values:[values],$.each(values,function(index,value){!1===module.get.item(value)&&(html=settings.templates.addition(module.add.variables(message.addResult,value)),$userChoice=$("<div />").html(html).attr("data-"+metadata.value,value).attr("data-"+metadata.text,value).addClass(className.addition).addClass(className.item),settings.hideAdditions&&$userChoice.addClass(className.hidden),$userChoices=void 0===$userChoices?$userChoice:$userChoices.add($userChoice),module.verbose("Creating user choices for value",value,$userChoice))}),$userChoices)},userLabels:function(value){var userValues=module.get.userValues();userValues&&(module.debug("Adding user labels",userValues),$.each(userValues,function(index,value){module.verbose("Adding custom user value"),module.add.label(value,value)}))},menu:function(){$menu=$("<div />").addClass(className.menu).appendTo($module)},sizer:function(){$sizer=$("<span />").addClass(className.sizer).insertAfter($search)}},search:function(query){query=void 0!==query?query:module.get.query(),module.verbose("Searching for query",query),module.has.minCharacters(query)?module.filter(query):module.hide()},select:{firstUnfiltered:function(){module.verbose("Selecting first non-filtered element"),module.remove.selectedItem(),$item.not(selector.unselectable).not(selector.addition+selector.hidden).eq(0).addClass(className.selected)},nextAvailable:function($selected){$selected=$selected.eq(0);var $nextAvailable=$selected.nextAll(selector.item).not(selector.unselectable).eq(0),$prevAvailable=$selected.prevAll(selector.item).not(selector.unselectable).eq(0);$nextAvailable.length>0?(module.verbose("Moving selection to",$nextAvailable),$nextAvailable.addClass(className.selected)):(module.verbose("Moving selection to",$prevAvailable),$prevAvailable.addClass(className.selected))}},setup:{api:function(){var apiSettings={debug:settings.debug,urlData:{value:module.get.value(),query:module.get.query()},on:!1};module.verbose("First request, initializing API"),$module.api(apiSettings)},layout:function(){$module.is("select")&&(module.setup.select(),module.setup.returnedObject()),module.has.menu()||module.create.menu(),module.is.search()&&!module.has.search()&&(module.verbose("Adding search input"),$search=$("<input />").addClass(className.search).prop("autocomplete","off").insertBefore($text)),module.is.multiple()&&module.is.searchSelection()&&!module.has.sizer()&&module.create.sizer(),settings.allowTab&&module.set.tabbable()},select:function(){var selectValues=module.get.selectValues();module.debug("Dropdown initialized on a select",selectValues),$module.is("select")&&($input=$module),$input.parent(selector.dropdown).length>0?(module.debug("UI dropdown already exists. Creating dropdown menu only"),$module=$input.closest(selector.dropdown),module.has.menu()||module.create.menu(),$menu=$module.children(selector.menu),module.setup.menu(selectValues)):(module.debug("Creating entire dropdown from select"),$module=$("<div />").attr("class",$input.attr("class")).addClass(className.selection).addClass(className.dropdown).html(templates.dropdown(selectValues)).insertBefore($input),$input.hasClass(className.multiple)&&!1===$input.prop("multiple")&&(module.error(error.missingMultiple),$input.prop("multiple",!0)),$input.is("[multiple]")&&module.set.multiple(),$input.prop("disabled")&&(module.debug("Disabling dropdown"),$module.addClass(className.disabled)),$input.removeAttr("class").detach().prependTo($module)),module.refresh()},menu:function(values){$menu.html(templates.menu(values,fields)),$item=$menu.find(selector.item)},reference:function(){module.debug("Dropdown behavior was called on select, replacing with closest dropdown"),$module=$module.parent(selector.dropdown),instance=$module.data(moduleNamespace),element=$module.get(0),module.refresh(),module.setup.returnedObject()},returnedObject:function(){var $firstModules=$allModules.slice(0,elementIndex),$lastModules=$allModules.slice(elementIndex+1);$allModules=$firstModules.add($module).add($lastModules)}},refresh:function(){module.refreshSelectors(),module.refreshData()},refreshItems:function(){$item=$menu.find(selector.item)},refreshSelectors:function(){module.verbose("Refreshing selector cache"),$text=$module.find(selector.text),$search=$module.find(selector.search),$input=$module.find(selector.input),$icon=$module.find(selector.icon),$combo=$module.prev().find(selector.text).length>0?$module.prev().find(selector.text):$module.prev(),$menu=$module.children(selector.menu),$item=$menu.find(selector.item)},refreshData:function(){module.verbose("Refreshing cached metadata"),$item.removeData(metadata.text).removeData(metadata.value)},clearData:function(){module.verbose("Clearing metadata"),$item.removeData(metadata.text).removeData(metadata.value),$module.removeData(metadata.defaultText).removeData(metadata.defaultValue).removeData(metadata.placeholderText)},toggle:function(){module.verbose("Toggling menu visibility"),module.is.active()?module.hide():module.show()},show:function(callback){if(callback=$.isFunction(callback)?callback:function(){},!module.can.show()&&module.is.remote()&&(module.debug("No API results retrieved, searching before show"),module.queryRemote(module.get.query(),module.show)),module.can.show()&&!module.is.active()){if(module.debug("Showing dropdown"),!module.has.message()||module.has.maxSelections()||module.has.allResultsFiltered()||module.remove.message(),module.is.allFiltered())return!0;!1!==settings.onShow.call(element)&&module.animate.show(function(){module.can.click()&&module.bind.intent(),module.has.menuSearch()&&module.focusSearch(),module.set.visible(),callback.call(element)})}},hide:function(callback){callback=$.isFunction(callback)?callback:function(){},module.is.active()&&!module.is.animatingOutward()&&(module.debug("Hiding dropdown"),!1!==settings.onHide.call(element)&&module.animate.hide(function(){module.remove.visible(),callback.call(element)}))},hideOthers:function(){module.verbose("Finding other dropdowns to hide"),$allModules.not($module).has(selector.menu+"."+className.visible).dropdown("hide")},hideMenu:function(){module.verbose("Hiding menu  instantaneously"),module.remove.active(),module.remove.visible(),$menu.transition("hide")},hideSubMenus:function(){var $subMenus=$menu.children(selector.item).find(selector.menu);module.verbose("Hiding sub menus",$subMenus),$subMenus.transition("hide")},bind:{events:function(){hasTouch&&module.bind.touchEvents(),module.bind.keyboardEvents(),module.bind.inputEvents(),module.bind.mouseEvents()},touchEvents:function(){module.debug("Touch device detected binding additional touch events"),module.is.searchSelection()||module.is.single()&&$module.on("touchstart"+eventNamespace,module.event.test.toggle),$menu.on("touchstart"+eventNamespace,selector.item,module.event.item.mouseenter)},keyboardEvents:function(){module.verbose("Binding keyboard events"),$module.on("keydown"+eventNamespace,module.event.keydown),module.has.search()&&$module.on(module.get.inputEvent()+eventNamespace,selector.search,module.event.input),module.is.multiple()&&$document.on("keydown"+elementNamespace,module.event.document.keydown)},inputEvents:function(){module.verbose("Binding input change events"),$module.on("change"+eventNamespace,selector.input,module.event.change)},mouseEvents:function(){module.verbose("Binding mouse events"),module.is.multiple()&&$module.on("click"+eventNamespace,selector.label,module.event.label.click).on("click"+eventNamespace,selector.remove,module.event.remove.click),module.is.searchSelection()?($module.on("mousedown"+eventNamespace,module.event.mousedown).on("mouseup"+eventNamespace,module.event.mouseup).on("mousedown"+eventNamespace,selector.menu,module.event.menu.mousedown).on("mouseup"+eventNamespace,selector.menu,module.event.menu.mouseup).on("click"+eventNamespace,selector.icon,module.event.icon.click).on("focus"+eventNamespace,selector.search,module.event.search.focus).on("click"+eventNamespace,selector.search,module.event.search.focus).on("blur"+eventNamespace,selector.search,module.event.search.blur).on("click"+eventNamespace,selector.text,module.event.text.focus),module.is.multiple()&&$module.on("click"+eventNamespace,module.event.click)):("click"==settings.on?$module.on("click"+eventNamespace,module.event.test.toggle):"hover"==settings.on?$module.on("mouseenter"+eventNamespace,module.delay.show).on("mouseleave"+eventNamespace,module.delay.hide):$module.on(settings.on+eventNamespace,module.toggle),$module.on("click"+eventNamespace,selector.icon,module.event.icon.click).on("mousedown"+eventNamespace,module.event.mousedown).on("mouseup"+eventNamespace,module.event.mouseup).on("focus"+eventNamespace,module.event.focus),module.has.menuSearch()?$module.on("blur"+eventNamespace,selector.search,module.event.search.blur):$module.on("blur"+eventNamespace,module.event.blur)),$menu.on("mouseenter"+eventNamespace,selector.item,module.event.item.mouseenter).on("mouseleave"+eventNamespace,selector.item,module.event.item.mouseleave).on("click"+eventNamespace,selector.item,module.event.item.click)},intent:function(){module.verbose("Binding hide intent event to document"),hasTouch&&$document.on("touchstart"+elementNamespace,module.event.test.touch).on("touchmove"+elementNamespace,module.event.test.touch),$document.on("click"+elementNamespace,module.event.test.hide)}},unbind:{intent:function(){module.verbose("Removing hide intent event from document"),hasTouch&&$document.off("touchstart"+elementNamespace).off("touchmove"+elementNamespace),$document.off("click"+elementNamespace)}},filter:function(query){var searchTerm=void 0!==query?query:module.get.query(),afterFiltered=function(){module.is.multiple()&&module.filterActive(),(query||!query&&0==module.get.activeItem().length)&&module.select.firstUnfiltered(),module.has.allResultsFiltered()?settings.onNoResults.call(element,searchTerm)?settings.allowAdditions?settings.hideAdditions&&(module.verbose("User addition with no menu, setting empty style"),module.set.empty(),module.hideMenu()):(module.verbose("All items filtered, showing message",searchTerm),module.add.message(message.noResults)):(module.verbose("All items filtered, hiding dropdown",searchTerm),module.hideMenu()):(module.remove.empty(),module.remove.message()),settings.allowAdditions&&module.add.userSuggestion(query),module.is.searchSelection()&&module.can.show()&&module.is.focusedOnSearch()&&module.show()};settings.useLabels&&module.has.maxSelections()||(settings.apiSettings?module.can.useAPI()?module.queryRemote(searchTerm,function(){settings.filterRemoteData&&module.filterItems(searchTerm),afterFiltered()}):module.error(error.noAPI):(module.filterItems(searchTerm),afterFiltered()))},queryRemote:function(query,callback){var apiSettings={errorDuration:!1,cache:"local",throttle:settings.throttle,urlData:{query:query},onError:function(){module.add.message(message.serverError),callback()},onFailure:function(){module.add.message(message.serverError),callback()},onSuccess:function(response){var values=response[fields.remoteValues];$.isArray(values)&&values.length>0?(module.remove.message(),module.setup.menu({values:response[fields.remoteValues]})):module.add.message(message.noResults),callback()}};$module.api("get request")||module.setup.api(),apiSettings=$.extend(!0,{},apiSettings,settings.apiSettings),$module.api("setting",apiSettings).api("query")},filterItems:function(query){var searchTerm=void 0!==query?query:module.get.query(),results=null,escapedTerm=module.escape.string(searchTerm),beginsWithRegExp=new RegExp("^"+escapedTerm,"igm");module.has.query()&&(results=[],module.verbose("Searching for matching values",searchTerm),$item.each(function(){var text,value,$choice=$(this);if("both"==settings.match||"text"==settings.match){if(text=String(module.get.choiceText($choice,!1)),-1!==text.search(beginsWithRegExp))return results.push(this),!0;if("exact"===settings.fullTextSearch&&module.exactSearch(searchTerm,text))return results.push(this),!0;if(!0===settings.fullTextSearch&&module.fuzzySearch(searchTerm,text))return results.push(this),!0}if("both"==settings.match||"value"==settings.match){if(value=String(module.get.choiceValue($choice,text)),-1!==value.search(beginsWithRegExp))return results.push(this),!0;if("exact"===settings.fullTextSearch&&module.exactSearch(searchTerm,value))return results.push(this),!0;if(!0===settings.fullTextSearch&&module.fuzzySearch(searchTerm,value))return results.push(this),!0}})),module.debug("Showing only matched items",searchTerm),module.remove.filteredItem(),results&&$item.not(results).addClass(className.filtered)},fuzzySearch:function(query,term){var termLength=term.length,queryLength=query.length;if(query=query.toLowerCase(),term=term.toLowerCase(),queryLength>termLength)return!1;if(queryLength===termLength)return query===term;search:for(var characterIndex=0,nextCharacterIndex=0;characterIndex<queryLength;characterIndex++){for(var queryCharacter=query.charCodeAt(characterIndex);nextCharacterIndex<termLength;)if(term.charCodeAt(nextCharacterIndex++)===queryCharacter)continue search;return!1}return!0},exactSearch:function(query,term){return query=query.toLowerCase(),term=term.toLowerCase(),term.indexOf(query)>-1},filterActive:function(){settings.useLabels&&$item.filter("."+className.active).addClass(className.filtered)},focusSearch:function(skipHandler){module.has.search()&&!module.is.focusedOnSearch()&&(skipHandler?($module.off("focus"+eventNamespace,selector.search),$search.focus(),$module.on("focus"+eventNamespace,selector.search,module.event.search.focus)):$search.focus())},forceSelection:function(){var $currentlySelected=$item.not(className.filtered).filter("."+className.selected).eq(0),$activeItem=$item.not(className.filtered).filter("."+className.active).eq(0),$selectedItem=$currentlySelected.length>0?$currentlySelected:$activeItem;if($selectedItem.length>0&&!module.is.multiple())return module.debug("Forcing partial selection to selected item",$selectedItem),void module.event.item.click.call($selectedItem,{},!0);settings.allowAdditions?(module.set.selected(module.get.query()),module.remove.searchTerm()):module.remove.searchTerm()},change:{values:function(values){settings.allowAdditions||module.clear(),module.debug("Creating dropdown with specified values",values),module.setup.menu({values:values}),$.each(values,function(index,item){if(1==item.selected)return module.debug("Setting initial selection to",item.value),module.set.selected(item.value),!0})}},event:{change:function(){internalChange||(module.debug("Input changed, updating selection"),module.set.selected())},focus:function(){settings.showOnFocus&&!activated&&module.is.hidden()&&!pageLostFocus&&module.show()},blur:function(event){pageLostFocus=document.activeElement===this,activated||pageLostFocus||(module.remove.activeLabel(),module.hide())},mousedown:function(){module.is.searchSelection()?willRefocus=!0:activated=!0},mouseup:function(){module.is.searchSelection()?willRefocus=!1:activated=!1},click:function(event){$(event.target).is($module)&&(module.is.focusedOnSearch()?module.show():module.focusSearch())},search:{focus:function(){activated=!0,module.is.multiple()&&module.remove.activeLabel(),settings.showOnFocus&&module.search()},blur:function(event){pageLostFocus=document.activeElement===this,module.is.searchSelection()&&!willRefocus&&(itemActivated||pageLostFocus||(settings.forceSelection&&module.forceSelection(),module.hide())),willRefocus=!1}},icon:{click:function(event){$icon.hasClass(className.clear)?module.clear():module.can.click()&&module.toggle()}},text:{focus:function(event){activated=!0,module.focusSearch()}},input:function(event){(module.is.multiple()||module.is.searchSelection())&&module.set.filtered(),clearTimeout(module.timer),module.timer=setTimeout(module.search,settings.delay.search)},label:{click:function(event){var $label=$(this),$labels=$module.find(selector.label),$activeLabels=$labels.filter("."+className.active),$nextActive=$label.nextAll("."+className.active),$prevActive=$label.prevAll("."+className.active),$range=$nextActive.length>0?$label.nextUntil($nextActive).add($activeLabels).add($label):$label.prevUntil($prevActive).add($activeLabels).add($label);event.shiftKey?($activeLabels.removeClass(className.active),$range.addClass(className.active)):event.ctrlKey?$label.toggleClass(className.active):($activeLabels.removeClass(className.active),$label.addClass(className.active)),settings.onLabelSelect.apply(this,$labels.filter("."+className.active))}},remove:{click:function(){var $label=$(this).parent();$label.hasClass(className.active)?module.remove.activeLabels():module.remove.activeLabels($label)}},test:{toggle:function(event){var toggleBehavior=module.is.multiple()?module.show:module.toggle;module.is.bubbledLabelClick(event)||module.is.bubbledIconClick(event)||module.determine.eventOnElement(event,toggleBehavior)&&event.preventDefault()},touch:function(event){module.determine.eventOnElement(event,function(){"touchstart"==event.type?module.timer=setTimeout(function(){module.hide()},settings.delay.touch):"touchmove"==event.type&&clearTimeout(module.timer)}),event.stopPropagation()},hide:function(event){module.determine.eventInModule(event,module.hide)}},select:{mutation:function(mutations){module.debug("<select> modified, recreating menu");var isSelectMutation=!1;$.each(mutations,function(index,mutation){if($(mutation.target).is("select")||$(mutation.addedNodes).is("select"))return isSelectMutation=!0,!0}),isSelectMutation&&(module.disconnect.selectObserver(),module.refresh(),module.setup.select(),module.set.selected(),module.observe.select())}},menu:{mutation:function(mutations){var mutation=mutations[0],$addedNode=$(mutation.addedNodes?mutation.addedNodes[0]:!1),$removedNode=$(mutation.removedNodes?mutation.removedNodes[0]:!1),$changedNodes=$addedNode.add($removedNode),isUserAddition=$changedNodes.is(selector.addition)||$changedNodes.closest(selector.addition).length>0,isMessage=$changedNodes.is(selector.message)||$changedNodes.closest(selector.message).length>0;isUserAddition||isMessage?(module.debug("Updating item selector cache"),module.refreshItems()):(module.debug("Menu modified, updating selector cache"),module.refresh())},mousedown:function(){itemActivated=!0},mouseup:function(){itemActivated=!1}},item:{mouseenter:function(event){var $target=$(event.target),$item=$(this),$subMenu=$item.children(selector.menu),$otherMenus=$item.siblings(selector.item).children(selector.menu),hasSubMenu=$subMenu.length>0;!($subMenu.find($target).length>0)&&hasSubMenu&&(clearTimeout(module.itemTimer),module.itemTimer=setTimeout(function(){module.verbose("Showing sub-menu",$subMenu),$.each($otherMenus,function(){module.animate.hide(!1,$(this))}),module.animate.show(!1,$subMenu)},settings.delay.show),event.preventDefault())},mouseleave:function(event){var $subMenu=$(this).children(selector.menu);$subMenu.length>0&&(clearTimeout(module.itemTimer),module.itemTimer=setTimeout(function(){module.verbose("Hiding sub-menu",$subMenu),module.animate.hide(!1,$subMenu)},settings.delay.hide))},click:function(event,skipRefocus){var $choice=$(this),$target=$(event?event.target:""),$subMenu=$choice.find(selector.menu),text=module.get.choiceText($choice),value=module.get.choiceValue($choice,text),hasSubMenu=$subMenu.length>0,isBubbledEvent=$subMenu.find($target).length>0;module.has.menuSearch()&&$(document.activeElement).blur(),isBubbledEvent||hasSubMenu&&!settings.allowCategorySelection||(module.is.searchSelection()&&(settings.allowAdditions&&module.remove.userAddition(),module.remove.searchTerm(),module.is.focusedOnSearch()||1==skipRefocus||module.focusSearch(!0)),settings.useLabels||(module.remove.filteredItem(),module.set.scrollPosition($choice)),module.determine.selectAction.call(this,text,value))}},document:{keydown:function(event){var pressedKey=event.which;if(module.is.inObject(pressedKey,keys)){var $label=$module.find(selector.label),$activeLabel=$label.filter("."+className.active),labelIndex=($activeLabel.data(metadata.value),$label.index($activeLabel)),labelCount=$label.length,hasActiveLabel=$activeLabel.length>0,hasMultipleActive=$activeLabel.length>1,isFirstLabel=0===labelIndex,isLastLabel=labelIndex+1==labelCount,isSearch=module.is.searchSelection(),isFocusedOnSearch=module.is.focusedOnSearch(),isFocused=module.is.focused(),caretAtStart=isFocusedOnSearch&&0===module.get.caretPosition();if(isSearch&&!hasActiveLabel&&!isFocusedOnSearch)return;pressedKey==keys.leftArrow?!isFocused&&!caretAtStart||hasActiveLabel?hasActiveLabel&&(event.shiftKey?module.verbose("Adding previous label to selection"):(module.verbose("Selecting previous label"),$label.removeClass(className.active)),isFirstLabel&&!hasMultipleActive?$activeLabel.addClass(className.active):$activeLabel.prev(selector.siblingLabel).addClass(className.active).end(),event.preventDefault()):(module.verbose("Selecting previous label"),$label.last().addClass(className.active)):pressedKey==keys.rightArrow?(isFocused&&!hasActiveLabel&&$label.first().addClass(className.active),hasActiveLabel&&(event.shiftKey?module.verbose("Adding next label to selection"):(module.verbose("Selecting next label"),$label.removeClass(className.active)),isLastLabel?isSearch?isFocusedOnSearch?$label.removeClass(className.active):module.focusSearch():hasMultipleActive?$activeLabel.next(selector.siblingLabel).addClass(className.active):$activeLabel.addClass(className.active):$activeLabel.next(selector.siblingLabel).addClass(className.active),event.preventDefault())):pressedKey==keys.deleteKey||pressedKey==keys.backspace?hasActiveLabel?(module.verbose("Removing active labels"),isLastLabel&&isSearch&&!isFocusedOnSearch&&module.focusSearch(),$activeLabel.last().next(selector.siblingLabel).addClass(className.active),module.remove.activeLabels($activeLabel),event.preventDefault()):caretAtStart&&!hasActiveLabel&&pressedKey==keys.backspace&&(module.verbose("Removing last label on input backspace"),$activeLabel=$label.last().addClass(className.active),module.remove.activeLabels($activeLabel)):$activeLabel.removeClass(className.active)}}},keydown:function(event){var pressedKey=event.which;if(module.is.inObject(pressedKey,keys)){var $nextItem,$currentlySelected=$item.not(selector.unselectable).filter("."+className.selected).eq(0),$activeItem=$menu.children("."+className.active).eq(0),$selectedItem=$currentlySelected.length>0?$currentlySelected:$activeItem,$visibleItems=$selectedItem.length>0?$selectedItem.siblings(":not(."+className.filtered+")").addBack():$menu.children(":not(."+className.filtered+")"),$subMenu=$selectedItem.children(selector.menu),$parentMenu=$selectedItem.closest(selector.menu),inVisibleMenu=$parentMenu.hasClass(className.visible)||$parentMenu.hasClass(className.animating)||$parentMenu.parent(selector.menu).length>0,hasSubMenu=$subMenu.length>0,hasSelectedItem=$selectedItem.length>0,selectedIsSelectable=$selectedItem.not(selector.unselectable).length>0,delimiterPressed=pressedKey==keys.delimiter&&settings.allowAdditions&&module.is.multiple(),isAdditionWithoutMenu=settings.allowAdditions&&settings.hideAdditions&&(pressedKey==keys.enter||delimiterPressed)&&selectedIsSelectable;if(isAdditionWithoutMenu&&(module.verbose("Selecting item from keyboard shortcut",$selectedItem),module.event.item.click.call($selectedItem,event),module.is.searchSelection()&&module.remove.searchTerm()),module.is.visible()){if((pressedKey==keys.enter||delimiterPressed)&&(pressedKey==keys.enter&&hasSelectedItem&&hasSubMenu&&!settings.allowCategorySelection?(module.verbose("Pressed enter on unselectable category, opening sub menu"),pressedKey=keys.rightArrow):selectedIsSelectable&&(module.verbose("Selecting item from keyboard shortcut",$selectedItem),module.event.item.click.call($selectedItem,event),module.is.searchSelection()&&module.remove.searchTerm()),event.preventDefault()),hasSelectedItem&&(pressedKey==keys.leftArrow&&$parentMenu[0]!==$menu[0]&&(module.verbose("Left key pressed, closing sub-menu"),module.animate.hide(!1,$parentMenu),$selectedItem.removeClass(className.selected),$parentMenu.closest(selector.item).addClass(className.selected),event.preventDefault()),pressedKey==keys.rightArrow&&hasSubMenu&&(module.verbose("Right key pressed, opening sub-menu"),module.animate.show(!1,$subMenu),$selectedItem.removeClass(className.selected),$subMenu.find(selector.item).eq(0).addClass(className.selected),event.preventDefault())),pressedKey==keys.upArrow){if($nextItem=hasSelectedItem&&inVisibleMenu?$selectedItem.prevAll(selector.item+":not("+selector.unselectable+")").eq(0):$item.eq(0),$visibleItems.index($nextItem)<0)return module.verbose("Up key pressed but reached top of current menu"),void event.preventDefault();module.verbose("Up key pressed, changing active item"),$selectedItem.removeClass(className.selected),$nextItem.addClass(className.selected),module.set.scrollPosition($nextItem),settings.selectOnKeydown&&module.is.single()&&module.set.selectedItem($nextItem),event.preventDefault()}if(pressedKey==keys.downArrow){if($nextItem=hasSelectedItem&&inVisibleMenu?$nextItem=$selectedItem.nextAll(selector.item+":not("+selector.unselectable+")").eq(0):$item.eq(0),0===$nextItem.length)return module.verbose("Down key pressed but reached bottom of current menu"),void event.preventDefault();module.verbose("Down key pressed, changing active item"),$item.removeClass(className.selected),$nextItem.addClass(className.selected),module.set.scrollPosition($nextItem),settings.selectOnKeydown&&module.is.single()&&module.set.selectedItem($nextItem),event.preventDefault()}pressedKey==keys.pageUp&&(module.scrollPage("up"),event.preventDefault()),pressedKey==keys.pageDown&&(module.scrollPage("down"),event.preventDefault()),pressedKey==keys.escape&&(module.verbose("Escape key pressed, closing dropdown"),module.hide())}else delimiterPressed&&event.preventDefault(),pressedKey!=keys.downArrow||module.is.visible()||(module.verbose("Down key pressed, showing dropdown"),module.show(),event.preventDefault())}else module.has.search()||module.set.selectedLetter(String.fromCharCode(pressedKey))}},trigger:{change:function(){var events=document.createEvent("HTMLEvents"),inputElement=$input[0];inputElement&&(module.verbose("Triggering native change event"),events.initEvent("change",!0,!1),inputElement.dispatchEvent(events))}},determine:{selectAction:function(text,value){module.verbose("Determining action",settings.action),$.isFunction(module.action[settings.action])?(module.verbose("Triggering preset action",settings.action,text,value),module.action[settings.action].call(element,text,value,this)):$.isFunction(settings.action)?(module.verbose("Triggering user action",settings.action,text,value),settings.action.call(element,text,value,this)):module.error(error.action,settings.action)},eventInModule:function(event,callback){var $target=$(event.target),inDocument=$target.closest(document.documentElement).length>0,inModule=$target.closest($module).length>0;return callback=$.isFunction(callback)?callback:function(){},inDocument&&!inModule?(module.verbose("Triggering event",callback),callback(),!0):(module.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(event,callback){var $target=$(event.target),$label=$target.closest(selector.siblingLabel),inVisibleDOM=document.body.contains(event.target),notOnLabel=0===$module.find($label).length,notInMenu=0===$target.closest($menu).length;return callback=$.isFunction(callback)?callback:function(){},inVisibleDOM&&notOnLabel&&notInMenu?(module.verbose("Triggering event",callback),callback(),!0):(module.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(text,value,element){if(value=void 0!==value?value:text,module.can.activate($(element))){if(module.set.selected(value,$(element)),module.is.multiple()&&!module.is.allFiltered())return;module.hideAndClear()}},select:function(text,value,element){if(value=void 0!==value?value:text,module.can.activate($(element))){if(module.set.value(value,text,$(element)),module.is.multiple()&&!module.is.allFiltered())return;module.hideAndClear()}},combo:function(text,value,element){value=void 0!==value?value:text,module.set.selected(value,$(element)),module.hideAndClear()},hide:function(text,value,element){module.set.value(value,text,$(element)),module.hideAndClear()}},get:{id:function(){return id},defaultText:function(){return $module.data(metadata.defaultText)},defaultValue:function(){return $module.data(metadata.defaultValue)},placeholderText:function(){return"auto"!=settings.placeholder&&"string"==typeof settings.placeholder?settings.placeholder:$module.data(metadata.placeholderText)||""},
text:function(){return $text.text()},query:function(){return $.trim($search.val())},searchWidth:function(value){return value=void 0!==value?value:$search.val(),$sizer.text(value),Math.ceil($sizer.width()+1)},selectionCount:function(){var values=module.get.values();return module.is.multiple()?$.isArray(values)?values.length:0:""!==module.get.value()?1:0},transition:function($subMenu){return"auto"==settings.transition?module.is.upward($subMenu)?"slide up":"slide down":settings.transition},userValues:function(){var values=module.get.values();return!!values&&(values=$.isArray(values)?values:[values],$.grep(values,function(value){return!1===module.get.item(value)}))},uniqueArray:function(array){return $.grep(array,function(value,index){return $.inArray(value,array)===index})},caretPosition:function(){var range,rangeLength,input=$search.get(0);return"selectionStart"in input?input.selectionStart:document.selection?(input.focus(),range=document.selection.createRange(),rangeLength=range.text.length,range.moveStart("character",-input.value.length),range.text.length-rangeLength):void 0},value:function(){var value=$input.length>0?$input.val():$module.data(metadata.value),isEmptyMultiselect=$.isArray(value)&&1===value.length&&""===value[0];return void 0===value||isEmptyMultiselect?"":value},values:function(){var value=module.get.value();return""===value?"":!module.has.selectInput()&&module.is.multiple()?"string"==typeof value?value.split(settings.delimiter):"":value},remoteValues:function(){var values=module.get.values(),remoteValues=!1;return values&&("string"==typeof values&&(values=[values]),$.each(values,function(index,value){var name=module.read.remoteData(value);module.verbose("Restoring value from session data",name,value),name&&(remoteValues||(remoteValues={}),remoteValues[value]=name)})),remoteValues},choiceText:function($choice,preserveHTML){if(preserveHTML=void 0!==preserveHTML?preserveHTML:settings.preserveHTML,$choice)return $choice.find(selector.menu).length>0&&(module.verbose("Retrieving text of element with sub-menu"),$choice=$choice.clone(),$choice.find(selector.menu).remove(),$choice.find(selector.menuIcon).remove()),void 0!==$choice.data(metadata.text)?$choice.data(metadata.text):preserveHTML?$.trim($choice.html()):$.trim($choice.text())},choiceValue:function($choice,choiceText){return choiceText=choiceText||module.get.choiceText($choice),!!$choice&&(void 0!==$choice.data(metadata.value)?String($choice.data(metadata.value)):"string"==typeof choiceText?$.trim(choiceText.toLowerCase()):String(choiceText))},inputEvent:function(){var input=$search[0];return!!input&&(void 0!==input.oninput?"input":void 0!==input.onpropertychange?"propertychange":"keyup")},selectValues:function(){var select={};return select.values=[],$module.find("option").each(function(){var $option=$(this),name=$option.html(),disabled=$option.attr("disabled"),value=void 0!==$option.attr("value")?$option.attr("value"):name;"auto"===settings.placeholder&&""===value?select.placeholder=name:select.values.push({name:name,value:value,disabled:disabled})}),settings.placeholder&&"auto"!==settings.placeholder&&(module.debug("Setting placeholder value to",settings.placeholder),select.placeholder=settings.placeholder),settings.sortSelect?(select.values.sort(function(a,b){return a.name>b.name?1:-1}),module.debug("Retrieved and sorted values from select",select)):module.debug("Retrieved values from select",select),select},activeItem:function(){return $item.filter("."+className.active)},selectedItem:function(){var $selectedItem=$item.not(selector.unselectable).filter("."+className.selected);return $selectedItem.length>0?$selectedItem:$item.eq(0)},itemWithAdditions:function(value){var $items=module.get.item(value),$userItems=module.create.userChoice(value);return $userItems&&$userItems.length>0&&($items=$items.length>0?$items.add($userItems):$userItems),$items},item:function(value,strict){var shouldSearch,isMultiple,$selectedItem=!1;return value=void 0!==value?value:void 0!==module.get.values()?module.get.values():module.get.text(),shouldSearch=isMultiple?value.length>0:void 0!==value&&null!==value,isMultiple=module.is.multiple()&&$.isArray(value),strict=""===value||0===value||(strict||!1),shouldSearch&&$item.each(function(){var $choice=$(this),optionText=module.get.choiceText($choice),optionValue=module.get.choiceValue($choice,optionText);if(null!==optionValue&&void 0!==optionValue)if(isMultiple)-1===$.inArray(String(optionValue),value)&&-1===$.inArray(optionText,value)||($selectedItem=$selectedItem?$selectedItem.add($choice):$choice);else if(strict){if(module.verbose("Ambiguous dropdown value using strict type check",$choice,value),optionValue===value||optionText===value)return $selectedItem=$choice,!0}else if(String(optionValue)==String(value)||optionText==value)return module.verbose("Found select item by value",optionValue,value),$selectedItem=$choice,!0}),$selectedItem}},check:{maxSelections:function(selectionCount){return!settings.maxSelections||(selectionCount=void 0!==selectionCount?selectionCount:module.get.selectionCount(),selectionCount>=settings.maxSelections?(module.debug("Maximum selection count reached"),settings.useLabels&&($item.addClass(className.filtered),module.add.message(message.maxSelections)),!0):(module.verbose("No longer at maximum selection count"),module.remove.message(),module.remove.filteredItem(),module.is.searchSelection()&&module.filterItems(),!1))}},restore:{defaults:function(){module.clear(),module.restore.defaultText(),module.restore.defaultValue()},defaultText:function(){var defaultText=module.get.defaultText();defaultText===module.get.placeholderText?(module.debug("Restoring default placeholder text",defaultText),module.set.placeholderText(defaultText)):(module.debug("Restoring default text",defaultText),module.set.text(defaultText))},placeholderText:function(){module.set.placeholderText()},defaultValue:function(){var defaultValue=module.get.defaultValue();void 0!==defaultValue&&(module.debug("Restoring default value",defaultValue),""!==defaultValue?(module.set.value(defaultValue),module.set.selected()):(module.remove.activeItem(),module.remove.selectedItem()))},labels:function(){settings.allowAdditions&&(settings.useLabels||(module.error(error.labels),settings.useLabels=!0),module.debug("Restoring selected values"),module.create.userLabels()),module.check.maxSelections()},selected:function(){module.restore.values(),module.is.multiple()?(module.debug("Restoring previously selected values and labels"),module.restore.labels()):module.debug("Restoring previously selected values")},values:function(){module.set.initialLoad(),settings.apiSettings&&settings.saveRemoteData&&module.get.remoteValues()?module.restore.remoteValues():module.set.selected(),module.remove.initialLoad()},remoteValues:function(){var values=module.get.remoteValues();module.debug("Recreating selected from session data",values),values&&(module.is.single()?$.each(values,function(value,name){module.set.text(name)}):$.each(values,function(value,name){module.add.label(value,name)}))}},read:{remoteData:function(value){var name;return void 0===window.Storage?void module.error(error.noStorage):void 0!==(name=sessionStorage.getItem(value))&&name}},save:{defaults:function(){module.save.defaultText(),module.save.placeholderText(),module.save.defaultValue()},defaultValue:function(){var value=module.get.value();module.verbose("Saving default value as",value),$module.data(metadata.defaultValue,value)},defaultText:function(){var text=module.get.text();module.verbose("Saving default text as",text),$module.data(metadata.defaultText,text)},placeholderText:function(){var text;!1!==settings.placeholder&&$text.hasClass(className.placeholder)&&(text=module.get.text(),module.verbose("Saving placeholder text as",text),$module.data(metadata.placeholderText,text))},remoteData:function(name,value){if(void 0===window.Storage)return void module.error(error.noStorage);module.verbose("Saving remote data to session storage",value,name),sessionStorage.setItem(value,name)}},clear:function(){module.is.multiple()&&settings.useLabels?module.remove.labels():(module.remove.activeItem(),module.remove.selectedItem()),module.set.placeholderText(),module.clearValue()},clearValue:function(){module.set.value("")},scrollPage:function(direction,$selectedItem){var isWithinRange,$nextSelectedItem,elementIndex,$currentItem=$selectedItem||module.get.selectedItem(),$menu=$currentItem.closest(selector.menu),menuHeight=$menu.outerHeight(),currentScroll=$menu.scrollTop(),itemHeight=$item.eq(0).outerHeight(),itemsPerPage=Math.floor(menuHeight/itemHeight),newScroll=($menu.prop("scrollHeight"),"up"==direction?currentScroll-itemHeight*itemsPerPage:currentScroll+itemHeight*itemsPerPage),$selectableItem=$item.not(selector.unselectable);elementIndex="up"==direction?$selectableItem.index($currentItem)-itemsPerPage:$selectableItem.index($currentItem)+itemsPerPage,isWithinRange="up"==direction?elementIndex>=0:elementIndex<$selectableItem.length,$nextSelectedItem=isWithinRange?$selectableItem.eq(elementIndex):"up"==direction?$selectableItem.first():$selectableItem.last(),$nextSelectedItem.length>0&&(module.debug("Scrolling page",direction,$nextSelectedItem),$currentItem.removeClass(className.selected),$nextSelectedItem.addClass(className.selected),settings.selectOnKeydown&&module.is.single()&&module.set.selectedItem($nextSelectedItem),$menu.scrollTop(newScroll))},set:{filtered:function(){var isMultiple=module.is.multiple(),isSearch=module.is.searchSelection(),isSearchMultiple=isMultiple&&isSearch,searchValue=isSearch?module.get.query():"",hasSearchValue="string"==typeof searchValue&&searchValue.length>0,searchWidth=module.get.searchWidth(),valueIsSet=""!==searchValue;isMultiple&&hasSearchValue&&(module.verbose("Adjusting input width",searchWidth,settings.glyphWidth),$search.css("width",searchWidth)),hasSearchValue||isSearchMultiple&&valueIsSet?(module.verbose("Hiding placeholder text"),$text.addClass(className.filtered)):(!isMultiple||isSearchMultiple&&!valueIsSet)&&(module.verbose("Showing placeholder text"),$text.removeClass(className.filtered))},empty:function(){$module.addClass(className.empty)},loading:function(){$module.addClass(className.loading)},placeholderText:function(text){text=text||module.get.placeholderText(),module.debug("Setting placeholder text",text),module.set.text(text),$text.addClass(className.placeholder)},tabbable:function(){module.is.searchSelection()?(module.debug("Added tabindex to searchable dropdown"),$search.val("").attr("tabindex",0),$menu.attr("tabindex",-1)):(module.debug("Added tabindex to dropdown"),void 0===$module.attr("tabindex")&&($module.attr("tabindex",0),$menu.attr("tabindex",-1)))},initialLoad:function(){module.verbose("Setting initial load"),initialLoad=!0},activeItem:function($item){settings.allowAdditions&&$item.filter(selector.addition).length>0?$item.addClass(className.filtered):$item.addClass(className.active)},partialSearch:function(text){var length=module.get.query().length;$search.val(text.substr(0,length))},scrollPosition:function($item,forceScroll){var $menu,hasActive,offset,itemOffset,menuOffset,menuScroll,menuHeight,abovePage,belowPage;$item=$item||module.get.selectedItem(),$menu=$item.closest(selector.menu),hasActive=$item&&$item.length>0,forceScroll=void 0!==forceScroll&&forceScroll,$item&&$menu.length>0&&hasActive&&(itemOffset=$item.position().top,$menu.addClass(className.loading),menuScroll=$menu.scrollTop(),menuOffset=$menu.offset().top,itemOffset=$item.offset().top,offset=menuScroll-menuOffset+itemOffset,forceScroll||(menuHeight=$menu.height(),belowPage=menuScroll+menuHeight<offset+5,abovePage=offset-5<menuScroll),module.debug("Scrolling to active item",offset),(forceScroll||abovePage||belowPage)&&$menu.scrollTop(offset),$menu.removeClass(className.loading))},text:function(text){"select"!==settings.action&&("combo"==settings.action?(module.debug("Changing combo button text",text,$combo),settings.preserveHTML?$combo.html(text):$combo.text(text)):(text!==module.get.placeholderText()&&$text.removeClass(className.placeholder),module.debug("Changing text",text,$text),$text.removeClass(className.filtered),settings.preserveHTML?$text.html(text):$text.text(text)))},selectedItem:function($item){var value=module.get.choiceValue($item),searchText=module.get.choiceText($item,!1),text=module.get.choiceText($item,!0);module.debug("Setting user selection to item",$item),module.remove.activeItem(),module.set.partialSearch(searchText),module.set.activeItem($item),module.set.selected(value,$item),module.set.text(text)},selectedLetter:function(letter){var $nextItem,$selectedItem=$item.filter("."+className.selected),alreadySelectedLetter=$selectedItem.length>0&&module.has.firstLetter($selectedItem,letter),$nextValue=!1;alreadySelectedLetter&&($nextItem=$selectedItem.nextAll($item).eq(0),module.has.firstLetter($nextItem,letter)&&($nextValue=$nextItem)),$nextValue||$item.each(function(){if(module.has.firstLetter($(this),letter))return $nextValue=$(this),!1}),$nextValue&&(module.verbose("Scrolling to next value with letter",letter),module.set.scrollPosition($nextValue),$selectedItem.removeClass(className.selected),$nextValue.addClass(className.selected),settings.selectOnKeydown&&module.is.single()&&module.set.selectedItem($nextValue))},direction:function($menu){"auto"==settings.direction?(module.remove.upward(),module.can.openDownward($menu)?module.remove.upward($menu):module.set.upward($menu),module.is.leftward($menu)||module.can.openRightward($menu)||module.set.leftward($menu)):"upward"==settings.direction&&module.set.upward($menu)},upward:function($currentMenu){($currentMenu||$module).addClass(className.upward)},leftward:function($currentMenu){($currentMenu||$menu).addClass(className.leftward)},value:function(value,text,$selected){var escapedValue=module.escape.value(value),hasInput=$input.length>0,currentValue=module.get.values(),stringValue=void 0!==value?String(value):value;if(hasInput){if(!settings.allowReselection&&stringValue==currentValue&&(module.verbose("Skipping value update already same value",value,currentValue),!module.is.initialLoad()))return;module.is.single()&&module.has.selectInput()&&module.can.extendSelect()&&(module.debug("Adding user option",value),module.add.optionValue(value)),module.debug("Updating input value",escapedValue,currentValue),internalChange=!0,$input.val(escapedValue),!1===settings.fireOnInit&&module.is.initialLoad()?module.debug("Input native change event ignored on initial load"):module.trigger.change(),internalChange=!1}else module.verbose("Storing value in metadata",escapedValue,$input),escapedValue!==currentValue&&$module.data(metadata.value,stringValue);module.is.single()&&settings.clearable&&(escapedValue?module.set.clearable():module.remove.clearable()),!1===settings.fireOnInit&&module.is.initialLoad()?module.verbose("No callback on initial load",settings.onChange):settings.onChange.call(element,value,text,$selected)},active:function(){$module.addClass(className.active)},multiple:function(){$module.addClass(className.multiple)},visible:function(){$module.addClass(className.visible)},exactly:function(value,$selectedItem){module.debug("Setting selected to exact values"),module.clear(),module.set.selected(value,$selectedItem)},selected:function(value,$selectedItem){var isMultiple=module.is.multiple();($selectedItem=settings.allowAdditions?$selectedItem||module.get.itemWithAdditions(value):$selectedItem||module.get.item(value))&&(module.debug("Setting selected menu item to",$selectedItem),module.is.multiple()&&module.remove.searchWidth(),module.is.single()?(module.remove.activeItem(),module.remove.selectedItem()):settings.useLabels&&module.remove.selectedItem(),$selectedItem.each(function(){var $selected=$(this),selectedText=module.get.choiceText($selected),selectedValue=module.get.choiceValue($selected,selectedText),isFiltered=$selected.hasClass(className.filtered),isActive=$selected.hasClass(className.active),isUserValue=$selected.hasClass(className.addition),shouldAnimate=isMultiple&&1==$selectedItem.length;isMultiple?!isActive||isUserValue?(settings.apiSettings&&settings.saveRemoteData&&module.save.remoteData(selectedText,selectedValue),settings.useLabels?(module.add.label(selectedValue,selectedText,shouldAnimate),module.add.value(selectedValue,selectedText,$selected),module.set.activeItem($selected),module.filterActive(),module.select.nextAvailable($selectedItem)):(module.add.value(selectedValue,selectedText,$selected),module.set.text(module.add.variables(message.count)),module.set.activeItem($selected))):isFiltered||(module.debug("Selected active value, removing label"),module.remove.selected(selectedValue)):(settings.apiSettings&&settings.saveRemoteData&&module.save.remoteData(selectedText,selectedValue),module.set.text(selectedText),module.set.value(selectedValue,selectedText,$selected),$selected.addClass(className.active).addClass(className.selected))}))},clearable:function(){$icon.addClass(className.clear)}},add:{label:function(value,text,shouldAnimate){var $label,$next=module.is.searchSelection()?$search:$text,escapedValue=module.escape.value(value);if(settings.ignoreCase&&(escapedValue=escapedValue.toLowerCase()),$label=$("<a />").addClass(className.label).attr("data-"+metadata.value,escapedValue).html(templates.label(escapedValue,text)),$label=settings.onLabelCreate.call($label,escapedValue,text),module.has.label(value))return void module.debug("User selection already exists, skipping",escapedValue);settings.label.variation&&$label.addClass(settings.label.variation),!0===shouldAnimate?(module.debug("Animating in label",$label),$label.addClass(className.hidden).insertBefore($next).transition(settings.label.transition,settings.label.duration)):(module.debug("Adding selection label",$label),$label.insertBefore($next))},message:function(message){var $message=$menu.children(selector.message),html=settings.templates.message(module.add.variables(message));$message.length>0?$message.html(html):$message=$("<div/>").html(html).addClass(className.message).appendTo($menu)},optionValue:function(value){var escapedValue=module.escape.value(value);$input.find('option[value="'+module.escape.string(escapedValue)+'"]').length>0||(module.disconnect.selectObserver(),module.is.single()&&(module.verbose("Removing previous user addition"),$input.find("option."+className.addition).remove()),$("<option/>").prop("value",escapedValue).addClass(className.addition).html(value).appendTo($input),module.verbose("Adding user addition as an <option>",value),module.observe.select())},userSuggestion:function(value){var html,$addition=$menu.children(selector.addition),$existingItem=module.get.item(value),alreadyHasValue=$existingItem&&$existingItem.not(selector.addition).length,hasUserSuggestion=$addition.length>0;if(!settings.useLabels||!module.has.maxSelections()){if(""===value||alreadyHasValue)return void $addition.remove();hasUserSuggestion?($addition.data(metadata.value,value).data(metadata.text,value).attr("data-"+metadata.value,value).attr("data-"+metadata.text,value).removeClass(className.filtered),settings.hideAdditions||(html=settings.templates.addition(module.add.variables(message.addResult,value)),$addition.html(html)),module.verbose("Replacing user suggestion with new value",$addition)):($addition=module.create.userChoice(value),$addition.prependTo($menu),module.verbose("Adding item choice to menu corresponding with user choice addition",$addition)),settings.hideAdditions&&!module.is.allFiltered()||$addition.addClass(className.selected).siblings().removeClass(className.selected),module.refreshItems()}},variables:function(message,term){var count,query,hasCount=-1!==message.search("{count}"),hasMaxCount=-1!==message.search("{maxCount}"),hasTerm=-1!==message.search("{term}");return module.verbose("Adding templated variables to message",message),hasCount&&(count=module.get.selectionCount(),message=message.replace("{count}",count)),hasMaxCount&&(count=module.get.selectionCount(),message=message.replace("{maxCount}",settings.maxSelections)),hasTerm&&(query=term||module.get.query(),message=message.replace("{term}",query)),message},value:function(addedValue,addedText,$selectedItem){var newValue,currentValue=module.get.values();return module.has.value(addedValue)?void module.debug("Value already selected"):""===addedValue?void module.debug("Cannot select blank values from multiselect"):($.isArray(currentValue)?(newValue=currentValue.concat([addedValue]),newValue=module.get.uniqueArray(newValue)):newValue=[addedValue],module.has.selectInput()?module.can.extendSelect()&&(module.debug("Adding value to select",addedValue,newValue,$input),module.add.optionValue(addedValue)):(newValue=newValue.join(settings.delimiter),module.debug("Setting hidden input to delimited value",newValue,$input)),!1===settings.fireOnInit&&module.is.initialLoad()?module.verbose("Skipping onadd callback on initial load",settings.onAdd):settings.onAdd.call(element,addedValue,addedText,$selectedItem),module.set.value(newValue,addedValue,addedText,$selectedItem),void module.check.maxSelections())}},remove:{active:function(){$module.removeClass(className.active)},activeLabel:function(){$module.find(selector.label).removeClass(className.active)},empty:function(){$module.removeClass(className.empty)},loading:function(){$module.removeClass(className.loading)},initialLoad:function(){initialLoad=!1},upward:function($currentMenu){($currentMenu||$module).removeClass(className.upward)},leftward:function($currentMenu){($currentMenu||$menu).removeClass(className.leftward)},visible:function(){$module.removeClass(className.visible)},activeItem:function(){$item.removeClass(className.active)},filteredItem:function(){settings.useLabels&&module.has.maxSelections()||(settings.useLabels&&module.is.multiple()?$item.not("."+className.active).removeClass(className.filtered):$item.removeClass(className.filtered),module.remove.empty())},optionValue:function(value){var escapedValue=module.escape.value(value),$option=$input.find('option[value="'+module.escape.string(escapedValue)+'"]');$option.length>0&&$option.hasClass(className.addition)&&(selectObserver&&(selectObserver.disconnect(),module.verbose("Temporarily disconnecting mutation observer")),$option.remove(),module.verbose("Removing user addition as an <option>",escapedValue),selectObserver&&selectObserver.observe($input[0],{childList:!0,subtree:!0}))},message:function(){$menu.children(selector.message).remove()},searchWidth:function(){$search.css("width","")},searchTerm:function(){module.verbose("Cleared search term"),$search.val(""),module.set.filtered()},userAddition:function(){$item.filter(selector.addition).remove()},selected:function(value,$selectedItem){if(!($selectedItem=settings.allowAdditions?$selectedItem||module.get.itemWithAdditions(value):$selectedItem||module.get.item(value)))return!1;$selectedItem.each(function(){var $selected=$(this),selectedText=module.get.choiceText($selected),selectedValue=module.get.choiceValue($selected,selectedText);module.is.multiple()?settings.useLabels?(module.remove.value(selectedValue,selectedText,$selected),module.remove.label(selectedValue)):(module.remove.value(selectedValue,selectedText,$selected),0===module.get.selectionCount()?module.set.placeholderText():module.set.text(module.add.variables(message.count))):module.remove.value(selectedValue,selectedText,$selected),$selected.removeClass(className.filtered).removeClass(className.active),settings.useLabels&&$selected.removeClass(className.selected)})},selectedItem:function(){$item.removeClass(className.selected)},value:function(removedValue,removedText,$removedItem){var newValue,values=module.get.values();module.has.selectInput()?(module.verbose("Input is <select> removing selected option",removedValue),newValue=module.remove.arrayValue(removedValue,values),module.remove.optionValue(removedValue)):(module.verbose("Removing from delimited values",removedValue),newValue=module.remove.arrayValue(removedValue,values),newValue=newValue.join(settings.delimiter)),!1===settings.fireOnInit&&module.is.initialLoad()?module.verbose("No callback on initial load",settings.onRemove):settings.onRemove.call(element,removedValue,removedText,$removedItem),module.set.value(newValue,removedText,$removedItem),module.check.maxSelections()},arrayValue:function(removedValue,values){return $.isArray(values)||(values=[values]),values=$.grep(values,function(value){return removedValue!=value}),module.verbose("Removed value from delimited string",removedValue,values),values},label:function(value,shouldAnimate){var $labels=$module.find(selector.label),$removedLabel=$labels.filter("[data-"+metadata.value+'="'+module.escape.string(value)+'"]');module.verbose("Removing label",$removedLabel),$removedLabel.remove()},activeLabels:function($activeLabels){$activeLabels=$activeLabels||$module.find(selector.label).filter("."+className.active),module.verbose("Removing active label selections",$activeLabels),module.remove.labels($activeLabels)},labels:function($labels){$labels=$labels||$module.find(selector.label),module.verbose("Removing labels",$labels),$labels.each(function(){var $label=$(this),value=$label.data(metadata.value),stringValue=void 0!==value?String(value):value,isUserValue=module.is.userValue(stringValue);if(!1===settings.onLabelRemove.call($label,value))return void module.debug("Label remove callback cancelled removal");module.remove.message(),isUserValue?(module.remove.value(stringValue),module.remove.label(stringValue)):module.remove.selected(stringValue)})},tabbable:function(){module.is.searchSelection()?(module.debug("Searchable dropdown initialized"),$search.removeAttr("tabindex"),$menu.removeAttr("tabindex")):(module.debug("Simple selection dropdown initialized"),$module.removeAttr("tabindex"),$menu.removeAttr("tabindex"))},clearable:function(){$icon.removeClass(className.clear)}},has:{menuSearch:function(){return module.has.search()&&$search.closest($menu).length>0},search:function(){return $search.length>0},sizer:function(){return $sizer.length>0},selectInput:function(){return $input.is("select")},minCharacters:function(searchTerm){return!settings.minCharacters||(searchTerm=void 0!==searchTerm?String(searchTerm):String(module.get.query()),searchTerm.length>=settings.minCharacters)},firstLetter:function($item,letter){var text,firstLetter;return!(!$item||0===$item.length||"string"!=typeof letter)&&(text=module.get.choiceText($item,!1),letter=letter.toLowerCase(),firstLetter=String(text).charAt(0).toLowerCase(),letter==firstLetter)},input:function(){return $input.length>0},items:function(){return $item.length>0},menu:function(){return $menu.length>0},message:function(){return 0!==$menu.children(selector.message).length},label:function(value){var escapedValue=module.escape.value(value),$labels=$module.find(selector.label);return settings.ignoreCase&&(escapedValue=escapedValue.toLowerCase()),$labels.filter("[data-"+metadata.value+'="'+module.escape.string(escapedValue)+'"]').length>0},maxSelections:function(){return settings.maxSelections&&module.get.selectionCount()>=settings.maxSelections},allResultsFiltered:function(){var $normalResults=$item.not(selector.addition);return $normalResults.filter(selector.unselectable).length===$normalResults.length},userSuggestion:function(){return $menu.children(selector.addition).length>0},query:function(){return""!==module.get.query()},value:function(value){return settings.ignoreCase?module.has.valueIgnoringCase(value):module.has.valueMatchingCase(value)},valueMatchingCase:function(value){var values=module.get.values();return!!($.isArray(values)?values&&-1!==$.inArray(value,values):values==value)},valueIgnoringCase:function(value){var values=module.get.values(),hasValue=!1;return $.isArray(values)||(values=[values]),$.each(values,function(index,existingValue){if(String(value).toLowerCase()==String(existingValue).toLowerCase())return hasValue=!0,!1}),hasValue}},is:{active:function(){return $module.hasClass(className.active)},animatingInward:function(){return $menu.transition("is inward")},animatingOutward:function(){return $menu.transition("is outward")},bubbledLabelClick:function(event){return $(event.target).is("select, input")&&$module.closest("label").length>0},bubbledIconClick:function(event){return $(event.target).closest($icon).length>0},alreadySetup:function(){return $module.is("select")&&void 0!==$module.parent(selector.dropdown).data(moduleNamespace)&&0===$module.prev().length},animating:function($subMenu){return $subMenu?$subMenu.transition&&$subMenu.transition("is animating"):$menu.transition&&$menu.transition("is animating")},leftward:function($subMenu){return($subMenu||$menu).hasClass(className.leftward)},disabled:function(){return $module.hasClass(className.disabled)},focused:function(){return document.activeElement===$module[0]},focusedOnSearch:function(){return document.activeElement===$search[0]},allFiltered:function(){return(module.is.multiple()||module.has.search())&&!(0==settings.hideAdditions&&module.has.userSuggestion())&&!module.has.message()&&module.has.allResultsFiltered()},hidden:function($subMenu){return!module.is.visible($subMenu)},initialLoad:function(){return initialLoad},inObject:function(needle,object){var found=!1;return $.each(object,function(index,property){if(property==needle)return found=!0,!0}),found},multiple:function(){return $module.hasClass(className.multiple)},remote:function(){return settings.apiSettings&&module.can.useAPI()},single:function(){return!module.is.multiple()},selectMutation:function(mutations){var selectChanged=!1;return $.each(mutations,function(index,mutation){if(mutation.target&&$(mutation.target).is("select"))return selectChanged=!0,!0}),selectChanged},search:function(){return $module.hasClass(className.search)},searchSelection:function(){return module.has.search()&&1===$search.parent(selector.dropdown).length},selection:function(){return $module.hasClass(className.selection)},userValue:function(value){return-1!==$.inArray(value,module.get.userValues())},upward:function($menu){return($menu||$module).hasClass(className.upward)},visible:function($subMenu){return $subMenu?$subMenu.hasClass(className.visible):$menu.hasClass(className.visible)},verticallyScrollableContext:function(){var overflowY=$context.get(0)!==window&&$context.css("overflow-y");return"auto"==overflowY||"scroll"==overflowY},horizontallyScrollableContext:function(){var overflowX=$context.get(0)!==window&&$context.css("overflow-X");return"auto"==overflowX||"scroll"==overflowX}},can:{activate:function($item){return!!settings.useLabels||(!module.has.maxSelections()||!(!module.has.maxSelections()||!$item.hasClass(className.active)))},openDownward:function($subMenu){var calculations,$currentMenu=$subMenu||$menu,canOpenDownward=!0,onScreen={};return $currentMenu.addClass(className.loading),calculations={context:{offset:$context.get(0)===window?{top:0,left:0}:$context.offset(),scrollTop:$context.scrollTop(),height:$context.outerHeight()},menu:{offset:$currentMenu.offset(),height:$currentMenu.outerHeight()}},module.is.verticallyScrollableContext()&&(calculations.menu.offset.top+=calculations.context.scrollTop),onScreen={above:calculations.context.scrollTop<=calculations.menu.offset.top-calculations.context.offset.top-calculations.menu.height,below:calculations.context.scrollTop+calculations.context.height>=calculations.menu.offset.top-calculations.context.offset.top+calculations.menu.height},onScreen.below?(module.verbose("Dropdown can fit in context downward",onScreen),canOpenDownward=!0):onScreen.below||onScreen.above?(module.verbose("Dropdown cannot fit below, opening upward",onScreen),canOpenDownward=!1):(module.verbose("Dropdown cannot fit in either direction, favoring downward",onScreen),canOpenDownward=!0),$currentMenu.removeClass(className.loading),canOpenDownward},openRightward:function($subMenu){var calculations,$currentMenu=$subMenu||$menu,canOpenRightward=!0,isOffscreenRight=!1
;return $currentMenu.addClass(className.loading),calculations={context:{offset:$context.get(0)===window?{top:0,left:0}:$context.offset(),scrollLeft:$context.scrollLeft(),width:$context.outerWidth()},menu:{offset:$currentMenu.offset(),width:$currentMenu.outerWidth()}},module.is.horizontallyScrollableContext()&&(calculations.menu.offset.left+=calculations.context.scrollLeft),isOffscreenRight=calculations.menu.offset.left-calculations.context.offset.left+calculations.menu.width>=calculations.context.scrollLeft+calculations.context.width,isOffscreenRight&&(module.verbose("Dropdown cannot fit in context rightward",isOffscreenRight),canOpenRightward=!1),$currentMenu.removeClass(className.loading),canOpenRightward},click:function(){return hasTouch||"click"==settings.on},extendSelect:function(){return settings.allowAdditions||settings.apiSettings},show:function(){return!module.is.disabled()&&(module.has.items()||module.has.message())},useAPI:function(){return void 0!==$.fn.api}},animate:{show:function(callback,$subMenu){var transition,$currentMenu=$subMenu||$menu,start=$subMenu?function(){}:function(){module.hideSubMenus(),module.hideOthers(),module.set.active()};callback=$.isFunction(callback)?callback:function(){},module.verbose("Doing menu show animation",$currentMenu),module.set.direction($subMenu),transition=module.get.transition($subMenu),module.is.selection()&&module.set.scrollPosition(module.get.selectedItem(),!0),(module.is.hidden($currentMenu)||module.is.animating($currentMenu))&&("none"==transition?(start(),$currentMenu.transition("show"),callback.call(element)):void 0!==$.fn.transition&&$module.transition("is supported")?$currentMenu.transition({animation:transition+" in",debug:settings.debug,verbose:settings.verbose,duration:settings.duration,queue:!0,onStart:start,onComplete:function(){callback.call(element)}}):module.error(error.noTransition,transition))},hide:function(callback,$subMenu){var $currentMenu=$subMenu||$menu,start=($subMenu?settings.duration:settings.duration,$subMenu?function(){}:function(){module.can.click()&&module.unbind.intent(),module.remove.active()}),transition=module.get.transition($subMenu);callback=$.isFunction(callback)?callback:function(){},(module.is.visible($currentMenu)||module.is.animating($currentMenu))&&(module.verbose("Doing menu hide animation",$currentMenu),"none"==transition?(start(),$currentMenu.transition("hide"),callback.call(element)):void 0!==$.fn.transition&&$module.transition("is supported")?$currentMenu.transition({animation:transition+" out",duration:settings.duration,debug:settings.debug,verbose:settings.verbose,queue:!1,onStart:start,onComplete:function(){callback.call(element)}}):module.error(error.transition))}},hideAndClear:function(){module.remove.searchTerm(),module.has.maxSelections()||(module.has.search()?module.hide(function(){module.remove.filteredItem()}):module.hide())},delay:{show:function(){module.verbose("Delaying show event to ensure user intent"),clearTimeout(module.timer),module.timer=setTimeout(module.show,settings.delay.show)},hide:function(){module.verbose("Delaying hide event to ensure user intent"),clearTimeout(module.timer),module.timer=setTimeout(module.hide,settings.delay.hide)}},escape:{value:function(value){var multipleValues=$.isArray(value),stringValue="string"==typeof value,isUnparsable=!stringValue&&!multipleValues,hasQuotes=stringValue&&-1!==value.search(regExp.quote),values=[];return isUnparsable||!hasQuotes?value:(module.debug("Encoding quote values for use in select",value),multipleValues?($.each(value,function(index,value){values.push(value.replace(regExp.quote,"&quot;"))}),values):value.replace(regExp.quote,"&quot;"))},string:function(text){return text=String(text),text.replace(regExp.escape,"\\$&")}},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]?(found=object[value],!1):(module.error(error.method,query),!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:$allModules},$.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:window,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,ignoreCase:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(value,text,$selected){},onAdd:function(value,text,$selected){},onRemove:function(value,text,$selected){},onLabelSelect:function($selectedLabels){},onLabelCreate:function(value,text){return $(this)},onLabelRemove:function(value){return!0},onNoResults:function(searchTerm){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",value:"value",text:"text"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",clear:"clear",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",upward:"upward",leftward:"left",visible:"visible"}},$.fn.dropdown.settings.templates={dropdown:function(select){var placeholder=select.placeholder||!1,html=(select.values,"");return html+='<i class="dropdown icon"></i>',select.placeholder?html+='<div class="default text">'+placeholder+"</div>":html+='<div class="text"></div>',html+='<div class="menu">',$.each(select.values,function(index,option){html+=option.disabled?'<div class="disabled item" data-value="'+option.value+'">'+option.name+"</div>":'<div class="item" data-value="'+option.value+'">'+option.name+"</div>"}),html+="</div>"},menu:function(response,fields){var values=response[fields.values]||{},html="";return $.each(values,function(index,option){var maybeText=option[fields.text]?'data-text="'+option[fields.text]+'"':"",maybeDisabled=option[fields.disabled]?"disabled ":"";html+='<div class="'+maybeDisabled+'item" data-value="'+option[fields.value]+'"'+maybeText+">",html+=option[fields.name],html+="</div>"}),html},label:function(value,text){return text+'<i class="delete icon"></i>'},message:function(message){return message},addition:function(choice){return choice}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.form=function(parameters){var returnedValue,$allModules=$(this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],legacyParameters=arguments[1],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $allModules.each(function(){var $field,$group,$message,$prompt,$submit,$clear,$reset,settings,validation,metadata,selector,className,regExp,error,namespace,moduleNamespace,eventNamespace,instance,module,$module=$(this),element=this,formErrors=[],keyHeldDown=!1;module={initialize:function(){module.get.settings(),methodInvoked?(void 0===instance&&module.instantiate(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.verbose("Initializing form validation",$module,settings),module.bindEvents(),module.set.defaults(),module.instantiate())},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,module)},destroy:function(){module.verbose("Destroying previous module",instance),module.removeEvents(),$module.removeData(moduleNamespace)},refresh:function(){module.verbose("Refreshing selector cache"),$field=$module.find(selector.field),$group=$module.find(selector.group),$message=$module.find(selector.message),$prompt=$module.find(selector.prompt),$submit=$module.find(selector.submit),$clear=$module.find(selector.clear),$reset=$module.find(selector.reset)},submit:function(){module.verbose("Submitting form",$module),$module.submit()},attachEvents:function(selector,action){action=action||"submit",$(selector).on("click"+eventNamespace,function(event){module[action](),event.preventDefault()})},bindEvents:function(){module.verbose("Attaching form events"),$module.on("submit"+eventNamespace,module.validate.form).on("blur"+eventNamespace,selector.field,module.event.field.blur).on("click"+eventNamespace,selector.submit,module.submit).on("click"+eventNamespace,selector.reset,module.reset).on("click"+eventNamespace,selector.clear,module.clear),settings.keyboardShortcuts&&$module.on("keydown"+eventNamespace,selector.field,module.event.field.keydown),$field.each(function(){var $input=$(this),type=$input.prop("type"),inputEvent=module.get.changeEvent(type,$input);$(this).on(inputEvent+eventNamespace,module.event.field.change)})},clear:function(){$field.each(function(){var $field=$(this),$element=$field.parent(),$fieldGroup=$field.closest($group),$prompt=$fieldGroup.find(selector.prompt),defaultValue=$field.data(metadata.defaultValue)||"",isCheckbox=$element.is(selector.uiCheckbox),isDropdown=$element.is(selector.uiDropdown);$fieldGroup.hasClass(className.error)&&(module.verbose("Resetting error on field",$fieldGroup),$fieldGroup.removeClass(className.error),$prompt.remove()),isDropdown?(module.verbose("Resetting dropdown value",$element,defaultValue),$element.dropdown("clear")):isCheckbox?$field.prop("checked",!1):(module.verbose("Resetting field value",$field,defaultValue),$field.val(""))})},reset:function(){$field.each(function(){var $field=$(this),$element=$field.parent(),$fieldGroup=$field.closest($group),$prompt=$fieldGroup.find(selector.prompt),defaultValue=$field.data(metadata.defaultValue),isCheckbox=$element.is(selector.uiCheckbox),isDropdown=$element.is(selector.uiDropdown),isErrored=$fieldGroup.hasClass(className.error);void 0!==defaultValue&&(isErrored&&(module.verbose("Resetting error on field",$fieldGroup),$fieldGroup.removeClass(className.error),$prompt.remove()),isDropdown?(module.verbose("Resetting dropdown value",$element,defaultValue),$element.dropdown("restore defaults")):isCheckbox?(module.verbose("Resetting checkbox value",$element,defaultValue),$field.prop("checked",defaultValue)):(module.verbose("Resetting field value",$field,defaultValue),$field.val(defaultValue)))})},determine:{isValid:function(){var allValid=!0;return $.each(validation,function(fieldName,field){module.validate.field(field,fieldName,!0)||(allValid=!1)}),allValid}},is:{bracketedRule:function(rule){return rule.type&&rule.type.match(settings.regExp.bracket)},shorthandFields:function(fields){var fieldKeys=Object.keys(fields),firstRule=fields[fieldKeys[0]];return module.is.shorthandRules(firstRule)},shorthandRules:function(rules){return"string"==typeof rules||$.isArray(rules)},empty:function($field){return!$field||0===$field.length||($field.is('input[type="checkbox"]')?!$field.is(":checked"):module.is.blank($field))},blank:function($field){return""===$.trim($field.val())},valid:function(field){var allValid=!0;return field?(module.verbose("Checking if field is valid",field),module.validate.field(validation[field],field,!1)):(module.verbose("Checking if form is valid"),$.each(validation,function(fieldName,field){module.is.valid(fieldName)||(allValid=!1)}),allValid)}},removeEvents:function(){$module.off(eventNamespace),$field.off(eventNamespace),$submit.off(eventNamespace),$field.off(eventNamespace)},event:{field:{keydown:function(event){var $field=$(this),key=event.which,isInput=$field.is(selector.input),isCheckbox=$field.is(selector.checkbox),isInDropdown=$field.closest(selector.uiDropdown).length>0,keyCode={enter:13,escape:27};key==keyCode.escape&&(module.verbose("Escape key pressed blurring field"),$field.blur()),event.ctrlKey||key!=keyCode.enter||!isInput||isInDropdown||isCheckbox||(keyHeldDown||($field.one("keyup"+eventNamespace,module.event.field.keyup),module.submit(),module.debug("Enter pressed on input submitting form")),keyHeldDown=!0)},keyup:function(){keyHeldDown=!1},blur:function(event){var $field=$(this),$fieldGroup=$field.closest($group),validationRules=module.get.validation($field);$fieldGroup.hasClass(className.error)?(module.debug("Revalidating field",$field,validationRules),validationRules&&module.validate.field(validationRules)):"blur"==settings.on&&validationRules&&module.validate.field(validationRules)},change:function(event){var $field=$(this),$fieldGroup=$field.closest($group),validationRules=module.get.validation($field);validationRules&&("change"==settings.on||$fieldGroup.hasClass(className.error)&&settings.revalidate)&&(clearTimeout(module.timer),module.timer=setTimeout(function(){module.debug("Revalidating field",$field,module.get.validation($field)),module.validate.field(validationRules)},settings.delay))}}},get:{ancillaryValue:function(rule){return!(!rule.type||!rule.value&&!module.is.bracketedRule(rule))&&(void 0!==rule.value?rule.value:rule.type.match(settings.regExp.bracket)[1]+"")},ruleName:function(rule){return module.is.bracketedRule(rule)?rule.type.replace(rule.type.match(settings.regExp.bracket)[0],""):rule.type},changeEvent:function(type,$input){return"checkbox"==type||"radio"==type||"hidden"==type||$input.is("select")?"change":module.get.inputEvent()},inputEvent:function(){return void 0!==document.createElement("input").oninput?"input":void 0!==document.createElement("input").onpropertychange?"propertychange":"keyup"},fieldsFromShorthand:function(fields){var fullFields={};return $.each(fields,function(name,rules){"string"==typeof rules&&(rules=[rules]),fullFields[name]={rules:[]},$.each(rules,function(index,rule){fullFields[name].rules.push({type:rule})})}),fullFields},prompt:function(rule,field){var $label,name,ruleName=module.get.ruleName(rule),ancillary=module.get.ancillaryValue(rule),$field=module.get.field(field.identifier),value=$field.val(),prompt=$.isFunction(rule.prompt)?rule.prompt(value):rule.prompt||settings.prompt[ruleName]||settings.text.unspecifiedRule,requiresValue=-1!==prompt.search("{value}"),requiresName=-1!==prompt.search("{name}");return requiresValue&&(prompt=prompt.replace("{value}",$field.val())),requiresName&&($label=$field.closest(selector.group).find("label").eq(0),name=1==$label.length?$label.text():$field.prop("placeholder")||settings.text.unspecifiedField,prompt=prompt.replace("{name}",name)),prompt=prompt.replace("{identifier}",field.identifier),prompt=prompt.replace("{ruleValue}",ancillary),rule.prompt||module.verbose("Using default validation prompt for type",prompt,ruleName),prompt},settings:function(){if($.isPlainObject(parameters)){var keys=Object.keys(parameters),isLegacySettings=keys.length>0&&(void 0!==parameters[keys[0]].identifier&&void 0!==parameters[keys[0]].rules);isLegacySettings?(settings=$.extend(!0,{},$.fn.form.settings,legacyParameters),validation=$.extend({},$.fn.form.settings.defaults,parameters),module.error(settings.error.oldSyntax,element),module.verbose("Extending settings from legacy parameters",validation,settings)):(parameters.fields&&module.is.shorthandFields(parameters.fields)&&(parameters.fields=module.get.fieldsFromShorthand(parameters.fields)),settings=$.extend(!0,{},$.fn.form.settings,parameters),validation=$.extend({},$.fn.form.settings.defaults,settings.fields),module.verbose("Extending settings",validation,settings))}else settings=$.fn.form.settings,validation=$.fn.form.settings.defaults,module.verbose("Using default form validation",validation,settings);namespace=settings.namespace,metadata=settings.metadata,selector=settings.selector,className=settings.className,regExp=settings.regExp,error=settings.error,moduleNamespace="module-"+namespace,eventNamespace="."+namespace,instance=$module.data(moduleNamespace),module.refresh()},field:function(identifier){return module.verbose("Finding field with identifier",identifier),identifier=module.escape.string(identifier),$field.filter("#"+identifier).length>0?$field.filter("#"+identifier):$field.filter('[name="'+identifier+'"]').length>0?$field.filter('[name="'+identifier+'"]'):$field.filter('[name="'+identifier+'[]"]').length>0?$field.filter('[name="'+identifier+'[]"]'):$field.filter("[data-"+metadata.validate+'="'+identifier+'"]').length>0?$field.filter("[data-"+metadata.validate+'="'+identifier+'"]'):$("<input/>")},fields:function(fields){var $fields=$();return $.each(fields,function(index,name){$fields=$fields.add(module.get.field(name))}),$fields},validation:function($field){var fieldValidation,identifier;return!!validation&&($.each(validation,function(fieldName,field){identifier=field.identifier||fieldName,module.get.field(identifier)[0]==$field[0]&&(field.identifier=identifier,fieldValidation=field)}),fieldValidation||!1)},value:function(field){var results,fields=[];return fields.push(field),results=module.get.values.call(element,fields),results[field]},values:function(fields){var $fields=$.isArray(fields)?module.get.fields(fields):$field,values={};return $fields.each(function(index,field){var $field=$(field),name=($field.prop("type"),$field.prop("name")),value=$field.val(),isCheckbox=$field.is(selector.checkbox),isRadio=$field.is(selector.radio),isMultiple=-1!==name.indexOf("[]"),isChecked=!!isCheckbox&&$field.is(":checked");name&&(isMultiple?(name=name.replace("[]",""),values[name]||(values[name]=[]),isCheckbox?isChecked?values[name].push(value||!0):values[name].push(!1):values[name].push(value)):isRadio?void 0!==values[name]&&0!=values[name]||(values[name]=!!isChecked&&(value||!0)):values[name]=isCheckbox?!!isChecked&&(value||!0):value)}),values}},has:{field:function(identifier){return module.verbose("Checking for existence of a field with identifier",identifier),identifier=module.escape.string(identifier),"string"!=typeof identifier&&module.error(error.identifier,identifier),$field.filter("#"+identifier).length>0||($field.filter('[name="'+identifier+'"]').length>0||$field.filter("[data-"+metadata.validate+'="'+identifier+'"]').length>0)}},escape:{string:function(text){return text=String(text),text.replace(regExp.escape,"\\$&")}},add:{rule:function(name,rules){module.add.field(name,rules)},field:function(name,rules){var newValidation={};module.is.shorthandRules(rules)?(rules=$.isArray(rules)?rules:[rules],newValidation[name]={rules:[]},$.each(rules,function(index,rule){newValidation[name].rules.push({type:rule})})):newValidation[name]=rules,validation=$.extend({},validation,newValidation),module.debug("Adding rules",newValidation,validation)},fields:function(fields){var newValidation;newValidation=fields&&module.is.shorthandFields(fields)?module.get.fieldsFromShorthand(fields):fields,validation=$.extend({},validation,newValidation)},prompt:function(identifier,errors){var $field=module.get.field(identifier),$fieldGroup=$field.closest($group),$prompt=$fieldGroup.children(selector.prompt),promptExists=0!==$prompt.length;errors="string"==typeof errors?[errors]:errors,module.verbose("Adding field error state",identifier),$fieldGroup.addClass(className.error),settings.inline&&(promptExists||($prompt=settings.templates.prompt(errors),$prompt.appendTo($fieldGroup)),$prompt.html(errors[0]),promptExists?module.verbose("Inline errors are disabled, no inline error added",identifier):settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")?(module.verbose("Displaying error with css transition",settings.transition),$prompt.transition(settings.transition+" in",settings.duration)):(module.verbose("Displaying error with fallback javascript animation"),$prompt.fadeIn(settings.duration)))},errors:function(errors){module.debug("Adding form error messages",errors),module.set.error(),$message.html(settings.templates.error(errors))}},remove:{rule:function(field,rule){var rules=$.isArray(rule)?rule:[rule];if(void 0==rule)return module.debug("Removed all rules"),void(validation[field].rules=[]);void 0!=validation[field]&&$.isArray(validation[field].rules)&&$.each(validation[field].rules,function(index,rule){-1!==rules.indexOf(rule.type)&&(module.debug("Removed rule",rule.type),validation[field].rules.splice(index,1))})},field:function(field){var fields=$.isArray(field)?field:[field];$.each(fields,function(index,field){module.remove.rule(field)})},rules:function(field,rules){$.isArray(field)?$.each(fields,function(index,field){module.remove.rule(field,rules)}):module.remove.rule(field,rules)},fields:function(fields){module.remove.field(fields)},prompt:function(identifier){var $field=module.get.field(identifier),$fieldGroup=$field.closest($group),$prompt=$fieldGroup.children(selector.prompt);$fieldGroup.removeClass(className.error),settings.inline&&$prompt.is(":visible")&&(module.verbose("Removing prompt for field",identifier),settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")?$prompt.transition(settings.transition+" out",settings.duration,function(){$prompt.remove()}):$prompt.fadeOut(settings.duration,function(){$prompt.remove()}))}},set:{success:function(){$module.removeClass(className.error).addClass(className.success)},defaults:function(){$field.each(function(){var $field=$(this),isCheckbox=$field.filter(selector.checkbox).length>0,value=isCheckbox?$field.is(":checked"):$field.val();$field.data(metadata.defaultValue,value)})},error:function(){$module.removeClass(className.success).addClass(className.error)},value:function(field,value){var fields={};return fields[field]=value,module.set.values.call(element,fields)},values:function(fields){$.isEmptyObject(fields)||$.each(fields,function(key,value){var $multipleField,$field=module.get.field(key),$element=$field.parent(),isMultiple=$.isArray(value),isCheckbox=$element.is(selector.uiCheckbox),isDropdown=$element.is(selector.uiDropdown),isRadio=$field.is(selector.radio)&&isCheckbox,fieldExists=$field.length>0;fieldExists&&(isMultiple&&isCheckbox?(module.verbose("Selecting multiple",value,$field),$element.checkbox("uncheck"),$.each(value,function(index,value){$multipleField=$field.filter('[value="'+value+'"]'),$element=$multipleField.parent(),$multipleField.length>0&&$element.checkbox("check")})):isRadio?(module.verbose("Selecting radio value",value,$field),$field.filter('[value="'+value+'"]').parent(selector.uiCheckbox).checkbox("check")):isCheckbox?(module.verbose("Setting checkbox value",value,$element),!0===value?$element.checkbox("check"):$element.checkbox("uncheck")):isDropdown?(module.verbose("Setting dropdown value",value,$element),$element.dropdown("set selected",value)):(module.verbose("Setting field value",value,$field),$field.val(value)))})}},validate:{form:function(event,ignoreCallbacks){var values=module.get.values();if(keyHeldDown)return!1;if(formErrors=[],module.determine.isValid()){if(module.debug("Form has no validation errors, submitting"),module.set.success(),!0!==ignoreCallbacks)return settings.onSuccess.call(element,event,values)}else if(module.debug("Form has errors"),module.set.error(),settings.inline||module.add.errors(formErrors),void 0!==$module.data("moduleApi")&&event.stopImmediatePropagation(),!0!==ignoreCallbacks)return settings.onFailure.call(element,formErrors,values)},field:function(field,fieldName,showErrors){showErrors=void 0===showErrors||showErrors,"string"==typeof field&&(module.verbose("Validating field",field),fieldName=field,field=validation[field]);var identifier=field.identifier||fieldName,$field=module.get.field(identifier),$dependsField=!!field.depends&&module.get.field(field.depends),fieldValid=!0,fieldErrors=[];return field.identifier||(module.debug("Using field name as identifier",identifier),field.identifier=identifier),$field.prop("disabled")?(module.debug("Field is disabled. Skipping",identifier),fieldValid=!0):field.optional&&module.is.blank($field)?(module.debug("Field is optional and blank. Skipping",identifier),fieldValid=!0):field.depends&&module.is.empty($dependsField)?(module.debug("Field depends on another value that is not present or empty. Skipping",$dependsField),fieldValid=!0):void 0!==field.rules&&$.each(field.rules,function(index,rule){module.has.field(identifier)&&!module.validate.rule(field,rule)&&(module.debug("Field is invalid",identifier,rule.type),fieldErrors.push(module.get.prompt(rule,field)),fieldValid=!1)}),fieldValid?(showErrors&&(module.remove.prompt(identifier,fieldErrors),settings.onValid.call($field)),!0):(showErrors&&(formErrors=formErrors.concat(fieldErrors),module.add.prompt(identifier,fieldErrors),settings.onInvalid.call($field,fieldErrors)),!1)},rule:function(field,rule){var $field=module.get.field(field.identifier),value=(rule.type,$field.val()),ancillary=module.get.ancillaryValue(rule),ruleName=module.get.ruleName(rule),ruleFunction=settings.rules[ruleName];return $.isFunction(ruleFunction)?(value=void 0===value||""===value||null===value?"":$.trim(value+""),ruleFunction.call($field,value,ancillary)):void module.error(error.noRule,ruleName)}},setting:function(name,value){if($.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),$allModules.length>1&&(title+=" ("+$allModules.length+")"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]&&(found=object[value],!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},module.initialize()}),void 0!==returnedValue?returnedValue:this},$.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain  "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(errors){var html='<ul class="list">';return $.each(errors,function(index,value){html+="<li>"+value+"</li>"}),html+="</ul>",$(html)},prompt:function(errors){return $("<div/>").addClass("ui basic red pointing prompt label").html(errors[0])}},rules:{empty:function(value){return!(void 0===value||""===value||$.isArray(value)&&0===value.length)},checked:function(){return $(this).filter(":checked").length>0},email:function(value){return $.fn.form.settings.regExp.email.test(value)},url:function(value){return $.fn.form.settings.regExp.url.test(value)},regExp:function(value,regExp){if(regExp instanceof RegExp)return value.match(regExp);var flags,regExpParts=regExp.match($.fn.form.settings.regExp.flags);return regExpParts&&(regExp=regExpParts.length>=2?regExpParts[1]:regExp,flags=regExpParts.length>=3?regExpParts[2]:""),value.match(new RegExp(regExp,flags))},integer:function(value,range){var min,max,parts,intRegExp=$.fn.form.settings.regExp.integer;return range&&-1===["",".."].indexOf(range)&&(-1==range.indexOf("..")?intRegExp.test(range)&&(min=max=range-0):(parts=range.split("..",2),intRegExp.test(parts[0])&&(min=parts[0]-0),intRegExp.test(parts[1])&&(max=parts[1]-0))),intRegExp.test(value)&&(void 0===min||value>=min)&&(void 0===max||value<=max)},decimal:function(value){return $.fn.form.settings.regExp.decimal.test(value)},number:function(value){return $.fn.form.settings.regExp.number.test(value)},is:function(value,text){return text="string"==typeof text?text.toLowerCase():text,(value="string"==typeof value?value.toLowerCase():value)==text},isExactly:function(value,text){return value==text},not:function(value,notValue){return value="string"==typeof value?value.toLowerCase():value,notValue="string"==typeof notValue?notValue.toLowerCase():notValue,value!=notValue},notExactly:function(value,notValue){return value!=notValue},contains:function(value,text){return text=text.replace($.fn.form.settings.regExp.escape,"\\$&"),-1!==value.search(new RegExp(text,"i"))},containsExactly:function(value,text){return text=text.replace($.fn.form.settings.regExp.escape,"\\$&"),-1!==value.search(new RegExp(text))},doesntContain:function(value,text){return text=text.replace($.fn.form.settings.regExp.escape,"\\$&"),-1===value.search(new RegExp(text,"i"))},doesntContainExactly:function(value,text){return text=text.replace($.fn.form.settings.regExp.escape,"\\$&"),-1===value.search(new RegExp(text))},minLength:function(value,requiredLength){return void 0!==value&&value.length>=requiredLength},length:function(value,requiredLength){return void 0!==value&&value.length>=requiredLength},exactLength:function(value,requiredLength){return void 0!==value&&value.length==requiredLength},maxLength:function(value,maxLength){return void 0!==value&&value.length<=maxLength},match:function(value,identifier){var matchingValue;$(this);return $('[data-validate="'+identifier+'"]').length>0?matchingValue=$('[data-validate="'+identifier+'"]').val():$("#"+identifier).length>0?matchingValue=$("#"+identifier).val():$('[name="'+identifier+'"]').length>0?matchingValue=$('[name="'+identifier+'"]').val():$('[name="'+identifier+'[]"]').length>0&&(matchingValue=$('[name="'+identifier+'[]"]')),void 0!==matchingValue&&value.toString()==matchingValue.toString()},different:function(value,identifier){var matchingValue;$(this);return $('[data-validate="'+identifier+'"]').length>0?matchingValue=$('[data-validate="'+identifier+'"]').val():$("#"+identifier).length>0?matchingValue=$("#"+identifier).val():$('[name="'+identifier+'"]').length>0?matchingValue=$('[name="'+identifier+'"]').val():$('[name="'+identifier+'[]"]').length>0&&(matchingValue=$('[name="'+identifier+'[]"]')),void 0!==matchingValue&&value.toString()!==matchingValue.toString()},creditCard:function(cardNumber,cardTypes){var unionPay,validation,cards={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},valid={},validCard=!1,requiredTypes="string"==typeof cardTypes&&cardTypes.split(",");if("string"==typeof cardNumber&&0!==cardNumber.length){if(cardNumber=cardNumber.replace(/[\-]/g,""),requiredTypes&&($.each(requiredTypes,function(index,type){(validation=cards[type])&&(valid={length:-1!==$.inArray(cardNumber.length,validation.length),pattern:-1!==cardNumber.search(validation.pattern)},valid.length&&valid.pattern&&(validCard=!0))}),!validCard))return!1;if(unionPay={number:-1!==$.inArray(cardNumber.length,cards.unionPay.length),pattern:-1!==cardNumber.search(cards.unionPay.pattern)},unionPay.number&&unionPay.pattern)return!0;for(var length=cardNumber.length,multiple=0,producedValue=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],sum=0;length--;)sum+=producedValue[multiple][parseInt(cardNumber.charAt(length),10)],multiple^=1;return sum%10==0&&sum>0}},minCount:function(value,minCount){return 0==minCount||(1==minCount?""!==value:value.split(",").length>=minCount)},exactCount:function(value,exactCount){return 0==exactCount?""===value:1==exactCount?""!==value&&-1===value.search(","):value.split(",").length==exactCount},maxCount:function(value,maxCount){return 0!=maxCount&&(1==maxCount?-1===value.search(","):value.split(",").length<=maxCount)}}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.tab=function(parameters){var returnedValue,$allModules=$($.isFunction(this)?window:this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1),initializedHistory=!1;return $allModules.each(function(){var $context,$tabs,activeTabPath,parameterArray,module,historyEvent,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.tab.settings,parameters):$.extend({},$.fn.tab.settings),className=settings.className,metadata=settings.metadata,selector=settings.selector,error=settings.error,eventNamespace="."+settings.namespace,moduleNamespace="module-"+settings.namespace,$module=$(this),cache={},firstLoad=!0,recursionDepth=0,element=this,instance=$module.data(moduleNamespace);module={initialize:function(){module.debug("Initializing tab menu item",$module),module.fix.callbacks(),module.determineTabs(),module.debug("Determining tabs",settings.context,$tabs),settings.auto&&module.set.auto(),module.bind.events(),settings.history&&!initializedHistory&&(module.initializeHistory(),initializedHistory=!0),module.instantiate()},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,module)},destroy:function(){module.debug("Destroying tabs",$module),$module.removeData(moduleNamespace).off(eventNamespace)},bind:{events:function(){$.isWindow(element)||(module.debug("Attaching tab activation events to element",$module),$module.on("click"+eventNamespace,module.event.click))}},determineTabs:function(){var $reference;"parent"===settings.context?($module.closest(selector.ui).length>0?($reference=$module.closest(selector.ui),module.verbose("Using closest UI element as parent",$reference)):$reference=$module,$context=$reference.parent(),module.verbose("Determined parent element for creating context",$context)):settings.context?($context=$(settings.context),module.verbose("Using selector for tab context",settings.context,$context)):$context=$("body"),settings.childrenOnly?($tabs=$context.children(selector.tabs),module.debug("Searching tab context children for tabs",$context,$tabs)):($tabs=$context.find(selector.tabs),module.debug("Searching tab context for tabs",$context,$tabs))},fix:{callbacks:function(){$.isPlainObject(parameters)&&(parameters.onTabLoad||parameters.onTabInit)&&(parameters.onTabLoad&&(parameters.onLoad=parameters.onTabLoad,delete parameters.onTabLoad,module.error(error.legacyLoad,parameters.onLoad)),parameters.onTabInit&&(parameters.onFirstLoad=parameters.onTabInit,delete parameters.onTabInit,module.error(error.legacyInit,parameters.onFirstLoad)),settings=$.extend(!0,{},$.fn.tab.settings,parameters))}},initializeHistory:function(){if(module.debug("Initializing page state"),void 0===$.address)return module.error(error.state),!1;if("state"==settings.historyType){if(module.debug("Using HTML5 to manage state"),!1===settings.path)return module.error(error.path),!1;$.address.history(!0).state(settings.path)}$.address.bind("change",module.event.history.change)},event:{click:function(event){var tabPath=$(this).data(metadata.tab);void 0!==tabPath?(settings.history?(module.verbose("Updating page state",event),$.address.value(tabPath)):(module.verbose("Changing tab",event),module.changeTab(tabPath)),event.preventDefault()):module.debug("No tab specified")},history:{change:function(event){var tabPath=event.pathNames.join("/")||module.get.initialPath(),pageTitle=settings.templates.determineTitle(tabPath)||!1;module.performance.display(),module.debug("History change event",tabPath,event),historyEvent=event,void 0!==tabPath&&module.changeTab(tabPath),pageTitle&&$.address.title(pageTitle)}}},refresh:function(){activeTabPath&&(module.debug("Refreshing tab",activeTabPath),module.changeTab(activeTabPath))},cache:{read:function(cacheKey){return void 0!==cacheKey&&cache[cacheKey]},add:function(cacheKey,content){cacheKey=cacheKey||activeTabPath,module.debug("Adding cached content for",cacheKey),cache[cacheKey]=content},remove:function(cacheKey){cacheKey=cacheKey||activeTabPath,module.debug("Removing cached content for",cacheKey),delete cache[cacheKey]}},set:{auto:function(){var url="string"==typeof settings.path?settings.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";module.verbose("Setting up automatic tab retrieval from server",url),$.isPlainObject(settings.apiSettings)?settings.apiSettings.url=url:settings.apiSettings={url:url}},loading:function(tabPath){var $tab=module.get.tabElement(tabPath);$tab.hasClass(className.loading)||(module.verbose("Setting loading state for",$tab),$tab.addClass(className.loading).siblings($tabs).removeClass(className.active+" "+className.loading),$tab.length>0&&settings.onRequest.call($tab[0],tabPath))},state:function(state){$.address.value(state)}},changeTab:function(tabPath){var pushStateAvailable=window.history&&window.history.pushState,shouldIgnoreLoad=pushStateAvailable&&settings.ignoreFirstLoad&&firstLoad,remoteContent=settings.auto||$.isPlainObject(settings.apiSettings),pathArray=remoteContent&&!shouldIgnoreLoad?module.utilities.pathToArray(tabPath):module.get.defaultPathArray(tabPath);tabPath=module.utilities.arrayToPath(pathArray),$.each(pathArray,function(index,tab){var $anchor,nextPathArray,nextPath,isLastTab,currentPathArray=pathArray.slice(0,index+1),currentPath=module.utilities.arrayToPath(currentPathArray),isTab=module.is.tab(currentPath),isLastIndex=index+1==pathArray.length,$tab=module.get.tabElement(currentPath);if(module.verbose("Looking for tab",tab),isTab){if(module.verbose("Tab was found",tab),activeTabPath=currentPath,parameterArray=module.utilities.filterArray(pathArray,currentPathArray),isLastIndex?isLastTab=!0:(nextPathArray=pathArray.slice(0,index+2),nextPath=module.utilities.arrayToPath(nextPathArray),(isLastTab=!module.is.tab(nextPath))&&module.verbose("Tab parameters found",nextPathArray)),isLastTab&&remoteContent)return shouldIgnoreLoad?(module.debug("Ignoring remote content on first tab load",currentPath),firstLoad=!1,module.cache.add(tabPath,$tab.html()),module.activate.all(currentPath),settings.onFirstLoad.call($tab[0],currentPath,parameterArray,historyEvent),settings.onLoad.call($tab[0],currentPath,parameterArray,historyEvent)):(module.activate.navigation(currentPath),module.fetch.content(currentPath,tabPath)),!1;module.debug("Opened local tab",currentPath),module.activate.all(currentPath),module.cache.read(currentPath)||(module.cache.add(currentPath,!0),module.debug("First time tab loaded calling tab init"),settings.onFirstLoad.call($tab[0],currentPath,parameterArray,historyEvent)),settings.onLoad.call($tab[0],currentPath,parameterArray,historyEvent)}else{if(-1!=tabPath.search("/")||""===tabPath)return module.error(error.missingTab,$module,$context,currentPath),!1;if($anchor=$("#"+tabPath+', a[name="'+tabPath+'"]'),currentPath=$anchor.closest("[data-tab]").data(metadata.tab),$tab=module.get.tabElement(currentPath),$anchor&&$anchor.length>0&&currentPath)return module.debug("Anchor link used, opening parent tab",$tab,$anchor),$tab.hasClass(className.active)||setTimeout(function(){module.scrollTo($anchor)},0),module.activate.all(currentPath),module.cache.read(currentPath)||(module.cache.add(currentPath,!0),module.debug("First time tab loaded calling tab init"),settings.onFirstLoad.call($tab[0],currentPath,parameterArray,historyEvent)),settings.onLoad.call($tab[0],currentPath,parameterArray,historyEvent),!1}})},scrollTo:function($element){var scrollOffset=!!($element&&$element.length>0)&&$element.offset().top;!1!==scrollOffset&&(module.debug("Forcing scroll to an in-page link in a hidden tab",scrollOffset,$element),$(document).scrollTop(scrollOffset))},update:{content:function(tabPath,html,evaluateScripts){var $tab=module.get.tabElement(tabPath),tab=$tab[0];evaluateScripts=void 0!==evaluateScripts?evaluateScripts:settings.evaluateScripts,"string"==typeof settings.cacheType&&"dom"==settings.cacheType.toLowerCase()&&"string"!=typeof html?$tab.empty().append($(html).clone(!0)):evaluateScripts?(module.debug("Updating HTML and evaluating inline scripts",tabPath,html),$tab.html(html)):(module.debug("Updating HTML",tabPath,html),tab.innerHTML=html)}},fetch:{content:function(tabPath,fullTabPath){var requestSettings,cachedContent,$tab=module.get.tabElement(tabPath),apiSettings={dataType:"html",encodeParameters:!1,on:"now",cache:settings.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(response){"response"==settings.cacheType&&module.cache.add(fullTabPath,response),module.update.content(tabPath,response),tabPath==activeTabPath?(module.debug("Content loaded",tabPath),module.activate.tab(tabPath)):module.debug("Content loaded in background",tabPath),settings.onFirstLoad.call($tab[0],tabPath,parameterArray,historyEvent),settings.onLoad.call($tab[0],tabPath,parameterArray,historyEvent),settings.loadOnce?module.cache.add(fullTabPath,!0):"string"==typeof settings.cacheType&&"dom"==settings.cacheType.toLowerCase()&&$tab.children().length>0?setTimeout(function(){var $clone=$tab.children().clone(!0);$clone=$clone.not("script"),module.cache.add(fullTabPath,$clone)},0):module.cache.add(fullTabPath,$tab.html())},urlData:{tab:fullTabPath}},request=$tab.api("get request")||!1,existingRequest=request&&"pending"===request.state();fullTabPath=fullTabPath||tabPath,cachedContent=module.cache.read(fullTabPath),settings.cache&&cachedContent?(module.activate.tab(tabPath),module.debug("Adding cached content",fullTabPath),settings.loadOnce||("once"==settings.evaluateScripts?module.update.content(tabPath,cachedContent,!1):module.update.content(tabPath,cachedContent)),settings.onLoad.call($tab[0],tabPath,parameterArray,historyEvent)):existingRequest?(module.set.loading(tabPath),module.debug("Content is already loading",fullTabPath)):void 0!==$.api?(requestSettings=$.extend(!0,{},settings.apiSettings,apiSettings),module.debug("Retrieving remote content",fullTabPath,requestSettings),module.set.loading(tabPath),$tab.api(requestSettings)):module.error(error.api)}},activate:{all:function(tabPath){module.activate.tab(tabPath),module.activate.navigation(tabPath)},tab:function(tabPath){var $tab=module.get.tabElement(tabPath),$deactiveTabs="siblings"==settings.deactivate?$tab.siblings($tabs):$tabs.not($tab),isActive=$tab.hasClass(className.active);module.verbose("Showing tab content for",$tab),isActive||($tab.addClass(className.active),$deactiveTabs.removeClass(className.active+" "+className.loading),$tab.length>0&&settings.onVisible.call($tab[0],tabPath))},navigation:function(tabPath){var $navigation=module.get.navElement(tabPath),$deactiveNavigation="siblings"==settings.deactivate?$navigation.siblings($allModules):$allModules.not($navigation),isActive=$navigation.hasClass(className.active);module.verbose("Activating tab navigation for",$navigation,tabPath),isActive||($navigation.addClass(className.active),$deactiveNavigation.removeClass(className.active+" "+className.loading))}},deactivate:{all:function(){module.deactivate.navigation(),module.deactivate.tabs()},navigation:function(){$allModules.removeClass(className.active)},tabs:function(){$tabs.removeClass(className.active+" "+className.loading)}},is:{tab:function(tabName){return void 0!==tabName&&module.get.tabElement(tabName).length>0}},get:{initialPath:function(){return $allModules.eq(0).data(metadata.tab)||$tabs.eq(0).data(metadata.tab)},path:function(){return $.address.value()},defaultPathArray:function(tabPath){return module.utilities.pathToArray(module.get.defaultPath(tabPath))},defaultPath:function(tabPath){var $defaultNav=$allModules.filter("[data-"+metadata.tab+'^="'+tabPath+'/"]').eq(0),defaultTab=$defaultNav.data(metadata.tab)||!1;if(defaultTab){if(module.debug("Found default tab",defaultTab),recursionDepth<settings.maxDepth)return recursionDepth++,module.get.defaultPath(defaultTab);module.error(error.recursion)}else module.debug("No default tabs found for",tabPath,$tabs);return recursionDepth=0,tabPath},navElement:function(tabPath){return tabPath=tabPath||activeTabPath,$allModules.filter("[data-"+metadata.tab+'="'+tabPath+'"]')},tabElement:function(tabPath){var $fullPathTab,$simplePathTab,tabPathArray,lastTab;return tabPath=tabPath||activeTabPath,tabPathArray=module.utilities.pathToArray(tabPath),lastTab=module.utilities.last(tabPathArray),$fullPathTab=$tabs.filter("[data-"+metadata.tab+'="'+tabPath+'"]'),$simplePathTab=$tabs.filter("[data-"+metadata.tab+'="'+lastTab+'"]'),$fullPathTab.length>0?$fullPathTab:$simplePathTab},tab:function(){return activeTabPath}},utilities:{filterArray:function(keepArray,removeArray){return $.grep(keepArray,function(keepValue){return-1==$.inArray(keepValue,removeArray)})},last:function(array){return!!$.isArray(array)&&array[array.length-1]},pathToArray:function(pathName){return void 0===pathName&&(pathName=activeTabPath),"string"==typeof pathName?pathName.split("/"):[pathName]},arrayToPath:function(pathArray){return!!$.isArray(pathArray)&&pathArray.join("/")}},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]?(found=object[value],!1):(module.error(error.method,query),!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.tab=function(){$(window).tab.apply(this,arguments)},$.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(tabPath,parameterArray,historyEvent){},onLoad:function(tabPath,parameterArray,historyEvent){},onVisible:function(tabPath,parameterArray,historyEvent){},onRequest:function(tabPath,parameterArray,historyEvent){},templates:{determineTitle:function(tabArray){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.transition=function(){var returnedValue,$allModules=$(this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],moduleArguments=arguments,query=moduleArguments[0],queryArguments=[].slice.call(arguments,1),methodInvoked="string"==typeof query;window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;return $allModules.each(function(index){var settings,instance,error,className,metadata,animationEnd,moduleNamespace,eventNamespace,module,$module=$(this),element=this;module={initialize:function(){settings=module.get.settings.apply(element,moduleArguments),className=settings.className,error=settings.error,metadata=settings.metadata,eventNamespace="."+settings.namespace,moduleNamespace="module-"+settings.namespace,instance=$module.data(moduleNamespace)||module,animationEnd=module.get.animationEndEvent(),methodInvoked&&(methodInvoked=module.invoke(query)),!1===methodInvoked&&(module.verbose("Converted arguments into settings object",settings),settings.interval?module.delay(settings.animate):module.animate(),module.instantiate())},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,instance)},destroy:function(){module.verbose("Destroying previous module for",element),$module.removeData(moduleNamespace)},refresh:function(){module.verbose("Refreshing display type on next animation"),delete module.displayType},forceRepaint:function(){module.verbose("Forcing element repaint");var $parentElement=$module.parent(),$nextElement=$module.next();0===$nextElement.length?$module.detach().appendTo($parentElement):$module.detach().insertBefore($nextElement)},repaint:function(){module.verbose("Repainting element");element.offsetWidth},delay:function(interval){var shouldReverse,delay,direction=module.get.animationDirection();direction||(direction=module.can.transition()?module.get.direction():"static"),interval=void 0!==interval?interval:settings.interval,shouldReverse="auto"==settings.reverse&&direction==className.outward,delay=shouldReverse||1==settings.reverse?($allModules.length-index)*settings.interval:index*settings.interval,module.debug("Delaying animation by",delay),setTimeout(module.animate,delay)},animate:function(overrideSettings){if(settings=overrideSettings||settings,!module.is.supported())return module.error(error.support),!1;if(module.debug("Preparing animation",settings.animation),module.is.animating()){if(settings.queue)return!settings.allowRepeats&&module.has.direction()&&module.is.occurring()&&!0!==module.queuing?module.debug("Animation is currently occurring, preventing queueing same animation",settings.animation):module.queue(settings.animation),!1;if(!settings.allowRepeats&&module.is.occurring())return module.debug("Animation is already occurring, will not execute repeated animation",settings.animation),!1;module.debug("New animation started, completing previous early",settings.animation),instance.complete()}module.can.animate()?module.set.animating(settings.animation):module.error(error.noAnimation,settings.animation,element)},reset:function(){module.debug("Resetting animation to beginning conditions"),module.remove.animationCallbacks(),module.restore.conditions(),module.remove.animating()},queue:function(animation){module.debug("Queueing animation of",animation),module.queuing=!0,$module.one(animationEnd+".queue"+eventNamespace,function(){module.queuing=!1,module.repaint(),module.animate.apply(this,settings)})},complete:function(event){module.debug("Animation complete",settings.animation),module.remove.completeCallback(),module.remove.failSafe(),module.is.looping()||(module.is.outward()?(module.verbose("Animation is outward, hiding element"),module.restore.conditions(),module.hide()):module.is.inward()?(module.verbose("Animation is outward, showing element"),module.restore.conditions(),module.show()):(module.verbose("Static animation completed"),module.restore.conditions(),settings.onComplete.call(element)))},force:{visible:function(){var style=$module.attr("style"),userStyle=module.get.userStyle(),displayType=module.get.displayType(),overrideStyle=userStyle+"display: "+displayType+" !important;",currentDisplay=$module.css("display"),emptyStyle=void 0===style||""===style;currentDisplay!==displayType?(module.verbose("Overriding default display to show element",displayType),$module.attr("style",overrideStyle)):emptyStyle&&$module.removeAttr("style")},hidden:function(){var style=$module.attr("style"),currentDisplay=$module.css("display"),emptyStyle=void 0===style||""===style;"none"===currentDisplay||module.is.hidden()?emptyStyle&&$module.removeAttr("style"):(module.verbose("Overriding default display to hide element"),$module.css("display","none"))}},has:{direction:function(animation){var hasDirection=!1;return animation=animation||settings.animation,"string"==typeof animation&&(animation=animation.split(" "),$.each(animation,function(index,word){word!==className.inward&&word!==className.outward||(hasDirection=!0)})),hasDirection},inlineDisplay:function(){var style=$module.attr("style")||"";return $.isArray(style.match(/display.*?;/,""))}},set:{animating:function(animation){var animationClass;module.remove.completeCallback(),animation=animation||settings.animation,animationClass=module.get.animationClass(animation),module.save.animation(animationClass),module.force.visible(),module.remove.hidden(),module.remove.direction(),module.start.animation(animationClass)},duration:function(animationName,duration){duration=duration||settings.duration,((duration="number"==typeof duration?duration+"ms":duration)||0===duration)&&(module.verbose("Setting animation duration",duration),$module.css({"animation-duration":duration}))},direction:function(direction){direction=direction||module.get.direction(),direction==className.inward?module.set.inward():module.set.outward()},looping:function(){module.debug("Transition set to loop"),$module.addClass(className.looping)},hidden:function(){$module.addClass(className.transition).addClass(className.hidden)},inward:function(){module.debug("Setting direction to inward"),$module.removeClass(className.outward).addClass(className.inward)},outward:function(){module.debug("Setting direction to outward"),$module.removeClass(className.inward).addClass(className.outward)},visible:function(){$module.addClass(className.transition).addClass(className.visible)}},start:{animation:function(animationClass){animationClass=animationClass||module.get.animationClass(),module.debug("Starting tween",animationClass),$module.addClass(animationClass).one(animationEnd+".complete"+eventNamespace,module.complete),settings.useFailSafe&&module.add.failSafe(),module.set.duration(settings.duration),settings.onStart.call(element)}},save:{animation:function(animation){module.cache||(module.cache={}),module.cache.animation=animation},displayType:function(displayType){"none"!==displayType&&$module.data(metadata.displayType,displayType)},transitionExists:function(animation,exists){$.fn.transition.exists[animation]=exists,module.verbose("Saving existence of transition",animation,exists)}},restore:{conditions:function(){var animation=module.get.currentAnimation();animation&&($module.removeClass(animation),module.verbose("Removing animation class",module.cache)),module.remove.duration()}},add:{failSafe:function(){var duration=module.get.duration();module.timer=setTimeout(function(){$module.triggerHandler(animationEnd)},duration+settings.failSafeDelay),module.verbose("Adding fail safe timer",module.timer)}},remove:{animating:function(){$module.removeClass(className.animating)},animationCallbacks:function(){module.remove.queueCallback(),module.remove.completeCallback()},queueCallback:function(){$module.off(".queue"+eventNamespace)},completeCallback:function(){$module.off(".complete"+eventNamespace)},display:function(){$module.css("display","")},direction:function(){$module.removeClass(className.inward).removeClass(className.outward)},duration:function(){$module.css("animation-duration","")},failSafe:function(){module.verbose("Removing fail safe timer",module.timer),module.timer&&clearTimeout(module.timer)},hidden:function(){$module.removeClass(className.hidden)},visible:function(){$module.removeClass(className.visible)},looping:function(){module.debug("Transitions are no longer looping"),module.is.looping()&&(module.reset(),$module.removeClass(className.looping))},transition:function(){$module.removeClass(className.visible).removeClass(className.hidden)}},get:{settings:function(animation,duration,onComplete){return"object"==typeof animation?$.extend(!0,{},$.fn.transition.settings,animation):"function"==typeof onComplete?$.extend({},$.fn.transition.settings,{animation:animation,onComplete:onComplete,duration:duration}):"string"==typeof duration||"number"==typeof duration?$.extend({},$.fn.transition.settings,{animation:animation,duration:duration}):"object"==typeof duration?$.extend({},$.fn.transition.settings,duration,{animation:animation}):"function"==typeof duration?$.extend({},$.fn.transition.settings,{animation:animation,onComplete:duration}):$.extend({},$.fn.transition.settings,{animation:animation})},animationClass:function(animation){var animationClass=animation||settings.animation,directionClass=module.can.transition()&&!module.has.direction()?module.get.direction()+" ":"";return className.animating+" "+className.transition+" "+directionClass+animationClass},currentAnimation:function(){return!(!module.cache||void 0===module.cache.animation)&&module.cache.animation},currentDirection:function(){return module.is.inward()?className.inward:className.outward},direction:function(){return module.is.hidden()||!module.is.visible()?className.inward:className.outward},animationDirection:function(animation){var direction;return animation=animation||settings.animation,"string"==typeof animation&&(animation=animation.split(" "),$.each(animation,function(index,word){word===className.inward?direction=className.inward:word===className.outward&&(direction=className.outward)})),direction||!1},duration:function(duration){return duration=duration||settings.duration,!1===duration&&(duration=$module.css("animation-duration")||0),"string"==typeof duration?duration.indexOf("ms")>-1?parseFloat(duration):1e3*parseFloat(duration):duration},displayType:function(){return settings.displayType?settings.displayType:(void 0===$module.data(metadata.displayType)&&module.can.transition(!0),$module.data(metadata.displayType))},userStyle:function(style){return style=style||$module.attr("style")||"",style.replace(/display.*?;/,"")},transitionExists:function(animation){return $.fn.transition.exists[animation]},animationStartEvent:function(){var animation,element=document.createElement("div"),animations={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(animation in animations)if(void 0!==element.style[animation])return animations[animation];return!1},animationEndEvent:function(){var animation,element=document.createElement("div"),animations={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(animation in animations)if(void 0!==element.style[animation])return animations[animation];return!1}},can:{transition:function(forced){var elementClass,tagName,$clone,currentAnimation,inAnimation,directionExists,displayType,animation=settings.animation,transitionExists=module.get.transitionExists(animation);if(void 0===transitionExists||forced){if(module.verbose("Determining whether animation exists"),elementClass=$module.attr("class"),tagName=$module.prop("tagName"),$clone=$("<"+tagName+" />").addClass(elementClass).insertAfter($module),currentAnimation=$clone.addClass(animation).removeClass(className.inward).removeClass(className.outward).addClass(className.animating).addClass(className.transition).css("animationName"),inAnimation=$clone.addClass(className.inward).css("animationName"),displayType=$clone.attr("class",elementClass).removeAttr("style").removeClass(className.hidden).removeClass(className.visible).show().css("display"),module.verbose("Determining final display state",displayType),module.save.displayType(displayType),$clone.remove(),currentAnimation!=inAnimation)module.debug("Direction exists for animation",animation),directionExists=!0;else{if("none"==currentAnimation||!currentAnimation)return void module.debug("No animation defined in css",animation);module.debug("Static animation found",animation,displayType),directionExists=!1}module.save.transitionExists(animation,directionExists)}return void 0!==transitionExists?transitionExists:directionExists},animate:function(){return void 0!==module.can.transition()}},is:{animating:function(){return $module.hasClass(className.animating)},inward:function(){return $module.hasClass(className.inward)},outward:function(){return $module.hasClass(className.outward)},looping:function(){return $module.hasClass(className.looping)},occurring:function(animation){return animation=animation||settings.animation,animation="."+animation.replace(" ","."),$module.filter(animation).length>0},visible:function(){return $module.is(":visible")},hidden:function(){return"hidden"===$module.css("visibility")},supported:function(){return!1!==animationEnd}},hide:function(){module.verbose("Hiding element"),module.is.animating()&&module.reset(),element.blur(),module.remove.display(),module.remove.visible(),module.set.hidden(),module.force.hidden(),settings.onHide.call(element),settings.onComplete.call(element)},show:function(display){module.verbose("Showing element",display),module.remove.hidden(),module.set.visible(),module.force.visible(),settings.onShow.call(element),settings.onComplete.call(element)},toggle:function(){module.is.visible()?module.hide():module.show()},stop:function(){module.debug("Stopping current animation"),$module.triggerHandler(animationEnd)},stopAll:function(){module.debug("Stopping all animation"),module.remove.queueCallback(),$module.triggerHandler(animationEnd)},clear:{queue:function(){module.debug("Clearing animation queue"),module.remove.queueCallback()}},enable:function(){module.verbose("Starting animation"),$module.removeClass(className.disabled)},disable:function(){module.debug("Stopping animation"),$module.addClass(className.disabled)},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),$allModules.length>1&&(title+=" ("+$allModules.length+")"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]&&(found=object[value],!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),void 0!==found&&found}},module.initialize()}),void 0!==returnedValue?returnedValue:this},$.fn.transition.exists={},$.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.transition=function(){var returnedValue,$allModules=$(this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],moduleArguments=arguments,query=moduleArguments[0],queryArguments=[].slice.call(arguments,1),methodInvoked="string"==typeof query;window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;return $allModules.each(function(index){var settings,instance,error,className,metadata,animationEnd,moduleNamespace,eventNamespace,module,$module=$(this),element=this;module={initialize:function(){settings=module.get.settings.apply(element,moduleArguments),className=settings.className,error=settings.error,metadata=settings.metadata,eventNamespace="."+settings.namespace,moduleNamespace="module-"+settings.namespace,instance=$module.data(moduleNamespace)||module,animationEnd=module.get.animationEndEvent(),methodInvoked&&(methodInvoked=module.invoke(query)),!1===methodInvoked&&(module.verbose("Converted arguments into settings object",settings),settings.interval?module.delay(settings.animate):module.animate(),module.instantiate())},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,instance)},destroy:function(){module.verbose("Destroying previous module for",element),$module.removeData(moduleNamespace)},refresh:function(){module.verbose("Refreshing display type on next animation"),delete module.displayType},forceRepaint:function(){module.verbose("Forcing element repaint");var $parentElement=$module.parent(),$nextElement=$module.next();0===$nextElement.length?$module.detach().appendTo($parentElement):$module.detach().insertBefore($nextElement)},repaint:function(){module.verbose("Repainting element");element.offsetWidth},delay:function(interval){var shouldReverse,delay,direction=module.get.animationDirection();direction||(direction=module.can.transition()?module.get.direction():"static"),interval=void 0!==interval?interval:settings.interval,shouldReverse="auto"==settings.reverse&&direction==className.outward,delay=shouldReverse||1==settings.reverse?($allModules.length-index)*settings.interval:index*settings.interval,module.debug("Delaying animation by",delay),setTimeout(module.animate,delay)},animate:function(overrideSettings){if(settings=overrideSettings||settings,!module.is.supported())return module.error(error.support),!1;if(module.debug("Preparing animation",settings.animation),module.is.animating()){if(settings.queue)return!settings.allowRepeats&&module.has.direction()&&module.is.occurring()&&!0!==module.queuing?module.debug("Animation is currently occurring, preventing queueing same animation",settings.animation):module.queue(settings.animation),!1;if(!settings.allowRepeats&&module.is.occurring())return module.debug("Animation is already occurring, will not execute repeated animation",settings.animation),!1;module.debug("New animation started, completing previous early",settings.animation),instance.complete()}module.can.animate()?module.set.animating(settings.animation):module.error(error.noAnimation,settings.animation,element)},reset:function(){module.debug("Resetting animation to beginning conditions"),module.remove.animationCallbacks(),module.restore.conditions(),module.remove.animating()},queue:function(animation){module.debug("Queueing animation of",animation),module.queuing=!0,$module.one(animationEnd+".queue"+eventNamespace,function(){module.queuing=!1,module.repaint(),module.animate.apply(this,settings)})},complete:function(event){module.debug("Animation complete",settings.animation),module.remove.completeCallback(),module.remove.failSafe(),module.is.looping()||(module.is.outward()?(module.verbose("Animation is outward, hiding element"),module.restore.conditions(),module.hide()):module.is.inward()?(module.verbose("Animation is outward, showing element"),module.restore.conditions(),module.show()):(module.verbose("Static animation completed"),module.restore.conditions(),settings.onComplete.call(element)))},force:{visible:function(){var style=$module.attr("style"),userStyle=module.get.userStyle(),displayType=module.get.displayType(),overrideStyle=userStyle+"display: "+displayType+" !important;",currentDisplay=$module.css("display"),emptyStyle=void 0===style||""===style;currentDisplay!==displayType?(module.verbose("Overriding default display to show element",displayType),$module.attr("style",overrideStyle)):emptyStyle&&$module.removeAttr("style")},hidden:function(){var style=$module.attr("style"),currentDisplay=$module.css("display"),emptyStyle=void 0===style||""===style;"none"===currentDisplay||module.is.hidden()?emptyStyle&&$module.removeAttr("style"):(module.verbose("Overriding default display to hide element"),$module.css("display","none"))}},has:{direction:function(animation){var hasDirection=!1;return animation=animation||settings.animation,"string"==typeof animation&&(animation=animation.split(" "),$.each(animation,function(index,word){word!==className.inward&&word!==className.outward||(hasDirection=!0)})),hasDirection},inlineDisplay:function(){var style=$module.attr("style")||"";return $.isArray(style.match(/display.*?;/,""))}},set:{animating:function(animation){var animationClass;module.remove.completeCallback(),animation=animation||settings.animation,animationClass=module.get.animationClass(animation),module.save.animation(animationClass),module.force.visible(),module.remove.hidden(),module.remove.direction(),module.start.animation(animationClass)},duration:function(animationName,duration){duration=duration||settings.duration,((duration="number"==typeof duration?duration+"ms":duration)||0===duration)&&(module.verbose("Setting animation duration",duration),$module.css({"animation-duration":duration}))},direction:function(direction){direction=direction||module.get.direction(),direction==className.inward?module.set.inward():module.set.outward()},looping:function(){module.debug("Transition set to loop"),$module.addClass(className.looping)},hidden:function(){$module.addClass(className.transition).addClass(className.hidden)},inward:function(){module.debug("Setting direction to inward"),$module.removeClass(className.outward).addClass(className.inward)},outward:function(){module.debug("Setting direction to outward"),$module.removeClass(className.inward).addClass(className.outward)},visible:function(){$module.addClass(className.transition).addClass(className.visible)}},start:{animation:function(animationClass){animationClass=animationClass||module.get.animationClass(),module.debug("Starting tween",animationClass),$module.addClass(animationClass).one(animationEnd+".complete"+eventNamespace,module.complete),settings.useFailSafe&&module.add.failSafe(),module.set.duration(settings.duration),settings.onStart.call(element)}},save:{animation:function(animation){module.cache||(module.cache={}),module.cache.animation=animation},displayType:function(displayType){"none"!==displayType&&$module.data(metadata.displayType,displayType)},transitionExists:function(animation,exists){$.fn.transition.exists[animation]=exists,module.verbose("Saving existence of transition",animation,exists)}},restore:{conditions:function(){var animation=module.get.currentAnimation();animation&&($module.removeClass(animation),module.verbose("Removing animation class",module.cache)),module.remove.duration()}},add:{failSafe:function(){var duration=module.get.duration();module.timer=setTimeout(function(){$module.triggerHandler(animationEnd)},duration+settings.failSafeDelay),module.verbose("Adding fail safe timer",module.timer)}},remove:{animating:function(){$module.removeClass(className.animating)},animationCallbacks:function(){module.remove.queueCallback(),module.remove.completeCallback()},queueCallback:function(){$module.off(".queue"+eventNamespace)},completeCallback:function(){$module.off(".complete"+eventNamespace)},display:function(){$module.css("display","")},direction:function(){$module.removeClass(className.inward).removeClass(className.outward)},duration:function(){$module.css("animation-duration","")},failSafe:function(){module.verbose("Removing fail safe timer",module.timer),module.timer&&clearTimeout(module.timer)},hidden:function(){$module.removeClass(className.hidden)},visible:function(){$module.removeClass(className.visible)},looping:function(){module.debug("Transitions are no longer looping"),module.is.looping()&&(module.reset(),$module.removeClass(className.looping))},transition:function(){$module.removeClass(className.visible).removeClass(className.hidden)}},get:{settings:function(animation,duration,onComplete){return"object"==typeof animation?$.extend(!0,{},$.fn.transition.settings,animation):"function"==typeof onComplete?$.extend({},$.fn.transition.settings,{animation:animation,onComplete:onComplete,duration:duration}):"string"==typeof duration||"number"==typeof duration?$.extend({},$.fn.transition.settings,{animation:animation,duration:duration}):"object"==typeof duration?$.extend({},$.fn.transition.settings,duration,{animation:animation}):"function"==typeof duration?$.extend({},$.fn.transition.settings,{animation:animation,onComplete:duration}):$.extend({},$.fn.transition.settings,{animation:animation})},animationClass:function(animation){var animationClass=animation||settings.animation,directionClass=module.can.transition()&&!module.has.direction()?module.get.direction()+" ":"";return className.animating+" "+className.transition+" "+directionClass+animationClass},currentAnimation:function(){return!(!module.cache||void 0===module.cache.animation)&&module.cache.animation},currentDirection:function(){return module.is.inward()?className.inward:className.outward},direction:function(){return module.is.hidden()||!module.is.visible()?className.inward:className.outward},animationDirection:function(animation){var direction;return animation=animation||settings.animation,"string"==typeof animation&&(animation=animation.split(" "),$.each(animation,function(index,word){word===className.inward?direction=className.inward:word===className.outward&&(direction=className.outward)})),direction||!1},duration:function(duration){return duration=duration||settings.duration,!1===duration&&(duration=$module.css("animation-duration")||0),"string"==typeof duration?duration.indexOf("ms")>-1?parseFloat(duration):1e3*parseFloat(duration):duration},displayType:function(shouldDetermine){return shouldDetermine=void 0===shouldDetermine||shouldDetermine,settings.displayType?settings.displayType:(shouldDetermine&&void 0===$module.data(metadata.displayType)&&module.can.transition(!0),$module.data(metadata.displayType))},userStyle:function(style){return style=style||$module.attr("style")||"",style.replace(/display.*?;/,"")},transitionExists:function(animation){return $.fn.transition.exists[animation]},animationStartEvent:function(){var animation,element=document.createElement("div"),animations={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(animation in animations)if(void 0!==element.style[animation])return animations[animation];return!1},animationEndEvent:function(){var animation,element=document.createElement("div"),animations={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(animation in animations)if(void 0!==element.style[animation])return animations[animation];return!1}},can:{transition:function(forced){var elementClass,tagName,$clone,currentAnimation,inAnimation,directionExists,animation=settings.animation,transitionExists=module.get.transitionExists(animation),displayType=module.get.displayType(!1);if(void 0===transitionExists||forced){if(module.verbose("Determining whether animation exists"),elementClass=$module.attr("class"),tagName=$module.prop("tagName"),$clone=$("<"+tagName+" />").addClass(elementClass).insertAfter($module),currentAnimation=$clone.addClass(animation).removeClass(className.inward).removeClass(className.outward).addClass(className.animating).addClass(className.transition).css("animationName"),inAnimation=$clone.addClass(className.inward).css("animationName"),displayType||(displayType=$clone.attr("class",elementClass).removeAttr("style").removeClass(className.hidden).removeClass(className.visible).show().css("display"),module.verbose("Determining final display state",displayType),module.save.displayType(displayType)),$clone.remove(),currentAnimation!=inAnimation)module.debug("Direction exists for animation",animation),directionExists=!0;else{if("none"==currentAnimation||!currentAnimation)return void module.debug("No animation defined in css",animation);module.debug("Static animation found",animation,displayType),directionExists=!1}module.save.transitionExists(animation,directionExists)}return void 0!==transitionExists?transitionExists:directionExists},animate:function(){return void 0!==module.can.transition()}},is:{animating:function(){return $module.hasClass(className.animating)},inward:function(){return $module.hasClass(className.inward)},outward:function(){return $module.hasClass(className.outward)},looping:function(){return $module.hasClass(className.looping)},occurring:function(animation){return animation=animation||settings.animation,animation="."+animation.replace(" ","."),$module.filter(animation).length>0},visible:function(){return $module.is(":visible")},hidden:function(){return"hidden"===$module.css("visibility")},supported:function(){return!1!==animationEnd}},hide:function(){module.verbose("Hiding element"),module.is.animating()&&module.reset(),element.blur(),module.remove.display(),module.remove.visible(),module.set.hidden(),module.force.hidden(),settings.onHide.call(element),settings.onComplete.call(element)},show:function(display){module.verbose("Showing element",display),module.remove.hidden(),module.set.visible(),module.force.visible(),settings.onShow.call(element),settings.onComplete.call(element)},toggle:function(){module.is.visible()?module.hide():module.show()},stop:function(){module.debug("Stopping current animation"),$module.triggerHandler(animationEnd)},stopAll:function(){module.debug("Stopping all animation"),module.remove.queueCallback(),$module.triggerHandler(animationEnd)},clear:{queue:function(){module.debug("Clearing animation queue"),module.remove.queueCallback()}},enable:function(){module.verbose("Starting animation"),$module.removeClass(className.disabled)},disable:function(){module.debug("Stopping animation"),$module.addClass(className.disabled)},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),$allModules.length>1&&(title+=" ("+$allModules.length+")"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]&&(found=object[value],!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),void 0!==found&&found}},module.initialize()}),void 0!==returnedValue?returnedValue:this},$.fn.transition.exists={},$.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.sidebar=function(parameters){var returnedValue,$allModules=$(this),$window=$(window),$document=$(document),$html=$("html"),$head=$("head"),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1),requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){setTimeout(callback,0)};return $allModules.each(function(){var $style,elementNamespace,id,currentScroll,transitionEvent,module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.sidebar.settings,parameters):$.extend({},$.fn.sidebar.settings),selector=settings.selector,className=settings.className,namespace=settings.namespace,regExp=settings.regExp,error=settings.error,eventNamespace="."+namespace,moduleNamespace="module-"+namespace,$module=$(this),$context=$(settings.context),$sidebars=$module.children(selector.sidebar),$fixed=$context.children(selector.fixed),$pusher=$context.children(selector.pusher),element=this,instance=$module.data(moduleNamespace);module={initialize:function(){module.debug("Initializing sidebar",parameters),module.create.id(),transitionEvent=module.get.transitionEvent(),settings.delaySetup?requestAnimationFrame(module.setup.layout):module.setup.layout(),requestAnimationFrame(function(){module.setup.cache()}),module.instantiate()},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,module)},create:{id:function(){id=(Math.random().toString(16)+"000000000").substr(2,8),elementNamespace="."+id,module.verbose("Creating unique id for element",id)}},destroy:function(){module.verbose("Destroying previous module for",$module),$module.off(eventNamespace).removeData(moduleNamespace),module.is.ios()&&module.remove.ios(),$context.off(elementNamespace),$window.off(elementNamespace),$document.off(elementNamespace)},event:{clickaway:function(event){var clickedInPusher=$pusher.find(event.target).length>0||$pusher.is(event.target),clickedContext=$context.is(event.target);clickedInPusher&&(module.verbose("User clicked on dimmed page"),module.hide()),clickedContext&&(module.verbose("User clicked on dimmable context (scaled out page)"),module.hide())},touch:function(event){},containScroll:function(event){element.scrollTop<=0&&(element.scrollTop=1),element.scrollTop+element.offsetHeight>=element.scrollHeight&&(element.scrollTop=element.scrollHeight-element.offsetHeight-1)},scroll:function(event){0===$(event.target).closest(selector.sidebar).length&&event.preventDefault()}},bind:{clickaway:function(){module.verbose("Adding clickaway events to context",$context),settings.closable&&$context.on("click"+elementNamespace,module.event.clickaway).on("touchend"+elementNamespace,module.event.clickaway)},scrollLock:function(){settings.scrollLock&&(module.debug("Disabling page scroll"),$window.on("DOMMouseScroll"+elementNamespace,module.event.scroll)),module.verbose("Adding events to contain sidebar scroll"),$document.on("touchmove"+elementNamespace,module.event.touch),$module.on("scroll"+eventNamespace,module.event.containScroll)}},unbind:{clickaway:function(){module.verbose("Removing clickaway events from context",$context),$context.off(elementNamespace)},scrollLock:function(){module.verbose("Removing scroll lock from page"),$document.off(elementNamespace),$window.off(elementNamespace),$module.off("scroll"+eventNamespace)}},add:{inlineCSS:function(){var style,width=module.cache.width||$module.outerWidth(),height=module.cache.height||$module.outerHeight(),isRTL=module.is.rtl(),direction=module.get.direction(),distance={left:width,right:-width,top:height,bottom:-height};isRTL&&(module.verbose("RTL detected, flipping widths"),distance.left=-width,distance.right=width),style="<style>","left"===direction||"right"===direction?(module.debug("Adding CSS rules for animation distance",width),style+=" .ui.visible."+direction+".sidebar ~ .fixed, .ui.visible."+direction+".sidebar ~ .pusher {   -webkit-transform: translate3d("+distance[direction]+"px, 0, 0);           transform: translate3d("+distance[direction]+"px, 0, 0); }"):"top"!==direction&&"bottom"!=direction||(style+=" .ui.visible."+direction+".sidebar ~ .fixed, .ui.visible."+direction+".sidebar ~ .pusher {   -webkit-transform: translate3d(0, "+distance[direction]+"px, 0);           transform: translate3d(0, "+distance[direction]+"px, 0); }"),module.is.ie()&&("left"===direction||"right"===direction?(module.debug("Adding CSS rules for animation distance",width),style+=" body.pushable > .ui.visible."+direction+".sidebar ~ .pusher:after {   -webkit-transform: translate3d("+distance[direction]+"px, 0, 0);           transform: translate3d("+distance[direction]+"px, 0, 0); }"):"top"!==direction&&"bottom"!=direction||(style+=" body.pushable > .ui.visible."+direction+".sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, "+distance[direction]+"px, 0);           transform: translate3d(0, "+distance[direction]+"px, 0); }"),style+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {   -webkit-transform: translate3d(0px, 0, 0);           transform: translate3d(0px, 0, 0); }"),style+="</style>",$style=$(style).appendTo($head),module.debug("Adding sizing css to head",$style)}},refresh:function(){module.verbose("Refreshing selector cache"),$context=$(settings.context),$sidebars=$context.children(selector.sidebar),$pusher=$context.children(selector.pusher),$fixed=$context.children(selector.fixed),module.clear.cache()},refreshSidebars:function(){module.verbose("Refreshing other sidebars"),$sidebars=$context.children(selector.sidebar)},repaint:function(){module.verbose("Forcing repaint event"),element.style.display="none";element.offsetHeight;element.scrollTop=element.scrollTop,element.style.display=""},setup:{cache:function(){module.cache={width:$module.outerWidth(),height:$module.outerHeight(),rtl:"rtl"==$module.css("direction")}},layout:function(){0===$context.children(selector.pusher).length&&(module.debug("Adding wrapper element for sidebar"),module.error(error.pusher),$pusher=$('<div class="pusher" />'),$context.children().not(selector.omitted).not($sidebars).wrapAll($pusher),module.refresh()),0!==$module.nextAll(selector.pusher).length&&$module.nextAll(selector.pusher)[0]===$pusher[0]||(module.debug("Moved sidebar to correct parent element"),module.error(error.movedSidebar,element),$module.detach().prependTo($context),module.refresh()),module.clear.cache(),module.set.pushable(),module.set.direction()}},attachEvents:function(selector,event){var $toggle=$(selector);event=$.isFunction(module[event])?module[event]:module.toggle,$toggle.length>0?(module.debug("Attaching sidebar events to element",selector,event),$toggle.on("click"+eventNamespace,event)):module.error(error.notFound,selector)},show:function(callback){if(callback=$.isFunction(callback)?callback:function(){},module.is.hidden()){if(module.refreshSidebars(),settings.overlay&&(module.error(error.overlay),settings.transition="overlay"),module.refresh(),module.othersActive())if(module.debug("Other sidebars currently visible"),settings.exclusive){if("overlay"!=settings.transition)return void module.hideOthers(module.show);module.hideOthers()}else settings.transition="overlay";module.pushPage(function(){callback.call(element),settings.onShow.call(element)}),settings.onChange.call(element),settings.onVisible.call(element)}else module.debug("Sidebar is already visible")},hide:function(callback){callback=$.isFunction(callback)?callback:function(){},(module.is.visible()||module.is.animating())&&(module.debug("Hiding sidebar",callback),module.refreshSidebars(),module.pullPage(function(){callback.call(element),settings.onHidden.call(element)}),settings.onChange.call(element),settings.onHide.call(element))},othersAnimating:function(){return $sidebars.not($module).filter("."+className.animating).length>0},othersVisible:function(){return $sidebars.not($module).filter("."+className.visible).length>0},othersActive:function(){return module.othersVisible()||module.othersAnimating()},hideOthers:function(callback){var $otherSidebars=$sidebars.not($module).filter("."+className.visible),sidebarCount=$otherSidebars.length,callbackCount=0;callback=callback||function(){},$otherSidebars.sidebar("hide",function(){++callbackCount==sidebarCount&&callback()})},toggle:function(){module.verbose("Determining toggled direction"),module.is.hidden()?module.show():module.hide()},pushPage:function(callback){var animate,dim,transitionEnd,transition=module.get.transition(),$transition="overlay"===transition||module.othersActive()?$module:$pusher;callback=$.isFunction(callback)?callback:function(){},"scale down"==settings.transition&&module.scrollToTop(),module.set.transition(transition),module.repaint(),animate=function(){module.bind.clickaway(),module.add.inlineCSS(),module.set.animating(),module.set.visible()},dim=function(){module.set.dimmed()},transitionEnd=function(event){event.target==$transition[0]&&($transition.off(transitionEvent+elementNamespace,transitionEnd),module.remove.animating(),module.bind.scrollLock(),callback.call(element))},$transition.off(transitionEvent+elementNamespace),$transition.on(transitionEvent+elementNamespace,transitionEnd),requestAnimationFrame(animate),settings.dimPage&&!module.othersVisible()&&requestAnimationFrame(dim)},pullPage:function(callback){var animate,transitionEnd,transition=module.get.transition(),$transition="overlay"==transition||module.othersActive()?$module:$pusher;callback=$.isFunction(callback)?callback:function(){},module.verbose("Removing context push state",module.get.direction()),module.unbind.clickaway(),module.unbind.scrollLock(),animate=function(){module.set.transition(transition),module.set.animating(),module.remove.visible(),settings.dimPage&&!module.othersVisible()&&$pusher.removeClass(className.dimmed)},transitionEnd=function(event){event.target==$transition[0]&&($transition.off(transitionEvent+elementNamespace,transitionEnd),module.remove.animating(),module.remove.transition(),module.remove.inlineCSS(),("scale down"==transition||settings.returnScroll&&module.is.mobile())&&module.scrollBack(),callback.call(element))},$transition.off(transitionEvent+elementNamespace),$transition.on(transitionEvent+elementNamespace,transitionEnd),requestAnimationFrame(animate)},scrollToTop:function(){module.verbose("Scrolling to top of page to avoid animation issues"),currentScroll=$(window).scrollTop(),$module.scrollTop(0),window.scrollTo(0,0)},scrollBack:function(){module.verbose("Scrolling back to original page position"),window.scrollTo(0,currentScroll)},clear:{cache:function(){module.verbose("Clearing cached dimensions"),module.cache={}}},set:{ios:function(){$html.addClass(className.ios)},pushed:function(){$context.addClass(className.pushed)},pushable:function(){$context.addClass(className.pushable)},dimmed:function(){$pusher.addClass(className.dimmed)},active:function(){$module.addClass(className.active)},animating:function(){$module.addClass(className.animating)},transition:function(transition){transition=transition||module.get.transition(),$module.addClass(transition)},direction:function(direction){direction=direction||module.get.direction(),$module.addClass(className[direction])},visible:function(){$module.addClass(className.visible)},overlay:function(){$module.addClass(className.overlay)}},remove:{inlineCSS:function(){module.debug("Removing inline css styles",$style),$style&&$style.length>0&&$style.remove()},ios:function(){$html.removeClass(className.ios)},pushed:function(){$context.removeClass(className.pushed)},pushable:function(){$context.removeClass(className.pushable)},active:function(){$module.removeClass(className.active)},animating:function(){$module.removeClass(className.animating)},transition:function(transition){transition=transition||module.get.transition(),$module.removeClass(transition)},direction:function(direction){direction=direction||module.get.direction(),$module.removeClass(className[direction])},visible:function(){$module.removeClass(className.visible)},overlay:function(){$module.removeClass(className.overlay)}},get:{direction:function(){return $module.hasClass(className.top)?className.top:$module.hasClass(className.right)?className.right:$module.hasClass(className.bottom)?className.bottom:className.left},transition:function(){var transition,direction=module.get.direction();return transition=module.is.mobile()?"auto"==settings.mobileTransition?settings.defaultTransition.mobile[direction]:settings.mobileTransition:"auto"==settings.transition?settings.defaultTransition.computer[direction]:settings.transition,module.verbose("Determined transition",transition),transition},transitionEvent:function(){var transition,element=document.createElement("element"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(transition in transitions)if(void 0!==element.style[transition])return transitions[transition]}},is:{ie:function(){var isIE11=!window.ActiveXObject&&"ActiveXObject"in window,isIE="ActiveXObject"in window;return isIE11||isIE},ios:function(){var userAgent=navigator.userAgent,isIOS=userAgent.match(regExp.ios),isMobileChrome=userAgent.match(regExp.mobileChrome);return!(!isIOS||isMobileChrome)&&(module.verbose("Browser was found to be iOS",userAgent),!0)},mobile:function(){var userAgent=navigator.userAgent;return userAgent.match(regExp.mobile)?(module.verbose("Browser was found to be mobile",userAgent),!0):(module.verbose("Browser is not mobile, using regular transition",userAgent),!1)},hidden:function(){return!module.is.visible()},visible:function(){return $module.hasClass(className.visible)},open:function(){return module.is.visible()},closed:function(){return module.is.hidden()},vertical:function(){return $module.hasClass(className.top)},animating:function(){return $context.hasClass(className.animating)},rtl:function(){return void 0===module.cache.rtl&&(module.cache.rtl="rtl"==$module.css("direction")),module.cache.rtl}},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]?(found=object[value],!1):(module.error(error.method,query),!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&module.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document);
!function(window,factory){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(jQuery){return factory(window,jQuery)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("jquery")):window.jQueryBridget=factory(window,window.jQuery)}(window,function(window,jQuery){"use strict";function jQueryBridget(namespace,PluginClass,$){function methodCall($elems,methodName,args){var returnValue,pluginMethodStr="$()."+namespace+'("'+methodName+'")';return $elems.each(function(i,elem){var instance=$.data(elem,namespace);if(!instance)return void logError(namespace+" not initialized. Cannot call methods, i.e. "+pluginMethodStr);var method=instance[methodName];if(!method||"_"==methodName.charAt(0))return void logError(pluginMethodStr+" is not a valid method");var value=method.apply(instance,args);returnValue=void 0===returnValue?value:returnValue}),void 0!==returnValue?returnValue:$elems}function plainCall($elems,options){$elems.each(function(i,elem){var instance=$.data(elem,namespace);instance?(instance.option(options),instance._init()):(instance=new PluginClass(elem,options),$.data(elem,namespace,instance))})}($=$||jQuery||window.jQuery)&&(PluginClass.prototype.option||(PluginClass.prototype.option=function(opts){$.isPlainObject(opts)&&(this.options=$.extend(!0,this.options,opts))}),$.fn[namespace]=function(arg0){if("string"==typeof arg0){return methodCall(this,arg0,arraySlice.call(arguments,1))}return plainCall(this,arg0),this},updateJQuery($))}function updateJQuery($){!$||$&&$.bridget||($.bridget=jQueryBridget)}var arraySlice=Array.prototype.slice,console=window.console,logError=void 0===console?function(){}:function(message){console.error(message)};return updateJQuery(jQuery||window.jQuery),jQueryBridget}),function(global,factory){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",factory):"object"==typeof module&&module.exports?module.exports=factory():global.EvEmitter=factory()}("undefined"!=typeof window?window:this,function(){function EvEmitter(){}var proto=EvEmitter.prototype;return proto.on=function(eventName,listener){if(eventName&&listener){var events=this._events=this._events||{},listeners=events[eventName]=events[eventName]||[];return-1==listeners.indexOf(listener)&&listeners.push(listener),this}},proto.once=function(eventName,listener){if(eventName&&listener){this.on(eventName,listener);var onceEvents=this._onceEvents=this._onceEvents||{};return(onceEvents[eventName]=onceEvents[eventName]||{})[listener]=!0,this}},proto.off=function(eventName,listener){var listeners=this._events&&this._events[eventName];if(listeners&&listeners.length){var index=listeners.indexOf(listener);return-1!=index&&listeners.splice(index,1),this}},proto.emitEvent=function(eventName,args){var listeners=this._events&&this._events[eventName];if(listeners&&listeners.length){listeners=listeners.slice(0),args=args||[];for(var onceListeners=this._onceEvents&&this._onceEvents[eventName],i=0;i<listeners.length;i++){var listener=listeners[i];onceListeners&&onceListeners[listener]&&(this.off(eventName,listener),delete onceListeners[listener]),listener.apply(this,args)}return this}},proto.allOff=function(){delete this._events,delete this._onceEvents},EvEmitter}),function(window,factory){"function"==typeof define&&define.amd?define("get-size/get-size",factory):"object"==typeof module&&module.exports?module.exports=factory():window.getSize=factory()}(window,function(){"use strict";function getStyleSize(value){var num=parseFloat(value);return-1==value.indexOf("%")&&!isNaN(num)&&num}function noop(){}function getZeroSize(){for(var size={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;i<measurementsLength;i++){size[measurements[i]]=0}return size}function getStyle(elem){var style=getComputedStyle(elem);return style||logError("Style returned "+style+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),style}function setup(){if(!isSetup){isSetup=!0;var div=document.createElement("div");div.style.width="200px",div.style.padding="1px 2px 3px 4px",div.style.borderStyle="solid",div.style.borderWidth="1px 2px 3px 4px",div.style.boxSizing="border-box";var body=document.body||document.documentElement;body.appendChild(div);var style=getStyle(div);isBoxSizeOuter=200==Math.round(getStyleSize(style.width)),getSize.isBoxSizeOuter=isBoxSizeOuter,body.removeChild(div)}}function getSize(elem){if(setup(),"string"==typeof elem&&(elem=document.querySelector(elem)),elem&&"object"==typeof elem&&elem.nodeType){var style=getStyle(elem);if("none"==style.display)return getZeroSize();var size={};size.width=elem.offsetWidth,size.height=elem.offsetHeight;for(var isBorderBox=size.isBorderBox="border-box"==style.boxSizing,i=0;i<measurementsLength;i++){var measurement=measurements[i],value=style[measurement],num=parseFloat(value);size[measurement]=isNaN(num)?0:num}var paddingWidth=size.paddingLeft+size.paddingRight,paddingHeight=size.paddingTop+size.paddingBottom,marginWidth=size.marginLeft+size.marginRight,marginHeight=size.marginTop+size.marginBottom,borderWidth=size.borderLeftWidth+size.borderRightWidth,borderHeight=size.borderTopWidth+size.borderBottomWidth,isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter,styleWidth=getStyleSize(style.width);!1!==styleWidth&&(size.width=styleWidth+(isBorderBoxSizeOuter?0:paddingWidth+borderWidth));var styleHeight=getStyleSize(style.height);return!1!==styleHeight&&(size.height=styleHeight+(isBorderBoxSizeOuter?0:paddingHeight+borderHeight)),size.innerWidth=size.width-(paddingWidth+borderWidth),size.innerHeight=size.height-(paddingHeight+borderHeight),size.outerWidth=size.width+marginWidth,size.outerHeight=size.height+marginHeight,size}}var isBoxSizeOuter,logError="undefined"==typeof console?noop:function(message){console.error(message)},measurements=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],measurementsLength=measurements.length,isSetup=!1;return getSize}),function(window,factory){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",factory):"object"==typeof module&&module.exports?module.exports=factory():window.matchesSelector=factory()}(window,function(){"use strict";var matchesMethod=function(){var ElemProto=window.Element.prototype;if(ElemProto.matches)return"matches";if(ElemProto.matchesSelector)return"matchesSelector";for(var prefixes=["webkit","moz","ms","o"],i=0;i<prefixes.length;i++){var prefix=prefixes[i],method=prefix+"MatchesSelector";if(ElemProto[method])return method}}();return function(elem,selector){return elem[matchesMethod](selector)}}),function(window,factory){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(matchesSelector){return factory(window,matchesSelector)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("desandro-matches-selector")):window.fizzyUIUtils=factory(window,window.matchesSelector)}(window,function(window,matchesSelector){var utils={};utils.extend=function(a,b){for(var prop in b)a[prop]=b[prop];return a},utils.modulo=function(num,div){return(num%div+div)%div};var arraySlice=Array.prototype.slice;utils.makeArray=function(obj){return Array.isArray(obj)?obj:null===obj||void 0===obj?[]:"object"==typeof obj&&"number"==typeof obj.length?arraySlice.call(obj):[obj]},utils.removeFrom=function(ary,obj){var index=ary.indexOf(obj);-1!=index&&ary.splice(index,1)},utils.getParent=function(elem,selector){for(;elem.parentNode&&elem!=document.body;)if(elem=elem.parentNode,matchesSelector(elem,selector))return elem},utils.getQueryElement=function(elem){return"string"==typeof elem?document.querySelector(elem):elem},utils.handleEvent=function(event){var method="on"+event.type;this[method]&&this[method](event)},utils.filterFindElements=function(elems,selector){elems=utils.makeArray(elems);var ffElems=[];return elems.forEach(function(elem){if(elem instanceof HTMLElement){if(!selector)return void ffElems.push(elem);matchesSelector(elem,selector)&&ffElems.push(elem);for(var childElems=elem.querySelectorAll(selector),i=0;i<childElems.length;i++)ffElems.push(childElems[i])}}),ffElems},utils.debounceMethod=function(_class,methodName,threshold){threshold=threshold||100;var method=_class.prototype[methodName],timeoutName=methodName+"Timeout";_class.prototype[methodName]=function(){var timeout=this[timeoutName];clearTimeout(timeout);var args=arguments,_this=this;this[timeoutName]=setTimeout(function(){method.apply(_this,args),delete _this[timeoutName]},threshold)}},utils.docReady=function(callback){var readyState=document.readyState;"complete"==readyState||"interactive"==readyState?setTimeout(callback):document.addEventListener("DOMContentLoaded",callback)},utils.toDashed=function(str){return str.replace(/(.)([A-Z])/g,function(match,$1,$2){return $1+"-"+$2}).toLowerCase()};var console=window.console;return utils.htmlInit=function(WidgetClass,namespace){utils.docReady(function(){var dashedNamespace=utils.toDashed(namespace),dataAttr="data-"+dashedNamespace,dataAttrElems=document.querySelectorAll("["+dataAttr+"]"),jsDashElems=document.querySelectorAll(".js-"+dashedNamespace),elems=utils.makeArray(dataAttrElems).concat(utils.makeArray(jsDashElems)),dataOptionsAttr=dataAttr+"-options",jQuery=window.jQuery;elems.forEach(function(elem){var options,attr=elem.getAttribute(dataAttr)||elem.getAttribute(dataOptionsAttr);try{options=attr&&JSON.parse(attr)}catch(error){return void(console&&console.error("Error parsing "+dataAttr+" on "+elem.className+": "+error))}var instance=new WidgetClass(elem,options);jQuery&&jQuery.data(elem,namespace,instance)})})},utils}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/cell",["get-size/get-size"],function(getSize){return factory(window,getSize)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("get-size")):(window.Flickity=window.Flickity||{},window.Flickity.Cell=factory(window,window.getSize))}(window,function(window,getSize){function Cell(elem,parent){this.element=elem,this.parent=parent,this.create()}var proto=Cell.prototype;return proto.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-selected","false"),this.x=0,this.shift=0},proto.destroy=function(){this.element.style.position="";var side=this.parent.originSide;this.element.removeAttribute("aria-selected"),this.element.style[side]=""},proto.getSize=function(){this.size=getSize(this.element)},proto.setPosition=function(x){this.x=x,this.updateTarget(),this.renderPosition(x)},proto.updateTarget=proto.setDefaultTarget=function(){var marginProperty="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[marginProperty]+this.size.width*this.parent.cellAlign},proto.renderPosition=function(x){var side=this.parent.originSide;this.element.style[side]=this.parent.getPositionValue(x)},proto.wrapShift=function(shift){this.shift=shift,this.renderPosition(this.x+this.parent.slideableWidth*shift)},proto.remove=function(){this.element.parentNode.removeChild(this.element)},Cell}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/slide",factory):"object"==typeof module&&module.exports?module.exports=factory():(window.Flickity=window.Flickity||{},window.Flickity.Slide=factory())}(window,function(){"use strict";function Slide(parent){this.parent=parent,this.isOriginLeft="left"==parent.originSide,this.cells=[],this.outerWidth=0,this.height=0}var proto=Slide.prototype;return proto.addCell=function(cell){if(this.cells.push(cell),this.outerWidth+=cell.size.outerWidth,this.height=Math.max(cell.size.outerHeight,this.height),1==this.cells.length){this.x=cell.x;var beginMargin=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=cell.size[beginMargin]}},proto.updateTarget=function(){var endMargin=this.isOriginLeft?"marginRight":"marginLeft",lastCell=this.getLastCell(),lastMargin=lastCell?lastCell.size[endMargin]:0,slideWidth=this.outerWidth-(this.firstMargin+lastMargin);this.target=this.x+this.firstMargin+slideWidth*this.parent.cellAlign},proto.getLastCell=function(){return this.cells[this.cells.length-1]},proto.select=function(){this.changeSelected(!0)},proto.unselect=function(){this.changeSelected(!1)},proto.changeSelected=function(isSelected){var classMethod=isSelected?"add":"remove";this.cells.forEach(function(cell){cell.element.classList[classMethod]("is-selected"),cell.element.setAttribute("aria-selected",isSelected.toString())})},proto.getCellElements=function(){return this.cells.map(function(cell){return cell.element})},Slide}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/animate",["fizzy-ui-utils/utils"],function(utils){return factory(window,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("fizzy-ui-utils")):(window.Flickity=window.Flickity||{},window.Flickity.animatePrototype=factory(window,window.fizzyUIUtils))}(window,function(window,utils){var proto={};return proto.startAnimation=function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},proto.animate=function(){this.applyDragForce(),this.applySelectedAttraction();var previousX=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(previousX),this.isAnimating){var _this=this;requestAnimationFrame(function(){_this.animate()})}},proto.positionSlider=function(){var x=this.x;this.options.wrapAround&&this.cells.length>1&&(x=utils.modulo(x,this.slideableWidth),x-=this.slideableWidth,this.shiftWrapCells(x)),x+=this.cursorPosition,x=this.options.rightToLeft?-x:x;var value=this.getPositionValue(x);this.slider.style.transform=this.isAnimating?"translate3d("+value+",0,0)":"translateX("+value+")";var firstSlide=this.slides[0];if(firstSlide){var positionX=-this.x-firstSlide.target,progress=positionX/this.slidesWidth;this.dispatchEvent("scroll",null,[progress,positionX])}},proto.positionSliderAtSelected=function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},proto.getPositionValue=function(position){return this.options.percentPosition?.01*Math.round(position/this.size.innerWidth*1e4)+"%":Math.round(position)+"px"},proto.settle=function(previousX){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*previousX)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},proto.shiftWrapCells=function(x){var beforeGap=this.cursorPosition+x;this._shiftCells(this.beforeShiftCells,beforeGap,-1);var afterGap=this.size.innerWidth-(x+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,afterGap,1)},proto._shiftCells=function(cells,gap,shift){for(var i=0;i<cells.length;i++){var cell=cells[i],cellShift=gap>0?shift:0;cell.wrapShift(cellShift),gap-=cell.size.outerWidth}},proto._unshiftCells=function(cells){if(cells&&cells.length)for(var i=0;i<cells.length;i++)cells[i].wrapShift(0)},proto.integratePhysics=function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},proto.applyForce=function(force){this.velocity+=force},proto.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},proto.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())},proto.applyDragForce=function(){if(this.isDraggable&&this.isPointerDown){var dragVelocity=this.dragX-this.x,dragForce=dragVelocity-this.velocity;this.applyForce(dragForce)}},proto.applySelectedAttraction=function(){if((!this.isDraggable||!this.isPointerDown)&&!this.isFreeScrolling&&this.slides.length){var distance=-1*this.selectedSlide.target-this.x,force=distance*this.options.selectedAttraction;this.applyForce(force)}},proto}),function(window,factory){if("function"==typeof define&&define.amd)define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(EvEmitter,getSize,utils,Cell,Slide,animatePrototype){return factory(window,EvEmitter,getSize,utils,Cell,Slide,animatePrototype)});else if("object"==typeof module&&module.exports)module.exports=factory(window,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"));else{var _Flickity=window.Flickity;window.Flickity=factory(window,window.EvEmitter,window.getSize,window.fizzyUIUtils,_Flickity.Cell,_Flickity.Slide,_Flickity.animatePrototype)}}(window,function(window,EvEmitter,getSize,utils,Cell,Slide,animatePrototype){function moveElements(elems,toElem){for(elems=utils.makeArray(elems);elems.length;)toElem.appendChild(elems.shift())}function Flickity(element,options){var queryElement=utils.getQueryElement(element);if(!queryElement)return void(console&&console.error("Bad element for Flickity: "+(queryElement||element)));if(this.element=queryElement,this.element.flickityGUID){var instance=instances[this.element.flickityGUID];return instance.option(options),instance}jQuery&&(this.$element=jQuery(this.element)),this.options=utils.extend({},this.constructor.defaults),this.option(options),this._create()}var jQuery=window.jQuery,getComputedStyle=window.getComputedStyle,console=window.console,GUID=0,instances={};Flickity.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},Flickity.createMethods=[];var proto=Flickity.prototype;utils.extend(proto,EvEmitter.prototype),proto._create=function(){var id=this.guid=++GUID;this.element.flickityGUID=id,instances[id]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&window.addEventListener("resize",this);for(var eventName in this.options.on){var listener=this.options.on[eventName];this.on(eventName,listener)}Flickity.createMethods.forEach(function(method){this[method]()},this),this.options.watchCSS?this.watchCSS():this.activate()},proto.option=function(opts){utils.extend(this.options,opts)},proto.activate=function(){if(!this.isActive){this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();moveElements(this._filterFindCellElements(this.element.children),this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate");var index,initialIndex=this.options.initialIndex;index=this.isInitActivated?this.selectedIndex:void 0!==initialIndex&&this.cells[initialIndex]?initialIndex:0,this.select(index,!1,!0),this.isInitActivated=!0,this.dispatchEvent("ready")}},proto._createSlider=function(){var slider=document.createElement("div");slider.className="flickity-slider",slider.style[this.originSide]=0,this.slider=slider},proto._filterFindCellElements=function(elems){return utils.filterFindElements(elems,this.options.cellSelector)},proto.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},proto._makeCells=function(elems){return this._filterFindCellElements(elems).map(function(cellElem){return new Cell(cellElem,this)},this)},proto.getLastCell=function(){return this.cells[this.cells.length-1]},proto.getLastSlide=function(){return this.slides[this.slides.length-1]},proto.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},proto._positionCells=function(index){index=index||0,this.maxCellHeight=index?this.maxCellHeight||0:0;var cellX=0;if(index>0){var startCell=this.cells[index-1];cellX=startCell.x+startCell.size.outerWidth}for(var len=this.cells.length,i=index;i<len;i++){var cell=this.cells[i];cell.setPosition(cellX),cellX+=cell.size.outerWidth,this.maxCellHeight=Math.max(cell.size.outerHeight,this.maxCellHeight)}this.slideableWidth=cellX,this.updateSlides(),this._containSlides(),this.slidesWidth=len?this.getLastSlide().target-this.slides[0].target:0},proto._sizeCells=function(cells){cells.forEach(function(cell){cell.getSize()})},proto.updateSlides=function(){if(this.slides=[],this.cells.length){var slide=new Slide(this);this.slides.push(slide);var isOriginLeft="left"==this.originSide,nextMargin=isOriginLeft?"marginRight":"marginLeft",canCellFit=this._getCanCellFit();this.cells.forEach(function(cell,i){if(!slide.cells.length)return void slide.addCell(cell);var slideWidth=slide.outerWidth-slide.firstMargin+(cell.size.outerWidth-cell.size[nextMargin]);canCellFit.call(this,i,slideWidth)?slide.addCell(cell):(slide.updateTarget(),slide=new Slide(this),this.slides.push(slide),slide.addCell(cell))},this),slide.updateTarget(),this.updateSelectedSlide()}},proto._getCanCellFit=function(){var groupCells=this.options.groupCells;if(!groupCells)return function(){return!1};if("number"==typeof groupCells){var number=parseInt(groupCells,10);return function(i){return i%number!=0}}var percentMatch="string"==typeof groupCells&&groupCells.match(/^(\d+)%$/),percent=percentMatch?parseInt(percentMatch[1],10)/100:1;return function(i,slideWidth){return slideWidth<=(this.size.innerWidth+1)*percent}},proto._init=proto.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},proto.getSize=function(){this.size=getSize(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var cellAlignShorthands={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};return proto.setCellAlign=function(){var shorthand=cellAlignShorthands[this.options.cellAlign];this.cellAlign=shorthand?shorthand[this.originSide]:this.options.cellAlign},proto.setGallerySize=function(){if(this.options.setGallerySize){var height=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=height+"px"}},proto._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var gapX=this.cursorPosition,cellIndex=this.cells.length-1;this.beforeShiftCells=this._getGapCells(gapX,cellIndex,-1),gapX=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(gapX,0,1)}},proto._getGapCells=function(gapX,cellIndex,increment){for(var cells=[];gapX>0;){var cell=this.cells[cellIndex];if(!cell)break;cells.push(cell),cellIndex+=increment,gapX-=cell.size.outerWidth}return cells},proto._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var isRightToLeft=this.options.rightToLeft,beginMargin=isRightToLeft?"marginRight":"marginLeft",endMargin=isRightToLeft?"marginLeft":"marginRight",contentWidth=this.slideableWidth-this.getLastCell().size[endMargin],isContentSmaller=contentWidth<this.size.innerWidth,beginBound=this.cursorPosition+this.cells[0].size[beginMargin],endBound=contentWidth-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(slide){isContentSmaller?slide.target=contentWidth*this.cellAlign:(slide.target=Math.max(slide.target,beginBound),slide.target=Math.min(slide.target,endBound))},this)}},proto.dispatchEvent=function(type,event,args){var emitArgs=event?[event].concat(args):args;if(this.emitEvent(type,emitArgs),jQuery&&this.$element){type+=this.options.namespaceJQueryEvents?".flickity":"";var $event=type;if(event){var jQEvent=jQuery.Event(event);jQEvent.type=type,$event=jQEvent}this.$element.trigger($event,args)}},proto.select=function(index,isWrap,isInstant){if(this.isActive&&(index=parseInt(index,10),this._wrapSelect(index),(this.options.wrapAround||isWrap)&&(index=utils.modulo(index,this.slides.length)),this.slides[index])){var prevIndex=this.selectedIndex;this.selectedIndex=index,this.updateSelectedSlide(),isInstant?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[index]),index!=prevIndex&&this.dispatchEvent("change",null,[index]),this.dispatchEvent("cellSelect")}},proto._wrapSelect=function(index){var len=this.slides.length;if(!(this.options.wrapAround&&len>1))return index;var wrapIndex=utils.modulo(index,len),delta=Math.abs(wrapIndex-this.selectedIndex),backWrapDelta=Math.abs(wrapIndex+len-this.selectedIndex),forewardWrapDelta=Math.abs(wrapIndex-len-this.selectedIndex);!this.isDragSelect&&backWrapDelta<delta?index+=len:!this.isDragSelect&&forewardWrapDelta<delta&&(index-=len),index<0?this.x-=this.slideableWidth:index>=len&&(this.x+=this.slideableWidth)},proto.previous=function(isWrap,isInstant){this.select(this.selectedIndex-1,isWrap,isInstant)},proto.next=function(isWrap,isInstant){this.select(this.selectedIndex+1,isWrap,isInstant)},proto.updateSelectedSlide=function(){var slide=this.slides[this.selectedIndex];slide&&(this.unselectSelectedSlide(),this.selectedSlide=slide,slide.select(),this.selectedCells=slide.cells,this.selectedElements=slide.getCellElements(),this.selectedCell=slide.cells[0],this.selectedElement=this.selectedElements[0])},proto.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},proto.selectCell=function(value,isWrap,isInstant){var cell=this.queryCell(value);if(cell){var index=this.getCellSlideIndex(cell);this.select(index,isWrap,isInstant)}},proto.getCellSlideIndex=function(cell){for(var i=0;i<this.slides.length;i++){if(-1!=this.slides[i].cells.indexOf(cell))return i}},proto.getCell=function(elem){for(var i=0;i<this.cells.length;i++){var cell=this.cells[i];if(cell.element==elem)return cell}},proto.getCells=function(elems){elems=utils.makeArray(elems);var cells=[];return elems.forEach(function(elem){var cell=this.getCell(elem);cell&&cells.push(cell)},this),cells},proto.getCellElements=function(){return this.cells.map(function(cell){return cell.element})},proto.getParentCell=function(elem){var cell=this.getCell(elem);return cell||(elem=utils.getParent(elem,".flickity-slider > *"),this.getCell(elem))},proto.getAdjacentCellElements=function(adjCount,index){if(!adjCount)return this.selectedSlide.getCellElements();index=void 0===index?this.selectedIndex:index;var len=this.slides.length;if(1+2*adjCount>=len)return this.getCellElements();for(var cellElems=[],i=index-adjCount;i<=index+adjCount;i++){var slideIndex=this.options.wrapAround?utils.modulo(i,len):i,slide=this.slides[slideIndex];slide&&(cellElems=cellElems.concat(slide.getCellElements()))}return cellElems},proto.queryCell=function(selector){return"number"==typeof selector?this.cells[selector]:("string"==typeof selector&&(selector=this.element.querySelector(selector)),this.getCell(selector))},proto.uiChange=function(){this.emitEvent("uiChange")},proto.childUIPointerDown=function(event){this.emitEvent("childUIPointerDown",[event])},proto.onresize=function(){this.watchCSS(),this.resize()},utils.debounceMethod(Flickity,"onresize",150),proto.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=utils.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var selectedElement=this.selectedElements&&this.selectedElements[0];this.selectCell(selectedElement,!1,!0)}},proto.watchCSS=function(){this.options.watchCSS&&(-1!=getComputedStyle(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},proto.onkeydown=function(event){var isNotFocused=document.activeElement&&document.activeElement!=this.element;if(this.options.accessibility&&!isNotFocused){var handler=Flickity.keyboardHandlers[event.keyCode];handler&&handler.call(this)}},Flickity.keyboardHandlers={37:function(){var leftMethod=this.options.rightToLeft?"next":"previous";this.uiChange(),this[leftMethod]()},39:function(){var rightMethod=this.options.rightToLeft?"previous":"next";this.uiChange(),this[rightMethod]()}},proto.focus=function(){var prevScrollY=window.pageYOffset;this.element.focus({preventScroll:!0}),window.pageYOffset!=prevScrollY&&window.scrollTo(window.pageXOffset,prevScrollY)},proto.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach(function(cell){cell.destroy()}),this.element.removeChild(this.viewport),moveElements(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},proto.destroy=function(){this.deactivate(),window.removeEventListener("resize",this),this.emitEvent("destroy"),jQuery&&this.$element&&jQuery.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete instances[this.guid]},utils.extend(proto,animatePrototype),Flickity.data=function(elem){elem=utils.getQueryElement(elem);var id=elem&&elem.flickityGUID;return id&&instances[id]},utils.htmlInit(Flickity,"flickity"),jQuery&&jQuery.bridget&&jQuery.bridget("flickity",Flickity),Flickity.setJQuery=function(jq){jQuery=jq},Flickity.Cell=Cell,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(EvEmitter){return factory(window,EvEmitter)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("ev-emitter")):window.Unipointer=factory(window,window.EvEmitter)}(window,function(window,EvEmitter){function noop(){}function Unipointer(){}var proto=Unipointer.prototype=Object.create(EvEmitter.prototype);proto.bindStartEvent=function(elem){this._bindStartEvent(elem,!0)},proto.unbindStartEvent=function(elem){this._bindStartEvent(elem,!1)},proto._bindStartEvent=function(elem,isAdd){isAdd=void 0===isAdd||isAdd;var bindMethod=isAdd?"addEventListener":"removeEventListener",startEvent="mousedown";window.PointerEvent?startEvent="pointerdown":"ontouchstart"in window&&(startEvent="touchstart"),elem[bindMethod](startEvent,this)},proto.handleEvent=function(event){var method="on"+event.type;this[method]&&this[method](event)},proto.getTouch=function(touches){for(var i=0;i<touches.length;i++){var touch=touches[i];if(touch.identifier==this.pointerIdentifier)return touch}},proto.onmousedown=function(event){var button=event.button;button&&0!==button&&1!==button||this._pointerDown(event,event)},proto.ontouchstart=function(event){this._pointerDown(event,event.changedTouches[0])},proto.onpointerdown=function(event){this._pointerDown(event,event)},proto._pointerDown=function(event,pointer){event.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==pointer.pointerId?pointer.pointerId:pointer.identifier,this.pointerDown(event,pointer))},proto.pointerDown=function(event,pointer){this._bindPostStartEvents(event),this.emitEvent("pointerDown",[event,pointer])};var postStartEvents={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return proto._bindPostStartEvents=function(event){if(event){var events=postStartEvents[event.type];events.forEach(function(eventName){window.addEventListener(eventName,this)},this),this._boundPointerEvents=events}},proto._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(eventName){window.removeEventListener(eventName,this)},this),delete this._boundPointerEvents)},proto.onmousemove=function(event){this._pointerMove(event,event)},
proto.onpointermove=function(event){event.pointerId==this.pointerIdentifier&&this._pointerMove(event,event)},proto.ontouchmove=function(event){var touch=this.getTouch(event.changedTouches);touch&&this._pointerMove(event,touch)},proto._pointerMove=function(event,pointer){this.pointerMove(event,pointer)},proto.pointerMove=function(event,pointer){this.emitEvent("pointerMove",[event,pointer])},proto.onmouseup=function(event){this._pointerUp(event,event)},proto.onpointerup=function(event){event.pointerId==this.pointerIdentifier&&this._pointerUp(event,event)},proto.ontouchend=function(event){var touch=this.getTouch(event.changedTouches);touch&&this._pointerUp(event,touch)},proto._pointerUp=function(event,pointer){this._pointerDone(),this.pointerUp(event,pointer)},proto.pointerUp=function(event,pointer){this.emitEvent("pointerUp",[event,pointer])},proto._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},proto._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},proto.pointerDone=noop,proto.onpointercancel=function(event){event.pointerId==this.pointerIdentifier&&this._pointerCancel(event,event)},proto.ontouchcancel=function(event){var touch=this.getTouch(event.changedTouches);touch&&this._pointerCancel(event,touch)},proto._pointerCancel=function(event,pointer){this._pointerDone(),this.pointerCancel(event,pointer)},proto.pointerCancel=function(event,pointer){this.emitEvent("pointerCancel",[event,pointer])},Unipointer.getPointerPoint=function(pointer){return{x:pointer.pageX,y:pointer.pageY}},Unipointer}),function(window,factory){"function"==typeof define&&define.amd?define("unidragger/unidragger",["unipointer/unipointer"],function(Unipointer){return factory(window,Unipointer)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("unipointer")):window.Unidragger=factory(window,window.Unipointer)}(window,function(window,Unipointer){function Unidragger(){}var proto=Unidragger.prototype=Object.create(Unipointer.prototype);proto.bindHandles=function(){this._bindHandles(!0)},proto.unbindHandles=function(){this._bindHandles(!1)},proto._bindHandles=function(isAdd){isAdd=void 0===isAdd||isAdd;for(var bindMethod=isAdd?"addEventListener":"removeEventListener",touchAction=isAdd?this._touchActionValue:"",i=0;i<this.handles.length;i++){var handle=this.handles[i];this._bindStartEvent(handle,isAdd),handle[bindMethod]("click",this),window.PointerEvent&&(handle.style.touchAction=touchAction)}},proto._touchActionValue="none",proto.pointerDown=function(event,pointer){this.okayPointerDown(event)&&(this.pointerDownPointer=pointer,event.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(event),this.emitEvent("pointerDown",[event,pointer]))};var cursorNodes={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},clickTypes={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return proto.okayPointerDown=function(event){var isCursorNode=cursorNodes[event.target.nodeName],isClickType=clickTypes[event.target.type],isOkay=!isCursorNode||isClickType;return isOkay||this._pointerReset(),isOkay},proto.pointerDownBlur=function(){var focused=document.activeElement;focused&&focused.blur&&focused!=document.body&&focused.blur()},proto.pointerMove=function(event,pointer){var moveVector=this._dragPointerMove(event,pointer);this.emitEvent("pointerMove",[event,pointer,moveVector]),this._dragMove(event,pointer,moveVector)},proto._dragPointerMove=function(event,pointer){var moveVector={x:pointer.pageX-this.pointerDownPointer.pageX,y:pointer.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(moveVector)&&this._dragStart(event,pointer),moveVector},proto.hasDragStarted=function(moveVector){return Math.abs(moveVector.x)>3||Math.abs(moveVector.y)>3},proto.pointerUp=function(event,pointer){this.emitEvent("pointerUp",[event,pointer]),this._dragPointerUp(event,pointer)},proto._dragPointerUp=function(event,pointer){this.isDragging?this._dragEnd(event,pointer):this._staticClick(event,pointer)},proto._dragStart=function(event,pointer){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(event,pointer)},proto.dragStart=function(event,pointer){this.emitEvent("dragStart",[event,pointer])},proto._dragMove=function(event,pointer,moveVector){this.isDragging&&this.dragMove(event,pointer,moveVector)},proto.dragMove=function(event,pointer,moveVector){event.preventDefault(),this.emitEvent("dragMove",[event,pointer,moveVector])},proto._dragEnd=function(event,pointer){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(event,pointer)},proto.dragEnd=function(event,pointer){this.emitEvent("dragEnd",[event,pointer])},proto.onclick=function(event){this.isPreventingClicks&&event.preventDefault()},proto._staticClick=function(event,pointer){this.isIgnoringMouseUp&&"mouseup"==event.type||(this.staticClick(event,pointer),"mouseup"!=event.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},proto.staticClick=function(event,pointer){this.emitEvent("staticClick",[event,pointer])},Unidragger.getPointerPoint=Unipointer.getPointerPoint,Unidragger}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(Flickity,Unidragger,utils){return factory(window,Flickity,Unidragger,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("unidragger"),require("fizzy-ui-utils")):window.Flickity=factory(window,window.Flickity,window.Unidragger,window.fizzyUIUtils)}(window,function(window,Flickity,Unidragger,utils){function getScrollPosition(){return{x:window.pageXOffset,y:window.pageYOffset}}utils.extend(Flickity.defaults,{draggable:">1",dragThreshold:3}),Flickity.createMethods.push("_createDrag");var proto=Flickity.prototype;utils.extend(proto,Unidragger.prototype),proto._touchActionValue="pan-y";var isTouch="createTouch"in document,isTouchmoveScrollCanceled=!1;proto._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("childUIPointerDown",this._childUIPointerDownDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),isTouch&&!isTouchmoveScrollCanceled&&(window.addEventListener("touchmove",function(){}),isTouchmoveScrollCanceled=!0)},proto.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},proto.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},proto.updateDraggable=function(){">1"==this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},proto.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},proto.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},proto._uiChangeDrag=function(){delete this.isFreeScrolling},proto._childUIPointerDownDrag=function(event){event.preventDefault(),this.pointerDownFocus(event)},proto.pointerDown=function(event,pointer){if(!this.isDraggable)return void this._pointerDownDefault(event,pointer);this.okayPointerDown(event)&&(this._pointerDownPreventDefault(event),this.pointerDownFocus(event),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=getScrollPosition(),window.addEventListener("scroll",this),this._pointerDownDefault(event,pointer))},proto._pointerDownDefault=function(event,pointer){this.pointerDownPointer=pointer,this._bindPostStartEvents(event),this.dispatchEvent("pointerDown",event,[pointer])};var focusNodes={INPUT:!0,TEXTAREA:!0,SELECT:!0};return proto.pointerDownFocus=function(event){focusNodes[event.target.nodeName]||this.focus()},proto._pointerDownPreventDefault=function(event){var isTouchStart="touchstart"==event.type,isTouchPointer="touch"==event.pointerType,isFocusNode=focusNodes[event.target.nodeName];isTouchStart||isTouchPointer||isFocusNode||event.preventDefault()},proto.hasDragStarted=function(moveVector){return Math.abs(moveVector.x)>this.options.dragThreshold},proto.pointerUp=function(event,pointer){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",event,[pointer]),this._dragPointerUp(event,pointer)},proto.pointerDone=function(){window.removeEventListener("scroll",this),delete this.pointerDownScroll},proto.dragStart=function(event,pointer){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),window.removeEventListener("scroll",this),this.dispatchEvent("dragStart",event,[pointer]))},proto.pointerMove=function(event,pointer){var moveVector=this._dragPointerMove(event,pointer);this.dispatchEvent("pointerMove",event,[pointer,moveVector]),this._dragMove(event,pointer,moveVector)},proto.dragMove=function(event,pointer,moveVector){if(this.isDraggable){event.preventDefault(),this.previousDragX=this.dragX;var direction=this.options.rightToLeft?-1:1;this.options.wrapAround&&(moveVector.x=moveVector.x%this.slideableWidth);var dragX=this.dragStartPosition+moveVector.x*direction;if(!this.options.wrapAround&&this.slides.length){var originBound=Math.max(-this.slides[0].target,this.dragStartPosition);dragX=dragX>originBound?.5*(dragX+originBound):dragX;var endBound=Math.min(-this.getLastSlide().target,this.dragStartPosition);dragX=dragX<endBound?.5*(dragX+endBound):dragX}this.dragX=dragX,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",event,[pointer,moveVector])}},proto.dragEnd=function(event,pointer){if(this.isDraggable){this.options.freeScroll&&(this.isFreeScrolling=!0);var index=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var restingX=this.getRestingPosition();this.isFreeScrolling=-restingX>this.slides[0].target&&-restingX<this.getLastSlide().target}else this.options.freeScroll||index!=this.selectedIndex||(index+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(index),delete this.isDragSelect,this.dispatchEvent("dragEnd",event,[pointer])}},proto.dragEndRestingSelect=function(){var restingX=this.getRestingPosition(),distance=Math.abs(this.getSlideDistance(-restingX,this.selectedIndex)),positiveResting=this._getClosestResting(restingX,distance,1),negativeResting=this._getClosestResting(restingX,distance,-1);return positiveResting.distance<negativeResting.distance?positiveResting.index:negativeResting.index},proto._getClosestResting=function(restingX,distance,increment){for(var index=this.selectedIndex,minDistance=1/0,condition=this.options.contain&&!this.options.wrapAround?function(d,md){return d<=md}:function(d,md){return d<md};condition(distance,minDistance)&&(index+=increment,minDistance=distance,null!==(distance=this.getSlideDistance(-restingX,index)));)distance=Math.abs(distance);return{distance:minDistance,index:index-increment}},proto.getSlideDistance=function(x,index){var len=this.slides.length,isWrapAround=this.options.wrapAround&&len>1,slideIndex=isWrapAround?utils.modulo(index,len):index,slide=this.slides[slideIndex];if(!slide)return null;var wrap=isWrapAround?this.slideableWidth*Math.floor(index/len):0;return x-(slide.target+wrap)},proto.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var distance=this.getSlideDistance(-this.dragX,this.selectedIndex),delta=this.previousDragX-this.dragX;return distance>0&&delta>0?1:distance<0&&delta<0?-1:0},proto.staticClick=function(event,pointer){var clickedCell=this.getParentCell(event.target),cellElem=clickedCell&&clickedCell.element,cellIndex=clickedCell&&this.cells.indexOf(clickedCell);this.dispatchEvent("staticClick",event,[pointer,cellElem,cellIndex])},proto.onscroll=function(){var scroll=getScrollPosition(),scrollMoveX=this.pointerDownScroll.x-scroll.x,scrollMoveY=this.pointerDownScroll.y-scroll.y;(Math.abs(scrollMoveX)>3||Math.abs(scrollMoveY)>3)&&this._pointerDone()},Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("tap-listener/tap-listener",["unipointer/unipointer"],function(Unipointer){return factory(window,Unipointer)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("unipointer")):window.TapListener=factory(window,window.Unipointer)}(window,function(window,Unipointer){function TapListener(elem){this.bindTap(elem)}var proto=TapListener.prototype=Object.create(Unipointer.prototype);return proto.bindTap=function(elem){elem&&(this.unbindTap(),this.tapElement=elem,this._bindStartEvent(elem,!0))},proto.unbindTap=function(){this.tapElement&&(this._bindStartEvent(this.tapElement,!0),delete this.tapElement)},proto.pointerUp=function(event,pointer){if(!this.isIgnoringMouseUp||"mouseup"!=event.type){var pointerPoint=Unipointer.getPointerPoint(pointer),boundingRect=this.tapElement.getBoundingClientRect(),scrollX=window.pageXOffset,scrollY=window.pageYOffset;if(pointerPoint.x>=boundingRect.left+scrollX&&pointerPoint.x<=boundingRect.right+scrollX&&pointerPoint.y>=boundingRect.top+scrollY&&pointerPoint.y<=boundingRect.bottom+scrollY&&this.emitEvent("tap",[event,pointer]),"mouseup"!=event.type){this.isIgnoringMouseUp=!0;var _this=this;setTimeout(function(){delete _this.isIgnoringMouseUp},400)}}},proto.destroy=function(){this.pointerDone(),this.unbindTap()},TapListener}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/prev-next-button",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(Flickity,TapListener,utils){return factory(window,Flickity,TapListener,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.TapListener,window.fizzyUIUtils)}(window,function(window,Flickity,TapListener,utils){"use strict";function PrevNextButton(direction,parent){this.direction=direction,this.parent=parent,this._create()}function getArrowMovements(shape){return"string"==typeof shape?shape:"M "+shape.x0+",50 L "+shape.x1+","+(shape.y1+50)+" L "+shape.x2+","+(shape.y2+50)+" L "+shape.x3+",50  L "+shape.x2+","+(50-shape.y2)+" L "+shape.x1+","+(50-shape.y1)+" Z"}var svgURI="http://www.w3.org/2000/svg";PrevNextButton.prototype=Object.create(TapListener.prototype),PrevNextButton.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var leftDirection=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==leftDirection;var element=this.element=document.createElement("button");element.className="flickity-button flickity-prev-next-button",element.className+=this.isPrevious?" previous":" next",element.setAttribute("type","button"),this.disable(),element.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var svg=this.createSVG();element.appendChild(svg),this.on("tap",this.onTap),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},PrevNextButton.prototype.activate=function(){this.bindTap(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},PrevNextButton.prototype.deactivate=function(){this.parent.element.removeChild(this.element),TapListener.prototype.destroy.call(this),this.element.removeEventListener("click",this)},PrevNextButton.prototype.createSVG=function(){var svg=document.createElementNS(svgURI,"svg");svg.setAttribute("class","flickity-button-icon"),svg.setAttribute("viewBox","0 0 100 100");var path=document.createElementNS(svgURI,"path"),pathMovements=getArrowMovements(this.parent.options.arrowShape);return path.setAttribute("d",pathMovements),path.setAttribute("class","arrow"),this.isLeft||path.setAttribute("transform","translate(100, 100) rotate(180) "),svg.appendChild(path),svg},PrevNextButton.prototype.onTap=function(){if(this.isEnabled){this.parent.uiChange();var method=this.isPrevious?"previous":"next";this.parent[method]()}},PrevNextButton.prototype.handleEvent=utils.handleEvent,PrevNextButton.prototype.onclick=function(event){var focused=document.activeElement;focused&&focused==this.element&&this.onTap(event,event)},PrevNextButton.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},PrevNextButton.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},PrevNextButton.prototype.update=function(){var slides=this.parent.slides;if(this.parent.options.wrapAround&&slides.length>1)return void this.enable();var lastIndex=slides.length?slides.length-1:0,boundIndex=this.isPrevious?0:lastIndex;this[this.parent.selectedIndex==boundIndex?"disable":"enable"]()},PrevNextButton.prototype.destroy=function(){this.deactivate()},utils.extend(Flickity.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),Flickity.createMethods.push("_createPrevNextButtons");var proto=Flickity.prototype;return proto._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new PrevNextButton(-1,this),this.nextButton=new PrevNextButton(1,this),this.on("activate",this.activatePrevNextButtons))},proto.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},proto.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},Flickity.PrevNextButton=PrevNextButton,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/page-dots",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(Flickity,TapListener,utils){return factory(window,Flickity,TapListener,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.TapListener,window.fizzyUIUtils)}(window,function(window,Flickity,TapListener,utils){function PageDots(parent){this.parent=parent,this._create()}PageDots.prototype=new TapListener,PageDots.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.on("tap",this.onTap),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},PageDots.prototype.activate=function(){this.setDots(),this.bindTap(this.holder),this.parent.element.appendChild(this.holder)},PageDots.prototype.deactivate=function(){this.parent.element.removeChild(this.holder),TapListener.prototype.destroy.call(this)},PageDots.prototype.setDots=function(){var delta=this.parent.slides.length-this.dots.length;delta>0?this.addDots(delta):delta<0&&this.removeDots(-delta)},PageDots.prototype.addDots=function(count){for(var fragment=document.createDocumentFragment(),newDots=[],length=this.dots.length,max=length+count,i=length;i<max;i++){var dot=document.createElement("li");dot.className="dot",dot.setAttribute("aria-label","Page dot "+(i+1)),fragment.appendChild(dot),newDots.push(dot)}this.holder.appendChild(fragment),this.dots=this.dots.concat(newDots)},PageDots.prototype.removeDots=function(count){this.dots.splice(this.dots.length-count,count).forEach(function(dot){this.holder.removeChild(dot)},this)},PageDots.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot",this.selectedDot.removeAttribute("aria-current")),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected",this.selectedDot.setAttribute("aria-current","step"))},PageDots.prototype.onTap=function(event){var target=event.target;if("LI"==target.nodeName){this.parent.uiChange();var index=this.dots.indexOf(target);this.parent.select(index)}},PageDots.prototype.destroy=function(){this.deactivate()},Flickity.PageDots=PageDots,utils.extend(Flickity.defaults,{pageDots:!0}),Flickity.createMethods.push("_createPageDots");var proto=Flickity.prototype;return proto._createPageDots=function(){this.options.pageDots&&(this.pageDots=new PageDots(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))},proto.activatePageDots=function(){this.pageDots.activate()},proto.updateSelectedPageDots=function(){this.pageDots.updateSelected()},proto.updatePageDots=function(){this.pageDots.setDots()},proto.deactivatePageDots=function(){this.pageDots.deactivate()},Flickity.PageDots=PageDots,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(EvEmitter,utils,Flickity){return factory(EvEmitter,utils,Flickity)}):"object"==typeof module&&module.exports?module.exports=factory(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity")):factory(window.EvEmitter,window.fizzyUIUtils,window.Flickity)}(window,function(EvEmitter,utils,Flickity){function Player(parent){this.parent=parent,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}Player.prototype=Object.create(EvEmitter.prototype),Player.prototype.play=function(){if("playing"!=this.state){if(document.hidden)return void document.addEventListener("visibilitychange",this.onVisibilityPlay);this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()}},Player.prototype.tick=function(){if("playing"==this.state){var time=this.parent.options.autoPlay;time="number"==typeof time?time:3e3;var _this=this;this.clear(),this.timeout=setTimeout(function(){_this.parent.next(!0),_this.tick()},time)}},Player.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},Player.prototype.clear=function(){clearTimeout(this.timeout)},Player.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},Player.prototype.unpause=function(){"paused"==this.state&&this.play()},Player.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},Player.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},utils.extend(Flickity.defaults,{pauseAutoPlayOnHover:!0}),Flickity.createMethods.push("_createPlayer");var proto=Flickity.prototype;return proto._createPlayer=function(){this.player=new Player(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},proto.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},proto.playPlayer=function(){this.player.play()},proto.stopPlayer=function(){this.player.stop()},proto.pausePlayer=function(){this.player.pause()},proto.unpausePlayer=function(){this.player.unpause()},proto.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},proto.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},proto.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},Flickity.Player=Player,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(Flickity,utils){return factory(window,Flickity,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.fizzyUIUtils)}(window,function(window,Flickity,utils){function getCellsFragment(cells){var fragment=document.createDocumentFragment();return cells.forEach(function(cell){fragment.appendChild(cell.element)}),fragment}var proto=Flickity.prototype;return proto.insert=function(elems,index){var cells=this._makeCells(elems);if(cells&&cells.length){var len=this.cells.length;index=void 0===index?len:index;var fragment=getCellsFragment(cells),isAppend=index==len;if(isAppend)this.slider.appendChild(fragment);else{var insertCellElement=this.cells[index].element;this.slider.insertBefore(fragment,insertCellElement)}if(0===index)this.cells=cells.concat(this.cells);else if(isAppend)this.cells=this.cells.concat(cells);else{var endCells=this.cells.splice(index,len-index);this.cells=this.cells.concat(cells).concat(endCells)}this._sizeCells(cells),this.cellChange(index,!0)}},proto.append=function(elems){this.insert(elems,this.cells.length)},proto.prepend=function(elems){this.insert(elems,0)},proto.remove=function(elems){var cells=this.getCells(elems);if(cells&&cells.length){var minCellIndex=this.cells.length-1;cells.forEach(function(cell){cell.remove();var index=this.cells.indexOf(cell);minCellIndex=Math.min(index,minCellIndex),utils.removeFrom(this.cells,cell)},this),this.cellChange(minCellIndex,!0)}},proto.cellSizeChange=function(elem){var cell=this.getCell(elem);if(cell){cell.getSize();var index=this.cells.indexOf(cell);this.cellChange(index)}},proto.cellChange=function(changedCellIndex,isPositioningSlider){var prevSelectedElem=this.selectedElement;this._positionCells(changedCellIndex),this._getWrapShiftCells(),this.setGallerySize();var cell=this.getCell(prevSelectedElem);cell&&(this.selectedIndex=this.getCellSlideIndex(cell)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[changedCellIndex]),this.select(this.selectedIndex),isPositioningSlider&&this.positionSliderAtSelected()},Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(Flickity,utils){return factory(window,Flickity,utils)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("./flickity"),require("fizzy-ui-utils")):factory(window,window.Flickity,window.fizzyUIUtils)}(window,function(window,Flickity,utils){"use strict";function getCellLazyImages(cellElem){if("IMG"==cellElem.nodeName){var lazyloadAttr=cellElem.getAttribute("data-flickity-lazyload"),srcAttr=cellElem.getAttribute("data-flickity-lazyload-src"),srcsetAttr=cellElem.getAttribute("data-flickity-lazyload-srcset");if(lazyloadAttr||srcAttr||srcsetAttr)return[cellElem]}var imgs=cellElem.querySelectorAll("img[data-flickity-lazyload], img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]");return utils.makeArray(imgs)}function LazyLoader(img,flickity){this.img=img,this.flickity=flickity,this.load()}Flickity.createMethods.push("_createLazyload");var proto=Flickity.prototype;return proto._createLazyload=function(){this.on("select",this.lazyLoad)},proto.lazyLoad=function(){var lazyLoad=this.options.lazyLoad;if(lazyLoad){var adjCount="number"==typeof lazyLoad?lazyLoad:0,cellElems=this.getAdjacentCellElements(adjCount),lazyImages=[];cellElems.forEach(function(cellElem){var lazyCellImages=getCellLazyImages(cellElem);lazyImages=lazyImages.concat(lazyCellImages)}),lazyImages.forEach(function(img){new LazyLoader(img,this)},this)}},LazyLoader.prototype.handleEvent=utils.handleEvent,LazyLoader.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);var src=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src"),srcset=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=src,srcset&&this.img.setAttribute("srcset",srcset),this.img.removeAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload-src"),this.img.removeAttribute("data-flickity-lazyload-srcset")},LazyLoader.prototype.onload=function(event){this.complete(event,"flickity-lazyloaded")},LazyLoader.prototype.onerror=function(event){this.complete(event,"flickity-lazyerror")},LazyLoader.prototype.complete=function(event,className){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var cell=this.flickity.getParentCell(this.img),cellElem=cell&&cell.element;this.flickity.cellSizeChange(cellElem),this.img.classList.add(className),this.flickity.dispatchEvent("lazyLoad",event,cellElem)},Flickity.LazyLoader=LazyLoader,Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],factory):"object"==typeof module&&module.exports&&(module.exports=factory(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload")))}(window,function(Flickity){return Flickity}),function(window,factory){"function"==typeof define&&define.amd?define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("flickity"),require("fizzy-ui-utils")):window.Flickity=factory(window.Flickity,window.fizzyUIUtils)}(window,function(Flickity,utils){function lerp(a,b,t){return(b-a)*t+a}Flickity.createMethods.push("_createAsNavFor");var proto=Flickity.prototype;return proto._createAsNavFor=function(){this.on("activate",this.activateAsNavFor),this.on("deactivate",this.deactivateAsNavFor),this.on("destroy",this.destroyAsNavFor);var asNavForOption=this.options.asNavFor;if(asNavForOption){var _this=this;setTimeout(function(){_this.setNavCompanion(asNavForOption)})}},proto.setNavCompanion=function(elem){elem=utils.getQueryElement(elem);var companion=Flickity.data(elem);if(companion&&companion!=this){this.navCompanion=companion;var _this=this;this.onNavCompanionSelect=function(){_this.navCompanionSelect()},companion.on("select",this.onNavCompanionSelect),this.on("staticClick",this.onNavStaticClick),this.navCompanionSelect(!0)}},proto.navCompanionSelect=function(isInstant){if(this.navCompanion){var selectedCell=this.navCompanion.selectedCells[0],firstIndex=this.navCompanion.cells.indexOf(selectedCell),lastIndex=firstIndex+this.navCompanion.selectedCells.length-1,selectIndex=Math.floor(lerp(firstIndex,lastIndex,this.navCompanion.cellAlign));if(this.selectCell(selectIndex,!1,isInstant),this.removeNavSelectedElements(),!(selectIndex>=this.cells.length)){var selectedCells=this.cells.slice(firstIndex,lastIndex+1);this.navSelectedElements=selectedCells.map(function(cell){return cell.element}),this.changeNavSelectedClass("add")}}},proto.changeNavSelectedClass=function(method){this.navSelectedElements.forEach(function(navElem){navElem.classList[method]("is-nav-selected")})},proto.activateAsNavFor=function(){this.navCompanionSelect(!0)},proto.removeNavSelectedElements=function(){this.navSelectedElements&&(this.changeNavSelectedClass("remove"),delete this.navSelectedElements)},proto.onNavStaticClick=function(event,pointer,cellElement,cellIndex){"number"==typeof cellIndex&&this.navCompanion.selectCell(cellIndex)},proto.deactivateAsNavFor=function(){this.removeNavSelectedElements()},proto.destroyAsNavFor=function(){this.navCompanion&&(this.navCompanion.off("select",this.onNavCompanionSelect),this.off("staticClick",this.onNavStaticClick),delete this.navCompanion)},Flickity}),function(window,factory){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(EvEmitter){return factory(window,EvEmitter)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("ev-emitter")):window.imagesLoaded=factory(window,window.EvEmitter)
}("undefined"!=typeof window?window:this,function(window,EvEmitter){function extend(a,b){for(var prop in b)a[prop]=b[prop];return a}function makeArray(obj){return Array.isArray(obj)?obj:"object"==typeof obj&&"number"==typeof obj.length?arraySlice.call(obj):[obj]}function ImagesLoaded(elem,options,onAlways){if(!(this instanceof ImagesLoaded))return new ImagesLoaded(elem,options,onAlways);var queryElem=elem;if("string"==typeof elem&&(queryElem=document.querySelectorAll(elem)),!queryElem)return void console.error("Bad element for imagesLoaded "+(queryElem||elem));this.elements=makeArray(queryElem),this.options=extend({},this.options),"function"==typeof options?onAlways=options:extend(this.options,options),onAlways&&this.on("always",onAlways),this.getImages(),$&&(this.jqDeferred=new $.Deferred),setTimeout(this.check.bind(this))}function LoadingImage(img){this.img=img}function Background(url,element){this.url=url,this.element=element,this.img=new Image}var $=window.jQuery,console=window.console,arraySlice=Array.prototype.slice;ImagesLoaded.prototype=Object.create(EvEmitter.prototype),ImagesLoaded.prototype.options={},ImagesLoaded.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},ImagesLoaded.prototype.addElementImages=function(elem){"IMG"==elem.nodeName&&this.addImage(elem),!0===this.options.background&&this.addElementBackgroundImages(elem);var nodeType=elem.nodeType;if(nodeType&&elementNodeTypes[nodeType]){for(var childImgs=elem.querySelectorAll("img"),i=0;i<childImgs.length;i++){var img=childImgs[i];this.addImage(img)}if("string"==typeof this.options.background){var children=elem.querySelectorAll(this.options.background);for(i=0;i<children.length;i++){var child=children[i];this.addElementBackgroundImages(child)}}}};var elementNodeTypes={1:!0,9:!0,11:!0};return ImagesLoaded.prototype.addElementBackgroundImages=function(elem){var style=getComputedStyle(elem);if(style)for(var reURL=/url\((['"])?(.*?)\1\)/gi,matches=reURL.exec(style.backgroundImage);null!==matches;){var url=matches&&matches[2];url&&this.addBackground(url,elem),matches=reURL.exec(style.backgroundImage)}},ImagesLoaded.prototype.addImage=function(img){var loadingImage=new LoadingImage(img);this.images.push(loadingImage)},ImagesLoaded.prototype.addBackground=function(url,elem){var background=new Background(url,elem);this.images.push(background)},ImagesLoaded.prototype.check=function(){function onProgress(image,elem,message){setTimeout(function(){_this.progress(image,elem,message)})}var _this=this;if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();this.images.forEach(function(loadingImage){loadingImage.once("progress",onProgress),loadingImage.check()})},ImagesLoaded.prototype.progress=function(image,elem,message){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!image.isLoaded,this.emitEvent("progress",[this,image,elem]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,image),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&console&&console.log("progress: "+message,image,elem)},ImagesLoaded.prototype.complete=function(){var eventName=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(eventName,[this]),this.emitEvent("always",[this]),this.jqDeferred){var jqMethod=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[jqMethod](this)}},LoadingImage.prototype=Object.create(EvEmitter.prototype),LoadingImage.prototype.check=function(){if(this.getIsImageComplete())return void this.confirm(0!==this.img.naturalWidth,"naturalWidth");this.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},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;this[method]&&this[method](event)},LoadingImage.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},LoadingImage.prototype.onerror=function(){this.confirm(!1,"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)},Background.prototype=Object.create(LoadingImage.prototype),Background.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"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])},ImagesLoaded.makeJQueryPlugin=function(jQuery){(jQuery=jQuery||window.jQuery)&&($=jQuery,$.fn.imagesLoaded=function(options,callback){return new ImagesLoaded(this,options,callback).jqDeferred.promise($(this))})},ImagesLoaded.makeJQueryPlugin(),ImagesLoaded}),function(window,factory){"function"==typeof define&&define.amd?define(["flickity/js/index","imagesloaded/imagesloaded"],function(Flickity,imagesLoaded){return factory(window,Flickity,imagesLoaded)}):"object"==typeof module&&module.exports?module.exports=factory(window,require("flickity"),require("imagesloaded")):window.Flickity=factory(window,window.Flickity,window.imagesLoaded)}(window,function(window,Flickity,imagesLoaded){"use strict";Flickity.createMethods.push("_createImagesLoaded");var proto=Flickity.prototype;return proto._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)},proto.imagesLoaded=function(){function onImagesLoadedProgress(instance,image){var cell=_this.getParentCell(image.img);_this.cellSizeChange(cell&&cell.element),_this.options.freeScroll||_this.positionSliderAtSelected()}if(this.options.imagesLoaded){var _this=this;imagesLoaded(this.slider).on("progress",onImagesLoadedProgress)}},Flickity});
!function(window,factory){"function"==typeof define&&define.amd?define(["jquery"],function($){return factory(window,$)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=factory(window,require("jquery")):window.lity=factory(window,window.jQuery||window.Zepto)}("undefined"!=typeof window?window:this,function(window,$){"use strict";function globalToggle(){_html[_instanceCount>0?"addClass":"removeClass"]("lity-active")}function transitionEnd(element){var deferred=$.Deferred();return transitionEndEvent?(element.one(transitionEndEvent,deferred.resolve),setTimeout(deferred.resolve,500)):deferred.resolve(),deferred.promise()}function settings(currSettings,key,value){if(1===arguments.length)return $.extend({},currSettings);if("string"==typeof key){if(void 0===value)return void 0===currSettings[key]?null:currSettings[key];currSettings[key]=value}else $.extend(currSettings,key);return this}function parseQueryParams(params){for(var p,pairs=decodeURI(params).split("&"),obj={},i=0,n=pairs.length;i<n;i++)pairs[i]&&(p=pairs[i].split("="),obj[p[0]]=p[1]);return obj}function appendQueryParams(url,params){return url+(url.indexOf("?")>-1?"&":"?")+$.param(params)}function error(msg){return $('<span class="lity-error"/>').append(msg)}function imageHandler(target){if(!_imageRegexp.test(target))return!1;var img=$('<img src="'+target+'">'),deferred=$.Deferred(),failed=function(){deferred.reject(error("Failed loading image"))};return img.on("load",function(){if(0===this.naturalWidth)return failed();deferred.resolve(img)}).on("error",failed),deferred.promise()}function inlineHandler(target){var el;try{el=$(target)}catch(e){return!1}if(!el.length)return!1;var placeholder=$('<span style="display:none !important" class="lity-inline-placeholder"/>');return el.after(placeholder).on("lity:ready",function(e,instance){instance.one("lity:remove",function(){placeholder.before(el.addClass("lity-hide")).remove()})})}function iframeHandler(target){var matches,url=target;return matches=_youtubeRegex.exec(target),matches&&(url=appendQueryParams("https://www.youtube"+(matches[2]||"")+".com/embed/"+matches[4],$.extend({autoplay:1},parseQueryParams(matches[5]||"")))),matches=_vimeoRegex.exec(target),matches&&(url=appendQueryParams("https://player.vimeo.com/video/"+matches[3],$.extend({autoplay:1},parseQueryParams(matches[4]||"")))),matches=_googlemapsRegex.exec(target),matches&&(url=appendQueryParams("https://www.google."+matches[3]+"/maps?"+matches[6],{output:matches[6].indexOf("layer=c")>0?"svembed":"embed"})),'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+url+'"></iframe></div>'}function lity(options){function keyup(e){27===e.keyCode&&close()}function resize(){var height=document.documentElement.clientHeight?document.documentElement.clientHeight:Math.round(_win.height());_content.css("max-height",Math.floor(height)+"px").trigger("lity:resize",[_instance])}function ready(el,content){_instance&&(_content=$(content),_win.on("resize",resize),resize(),_instance.find(".lity-loader").each(function(){var el=$(this);transitionEnd(el).always(function(){el.remove()})}),_instance.removeClass("lity-loading").find(".lity-content").empty().append(_content),_content.removeClass("lity-hide").trigger("lity:ready",[_instance,el]),_ready.resolve())}function init(handler,content,options,el){_ready=$.Deferred(),_instanceCount++,globalToggle(),_instance=$(options.template).addClass("lity-loading").appendTo("body"),options.esc&&_win.on("keyup",keyup),setTimeout(function(){_instance.addClass("lity-opened lity-"+handler).on("click","[data-lity-close]",function(e){$(e.target).is("[data-lity-close]")&&close()}).trigger("lity:open",[_instance,el]),$.when(content).always($.proxy(ready,null,el))},0)}function open(target,options,el){var handler,content,handlers=$.extend({},_defaultHandlers,_handlers);if(options=$.extend({},_defaultOptions,_options,options),options.handler&&handlers[options.handler])content=handlers[options.handler](target,popup),handler=options.handler;else{var lateHandlers={};$.each(["inline","iframe"],function(i,name){handlers[name]&&(lateHandlers[name]=handlers[name]),delete handlers[name]});var call=function(name,callback){return!callback||(content=callback(target,popup),content?(handler=name,!1):void 0)};$.each(handlers,call),handler||$.each(lateHandlers,call)}return content&&$.when(close()).done($.proxy(init,null,handler,content,options,el)),!!content}function close(){if(_instance){var deferred=$.Deferred();return _ready.done(function(){_instanceCount--,globalToggle(),_win.off("resize",resize).off("keyup",keyup),_content.trigger("lity:close",[_instance]),_instance.removeClass("lity-opened").addClass("lity-closed");var instance=_instance,content=_content;_instance=null,_content=null,transitionEnd(content.add(instance)).always(function(){content.trigger("lity:remove",[instance]),instance.remove(),deferred.resolve()})}),deferred.promise()}}function popup(event){if(!event.preventDefault)return popup.open(event);var el=$(this),target=el.data("lity-target")||el.attr("href")||el.attr("src");if(target){open(target,el.data("lity-options")||el.data("lity"),el)&&(el.blur(),event.preventDefault())}}var _instance,_content,_options={},_handlers={},_ready=$.Deferred().resolve();return popup.handlers=$.proxy(settings,popup,_handlers),popup.options=$.proxy(settings,popup,_options),popup.open=function(target,options,el){return open(target,options,el),popup},popup.close=function(){return close(),popup},popup.options(options)}var document=window.document,_win=$(window),_html=$("html"),_instanceCount=0,_imageRegexp=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,_youtubeRegex=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,_vimeoRegex=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,_googlemapsRegex=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,_defaultHandlers={image:imageHandler,inline:inlineHandler,iframe:iframeHandler},_defaultOptions={esc:!0,handler:null,template:'<div class="lity" tabindex="-1"><div class="lity-wrap" data-lity-close><div class="lity-loader">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" title="Close (Esc)" data-lity-close>×</button></div></div></div>'},transitionEndEvent=function(){var el=document.createElement("div"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name];return!1}();return lity.version="1.6.6",lity.handlers=$.proxy(settings,lity,_defaultHandlers),lity.options=$.proxy(settings,lity,_defaultOptions),$(document).on("click","[data-lity]",lity()),lity});
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.dimmer=function(parameters){var returnedValue,$allModules=$(this),time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $allModules.each(function(){var $dimmer,$dimmable,module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.dimmer.settings,parameters):$.extend({},$.fn.dimmer.settings),selector=settings.selector,namespace=settings.namespace,className=settings.className,error=settings.error,eventNamespace="."+namespace,moduleNamespace="module-"+namespace,moduleSelector=$allModules.selector||"",clickEvent="ontouchstart"in document.documentElement?"touchstart":"click",$module=$(this),element=this,instance=$module.data(moduleNamespace);module={preinitialize:function(){module.is.dimmer()?($dimmable=$module.parent(),$dimmer=$module):($dimmable=$module,$dimmer=module.has.dimmer()?settings.dimmerName?$dimmable.find(selector.dimmer).filter("."+settings.dimmerName):$dimmable.find(selector.dimmer):module.create())},initialize:function(){module.debug("Initializing dimmer",settings),module.bind.events(),module.set.dimmable(),module.instantiate()},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,instance)},destroy:function(){module.verbose("Destroying previous module",$dimmer),module.unbind.events(),module.remove.variation(),$dimmable.off(eventNamespace)},bind:{events:function(){"hover"==settings.on?$dimmable.on("mouseenter"+eventNamespace,module.show).on("mouseleave"+eventNamespace,module.hide):"click"==settings.on&&$dimmable.on(clickEvent+eventNamespace,module.toggle),module.is.page()&&(module.debug("Setting as a page dimmer",$dimmable),module.set.pageDimmer()),module.is.closable()&&(module.verbose("Adding dimmer close event",$dimmer),$dimmable.on(clickEvent+eventNamespace,selector.dimmer,module.event.click))}},unbind:{events:function(){$module.removeData(moduleNamespace),$dimmable.off(eventNamespace)}},event:{click:function(event){module.verbose("Determining if event occured on dimmer",event),(0===$dimmer.find(event.target).length||$(event.target).is(selector.content))&&(module.hide(),event.stopImmediatePropagation())}},addContent:function(element){var $content=$(element);module.debug("Add content to dimmer",$content),$content.parent()[0]!==$dimmer[0]&&$content.detach().appendTo($dimmer)},create:function(){var $element=$(settings.template.dimmer());return settings.dimmerName&&(module.debug("Creating named dimmer",settings.dimmerName),$element.addClass(settings.dimmerName)),$element.appendTo($dimmable),$element},show:function(callback){callback=$.isFunction(callback)?callback:function(){},module.debug("Showing dimmer",$dimmer,settings),module.set.variation(),module.is.dimmed()&&!module.is.animating()||!module.is.enabled()?module.debug("Dimmer is already shown or disabled"):(module.animate.show(callback),settings.onShow.call(element),settings.onChange.call(element))},hide:function(callback){callback=$.isFunction(callback)?callback:function(){},module.is.dimmed()||module.is.animating()?(module.debug("Hiding dimmer",$dimmer),module.animate.hide(callback),settings.onHide.call(element),settings.onChange.call(element)):module.debug("Dimmer is not visible")},toggle:function(){module.verbose("Toggling dimmer visibility",$dimmer),module.is.dimmed()?module.hide():module.show()},animate:{show:function(callback){callback=$.isFunction(callback)?callback:function(){},settings.useCSS&&void 0!==$.fn.transition&&$dimmer.transition("is supported")?(settings.useFlex?(module.debug("Using flex dimmer"),module.remove.legacy()):(module.debug("Using legacy non-flex dimmer"),module.set.legacy()),"auto"!==settings.opacity&&module.set.opacity(),$dimmer.transition({displayType:settings.useFlex?"flex":"block",animation:settings.transition+" in",queue:!1,duration:module.get.duration(),useFailSafe:!0,onStart:function(){module.set.dimmed()},onComplete:function(){module.set.active(),callback()}})):(module.verbose("Showing dimmer animation with javascript"),module.set.dimmed(),"auto"==settings.opacity&&(settings.opacity=.8),$dimmer.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(module.get.duration(),settings.opacity,function(){$dimmer.removeAttr("style"),module.set.active(),callback()}))},hide:function(callback){callback=$.isFunction(callback)?callback:function(){},settings.useCSS&&void 0!==$.fn.transition&&$dimmer.transition("is supported")?(module.verbose("Hiding dimmer with css"),$dimmer.transition({displayType:settings.useFlex?"flex":"block",animation:settings.transition+" out",queue:!1,duration:module.get.duration(),useFailSafe:!0,onStart:function(){module.remove.dimmed()},onComplete:function(){module.remove.variation(),module.remove.active(),callback()}})):(module.verbose("Hiding dimmer with javascript"),module.remove.dimmed(),$dimmer.stop().fadeOut(module.get.duration(),function(){module.remove.active(),$dimmer.removeAttr("style"),callback()}))}},get:{dimmer:function(){return $dimmer},duration:function(){return"object"==typeof settings.duration?module.is.active()?settings.duration.hide:settings.duration.show:settings.duration}},has:{dimmer:function(){return settings.dimmerName?$module.find(selector.dimmer).filter("."+settings.dimmerName).length>0:$module.find(selector.dimmer).length>0}},is:{active:function(){return $dimmer.hasClass(className.active)},animating:function(){return $dimmer.is(":animated")||$dimmer.hasClass(className.animating)},closable:function(){return"auto"==settings.closable?"hover"!=settings.on:settings.closable},dimmer:function(){return $module.hasClass(className.dimmer)},dimmable:function(){return $module.hasClass(className.dimmable)},dimmed:function(){return $dimmable.hasClass(className.dimmed)},disabled:function(){return $dimmable.hasClass(className.disabled)},enabled:function(){return!module.is.disabled()},page:function(){return $dimmable.is("body")},pageDimmer:function(){return $dimmer.hasClass(className.pageDimmer)}},can:{show:function(){return!$dimmer.hasClass(className.disabled)}},set:{opacity:function(opacity){var color=$dimmer.css("background-color"),colorArray=color.split(","),isRGB=colorArray&&3==colorArray.length,isRGBA=colorArray&&4==colorArray.length;opacity=0===settings.opacity?0:settings.opacity||opacity,isRGB||isRGBA?(colorArray[3]=opacity+")",color=colorArray.join(",")):color="rgba(0, 0, 0, "+opacity+")",module.debug("Setting opacity to",opacity),$dimmer.css("background-color",color)},legacy:function(){$dimmer.addClass(className.legacy)},active:function(){$dimmer.addClass(className.active)},dimmable:function(){$dimmable.addClass(className.dimmable)},dimmed:function(){$dimmable.addClass(className.dimmed)},pageDimmer:function(){$dimmer.addClass(className.pageDimmer)},disabled:function(){$dimmer.addClass(className.disabled)},variation:function(variation){(variation=variation||settings.variation)&&$dimmer.addClass(variation)}},remove:{active:function(){$dimmer.removeClass(className.active)},legacy:function(){$dimmer.removeClass(className.legacy)},dimmed:function(){$dimmable.removeClass(className.dimmed)},disabled:function(){$dimmer.removeClass(className.disabled)},variation:function(variation){(variation=variation||settings.variation)&&$dimmer.removeClass(variation)}},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),$allModules.length>1&&(title+=" ("+$allModules.length+")"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]?(found=object[value],!1):(module.error(error.method,query),!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},module.preinitialize(),methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,useFlex:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",legacy:"legacy",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return $("<div />").attr("class","ui dimmer")}}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.search=function(parameters){var returnedValue,$allModules=$(this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $(this).each(function(){var module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.search.settings,parameters):$.extend({},$.fn.search.settings),className=settings.className,metadata=settings.metadata,regExp=settings.regExp,fields=settings.fields,selector=settings.selector,error=settings.error,namespace=settings.namespace,eventNamespace="."+namespace,moduleNamespace=namespace+"-module",$module=$(this),$prompt=$module.find(selector.prompt),$searchButton=$module.find(selector.searchButton),$results=$module.find(selector.results),$result=$module.find(selector.result),$category=$module.find(selector.category),element=this,instance=$module.data(moduleNamespace),disabledBubbled=!1,resultsDismissed=!1;module={initialize:function(){module.verbose("Initializing module"),module.get.settings(),module.determine.searchFields(),module.bind.events(),module.set.type(),module.create.results(),module.instantiate()},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,module)},destroy:function(){module.verbose("Destroying instance"),$module.off(eventNamespace).removeData(moduleNamespace)},refresh:function(){module.debug("Refreshing selector cache"),$prompt=$module.find(selector.prompt),$searchButton=$module.find(selector.searchButton),$category=$module.find(selector.category),$results=$module.find(selector.results),$result=$module.find(selector.result)},refreshResults:function(){$results=$module.find(selector.results),$result=$module.find(selector.result)},bind:{events:function(){module.verbose("Binding events to search"),settings.automatic&&($module.on(module.get.inputEvent()+eventNamespace,selector.prompt,module.event.input),$prompt.attr("autocomplete","off")),$module.on("focus"+eventNamespace,selector.prompt,module.event.focus).on("blur"+eventNamespace,selector.prompt,module.event.blur).on("keydown"+eventNamespace,selector.prompt,module.handleKeyboard).on("click"+eventNamespace,selector.searchButton,module.query).on("mousedown"+eventNamespace,selector.results,module.event.result.mousedown).on("mouseup"+eventNamespace,selector.results,module.event.result.mouseup).on("click"+eventNamespace,selector.result,module.event.result.click)}},determine:{searchFields:function(){parameters&&void 0!==parameters.searchFields&&(settings.searchFields=parameters.searchFields)}},event:{input:function(){settings.searchDelay?(clearTimeout(module.timer),module.timer=setTimeout(function(){module.is.focused()&&module.query()},settings.searchDelay)):module.query()},focus:function(){module.set.focus(),settings.searchOnFocus&&module.has.minimumCharacters()&&module.query(function(){module.can.show()&&module.showResults()})},blur:function(event){var pageLostFocus=document.activeElement===this,callback=function(){module.cancel.query(),module.remove.focus(),module.timer=setTimeout(module.hideResults,settings.hideDelay)};pageLostFocus||(resultsDismissed=!1,module.resultsClicked?(module.debug("Determining if user action caused search to close"),$module.one("click.close"+eventNamespace,selector.results,function(event){if(module.is.inMessage(event)||disabledBubbled)return void $prompt.focus();disabledBubbled=!1,module.is.animating()||module.is.hidden()||callback()})):(module.debug("Input blurred without user action, closing results"),callback()))},result:{mousedown:function(){module.resultsClicked=!0},mouseup:function(){module.resultsClicked=!1},click:function(event){module.debug("Search result selected");var $result=$(this),$title=$result.find(selector.title).eq(0),$link=$result.is("a[href]")?$result:$result.find("a[href]").eq(0),href=$link.attr("href")||!1,target=$link.attr("target")||!1,value=($title.html(),$title.length>0&&$title.text()),results=module.get.results(),result=$result.data(metadata.result)||module.get.result(value,results);if($.isFunction(settings.onSelect)&&!1===settings.onSelect.call(element,result,results))return module.debug("Custom onSelect callback cancelled default select action"),void(disabledBubbled=!0);module.hideResults(),value&&module.set.value(value),href&&(module.verbose("Opening search link found in result",$link),"_blank"==target||event.ctrlKey?window.open(href):window.location.href=href)}}},handleKeyboard:function(event){var newIndex,$result=$module.find(selector.result),$category=$module.find(selector.category),$activeResult=$result.filter("."+className.active),currentIndex=$result.index($activeResult),resultSize=$result.length,hasActiveResult=$activeResult.length>0,keyCode=event.which,keys={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(keyCode==keys.escape&&(module.verbose("Escape key pressed, blurring search field"),module.hideResults(),resultsDismissed=!0),module.is.visible())if(keyCode==keys.enter){if(module.verbose("Enter key pressed, selecting active result"),$result.filter("."+className.active).length>0)return module.event.result.click.call($result.filter("."+className.active),event),event.preventDefault(),!1}else keyCode==keys.upArrow&&hasActiveResult?(module.verbose("Up key pressed, changing active result"),newIndex=currentIndex-1<0?currentIndex:currentIndex-1,$category.removeClass(className.active),$result.removeClass(className.active).eq(newIndex).addClass(className.active).closest($category).addClass(className.active),event.preventDefault()):keyCode==keys.downArrow&&(module.verbose("Down key pressed, changing active result"),newIndex=currentIndex+1>=resultSize?currentIndex:currentIndex+1,$category.removeClass(className.active),$result.removeClass(className.active).eq(newIndex).addClass(className.active).closest($category).addClass(className.active),event.preventDefault());else keyCode==keys.enter&&(module.verbose("Enter key pressed, executing query"),module.query(),module.set.buttonPressed(),$prompt.one("keyup",module.remove.buttonFocus))},setup:{api:function(searchTerm,callback){var apiSettings={debug:settings.debug,on:!1,cache:settings.cache,action:"search",urlData:{query:searchTerm},onSuccess:function(response){module.parse.response.call(element,response,searchTerm),callback()},onFailure:function(){module.displayMessage(error.serverError),callback()},onAbort:function(response){},onError:module.error};$.extend(!0,apiSettings,settings.apiSettings),module.verbose("Setting up API request",apiSettings),$module.api(apiSettings)}},can:{useAPI:function(){return void 0!==$.fn.api},show:function(){return module.is.focused()&&!module.is.visible()&&!module.is.empty()},transition:function(){return settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")}},is:{animating:function(){return $results.hasClass(className.animating)},hidden:function(){return $results.hasClass(className.hidden)},inMessage:function(event){if(event.target){var $target=$(event.target);return $.contains(document.documentElement,event.target)&&$target.closest(selector.message).length>0}},empty:function(){return""===$results.html()},visible:function(){return $results.filter(":visible").length>0},focused:function(){return $prompt.filter(":focus").length>0}},get:{settings:function(){$.isPlainObject(parameters)&&parameters.searchFullText&&(settings.fullTextSearch=parameters.searchFullText,module.error(settings.error.oldSearchSyntax,element))},inputEvent:function(){var prompt=$prompt[0];return void 0!==prompt&&void 0!==prompt.oninput?"input":void 0!==prompt&&void 0!==prompt.onpropertychange?"propertychange":"keyup"},value:function(){return $prompt.val()},results:function(){return $module.data(metadata.results)},result:function(value,results){var lookupFields=["title","id"],result=!1;return value=void 0!==value?value:module.get.value(),results=void 0!==results?results:module.get.results(),"category"===settings.type?(module.debug("Finding result that matches",value),$.each(results,function(index,category){if($.isArray(category.results)&&(result=module.search.object(value,category.results,lookupFields)[0]))return!1})):(module.debug("Finding result in results object",value),result=module.search.object(value,results,lookupFields)[0]),result||!1}},select:{firstResult:function(){module.verbose("Selecting first result"),$result.first().addClass(className.active)}},set:{focus:function(){$module.addClass(className.focus)},loading:function(){$module.addClass(className.loading)},value:function(value){module.verbose("Setting search input value",value),$prompt.val(value)},type:function(type){type=type||settings.type,"category"==settings.type&&$module.addClass(settings.type)},buttonPressed:function(){$searchButton.addClass(className.pressed)}},remove:{loading:function(){$module.removeClass(className.loading)},focus:function(){$module.removeClass(className.focus)},buttonPressed:function(){$searchButton.removeClass(className.pressed)}},query:function(callback){callback=$.isFunction(callback)?callback:function(){};var searchTerm=module.get.value(),cache=module.read.cache(searchTerm);callback=callback||function(){},module.has.minimumCharacters()?(cache?(module.debug("Reading result from cache",searchTerm),module.save.results(cache.results),module.addResults(cache.html),module.inject.id(cache.results),callback()):(module.debug("Querying for",searchTerm),$.isPlainObject(settings.source)||$.isArray(settings.source)?(module.search.local(searchTerm),callback()):module.can.useAPI()?module.search.remote(searchTerm,callback):(module.error(error.source),callback())),settings.onSearchQuery.call(element,searchTerm)):module.hideResults()},search:{local:function(searchTerm){var searchHTML,results=module.search.object(searchTerm,settings.content);module.set.loading(),module.save.results(results),module.debug("Returned full local search results",results),settings.maxResults>0&&(module.debug("Using specified max results",results),results=results.slice(0,settings.maxResults)),"category"==settings.type&&(results=module.create.categoryResults(results)),searchHTML=module.generateResults({results:results}),module.remove.loading(),module.addResults(searchHTML),module.inject.id(results),module.write.cache(searchTerm,{html:searchHTML,results:results})},remote:function(searchTerm,callback){callback=$.isFunction(callback)?callback:function(){},$module.api("is loading")&&$module.api("abort"),module.setup.api(searchTerm,callback),$module.api("query")},object:function(searchTerm,source,searchFields){var results=[],exactResults=[],fuzzyResults=[],searchExp=searchTerm.toString().replace(regExp.escape,"\\$&"),matchRegExp=new RegExp(regExp.beginsWith+searchExp,"i"),addResult=function(array,result){var notResult=-1==$.inArray(result,results),notFuzzyResult=-1==$.inArray(result,fuzzyResults),notExactResults=-1==$.inArray(result,exactResults);notResult&&notFuzzyResult&&notExactResults&&array.push(result)};return source=source||settings.source,searchFields=void 0!==searchFields?searchFields:settings.searchFields,$.isArray(searchFields)||(searchFields=[searchFields]),void 0===source||!1===source?(module.error(error.source),[]):($.each(searchFields,function(index,field){$.each(source,function(label,content){"string"==typeof content[field]&&(-1!==content[field].search(matchRegExp)?addResult(results,content):"exact"===settings.fullTextSearch&&module.exactSearch(searchTerm,content[field])?addResult(exactResults,content):1==settings.fullTextSearch&&module.fuzzySearch(searchTerm,content[field])&&addResult(fuzzyResults,content))})}),$.merge(exactResults,fuzzyResults),$.merge(results,exactResults),results)}},exactSearch:function(query,term){return query=query.toLowerCase(),term=term.toLowerCase(),term.indexOf(query)>-1},fuzzySearch:function(query,term){var termLength=term.length,queryLength=query.length;if("string"!=typeof query)return!1;if(query=query.toLowerCase(),term=term.toLowerCase(),queryLength>termLength)return!1;if(queryLength===termLength)return query===term;search:for(var characterIndex=0,nextCharacterIndex=0;characterIndex<queryLength;characterIndex++){for(var queryCharacter=query.charCodeAt(characterIndex);nextCharacterIndex<termLength;)if(term.charCodeAt(nextCharacterIndex++)===queryCharacter)continue search;return!1}return!0},parse:{response:function(response,searchTerm){var searchHTML=module.generateResults(response);module.verbose("Parsing server response",response),void 0!==response&&void 0!==searchTerm&&void 0!==response[fields.results]&&(module.addResults(searchHTML),module.inject.id(response[fields.results]),module.write.cache(searchTerm,{html:searchHTML,results:response[fields.results]}),module.save.results(response[fields.results]))}},cancel:{query:function(){module.can.useAPI()&&$module.api("abort")}},has:{minimumCharacters:function(){return module.get.value().length>=settings.minCharacters},results:function(){return 0!==$results.length&&""!=$results.html()}},clear:{cache:function(value){var cache=$module.data(metadata.cache);value?value&&cache&&cache[value]&&(module.debug("Removing value from cache",value),delete cache[value],$module.data(metadata.cache,cache)):(module.debug("Clearing cache",value),$module.removeData(metadata.cache))}},read:{cache:function(name){var cache=$module.data(metadata.cache);return!!settings.cache&&(module.verbose("Checking cache for generated html for query",name),"object"==typeof cache&&void 0!==cache[name]&&cache[name])}},create:{categoryResults:function(results){var categoryResults={};return $.each(results,function(index,result){result.category&&(void 0===categoryResults[result.category]?(module.verbose("Creating new category of results",result.category),categoryResults[result.category]={name:result.category,results:[result]}):categoryResults[result.category].results.push(result))}),categoryResults},id:function(resultIndex,categoryIndex){var letterID,id,resultID=resultIndex+1;return void 0!==categoryIndex?(letterID=String.fromCharCode(97+categoryIndex),id=letterID+resultID,module.verbose("Creating category result id",id)):(id=resultID,module.verbose("Creating result id",id)),id},results:function(){0===$results.length&&($results=$("<div />").addClass(className.results).appendTo($module))}},inject:{result:function(result,resultIndex,categoryIndex){module.verbose("Injecting result into results");var $selectedResult=void 0!==categoryIndex?$results.children().eq(categoryIndex).children(selector.results).first().children(selector.result).eq(resultIndex):$results.children(selector.result).eq(resultIndex);module.verbose("Injecting results metadata",$selectedResult),$selectedResult.data(metadata.result,result)},id:function(results){module.debug("Injecting unique ids into results");var categoryIndex=0,resultIndex=0;return"category"===settings.type?$.each(results,function(index,category){resultIndex=0,$.each(category.results,function(index,value){var result=category.results[index];void 0===result.id&&(result.id=module.create.id(resultIndex,categoryIndex)),module.inject.result(result,resultIndex,categoryIndex),resultIndex++}),categoryIndex++}):$.each(results,function(index,value){var result=results[index];void 0===result.id&&(result.id=module.create.id(resultIndex)),module.inject.result(result,resultIndex),resultIndex++}),results}},save:{results:function(results){module.verbose("Saving current search results to metadata",results),$module.data(metadata.results,results)}},write:{cache:function(name,value){var cache=void 0!==$module.data(metadata.cache)?$module.data(metadata.cache):{};settings.cache&&(module.verbose("Writing generated html to cache",name,value),cache[name]=value,$module.data(metadata.cache,cache))}},addResults:function(html){if($.isFunction(settings.onResultsAdd)&&!1===settings.onResultsAdd.call($results,html))return module.debug("onResultsAdd callback cancelled default action"),!1;html?($results.html(html),module.refreshResults(),settings.selectFirstResult&&module.select.firstResult(),module.showResults()):module.hideResults(function(){$results.empty()})},showResults:function(callback){callback=$.isFunction(callback)?callback:function(){},resultsDismissed||!module.is.visible()&&module.has.results()&&(module.can.transition()?(module.debug("Showing results with css animations"),$results.transition({animation:settings.transition+" in",debug:settings.debug,verbose:settings.verbose,duration:settings.duration,onComplete:function(){callback()},queue:!0})):(module.debug("Showing results with javascript"),$results.stop().fadeIn(settings.duration,settings.easing)),settings.onResultsOpen.call($results))},hideResults:function(callback){callback=$.isFunction(callback)?callback:function(){},module.is.visible()&&(module.can.transition()?(module.debug("Hiding results with css animations"),$results.transition({animation:settings.transition+" out",debug:settings.debug,verbose:settings.verbose,duration:settings.duration,onComplete:function(){callback()},queue:!0})):(module.debug("Hiding results with javascript"),$results.stop().fadeOut(settings.duration,settings.easing)),settings.onResultsClose.call($results))},generateResults:function(response){module.debug("Generating html from response",response);var template=settings.templates[settings.type],isProperObject=$.isPlainObject(response[fields.results])&&!$.isEmptyObject(response[fields.results]),isProperArray=$.isArray(response[fields.results])&&response[fields.results].length>0,html="";return isProperObject||isProperArray?(settings.maxResults>0&&(isProperObject?"standard"==settings.type&&module.error(error.maxResults):response[fields.results]=response[fields.results].slice(0,settings.maxResults)),$.isFunction(template)?html=template(response,fields):module.error(error.noTemplate,!1)):settings.showNoResults&&(html=module.displayMessage(error.noResults,"empty")),settings.onResults.call(element,response),html},displayMessage:function(text,type){return type=type||"standard",module.debug("Displaying message",text,type),module.addResults(settings.templates.message(text,type)),settings.templates.message(text,type)},setting:function(name,value){if($.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),$allModules.length>1&&(title+=" ("+$allModules.length+")"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]&&(found=object[value],!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["title","description"],displayField:"",fullTextSearch:"exact",automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(query){},onResults:function(response){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined."},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(string){var badChars=/[&<>"'`]/g,shouldEscape=/[&<>"'`]/,escape={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},escapedChar=function(chr){return escape[chr]};return shouldEscape.test(string)?string.replace(badChars,escapedChar):string},message:function(message,type){var html="";return void 0!==message&&void 0!==type&&(html+='<div class="message '+type+'">',html+="empty"==type?'<div class="header">No Results</div class="header"><div class="description">'+message+'</div class="description">':' <div class="description">'+message+"</div>",html+="</div>"),html},category:function(response,fields){var html="";$.fn.search.settings.templates.escape;return void 0!==response[fields.categoryResults]&&($.each(response[fields.categoryResults],function(index,category){void 0!==category[fields.results]&&category.results.length>0&&(html+='<div class="category">',void 0!==category[fields.categoryName]&&(html+='<div class="name">'+category[fields.categoryName]+"</div>"),html+='<div class="results">',$.each(category.results,function(index,result){result[fields.url]?html+='<a class="result" href="'+result[fields.url]+'">':html+='<a class="result">',void 0!==result[fields.image]&&(html+='<div class="image"> <img src="'+result[fields.image]+'"></div>'),html+='<div class="content">',void 0!==result[fields.price]&&(html+='<div class="price">'+result[fields.price]+"</div>"),void 0!==result[fields.title]&&(html+='<div class="title">'+result[fields.title]+"</div>"),void 0!==result[fields.description]&&(html+='<div class="description">'+result[fields.description]+"</div>"),html+="</div>",html+="</a>"}),html+="</div>",html+="</div>")}),response[fields.action]&&(html+='<a href="'+response[fields.action][fields.actionURL]+'" class="action">'+response[fields.action][fields.actionText]+"</a>"),html)},standard:function(response,fields){var html="";return void 0!==response[fields.results]&&($.each(response[fields.results],function(index,result){result[fields.url]?html+='<a class="result" href="'+result[fields.url]+'">':html+='<a class="result">',void 0!==result[fields.image]&&(html+='<div class="image"> <img src="'+result[fields.image]+'"></div>'),html+='<div class="content">',void 0!==result[fields.price]&&(html+='<div class="price">'+result[fields.price]+"</div>"),void 0!==result[fields.title]&&(html+='<div class="title">'+result[fields.title]+"</div>"),void 0!==result[fields.description]&&(html+='<div class="description">'+result[fields.description]+"</div>"),html+="</div>",html+="</a>"}),response[fields.action]&&(html+='<a href="'+response[fields.action][fields.actionURL]+'" class="action">'+response[fields.action][fields.actionText]+"</a>"),html)}}}}(jQuery,window,document);
!function($,window,document,undefined){"use strict";window=void 0!==window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),$.fn.modal=function(parameters){var returnedValue,$allModules=$(this),$window=$(window),$document=$(document),$body=$("body"),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1),requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){setTimeout(callback,0)};return $allModules.each(function(){var $allModals,$otherModals,$focusedElement,$dimmable,$dimmer,elementEventNamespace,id,observer,module,settings=$.isPlainObject(parameters)?$.extend(!0,{},$.fn.modal.settings,parameters):$.extend({},$.fn.modal.settings),selector=settings.selector,className=settings.className,namespace=settings.namespace,error=settings.error,eventNamespace="."+namespace,moduleNamespace="module-"+namespace,$module=$(this),$context=$(settings.context),$close=$module.find(selector.close),element=this,instance=$module.data(moduleNamespace),ignoreRepeatedEvents=!1;module={initialize:function(){module.verbose("Initializing dimmer",$context),module.create.id(),module.create.dimmer(),module.refreshModals(),module.bind.events(),settings.observeChanges&&module.observeChanges(),module.instantiate()},instantiate:function(){module.verbose("Storing instance of modal"),instance=module,$module.data(moduleNamespace,instance)},create:{dimmer:function(){var defaultSettings={debug:settings.debug,variation:!settings.centered&&"top aligned",dimmerName:"modals"},dimmerSettings=$.extend(!0,defaultSettings,settings.dimmerSettings);if(void 0===$.fn.dimmer)return void module.error(error.dimmer);module.debug("Creating dimmer"),$dimmable=$context.dimmer(dimmerSettings),settings.detachable?(module.verbose("Modal is detachable, moving content into dimmer"),$dimmable.dimmer("add content",$module)):module.set.undetached(),$dimmer=$dimmable.dimmer("get dimmer")},id:function(){id=(Math.random().toString(16)+"000000000").substr(2,8),elementEventNamespace="."+id,module.verbose("Creating unique id for element",id)}},destroy:function(){module.verbose("Destroying previous modal"),$module.removeData(moduleNamespace).off(eventNamespace),$window.off(elementEventNamespace),$dimmer.off(elementEventNamespace),$close.off(eventNamespace),$context.dimmer("destroy")},observeChanges:function(){"MutationObserver"in window&&(observer=new MutationObserver(function(mutations){module.debug("DOM tree modified, refreshing"),module.refresh()}),observer.observe(element,{childList:!0,subtree:!0}),module.debug("Setting up mutation observer",observer))},refresh:function(){module.remove.scrolling(),module.cacheSizes(),module.can.useFlex()||module.set.modalOffset(),module.set.screenHeight(),module.set.type()},refreshModals:function(){$otherModals=$module.siblings(selector.modal),$allModals=$otherModals.add($module)},attachEvents:function(selector,event){var $toggle=$(selector);event=$.isFunction(module[event])?module[event]:module.toggle,$toggle.length>0?(module.debug("Attaching modal events to element",selector,event),$toggle.off(eventNamespace).on("click"+eventNamespace,event)):module.error(error.notFound,selector)},bind:{events:function(){module.verbose("Attaching events"),$module.on("click"+eventNamespace,selector.close,module.event.close).on("click"+eventNamespace,selector.approve,module.event.approve).on("click"+eventNamespace,selector.deny,module.event.deny),$window.on("resize"+elementEventNamespace,module.event.resize)},scrollLock:function(){$dimmable.get(0).addEventListener("touchmove",module.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){$dimmable.get(0).removeEventListener("touchmove",module.event.preventScroll,{passive:!1})}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){if(ignoreRepeatedEvents||!1===settings.onApprove.call(element,$(this)))return void module.verbose("Approve callback returned false cancelling hide");ignoreRepeatedEvents=!0,module.hide(function(){ignoreRepeatedEvents=!1})},preventScroll:function(event){event.preventDefault()},deny:function(){if(ignoreRepeatedEvents||!1===settings.onDeny.call(element,$(this)))return void module.verbose("Deny callback returned false cancelling hide");ignoreRepeatedEvents=!0,module.hide(function(){ignoreRepeatedEvents=!1})},close:function(){module.hide()},click:function(event){if(!settings.closable)return void module.verbose("Dimmer clicked but closable setting is disabled");var $target=$(event.target),isInModal=$target.closest(selector.modal).length>0,isInDOM=$.contains(document.documentElement,event.target);!isInModal&&isInDOM&&module.is.active()&&(module.debug("Dimmer clicked, hiding all modals"),module.remove.clickaway(),settings.allowMultiple?module.hide():module.hideAll())},debounce:function(method,delay){clearTimeout(module.timer),module.timer=setTimeout(method,delay)},keyboard:function(event){27==event.which&&(settings.closable?(module.debug("Escape key pressed hiding modal"),module.hide()):module.debug("Escape key pressed, but closable is set to false"),event.preventDefault())},resize:function(){$dimmable.dimmer("is active")&&(module.is.animating()||module.is.active())&&requestAnimationFrame(module.refresh)}},toggle:function(){module.is.active()||module.is.animating()?module.hide():module.show()},show:function(callback){callback=$.isFunction(callback)?callback:function(){},module.refreshModals(),module.set.dimmerSettings(),module.set.dimmerStyles(),module.showModal(callback)},hide:function(callback){callback=$.isFunction(callback)?callback:function(){},module.refreshModals(),module.hideModal(callback)},showModal:function(callback){callback=$.isFunction(callback)?callback:function(){},module.is.animating()||!module.is.active()?(module.showDimmer(),module.cacheSizes(),module.can.useFlex()?module.remove.legacy():(module.set.legacy(),module.set.modalOffset(),module.debug("Using non-flex legacy modal positioning.")),module.set.screenHeight(),module.set.type(),module.set.clickaway(),!settings.allowMultiple&&module.others.active()?module.hideOthers(module.showModal):(settings.allowMultiple&&settings.detachable&&$module.detach().appendTo($dimmer),settings.onShow.call(element),settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")?(module.debug("Showing modal with css animations"),$module.transition({debug:settings.debug,animation:settings.transition+" in",queue:settings.queue,duration:settings.duration,useFailSafe:!0,onComplete:function(){settings.onVisible.apply(element),settings.keyboardShortcuts&&module.add.keyboardShortcuts(),module.save.focus(),module.set.active(),settings.autofocus&&module.set.autofocus(),callback()}})):module.error(error.noTransition))):module.debug("Modal is already visible")},hideModal:function(callback,keepDimmed){if(callback=$.isFunction(callback)?callback:function(){},module.debug("Hiding modal"),!1===settings.onHide.call(element,$(this)))return void module.verbose("Hide callback returned false cancelling hide");(module.is.animating()||module.is.active())&&(settings.transition&&void 0!==$.fn.transition&&$module.transition("is supported")?(module.remove.active(),$module.transition({debug:settings.debug,animation:settings.transition+" out",queue:settings.queue,duration:settings.duration,useFailSafe:!0,onStart:function(){module.others.active()||keepDimmed||module.hideDimmer(),settings.keyboardShortcuts&&module.remove.keyboardShortcuts()},onComplete:function(){settings.onHidden.call(element),module.remove.dimmerStyles(),module.restore.focus(),callback()}})):module.error(error.noTransition))},showDimmer:function(){$dimmable.dimmer("is animating")||!$dimmable.dimmer("is active")?(module.debug("Showing dimmer"),$dimmable.dimmer("show")):module.debug("Dimmer already visible")},hideDimmer:function(){if(!$dimmable.dimmer("is animating")&&!$dimmable.dimmer("is active"))return void module.debug("Dimmer is not visible cannot hide");module.unbind.scrollLock(),$dimmable.dimmer("hide",function(){module.remove.clickaway(),module.remove.screenHeight()})},hideAll:function(callback){var $visibleModals=$allModals.filter("."+className.active+", ."+className.animating);callback=$.isFunction(callback)?callback:function(){},$visibleModals.length>0&&(module.debug("Hiding all visible modals"),module.hideDimmer(),$visibleModals.modal("hide modal",callback))},hideOthers:function(callback){var $visibleModals=$otherModals.filter("."+className.active+", ."+className.animating);callback=$.isFunction(callback)?callback:function(){},$visibleModals.length>0&&(module.debug("Hiding other modals",$otherModals),$visibleModals.modal("hide modal",callback,!0))},others:{active:function(){return $otherModals.filter("."+className.active).length>0},animating:function(){return $otherModals.filter("."+className.animating).length>0}},add:{keyboardShortcuts:function(){module.verbose("Adding keyboard shortcuts"),$document.on("keyup"+eventNamespace,module.event.keyboard)}},save:{focus:function(){$(document.activeElement).closest($module).length>0||($focusedElement=$(document.activeElement).blur())}},restore:{focus:function(){$focusedElement&&$focusedElement.length>0&&$focusedElement.focus()}},remove:{active:function(){$module.removeClass(className.active)},legacy:function(){$module.removeClass(className.legacy)},clickaway:function(){$dimmer.off("click"+elementEventNamespace)},dimmerStyles:function(){$dimmer.removeClass(className.inverted),$dimmable.removeClass(className.blurring)},bodyStyle:function(){""===$body.attr("style")&&(module.verbose("Removing style attribute"),$body.removeAttr("style"))},screenHeight:function(){module.debug("Removing page height"),$body.css("height","")},keyboardShortcuts:function(){module.verbose("Removing keyboard shortcuts"),$document.off("keyup"+eventNamespace)},scrolling:function(){$dimmable.removeClass(className.scrolling),$module.removeClass(className.scrolling)}},cacheSizes:function(){$module.addClass(className.loading);var scrollHeight=$module.prop("scrollHeight"),modalWidth=$module.outerWidth(),modalHeight=$module.outerHeight();void 0!==module.cache&&0===modalHeight||(module.cache={pageHeight:$(document).outerHeight(),width:modalWidth,height:modalHeight+settings.offset,scrollHeight:scrollHeight+settings.offset,contextHeight:"body"==settings.context?$(window).height():$dimmable.height()},module.cache.topOffset=-module.cache.height/2),$module.removeClass(className.loading),module.debug("Caching modal and container sizes",module.cache)},can:{useFlex:function(){return"auto"==settings.useFlex?settings.detachable&&!module.is.ie():settings.useFlex},fit:function(){var contextHeight=module.cache.contextHeight,verticalCenter=module.cache.contextHeight/2,topOffset=module.cache.topOffset,scrollHeight=module.cache.scrollHeight,height=module.cache.height,paddingHeight=settings.padding,startPosition=verticalCenter+topOffset;return scrollHeight>height?startPosition+scrollHeight+paddingHeight<contextHeight:height+2*paddingHeight<contextHeight}},is:{active:function(){return $module.hasClass(className.active)},ie:function(){var isIE11=!window.ActiveXObject&&"ActiveXObject"in window,isIE="ActiveXObject"in window;return isIE11||isIE},animating:function(){return $module.transition("is supported")?$module.transition("is animating"):$module.is(":visible")},scrolling:function(){return $dimmable.hasClass(className.scrolling)},modernBrowser:function(){return!(window.ActiveXObject||"ActiveXObject"in window)}},set:{autofocus:function(){var $inputs=$module.find("[tabindex], :input").filter(":visible"),$autofocus=$inputs.filter("[autofocus]"),$input=$autofocus.length>0?$autofocus.first():$inputs.first();$input.length>0&&$input.focus()},clickaway:function(){$dimmer.on("click"+elementEventNamespace,module.event.click)},dimmerSettings:function(){if(void 0===$.fn.dimmer)return void module.error(error.dimmer);var defaultSettings={debug:settings.debug,dimmerName:"modals",closable:"auto",useFlex:module.can.useFlex(),variation:!settings.centered&&"top aligned",duration:{show:settings.duration,hide:settings.duration}},dimmerSettings=$.extend(!0,defaultSettings,settings.dimmerSettings);settings.inverted&&(dimmerSettings.variation=void 0!==dimmerSettings.variation?dimmerSettings.variation+" inverted":"inverted"),$context.dimmer("setting",dimmerSettings)},dimmerStyles:function(){settings.inverted?$dimmer.addClass(className.inverted):$dimmer.removeClass(className.inverted),settings.blurring?$dimmable.addClass(className.blurring):$dimmable.removeClass(className.blurring)},modalOffset:function(){var width=module.cache.width,height=module.cache.height;$module.css({marginTop:settings.centered&&module.can.fit()?-height/2:0,marginLeft:-width/2}),module.verbose("Setting modal offset for legacy mode")},screenHeight:function(){module.can.fit()?$body.css("height",""):(module.debug("Modal is taller than page content, resizing page height"),$body.css("height",module.cache.height+2*settings.padding))},active:function(){$module.addClass(className.active)},scrolling:function(){$dimmable.addClass(className.scrolling),$module.addClass(className.scrolling),module.unbind.scrollLock()},legacy:function(){$module.addClass(className.legacy)},type:function(){module.can.fit()?(module.verbose("Modal fits on screen"),module.others.active()||module.others.animating()||(module.remove.scrolling(),module.bind.scrollLock())):(module.verbose("Modal cannot fit on screen setting to scrolling"),module.set.scrolling())},undetached:function(){$dimmable.addClass(className.undetached)}},setting:function(name,value){if(module.debug("Changing setting",name,value),$.isPlainObject(name))$.extend(!0,settings,name);else{if(void 0===value)return settings[name];$.isPlainObject(settings[name])?$.extend(!0,settings[name],value):settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(void 0===value)return module[name];module[name]=value}},debug:function(){!settings.silent&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){!settings.silent&&settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){settings.silent||(module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments))},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Name:message[0],Arguments:[].slice.call(message,1)||"",Element:element,"Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,500)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(void 0!==console.group||void 0!==console.table)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&void 0!==object&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(void 0!==object[camelCaseValue])return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return void 0!==object[value]&&(found=object[value],!1);object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):void 0!==found&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):void 0!==returnedValue?returnedValue=[returnedValue,response]:void 0!==response&&(returnedValue=response),found}},methodInvoked?(void 0===instance&&module.initialize(),module.invoke(query)):(void 0!==instance&&instance.invoke("destroy"),module.initialize())}),void 0!==returnedValue?returnedValue:this},$.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document);
$(document).ready(function(){$("#headerSearch").search({apiSettings:{url:"https://api.japan-partner.com/search?search={query}"},fields:{category:'category',results:"results",title:"name",url:"url"},minCharacters:3,type:'category'});var mainBanner=($("#main .video > .carousel").flickity({cellSelector:".cell",wrapAround:!0,autoPlay:5e3,arrowShape:{x0:10,x1:60,y1:50,x2:60,y2:40,x3:60}}),$("#main .mostPopular > .carousel").flickity({cellSelector:".cell",wrapAround:!0,autoPlay:5e3,lazyLoad:2,arrowShape:{x0:10,x1:60,y1:50,x2:60,y2:40,x3:60}}),$("#main .banners > .carousel").flickity({cellSelector:".cell",wrapAround:!0,autoPlay:5e3,lazyLoad:2}));$("#main .banners .next.slide").on("click",function(){mainBanner.flickity("next")});var stocklistBanner=($(".gallery > .slider").flickity({cellSelector:".cell",wrapAround:!0,lazyLoad:2,adaptiveHeight:!0,pageDots:!1}),$(".gallery > .thumbnails").flickity({asNavFor:".gallery > .slider",cellSelector:".cell",contain:!0,pageDots:!1,arrowShape:{x0:20,x1:70,y1:50,x2:70,y2:50,x3:70}}),$(".simple.slider .carousel").flickity({cellCelector:".cell",wrapAround:!0,lazyLoad:2,pageDots:!1,prevNextButtons:!1,setGallerySize:!0}));$(".simple.slider .carousel ~ .next.slide").on("click",function(){stocklistBanner.flickity("next")}),window.matchMedia("only screen and (max-width: 767px)").matches||$(document).on("lity:open",function(){$(".lity").clone()}),$("#countries").dropdown(),$(".left.demo.sidebar").first().sidebar("attach events",".toggle.button"),$(".toggle.button").removeClass("disabled")});
$("#header nav .dropdown").dropdown({on:"hover",duration:0,delay:{show:0,hide:0}}),$(".ui .simple .dropdown").dropdown({on:"click",action:"select",duration:1,delay:{show:1,hide:1}}),$(".currency .dropdown").dropdown({duration:0,delay:{show:0,hide:0}}),$("#search-tabs .menu .item").tab();