(function(n,t,i,r){n.site=n.fn.site=function(u){var a=(new Date).getTime(),h=[],y=arguments[0],b=typeof y=="string",k=[].slice.call(arguments,1),e=n.isPlainObject(u)?n.extend(!0,{},n.site.settings,u):n.extend({},n.site.settings),c=e.namespace,p=e.error,g="."+c,v="module-"+c,d=n(i),l=d,w=this,s=l.data(v),f,o;return f={initialize:function(){f.instantiate()},instantiate:function(){f.verbose("Storing instance of site",f);s=f;l.data(v,f)},normalize:function(){f.fix.console();f.fix.requestAnimationFrame()},fix:{console:function(){f.debug("Normalizing window.console");(console===r||console.log===r)&&(f.verbose("Console not available, normalizing events"),f.disable.console());(typeof console.group=="undefined"||typeof console.groupEnd=="undefined"||typeof console.groupCollapsed=="undefined")&&(f.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){});typeof console.markTimeline=="undefined"&&(f.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){f.debug("Disabling programmatic console clearing");t.console.clear=function(){}},requestAnimationFrame:function(){f.debug("Normalizing requestAnimationFrame");t.requestAnimationFrame===r&&(f.debug("RequestAnimationFrame not available, normalizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)})}},moduleExists:function(t){return n.fn[t]!==r&&n.fn[t].settings!==r},enabled:{modules:function(t){var i=[];return t=t||e.modules,n.each(t,function(n,t){f.moduleExists(t)&&i.push(t)}),i}},disabled:{modules:function(t){var i=[];return t=t||e.modules,n.each(t,function(n,t){f.moduleExists(t)||i.push(t)}),i}},change:{setting:function(t,i,u,o){u=typeof u=="string"?u==="all"?e.modules:[u]:u||e.modules;o=o!==r?o:!0;n.each(u,function(r,u){var s=f.moduleExists(u)?n.fn[u].settings.namespace||!1:!0,e;f.moduleExists(u)&&(f.verbose("Changing default setting",t,i,u),n.fn[u].settings[t]=i,o&&s&&(e=n(":data(module-"+s+")"),e.length>0&&(f.verbose("Modifying existing settings",e),e[u]("setting",t,i))))})},settings:function(t,i,u){i=typeof i=="string"?[i]:i||e.modules;u=u!==r?u:!0;n.each(i,function(i,r){var e;f.moduleExists(r)&&(f.verbose("Changing default setting",t,r),n.extend(!0,n.fn[r].settings,t),u&&c&&(e=n(":data(module-"+c+")"),e.length>0&&(f.verbose("Modifying existing settings",e),e[r]("setting",t))))})}},enable:{console:function(){f.console(!0)},debug:function(n,t){n=n||e.modules;f.debug("Enabling debug for modules",n);f.change.setting("debug",!0,n,t)},verbose:function(n,t){n=n||e.modules;f.debug("Enabling verbose debug for modules",n);f.change.setting("verbose",!0,n,t)}},disable:{console:function(){f.console(!1)},debug:function(n,t){n=n||e.modules;f.debug("Disabling debug for modules",n);f.change.setting("debug",!1,n,t)},verbose:function(n,t){n=n||e.modules;f.debug("Disabling verbose debug for modules",n);f.change.setting("verbose",!1,n,t)}},console:function(n){if(n){if(s.cache.console===r){f.error(p.console);return}f.debug("Restoring console function");t.console=s.cache.console}else f.debug("Disabling console function"),s.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){f.verbose("Destroying previous site for",l);l.removeData(v)},cache:{},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,e,t);else if(i!==r)e[t]=i;else return e[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,f,t);else if(i!==r)f[t]=i;else return f[t]},debug:function(){e.debug&&(e.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,e.name+":"),f.debug.apply(console,arguments)))},verbose:function(){e.verbose&&e.debug&&(e.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,e.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,e.name+":");f.error.apply(console,arguments)},performance:{log:function(n){var t,i,r;e.performance&&(t=(new Date).getTime(),r=a||t,i=t-r,a=t,h.push({Element:w,Name:n[0],Arguments:[].slice.call(n,1)||"","Execution Time":i}));clearTimeout(f.performance.timer);f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=e.name+":",i=0;a=!1;clearTimeout(f.performance.timer);n.each(h,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";(console.group!==r||console.table!==r)&&h.length>0&&(console.groupCollapsed(t),console.table?console.table(h):n.each(h,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());h=[]}},invoke:function(t,i,u){var e=s,l,h,c;return i=i||k,u=w||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),l=t.length-1,n.each(t,function(i,u){var o=i!=l?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[o])&&i!=l)e=e[o];else{if(e[o]!==r)return h=e[o],!1;if(n.isPlainObject(e[u])&&i!=l)e=e[u];else return e[u]!==r?(h=e[u],!1):(f.error(p.method,t),!1)}})),n.isFunction(h)?c=h.apply(u,i):h!==r&&(c=h),n.isArray(o)?o.push(c):o!==r?o=[o,c]:c!==r&&(o=c),h}},b?(s===r&&f.initialize(),f.invoke(y)):(s!==r&&f.destroy(),f.initialize()),o!==r?o:this};n.site.settings={name:"Site",namespace:"site",error:{console:"Console cannot be restored, most likely it was overwritten outside of module",method:"The method you called is not defined."},debug:!1,verbose:!1,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}};n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])}})})(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.form=function(t){var e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c=arguments[1],l=typeof h=="string",a=[].slice.call(arguments,1),u;return e.each(function(){var b=n(this),nt=this,ut=[],ft=!1,k,tt,ht,at,ct,vt,yt,y,w,it,p,g,lt,ot,st,et,d,rt,v;v={initialize:function(){v.get.settings();l?(rt===r&&v.instantiate(),v.invoke(h)):(rt!==r&&rt.invoke("destroy"),v.verbose("Initializing form validation",b,y),v.bindEvents(),v.set.defaults(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);rt=v;b.data(et,v)},destroy:function(){v.verbose("Destroying previous module",rt);v.removeEvents();b.removeData(et)},refresh:function(){v.verbose("Refreshing selector cache");k=b.find(p.field);tt=b.find(p.group);ht=b.find(p.message);at=b.find(p.prompt);ct=b.find(p.submit);vt=b.find(p.clear);yt=b.find(p.reset)},submit:function(){v.verbose("Submitting form",b);b.submit()},attachEvents:function(t,i){i=i||"submit";n(t).on("click"+d,function(n){v[i]();n.preventDefault()})},bindEvents:function(){v.verbose("Attaching form events");b.on("submit"+d,v.validate.form).on("blur"+d,p.field,v.event.field.blur).on("click"+d,p.submit,v.submit).on("click"+d,p.reset,v.reset).on("click"+d,p.clear,v.clear);if(y.keyboardShortcuts)b.on("keydown"+d,p.field,v.event.field.keydown);k.each(function(){var t=n(this),i=t.prop("type"),r=v.get.changeEvent(i,t);n(this).on(r+d,v.event.field.change)})},clear:function(){k.each(function(){var t=n(this),i=t.parent(),r=t.closest(tt),f=r.find(p.prompt),u=t.data(it.defaultValue)||"",e=i.is(p.uiCheckbox),o=i.is(p.uiDropdown),s=r.hasClass(g.error);s&&(v.verbose("Resetting error on field",r),r.removeClass(g.error),f.remove());o?(v.verbose("Resetting dropdown value",i,u),i.dropdown("clear")):e?t.prop("checked",!1):(v.verbose("Resetting field value",t,u),t.val(""))})},reset:function(){k.each(function(){var t=n(this),u=t.parent(),f=t.closest(tt),e=f.find(p.prompt),i=t.data(it.defaultValue),o=u.is(p.uiCheckbox),s=u.is(p.uiDropdown),h=f.hasClass(g.error);i!==r&&(h&&(v.verbose("Resetting error on field",f),f.removeClass(g.error),e.remove()),s?(v.verbose("Resetting dropdown value",u,i),u.dropdown("restore defaults")):o?(v.verbose("Resetting checkbox value",u,i),t.prop("checked",i)):(v.verbose("Resetting field value",t,i),t.val(i)))})},determine:{isValid:function(){var t=!0;return n.each(w,function(n,i){v.validate.field(i,n,!0)||(t=!1)}),t}},is:{bracketedRule:function(n){return n.type&&n.type.match(y.regExp.bracket)},shorthandFields:function(n){var t=Object.keys(n),i=n[t[0]];return v.is.shorthandRules(i)},shorthandRules:function(t){return typeof t=="string"||n.isArray(t)},empty:function(n){return n&&n.length!==0?n.is('input[type="checkbox"]')?!n.is(":checked"):v.is.blank(n):!0},blank:function(t){return n.trim(t.val())===""},valid:function(t){var i=!0;return t?(v.verbose("Checking if field is valid",t),v.validate.field(w[t],t,!1)):(v.verbose("Checking if form is valid"),n.each(w,function(n){v.is.valid(n)||(i=!1)}),i)}},removeEvents:function(){b.off(d);k.off(d);ct.off(d);k.off(d)},event:{field:{keydown:function(t){var i=n(this),r=t.which,f=i.is(p.input),e=i.is(p.checkbox),o=i.closest(p.uiDropdown).length>0,u={enter:13,escape:27};if(r==u.escape&&(v.verbose("Escape key pressed blurring field"),i.blur()),!t.ctrlKey&&r==u.enter&&f&&!o&&!e){if(!ft){i.one("keyup"+d,v.event.field.keyup);v.submit();v.debug("Enter pressed on input submitting form")}ft=!0}},keyup:function(){ft=!1},blur:function(){var i=n(this),r=i.closest(tt),t=v.get.validation(i);r.hasClass(g.error)?(v.debug("Revalidating field",i,t),t&&v.validate.field(t)):y.on=="blur"&&t&&v.validate.field(t)},change:function(){var t=n(this),r=t.closest(tt),i=v.get.validation(t);i&&(y.on=="change"||r.hasClass(g.error)&&y.revalidate)&&(clearTimeout(v.timer),v.timer=setTimeout(function(){v.debug("Revalidating field",t,v.get.validation(t));v.validate.field(i)},y.delay))}}},get:{ancillaryValue:function(n){return!n.type||!n.value&&!v.is.bracketedRule(n)?!1:n.value!==r?n.value:n.type.match(y.regExp.bracket)[1]+""},ruleName:function(n){return v.is.bracketedRule(n)?n.type.replace(n.type.match(y.regExp.bracket)[0],""):n.type},changeEvent:function(n,t){return n=="checkbox"||n=="radio"||n=="hidden"||t.is("select")?"change":v.get.inputEvent()},inputEvent:function(){return i.createElement("input").oninput!==r?"input":i.createElement("input").onpropertychange!==r?"propertychange":"keyup"},fieldsFromShorthand:function(t){var i={};return n.each(t,function(t,r){typeof r=="string"&&(r=[r]);i[t]={rules:[]};n.each(r,function(n,r){i[t].rules.push({type:r})})}),i},prompt:function(t,i){var e=v.get.ruleName(t),s=v.get.ancillaryValue(t),u=v.get.field(i.identifier),h=u.val(),r=n.isFunction(t.prompt)?t.prompt(h):t.prompt||y.prompt[e]||y.text.unspecifiedRule,c=r.search("{value}")!==-1,l=r.search("{name}")!==-1,f,o;return c&&(r=r.replace("{value}",u.val())),l&&(f=u.closest(p.group).find("label").eq(0),o=f.length==1?f.text():u.prop("placeholder")||y.text.unspecifiedField,r=r.replace("{name}",o)),r=r.replace("{identifier}",i.identifier),r=r.replace("{ruleValue}",s),t.prompt||v.verbose("Using default validation prompt for type",r,e),r},settings:function(){if(n.isPlainObject(t)){var i=Object.keys(t),u=i.length>0?t[i[0]].identifier!==r&&t[i[0]].rules!==r:!1;u?(y=n.extend(!0,{},n.fn.form.settings,c),w=n.extend({},n.fn.form.settings.defaults,t),v.error(y.error.oldSyntax,nt),v.verbose("Extending settings from legacy parameters",w,y)):(t.fields&&v.is.shorthandFields(t.fields)&&(t.fields=v.get.fieldsFromShorthand(t.fields)),y=n.extend(!0,{},n.fn.form.settings,t),w=n.extend({},n.fn.form.settings.defaults,y.fields),v.verbose("Extending settings",w,y))}else y=n.fn.form.settings,w=n.fn.form.settings.defaults,v.verbose("Using default form validation",w,y);st=y.namespace;it=y.metadata;p=y.selector;g=y.className;lt=y.regExp;ot=y.error;et="module-"+st;d="."+st;rt=b.data(et);v.refresh()},field:function(t){return(v.verbose("Finding field with identifier",t),t=v.escape.string(t),k.filter("#"+t).length>0)?k.filter("#"+t):k.filter('[name="'+t+'"]').length>0?k.filter('[name="'+t+'"]'):k.filter('[name="'+t+'[]"]').length>0?k.filter('[name="'+t+'[]"]'):k.filter("[data-"+it.validate+'="'+t+'"]').length>0?k.filter("[data-"+it.validate+'="'+t+'"]'):n("<input/>")},fields:function(t){var i=n();return n.each(t,function(n,t){i=i.add(v.get.field(t))}),i},validation:function(t){var r,i;return w?(n.each(w,function(n,u){i=u.identifier||n;v.get.field(i)[0]==t[0]&&(u.identifier=i,r=u)}),r||!1):!1},value:function(n){var t=[],i;return t.push(n),i=v.get.values.call(nt,t),i[n]},values:function(t){var u=n.isArray(t)?v.get.fields(t):k,i={};return u.each(function(t,u){var e=n(u),a=e.prop("type"),f=e.prop("name"),o=e.val(),s=e.is(p.checkbox),c=e.is(p.radio),l=f.indexOf("[]")!==-1,h=s?e.is(":checked"):!1;f&&(l?(f=f.replace("[]",""),i[f]||(i[f]=[]),s?h?i[f].push(o||!0):i[f].push(!1):i[f].push(o)):c?(i[f]===r||i[f]==!1)&&(i[f]=h?o||!0:!1):i[f]=s?h?o||!0:!1:o)}),i}},has:{field:function(n){return(v.verbose("Checking for existence of a field with identifier",n),n=v.escape.string(n),typeof n!="string"&&v.error(ot.identifier,n),k.filter("#"+n).length>0)?!0:k.filter('[name="'+n+'"]').length>0||k.filter("[data-"+it.validate+'="'+n+'"]').length>0?!0:!1}},escape:{string:function(n){return n=String(n),n.replace(lt.escape,"\\$&")}},add:{rule:function(n,t){v.add.field(n,t)},field:function(t,i){var r={};v.is.shorthandRules(i)?(i=n.isArray(i)?i:[i],r[t]={rules:[]},n.each(i,function(n,i){r[t].rules.push({type:i})})):r[t]=i;w=n.extend({},w,r);v.debug("Adding rules",r,w)},fields:function(t){var i;i=t&&v.is.shorthandFields(t)?v.get.fieldsFromShorthand(t):t;w=n.extend({},w,i)},prompt:function(t,i){var o=v.get.field(t),f=o.closest(tt),u=f.children(p.prompt),e=u.length!==0;i=typeof i=="string"?[i]:i;v.verbose("Adding field error state",t);f.addClass(g.error);y.inline&&(e||(u=y.templates.prompt(i),u.appendTo(f)),u.html(i[0]),e?v.verbose("Inline errors are disabled, no inline error added",t):y.transition&&n.fn.transition!==r&&b.transition("is supported")?(v.verbose("Displaying error with css transition",y.transition),u.transition(y.transition+" in",y.duration)):(v.verbose("Displaying error with fallback javascript animation"),u.fadeIn(y.duration)))},errors:function(n){v.debug("Adding form error messages",n);v.set.error();ht.html(y.templates.error(n))}},remove:{rule:function(t,i){var u=n.isArray(i)?i:[i];if(i==r){v.debug("Removed all rules");w[t].rules=[];return}w[t]!=r&&n.isArray(w[t].rules)&&n.each(w[t].rules,function(n,i){u.indexOf(i.type)!==-1&&(v.debug("Removed rule",i.type),w[t].rules.splice(n,1))})},field:function(t){var i=n.isArray(t)?t:[t];n.each(i,function(n,t){v.remove.rule(t)})},rules:function(t,i){n.isArray(t)?n.each(fields,function(n,t){v.remove.rule(t,i)}):v.remove.rule(t,i)},fields:function(n){v.remove.field(n)},prompt:function(t){var f=v.get.field(t),u=f.closest(tt),i=u.children(p.prompt);u.removeClass(g.error);y.inline&&i.is(":visible")&&(v.verbose("Removing prompt for field",t),y.transition&&n.fn.transition!==r&&b.transition("is supported")?i.transition(y.transition+" out",y.duration,function(){i.remove()}):i.fadeOut(y.duration,function(){i.remove()}))}},set:{success:function(){b.removeClass(g.error).addClass(g.success)},defaults:function(){k.each(function(){var t=n(this),i=t.filter(p.checkbox).length>0,r=i?t.is(":checked"):t.val();t.data(it.defaultValue,r)})},error:function(){b.removeClass(g.success).addClass(g.error)},value:function(n,t){var i={};return i[n]=t,v.set.values.call(nt,i)},values:function(t){n.isEmptyObject(t)||n.each(t,function(t,i){var u=v.get.field(t),r=u.parent(),o=n.isArray(i),f=r.is(p.uiCheckbox),s=r.is(p.uiDropdown),h=u.is(p.radio)&&f,c=u.length>0,e;c&&(o&&f?(v.verbose("Selecting multiple",i,u),r.checkbox("uncheck"),n.each(i,function(n,t){e=u.filter('[value="'+t+'"]');r=e.parent();e.length>0&&r.checkbox("check")})):h?(v.verbose("Selecting radio value",i,u),u.filter('[value="'+i+'"]').parent(p.uiCheckbox).checkbox("check")):f?(v.verbose("Setting checkbox value",i,r),i===!0?r.checkbox("check"):r.checkbox("uncheck")):s?(v.verbose("Setting dropdown value",i,r),r.dropdown("set selected",i)):(v.verbose("Setting field value",i,u),u.val(i)))})}},validate:{form:function(n,t){var i=v.get.values();if(ft)return!1;if(ut=[],v.determine.isValid()){if(v.debug("Form has no validation errors, submitting"),v.set.success(),t!==!0)return y.onSuccess.call(nt,n,i)}else if(v.debug("Form has errors"),v.set.error(),y.inline||v.add.errors(ut),b.data("moduleApi")!==r&&n.stopImmediatePropagation(),t!==!0)return y.onFailure.call(nt,ut,i)},field:function(t,i,u){u=u!==r?u:!0;typeof t=="string"&&(v.verbose("Validating field",t),i=t,t=w[t]);var f=t.identifier||i,s=v.get.field(f),h=t.depends?v.get.field(t.depends):!1,e=!0,o=[];if(t.identifier||(v.debug("Using field name as identifier",f),t.identifier=f),s.prop("disabled")?(v.debug("Field is disabled. Skipping",f),e=!0):t.optional&&v.is.blank(s)?(v.debug("Field is optional and blank. Skipping",f),e=!0):t.depends&&v.is.empty(h)?(v.debug("Field depends on another value that is not present or empty. Skipping",h),e=!0):t.rules!==r&&n.each(t.rules,function(n,i){v.has.field(f)&&!v.validate.rule(t,i)&&(v.debug("Field is invalid",f,i.type),o.push(v.get.prompt(i,t)),e=!1)}),e)u&&(v.remove.prompt(f,o),y.onValid.call(s));else return u&&(ut=ut.concat(o),v.add.prompt(f,o),y.onInvalid.call(s,o)),!1;return!0},rule:function(t,i){var f=v.get.field(t.identifier),h=i.type,u=f.val(),s=v.get.ancillaryValue(i),e=v.get.ruleName(i),o=y.rules[e];if(!n.isFunction(o)){v.error(ot.noRule,e);return}return u=u===r||u===""||u===null?"":n.trim(u+""),o.call(f,u,s)}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else if(i!==r)y[t]=i;else return y[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else if(i!==r)v[t]=i;else return v[t]},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;y.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=rt,h,o,s;return i=i||a,f=nt||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};v.initialize()}),u!==r?u:this};n.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(t){var i='<ul class="list">';return n.each(t,function(n,t){i+="<li>"+t+"<\/li>"}),i+="<\/ul>",n(i)},prompt:function(t){return n("<div/>").addClass("ui basic red pointing prompt label").html(t[0])}},rules:{empty:function(t){return!(t===r||""===t||n.isArray(t)&&t.length===0)},checked:function(){return n(this).filter(":checked").length>0},email:function(t){return n.fn.form.settings.regExp.email.test(t)},url:function(t){return n.fn.form.settings.regExp.url.test(t)},regExp:function(t,i){if(i instanceof RegExp)return t.match(i);var r=i.match(n.fn.form.settings.regExp.flags),u;return r&&(i=r.length>=2?r[1]:i,u=r.length>=3?r[2]:""),t.match(new RegExp(i,u))},integer:function(t,i){var f=n.fn.form.settings.regExp.integer,e,o,u;return i&&["",".."].indexOf(i)===-1&&(i.indexOf("..")==-1?f.test(i)&&(e=o=+i):(u=i.split("..",2),f.test(u[0])&&(e=u[0]-0),f.test(u[1])&&(o=u[1]-0))),f.test(t)&&(e===r||t>=e)&&(o===r||t<=o)},decimal:function(t){return n.fn.form.settings.regExp.decimal.test(t)},number:function(t){return n.fn.form.settings.regExp.number.test(t)},is:function(n,t){return t=typeof t=="string"?t.toLowerCase():t,n=typeof n=="string"?n.toLowerCase():n,n==t},isExactly:function(n,t){return n==t},not:function(n,t){return n=typeof n=="string"?n.toLowerCase():n,t=typeof t=="string"?t.toLowerCase():t,n!=t},notExactly:function(n,t){return n!=t},contains:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),t.search(new RegExp(i,"i"))!==-1},containsExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),t.search(new RegExp(i))!==-1},doesntContain:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),t.search(new RegExp(i,"i"))===-1},doesntContainExactly:function(t,i){return i=i.replace(n.fn.form.settings.regExp.escape,"\\$&"),t.search(new RegExp(i))===-1},minLength:function(n,t){return n!==r?n.length>=t:!1},length:function(n,t){return n!==r?n.length>=t:!1},exactLength:function(n,t){return n!==r?n.length==t:!1},maxLength:function(n,t){return n!==r?n.length<=t:!1},match:function(t,i){var f=n(this),u;return n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r?t.toString()==u.toString():!1},different:function(t,i){var f=n(this),u;return n('[data-validate="'+i+'"]').length>0?u=n('[data-validate="'+i+'"]').val():n("#"+i).length>0?u=n("#"+i).val():n('[name="'+i+'"]').length>0?u=n('[name="'+i+'"]').val():n('[name="'+i+'[]"]').length>0&&(u=n('[name="'+i+'[]"]')),u!==r?t.toString()!==u.toString():!1},creditCard:function(t,i){var u={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]}},f={},s=!1,h=typeof i=="string"?i.split(","):!1,e,r;if(typeof t=="string"&&t.length!==0){if(t=t.replace(/[\-]/g,""),h&&(n.each(h,function(i,e){r=u[e];r&&(f={length:n.inArray(t.length,r.length)!==-1,pattern:t.search(r.pattern)!==-1},f.length&&f.pattern&&(s=!0))}),!s))return!1;if(e={number:n.inArray(t.length,u.unionPay.length)!==-1,pattern:t.search(u.unionPay.pattern)!==-1},e.number&&e.pattern)return!0;for(var c=t.length,l=0,a=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],o=0;c--;)o+=a[l][parseInt(t.charAt(c),10)],l^=1;return o%10==0&&o>0}},minCount:function(n,t){return t==0?!0:t==1?n!=="":n.split(",").length>=t},exactCount:function(n,t){return t==0?n==="":t==1?n!==""&&n.search(",")===-1:n.split(",").length==t},maxCount:function(n,t){return t==0?!1:t==1?n.search(",")===-1:n.split(",").length<=t}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.accordion=function(i){var o=n(this),e=(new Date).getTime(),f=[],s=arguments[0],h=typeof s=="string",c=[].slice.call(arguments,1),l=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},u;return o.each(function(){var l=n.isPlainObject(i)?n.extend(!0,{},n.fn.accordion.settings,i):n.extend({},n.fn.accordion.settings),v=l.className,tt=l.namespace,y=l.selector,ut=l.error,it="."+tt,d="module-"+tt,rt=o.selector||"",p=n(this),b=p.find(y.title),w=p.find(y.content),g=this,k=p.data(d),nt,a;a={initialize:function(){a.debug("Initializing",p);a.bind.events();l.observeChanges&&a.observeChanges();a.instantiate()},instantiate:function(){k=a;p.data(d,a)},destroy:function(){a.debug("Destroying previous instance",p);p.off(it).removeData(d)},refresh:function(){b=p.find(y.title);w=p.find(y.content)},observeChanges:function(){"MutationObserver"in t&&(nt=new MutationObserver(function(){a.debug("DOM tree modified, updating selector cache");a.refresh()}),nt.observe(g,{childList:!0,subtree:!0}),a.debug("Setting up mutation observer",nt))},bind:{events:function(){a.debug("Binding delegated events");p.on(l.on+it,y.trigger,a.event.click)}},event:{click:function(){a.toggle.call(this)}},toggle:function(t){var i=t!==r?typeof t=="number"?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),u=i.next(w),f=u.hasClass(v.animating),e=u.hasClass(v.active),o=e&&!f,s=!e&&f;a.debug("Toggling visibility of content",i);o||s?l.collapsible?a.close.call(i):a.debug("Cannot close accordion content collapsing is disabled"):a.open.call(i)},open:function(t){var u=t!==r?typeof t=="number"?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),i=u.next(w),f=i.hasClass(v.animating),e=i.hasClass(v.active),o=e||f;if(o){a.debug("Accordion already open, skipping",i);return}a.debug("Opening accordion content",u);l.onOpening.call(i);l.onChanging.call(i);l.exclusive&&a.closeOthers.call(u);u.addClass(v.active);i.stop(!0,!0).addClass(v.animating);l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration}):i.children().stop(!0,!0).animate({opacity:1},l.duration,a.resetOpacity));i.slideDown(l.duration,l.easing,function(){i.removeClass(v.animating).addClass(v.active);a.reset.display.call(this);l.onOpen.call(this);l.onChange.call(this)})},close:function(t){var f=t!==r?typeof t=="number"?b.eq(t):n(t).closest(y.title):n(this).closest(y.title),i=f.next(w),e=i.hasClass(v.animating),u=i.hasClass(v.active),o=!u&&e,s=u&&e;(u||o)&&!s&&(a.debug("Closing accordion content",i),l.onClosing.call(i),l.onChanging.call(i),f.removeClass(v.active),i.stop(!0,!0).addClass(v.animating),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?i.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration}):i.children().stop(!0,!0).animate({opacity:0},l.duration,a.resetOpacity)),i.slideUp(l.duration,l.easing,function(){i.removeClass(v.animating).removeClass(v.active);a.reset.display.call(this);l.onClose.call(this);l.onChange.call(this)}))},closeOthers:function(t){var s=t!==r?b.eq(t):n(this).closest(y.title),f=s.parents(y.content).prev(y.title),e=s.closest(y.accordion),o=y.title+"."+v.active+":visible",c=y.content+"."+v.active+":visible",i,h,u;l.closeNested?(i=e.find(o).not(f),u=i.next(w)):(i=e.find(o).not(f),h=e.find(c).find(o).not(f),i=i.not(h),u=i.next(w));i.length>0&&(a.debug("Exclusive enabled, closing other content",i),i.removeClass(v.active),u.removeClass(v.animating).stop(!0,!0),l.animateChildren&&(n.fn.transition!==r&&p.transition("is supported")?u.children().transition({animation:"fade out",useFailSafe:!0,debug:l.debug,verbose:l.verbose,duration:l.duration}):u.children().stop(!0,!0).animate({opacity:0},l.duration,a.resetOpacity)),u.slideUp(l.duration,l.easing,function(){n(this).removeClass(v.active);a.reset.display.call(this)}))},reset:{display:function(){a.verbose("Removing inline display from element",this);n(this).css("display","");n(this).attr("style")===""&&n(this).attr("style","").removeAttr("style")},opacity:function(){a.verbose("Removing inline opacity from element",this);n(this).css("opacity","");n(this).attr("style")===""&&n(this).attr("style","").removeAttr("style")}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,l,t);else if(i!==r)n.isPlainObject(l[t])?n.extend(!0,l[t],i):l[t]=i;else return l[t]},internal:function(t,i){if(a.debug("Changing internal",t,i),i!==r)n.isPlainObject(t)?n.extend(!0,a,t):a[t]=i;else return a[t]},debug:function(){!l.silent&&l.debug&&(l.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,l.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),a.verbose.apply(console,arguments)))},error:function(){l.silent||(a.error=Function.prototype.bind.call(console.error,console,l.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;l.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=l.name+":",i=0;e=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";rt&&(t+=" '"+rt+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=k,h,o,s;return i=i||c,f=g||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):(a.error(ut.method,t),!1)}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};h?(k===r&&a.initialize(),a.invoke(s)):(k!==r&&k.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}};n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.checkbox=function(u){var s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=arguments[0],l=typeof c=="string",a=[].slice.call(arguments,1),f;return s.each(function(){var v=n.extend(!0,{},n.fn.checkbox.settings,u),b=v.className,et=v.namespace,k=v.selector,ot=v.error,d="."+et,rt="module-"+et,p=n(this),g=n(this).children(k.label),y=n(this).children(k.input),w=y[0],tt=!1,it=!1,nt=p.data(rt),ut,ft=this,s;s={initialize:function(){s.verbose("Initializing checkbox",v);s.create.label();s.bind.events();s.set.tabbable();s.hide.input();s.observeChanges();s.instantiate();s.setup()},instantiate:function(){s.verbose("Storing instance of module",s);nt=s;p.data(rt,s)},destroy:function(){s.verbose("Destroying module");s.unbind.events();s.show.input();p.removeData(rt)},fix:{reference:function(){p.is(k.input)&&(s.debug("Behavior called on <input> adjusting invoked element"),p=p.closest(k.checkbox),s.refresh())}},setup:function(){s.set.initialLoad();s.is.indeterminate()?(s.debug("Initial value is indeterminate"),s.indeterminate()):s.is.checked()?(s.debug("Initial value is checked"),s.check()):(s.debug("Initial value is unchecked"),s.uncheck());s.remove.initialLoad()},refresh:function(){g=p.children(k.label);y=p.children(k.input);w=y[0]},hide:{input:function(){s.verbose("Modifying <input> z-index to be unselectable");y.addClass(b.hidden)}},show:{input:function(){s.verbose("Modifying <input> z-index to be selectable");y.removeClass(b.hidden)}},observeChanges:function(){"MutationObserver"in t&&(ut=new MutationObserver(function(){s.debug("DOM tree modified, updating selector cache");s.refresh()}),ut.observe(ft,{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",ut))},attachEvents:function(t,i){var r=n(t);if(i=n.isFunction(s[i])?s[i]:s.toggle,r.length>0){s.debug("Attaching checkbox events to element",t,i);r.on("click"+d,i)}else s.error(ot.notFound)},event:{click:function(t){var i=n(t.target);if(i.is(k.input)){s.verbose("Using default check action on initialized checkbox");return}if(i.is(k.link)){s.debug("Clicking link inside checkbox, skipping toggle");return}s.toggle();y.focus();t.preventDefault()},keydown:function(n){var t=n.which,i={enter:13,space:32,escape:27};t==i.escape?(s.verbose("Escape key pressed blurring field"),y.blur(),it=!0):n.ctrlKey||t!=i.space&&t!=i.enter?it=!1:(s.verbose("Enter/space key pressed, toggling checkbox"),s.toggle(),it=!0)},keyup:function(n){it&&n.preventDefault()}},check:function(){s.should.allowCheck()&&(s.debug("Checking checkbox",y),s.set.checked(),s.should.ignoreCallbacks()||(v.onChecked.call(w),v.onChange.call(w)))},uncheck:function(){s.should.allowUncheck()&&(s.debug("Unchecking checkbox"),s.set.unchecked(),s.should.ignoreCallbacks()||(v.onUnchecked.call(w),v.onChange.call(w)))},indeterminate:function(){if(s.should.allowIndeterminate()){s.debug("Checkbox is already indeterminate");return}s.debug("Making checkbox indeterminate");s.set.indeterminate();s.should.ignoreCallbacks()||(v.onIndeterminate.call(w),v.onChange.call(w))},determinate:function(){if(s.should.allowDeterminate()){s.debug("Checkbox is already determinate");return}s.debug("Making checkbox determinate");s.set.determinate();s.should.ignoreCallbacks()||(v.onDeterminate.call(w),v.onChange.call(w))},enable:function(){if(s.is.enabled()){s.debug("Checkbox is already enabled");return}s.debug("Enabling checkbox");s.set.enabled();v.onEnable.call(w);v.onEnabled.call(w)},disable:function(){if(s.is.disabled()){s.debug("Checkbox is already disabled");return}s.debug("Disabling checkbox");s.set.disabled();v.onDisable.call(w);v.onDisabled.call(w)},get:{radios:function(){var t=s.get.name();return n('input[name="'+t+'"]').closest(k.checkbox)},otherRadios:function(){return s.get.radios().not(p)},name:function(){return y.attr("name")}},is:{initialLoad:function(){return tt},radio:function(){return y.hasClass(b.radio)||y.attr("type")=="radio"},indeterminate:function(){return y.prop("indeterminate")!==r&&y.prop("indeterminate")},checked:function(){return y.prop("checked")!==r&&y.prop("checked")},disabled:function(){return y.prop("disabled")!==r&&y.prop("disabled")},enabled:function(){return!s.is.disabled()},determinate:function(){return!s.is.indeterminate()},unchecked:function(){return!s.is.checked()}},should:{allowCheck:function(){return s.is.determinate()&&s.is.checked()&&!s.should.forceCallbacks()?(s.debug("Should not allow check, checkbox is already checked"),!1):v.beforeChecked.apply(w)===!1?(s.debug("Should not allow check, beforeChecked cancelled"),!1):!0},allowUncheck:function(){return s.is.determinate()&&s.is.unchecked()&&!s.should.forceCallbacks()?(s.debug("Should not allow uncheck, checkbox is already unchecked"),!1):v.beforeUnchecked.apply(w)===!1?(s.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1):!0},allowIndeterminate:function(){return s.is.indeterminate()&&!s.should.forceCallbacks()?(s.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):v.beforeIndeterminate.apply(w)===!1?(s.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1):!0},allowDeterminate:function(){return s.is.determinate()&&!s.should.forceCallbacks()?(s.debug("Should not allow determinate, checkbox is already determinate"),!1):v.beforeDeterminate.apply(w)===!1?(s.debug("Should not allow determinate, beforeDeterminate cancelled"),!1):!0},forceCallbacks:function(){return s.is.initialLoad()&&v.fireOnInit},ignoreCallbacks:function(){return tt&&!v.fireOnInit}},can:{change:function(){return!(p.hasClass(b.disabled)||p.hasClass(b.readOnly)||y.prop("disabled")||y.prop("readonly"))},uncheck:function(){return typeof v.uncheckable=="boolean"?v.uncheckable:!s.is.radio()}},set:{initialLoad:function(){tt=!0},checked:function(){if(s.verbose("Setting class to checked"),p.removeClass(b.indeterminate).addClass(b.checked),s.is.radio()&&s.uncheckOthers(),!s.is.indeterminate()&&s.is.checked()){s.debug("Input is already checked, skipping input property change");return}s.verbose("Setting state to checked",w);y.prop("indeterminate",!1).prop("checked",!0);s.trigger.change()},unchecked:function(){if(s.verbose("Removing checked class"),p.removeClass(b.indeterminate).removeClass(b.checked),!s.is.indeterminate()&&s.is.unchecked()){s.debug("Input is already unchecked");return}s.debug("Setting state to unchecked");y.prop("indeterminate",!1).prop("checked",!1);s.trigger.change()},indeterminate:function(){if(s.verbose("Setting class to indeterminate"),p.addClass(b.indeterminate),s.is.indeterminate()){s.debug("Input is already indeterminate, skipping input property change");return}s.debug("Setting state to indeterminate");y.prop("indeterminate",!0);s.trigger.change()},determinate:function(){if(s.verbose("Removing indeterminate class"),p.removeClass(b.indeterminate),s.is.determinate()){s.debug("Input is already determinate, skipping input property change");return}s.debug("Setting state to determinate");y.prop("indeterminate",!1)},disabled:function(){if(s.verbose("Setting class to disabled"),p.addClass(b.disabled),s.is.disabled()){s.debug("Input is already disabled, skipping input property change");return}s.debug("Setting state to disabled");y.prop("disabled","disabled");s.trigger.change()},enabled:function(){if(s.verbose("Removing disabled class"),p.removeClass(b.disabled),s.is.enabled()){s.debug("Input is already enabled, skipping input property change");return}s.debug("Setting state to enabled");y.prop("disabled",!1);s.trigger.change()},tabbable:function(){s.verbose("Adding tabindex to checkbox");y.attr("tabindex")===r&&y.attr("tabindex",0)}},remove:{initialLoad:function(){tt=!1}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=y[0];t&&(s.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},create:{label:function(){y.prevAll(k.label).length>0?(y.prev(k.label).detach().insertAfter(y),s.debug("Moving existing label",g)):s.has.label()||(g=n("<label>").insertAfter(y),s.debug("Creating label",g))}},has:{label:function(){return g.length>0}},bind:{events:function(){s.verbose("Attaching checkbox events");p.on("click"+d,s.event.click).on("keydown"+d,k.input,s.event.keydown).on("keyup"+d,k.input,s.event.keyup)}},unbind:{events:function(){s.debug("Removing events");p.off(d)}},uncheckOthers:function(){var n=s.get.otherRadios();s.debug("Unchecking other radios",n);n.removeClass(b.checked)},toggle:function(){if(!s.can.change()){s.is.radio()||s.debug("Checkbox is read-only or disabled, ignoring toggle");return}s.is.indeterminate()||s.is.unchecked()?(s.debug("Currently unchecked"),s.check()):s.is.checked()&&s.can.uncheck()&&(s.debug("Currently checked"),s.uncheck())},setting:function(t,i){if(s.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else if(i!==r)n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i;else return v[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else if(i!==r)s[t]=i;else return s[t]},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;v.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ft,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=nt,c,o,h;return i=i||a,u=ft||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=c)e=e[u];else return e[u]!==r?(o=e[u],!1):(s.error(ot.method,t),!1)}})),n.isFunction(o)?h=o.apply(u,i):o!==r&&(h=o),n.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),o}};l?(nt===r&&s.initialize(),s.invoke(c)):(nt!==r&&nt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.dimmer=function(t){var e=n(this),o=(new Date).getTime(),f=[],s=arguments[0],h=typeof s=="string",c=[].slice.call(arguments,1),u;return e.each(function(){var a=n.isPlainObject(t)?n.extend(!0,{},n.fn.dimmer.settings,t):n.extend({},n.fn.dimmer.settings),b=a.selector,tt=a.namespace,p=a.className,ut=a.error,k="."+tt,nt="module-"+tt,it=e.selector||"",rt="ontouchstart"in i.documentElement?"touchstart":"click",w=n(this),v,y,d=this,g=w.data(nt),l;l={preinitialize:function(){l.is.dimmer()?(y=w.parent(),v=w):(y=w,v=l.has.dimmer()?a.dimmerName?y.find(b.dimmer).filter("."+a.dimmerName):y.find(b.dimmer):l.create(),l.set.variation())},initialize:function(){l.debug("Initializing dimmer",a);l.bind.events();l.set.dimmable();l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);g=l;w.data(nt,g)},destroy:function(){l.verbose("Destroying previous module",v);l.unbind.events();l.remove.variation();y.off(k)},bind:{events:function(){if(l.is.page()&&y.get(0).addEventListener("touchmove",l.event.preventScroll,{passive:!1}),a.on=="hover")y.on("mouseenter"+k,l.show).on("mouseleave"+k,l.hide);else if(a.on=="click")y.on(rt+k,l.toggle);if(l.is.page()&&(l.debug("Setting as a page dimmer",y),l.set.pageDimmer()),l.is.closable()){l.verbose("Adding dimmer close event",v);y.on(rt+k,b.dimmer,l.event.click)}}},unbind:{events:function(){l.is.page()&&y.get(0).removeEventListener("touchmove",l.event.preventScroll,{passive:!1});w.removeData(nt);y.off(k)}},event:{click:function(t){l.verbose("Determining if event occured on dimmer",t);(v.find(t.target).length===0||n(t.target).is(b.content))&&(l.hide(),t.stopImmediatePropagation())},preventScroll:function(n){n.preventDefault()}},addContent:function(t){var i=n(t);l.debug("Add content to dimmer",i);i.parent()[0]!==v[0]&&i.detach().appendTo(v)},create:function(){var t=n(a.template.dimmer());return a.dimmerName&&(l.debug("Creating named dimmer",a.dimmerName),t.addClass(a.dimmerName)),t.appendTo(y),t},show:function(t){t=n.isFunction(t)?t:function(){};l.debug("Showing dimmer",v,a);(!l.is.dimmed()||l.is.animating())&&l.is.enabled()?(l.animate.show(t),a.onShow.call(d),a.onChange.call(d)):l.debug("Dimmer is already shown or disabled")},hide:function(t){t=n.isFunction(t)?t:function(){};l.is.dimmed()||l.is.animating()?(l.debug("Hiding dimmer",v),l.animate.hide(t),a.onHide.call(d),a.onChange.call(d)):l.debug("Dimmer is not visible")},toggle:function(){l.verbose("Toggling dimmer visibility",v);l.is.dimmed()?l.hide():l.show()},animate:{show:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?(a.opacity!=="auto"&&l.set.opacity(),v.transition({displayType:"flex",animation:a.transition+" in",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.set.dimmed()},onComplete:function(){l.set.active();t()}})):(l.verbose("Showing dimmer animation with javascript"),l.set.dimmed(),a.opacity=="auto"&&(a.opacity=.8),v.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(l.get.duration(),a.opacity,function(){v.removeAttr("style");l.set.active();t()}))},hide:function(t){t=n.isFunction(t)?t:function(){};a.useCSS&&n.fn.transition!==r&&v.transition("is supported")?(l.verbose("Hiding dimmer with css"),v.transition({displayType:"flex",animation:a.transition+" out",queue:!1,duration:l.get.duration(),useFailSafe:!0,onStart:function(){l.remove.dimmed()},onComplete:function(){l.remove.active();t()}})):(l.verbose("Hiding dimmer with javascript"),l.remove.dimmed(),v.stop().fadeOut(l.get.duration(),function(){l.remove.active();v.removeAttr("style");t()}))}},get:{dimmer:function(){return v},duration:function(){return typeof a.duration=="object"?l.is.active()?a.duration.hide:a.duration.show:a.duration}},has:{dimmer:function(){return a.dimmerName?w.find(b.dimmer).filter("."+a.dimmerName).length>0:w.find(b.dimmer).length>0}},is:{active:function(){return v.hasClass(p.active)},animating:function(){return v.is(":animated")||v.hasClass(p.animating)},closable:function(){return a.closable=="auto"?a.on=="hover"?!1:!0:a.closable},dimmer:function(){return w.hasClass(p.dimmer)},dimmable:function(){return w.hasClass(p.dimmable)},dimmed:function(){return y.hasClass(p.dimmed)},disabled:function(){return y.hasClass(p.disabled)},enabled:function(){return!l.is.disabled()},page:function(){return y.is("body")},pageDimmer:function(){return v.hasClass(p.pageDimmer)}},can:{show:function(){return!v.hasClass(p.disabled)}},set:{opacity:function(n){var i=v.css("background-color"),t=i.split(","),r=t&&t.length==3,u=t&&t.length==4;n=a.opacity===0?0:a.opacity||n;r||u?(t[3]=n+")",i=t.join(",")):i="rgba(0, 0, 0, "+n+")";l.debug("Setting opacity to",n);v.css("background-color",i)},active:function(){v.addClass(p.active)},dimmable:function(){y.addClass(p.dimmable)},dimmed:function(){y.addClass(p.dimmed)},pageDimmer:function(){v.addClass(p.pageDimmer)},disabled:function(){v.addClass(p.disabled)},variation:function(n){n=n||a.variation;n&&v.addClass(n)}},remove:{active:function(){v.removeClass(p.active)},dimmed:function(){y.removeClass(p.dimmed)},disabled:function(){v.removeClass(p.disabled)},variation:function(n){n=n||a.variation;n&&v.removeClass(n)}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else if(i!==r)n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i;else return a[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else if(i!==r)l[t]=i;else return l[t]},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;o=!1;clearTimeout(l.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";it&&(t+=" '"+it+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=g,h,o,s;return i=i||c,f=d||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):(l.error(ut.method,t),!1)}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};l.preinitialize();h?(g===r&&l.initialize(),l.invoke(s)):(g!==r&&g.invoke("destroy"),l.initialize())}),u!==r?u:this};n.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!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",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return n("<div />").attr("class","ui dimmer")}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.dropdown=function(u){var e=n(this),o=n(i),l=e.selector||"",h="ontouchstart"in i.documentElement,c=(new Date).getTime(),s=[],a=arguments[0],v=typeof a=="string",y=[].slice.call(arguments,1),f;return e.each(function(p){var b=n.isPlainObject(u)?n.extend(!0,{},n.fn.dropdown.settings,u):n.extend({},n.fn.dropdown.settings),k=b.className,ct=b.message,ri=b.fields,ft=b.keys,rt=b.metadata,si=b.namespace,dt=b.regExp,g=b.selector,vt=b.error,ui=b.templates,tt="."+si,wt="module-"+si,d=n(this),ht=n(b.context),st=d.find(g.text),et=d.find(g.search),gt=d.find(g.sizer),ut=d.find(g.input),hi=d.find(g.icon),ni=d.prev().find(g.text).length>0?d.prev().find(g.text):d.prev(),nt=d.children(g.menu),it=nt.find(g.item),yt=!1,fi=!1,ei=!1,ot=this,pt=d.data(wt),oi,bt,ti,lt,ii,at,kt,w;w={initialize:function(){w.debug("Initializing dropdown",b);w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),b.values&&w.change.values(b.values),w.refreshData(),w.save.defaults(),w.restore.selected(),w.create.id(),w.bind.events(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w);pt=w;d.data(wt,w)},destroy:function(){w.verbose("Destroying previous dropdown",d);w.remove.tabbable();d.off(tt).removeData(wt);nt.off(tt);o.off(lt);w.disconnect.menuObserver();w.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in t&&(at=new MutationObserver(w.event.select.mutation),kt=new MutationObserver(w.event.menu.mutation),w.debug("Setting up mutation observer",at,kt),w.observe.select(),w.observe.menu())},disconnect:{menuObserver:function(){kt&&kt.disconnect()},selectObserver:function(){at&&at.disconnect()}},observe:{select:function(){w.has.input()&&at.observe(d[0],{childList:!0,subtree:!0})},menu:function(){w.has.menu()&&kt.observe(nt[0],{childList:!0,subtree:!0})}},create:{id:function(){ii=(Math.random().toString(16)+"000000000").substr(2,8);lt="."+ii;w.verbose("Creating unique id for element",ii)},userChoice:function(t){var u,i,f;return(t=t||w.get.userValues(),!t)?!1:(t=n.isArray(t)?t:[t],n.each(t,function(t,e){w.get.item(e)===!1&&(f=b.templates.addition(w.add.variables(ct.addResult,e)),i=n("<div />").html(f).attr("data-"+rt.value,e).attr("data-"+rt.text,e).addClass(k.addition).addClass(k.item),b.hideAdditions&&i.addClass(k.hidden),u=u===r?i:u.add(i),w.verbose("Creating user choices for value",e,i))}),u)},userLabels:function(){var t=w.get.userValues();t&&(w.debug("Adding user labels",t),n.each(t,function(n,t){w.verbose("Adding custom user value");w.add.label(t,t)}))},menu:function(){nt=n("<div />").addClass(k.menu).appendTo(d)},sizer:function(){gt=n("<span />").addClass(k.sizer).insertAfter(et)}},search:function(n){n=n!==r?n:w.get.query();w.verbose("Searching for query",n);w.has.minCharacters(n)?w.filter(n):w.hide()},select:{firstUnfiltered:function(){w.verbose("Selecting first non-filtered element");w.remove.selectedItem();it.not(g.unselectable).not(g.addition+g.hidden).eq(0).addClass(k.selected)},nextAvailable:function(n){n=n.eq(0);var t=n.nextAll(g.item).not(g.unselectable).eq(0),i=n.prevAll(g.item).not(g.unselectable).eq(0),r=t.length>0;r?(w.verbose("Moving selection to",t),t.addClass(k.selected)):(w.verbose("Moving selection to",i),i.addClass(k.selected))}},setup:{api:function(){var n={debug:b.debug,urlData:{value:w.get.value(),query:w.get.query()},on:!1};w.verbose("First request, initializing API");d.api(n)},layout:function(){d.is("select")&&(w.setup.select(),w.setup.returnedObject());w.has.menu()||w.create.menu();w.is.search()&&!w.has.search()&&(w.verbose("Adding search input"),et=n("<input />").addClass(k.search).prop("autocomplete","off").insertBefore(st));w.is.multiple()&&w.is.searchSelection()&&!w.has.sizer()&&w.create.sizer();b.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t);d.is("select")&&(ut=d);ut.parent(g.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),d=ut.closest(g.dropdown),w.has.menu()||w.create.menu(),nt=d.children(g.menu),w.setup.menu(t)):(w.debug("Creating entire dropdown from select"),d=n("<div />").attr("class",ut.attr("class")).addClass(k.selection).addClass(k.dropdown).html(ui.dropdown(t)).insertBefore(ut),ut.hasClass(k.multiple)&&ut.prop("multiple")===!1&&(w.error(vt.missingMultiple),ut.prop("multiple",!0)),ut.is("[multiple]")&&w.set.multiple(),ut.prop("disabled")&&(w.debug("Disabling dropdown"),d.addClass(k.disabled)),ut.removeAttr("class").detach().prependTo(d));w.refresh()},menu:function(n){nt.html(ui.menu(n,ri));it=nt.find(g.item)},reference:function(){w.debug("Dropdown behavior was called on select, replacing with closest dropdown");d=d.parent(g.dropdown);pt=d.data(wt);ot=d.get(0);w.refresh();w.setup.returnedObject()},returnedObject:function(){var n=e.slice(0,p),t=e.slice(p+1);e=n.add(d).add(t)}},refresh:function(){w.refreshSelectors();w.refreshData()},refreshItems:function(){it=nt.find(g.item)},refreshSelectors:function(){w.verbose("Refreshing selector cache");st=d.find(g.text);et=d.find(g.search);ut=d.find(g.input);hi=d.find(g.icon);ni=d.prev().find(g.text).length>0?d.prev().find(g.text):d.prev();nt=d.children(g.menu);it=nt.find(g.item)},refreshData:function(){w.verbose("Refreshing cached metadata");it.removeData(rt.text).removeData(rt.value)},clearData:function(){w.verbose("Clearing metadata");it.removeData(rt.text).removeData(rt.value);d.removeData(rt.defaultText).removeData(rt.defaultValue).removeData(rt.placeholderText)},toggle:function(){w.verbose("Toggling menu visibility");w.is.active()?w.hide():w.show()},show:function(t){if(t=n.isFunction(t)?t:function(){},!w.can.show()&&w.is.remote()&&(w.debug("No API results retrieved, searching before show"),w.queryRemote(w.get.query(),w.show)),w.can.show()&&!w.is.active()){if(w.debug("Showing dropdown"),!w.has.message()||w.has.maxSelections()||w.has.allResultsFiltered()||w.remove.message(),w.is.allFiltered())return!0;b.onShow.call(ot)!==!1&&w.animate.show(function(){w.can.click()&&w.bind.intent();w.has.menuSearch()&&w.focusSearch();w.set.visible();t.call(ot)})}},hide:function(t){t=n.isFunction(t)?t:function(){};w.is.active()&&!w.is.animatingOutward()&&(w.debug("Hiding dropdown"),b.onHide.call(ot)!==!1&&w.animate.hide(function(){w.remove.visible();t.call(ot)}))},hideOthers:function(){w.verbose("Finding other dropdowns to hide");e.not(d).has(g.menu+"."+k.visible).dropdown("hide")},hideMenu:function(){w.verbose("Hiding menu  instantaneously");w.remove.active();w.remove.visible();nt.transition("hide")},hideSubMenus:function(){var n=nt.children(g.item).find(g.menu);w.verbose("Hiding sub menus",n);n.transition("hide")},bind:{events:function(){h&&w.bind.touchEvents();w.bind.keyboardEvents();w.bind.inputEvents();w.bind.mouseEvents()},touchEvents:function(){if(w.debug("Touch device detected binding additional touch events"),!w.is.searchSelection()&&w.is.single())d.on("touchstart"+tt,w.event.test.toggle);nt.on("touchstart"+tt,g.item,w.event.item.mouseenter)},keyboardEvents:function(){w.verbose("Binding keyboard events");d.on("keydown"+tt,w.event.keydown);if(w.has.search())d.on(w.get.inputEvent()+tt,g.search,w.event.input);if(w.is.multiple())o.on("keydown"+lt,w.event.document.keydown)},inputEvents:function(){w.verbose("Binding input change events");d.on("change"+tt,g.input,w.event.change)},mouseEvents:function(){if(w.verbose("Binding mouse events"),w.is.multiple())d.on("click"+tt,g.label,w.event.label.click).on("click"+tt,g.remove,w.event.remove.click);if(w.is.searchSelection()){d.on("mousedown"+tt,w.event.mousedown).on("mouseup"+tt,w.event.mouseup).on("mousedown"+tt,g.menu,w.event.menu.mousedown).on("mouseup"+tt,g.menu,w.event.menu.mouseup).on("click"+tt,g.icon,w.event.icon.click).on("focus"+tt,g.search,w.event.search.focus).on("click"+tt,g.search,w.event.search.focus).on("blur"+tt,g.search,w.event.search.blur).on("click"+tt,g.text,w.event.text.focus);if(w.is.multiple())d.on("click"+tt,w.event.click)}else{if(b.on=="click")d.on("click"+tt,g.icon,w.event.icon.click).on("click"+tt,w.event.test.toggle);else if(b.on=="hover")d.on("mouseenter"+tt,w.delay.show).on("mouseleave"+tt,w.delay.hide);else d.on(b.on+tt,w.toggle);d.on("mousedown"+tt,w.event.mousedown).on("mouseup"+tt,w.event.mouseup).on("focus"+tt,w.event.focus);if(w.has.menuSearch())d.on("blur"+tt,g.search,w.event.search.blur);else d.on("blur"+tt,w.event.blur)}nt.on("mouseenter"+tt,g.item,w.event.item.mouseenter).on("mouseleave"+tt,g.item,w.event.item.mouseleave).on("click"+tt,g.item,w.event.item.click)},intent:function(){if(w.verbose("Binding hide intent event to document"),h)o.on("touchstart"+lt,w.event.test.touch).on("touchmove"+lt,w.event.test.touch);o.on("click"+lt,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document");h&&o.off("touchstart"+lt).off("touchmove"+lt);o.off("click"+lt)}},filter:function(n){var t=n!==r?n:w.get.query(),i=function(){w.is.multiple()&&w.filterActive();(n||!n&&w.get.activeItem().length==0)&&w.select.firstUnfiltered();w.has.allResultsFiltered()?b.onNoResults.call(ot,t)?b.allowAdditions?b.hideAdditions&&(w.verbose("User addition with no menu, setting empty style"),w.set.empty(),w.hideMenu()):(w.verbose("All items filtered, showing message",t),w.add.message(ct.noResults)):(w.verbose("All items filtered, hiding dropdown",t),w.hideMenu()):(w.remove.empty(),w.remove.message());b.allowAdditions&&w.add.userSuggestion(n);w.is.searchSelection()&&w.can.show()&&w.is.focusedOnSearch()&&w.show()};b.useLabels&&w.has.maxSelections()||(b.apiSettings?w.can.useAPI()?w.queryRemote(t,function(){b.filterRemoteData&&w.filterItems(t);i()}):w.error(vt.noAPI):(w.filterItems(t),i()))},queryRemote:function(t,i){var r={errorDuration:!1,cache:"local",throttle:b.throttle,urlData:{query:t},onError:function(){w.add.message(ct.serverError);i()},onFailure:function(){w.add.message(ct.serverError);i()},onSuccess:function(t){var r=t[ri.remoteValues],u=n.isArray(r)&&r.length>0;u?(w.remove.message(),w.setup.menu({values:t[ri.remoteValues]})):w.add.message(ct.noResults);i()}};d.api("get request")||w.setup.api();r=n.extend(!0,{},r,b.apiSettings);d.api("setting",r).api("query")},filterItems:function(t){var u=t!==r?t:w.get.query(),i=null,e=w.escape.string(u),f=new RegExp("^"+e,"igm");w.has.query()&&(i=[],w.verbose("Searching for matching values",u),it.each(function(){var e=n(this),t,r;return(b.match=="both"||b.match=="text")&&((t=String(w.get.choiceText(e,!1)),t.search(f)!==-1)||b.fullTextSearch==="exact"&&w.exactSearch(u,t)||b.fullTextSearch===!0&&w.fuzzySearch(u,t))?(i.push(this),!0):(b.match=="both"||b.match=="value")&&((r=String(w.get.choiceValue(e,t)),r.search(f)!==-1)||b.fullTextSearch==="exact"&&w.exactSearch(u,r)||b.fullTextSearch===!0&&w.fuzzySearch(u,r))?(i.push(this),!0):void 0}));w.debug("Showing only matched items",u);w.remove.filteredItem();i&&it.not(i).addClass(k.filtered)},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(n=n.toLowerCase(),t=t.toLowerCase(),u>r)return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},exactSearch:function(n,t){return(n=n.toLowerCase(),t=t.toLowerCase(),t.indexOf(n)>-1)?!0:!1},filterActive:function(){b.useLabels&&it.filter("."+k.active).addClass(k.filtered)},focusSearch:function(n){if(w.has.search()&&!w.is.focusedOnSearch())if(n){d.off("focus"+tt,g.search);et.focus();d.on("focus"+tt,g.search,w.event.search.focus)}else et.focus()},forceSelection:function(){var t=it.not(k.filtered).filter("."+k.selected).eq(0),i=it.not(k.filtered).filter("."+k.active).eq(0),n=t.length>0?t:i,r=n.length>0;if(r&&!w.is.multiple()){w.debug("Forcing partial selection to selected item",n);w.event.item.click.call(n,{},!0);return}b.allowAdditions?(w.set.selected(w.get.query()),w.remove.searchTerm()):w.remove.searchTerm()},change:{values:function(t){b.allowAdditions||w.clear();w.debug("Creating dropdown with specified values",t);w.setup.menu({values:t});n.each(t,function(n,t){if(t.selected==!0)return w.debug("Setting initial selection to",t.value),w.set.selected(t.value),!0})}},event:{change:function(){ei||(w.debug("Input changed, updating selection"),w.set.selected())},focus:function(){b.showOnFocus&&!yt&&w.is.hidden()&&!bt&&w.show()},blur:function(){bt=i.activeElement===this;yt||bt||(w.remove.activeLabel(),w.hide())},mousedown:function(){w.is.searchSelection()?ti=!0:yt=!0},mouseup:function(){w.is.searchSelection()?ti=!1:yt=!1},click:function(t){var i=n(t.target);i.is(d)&&(w.is.focusedOnSearch()?w.show():w.focusSearch())},search:{focus:function(){yt=!0;w.is.multiple()&&w.remove.activeLabel();b.showOnFocus&&w.search()},blur:function(){bt=i.activeElement===this;w.is.searchSelection()&&!ti&&(fi||bt||(b.forceSelection&&w.forceSelection(),w.hide()));ti=!1}},icon:{click:function(){w.toggle()}},text:{focus:function(){yt=!0;w.focusSearch()}},input:function(){(w.is.multiple()||w.is.searchSelection())&&w.set.filtered();clearTimeout(w.timer);w.timer=setTimeout(w.search,b.delay.search)},label:{click:function(t){var i=n(this),u=d.find(g.label),r=u.filter("."+k.active),f=i.nextAll("."+k.active),e=i.prevAll("."+k.active),o=f.length>0?i.nextUntil(f).add(r).add(i):i.prevUntil(e).add(r).add(i);t.shiftKey?(r.removeClass(k.active),o.addClass(k.active)):t.ctrlKey?i.toggleClass(k.active):(r.removeClass(k.active),i.addClass(k.active));b.onLabelSelect.apply(this,u.filter("."+k.active))}},remove:{click:function(){var t=n(this).parent();t.hasClass(k.active)?w.remove.activeLabels():w.remove.activeLabels(t)}},test:{toggle:function(n){var t=w.is.multiple()?w.show:w.toggle;w.is.bubbledLabelClick(n)||w.is.bubbledIconClick(n)||w.determine.eventOnElement(n,t)&&n.preventDefault()},touch:function(n){w.determine.eventOnElement(n,function(){n.type=="touchstart"?w.timer=setTimeout(function(){w.hide()},b.delay.touch):n.type=="touchmove"&&clearTimeout(w.timer)});n.stopPropagation()},hide:function(n){w.determine.eventInModule(n,w.hide)}},select:{mutation:function(t){w.debug("<select> modified, recreating menu");var i=!1;n.each(t,function(t,r){if(n(r.target).is("select")||n(r.addedNodes).is("select"))return i=!0,!0});i&&(w.disconnect.selectObserver(),w.refresh(),w.setup.select(),w.set.selected(),w.observe.select())}},menu:{mutation:function(t){var i=t[0],u=i.addedNodes?n(i.addedNodes[0]):n(!1),f=i.removedNodes?n(i.removedNodes[0]):n(!1),r=u.add(f),e=r.is(g.addition)||r.closest(g.addition).length>0,o=r.is(g.message)||r.closest(g.message).length>0;e||o?(w.debug("Updating item selector cache"),w.refreshItems()):(w.debug("Menu modified, updating selector cache"),w.refresh())},mousedown:function(){fi=!0},mouseup:function(){fi=!1}},item:{mouseenter:function(t){var u=n(t.target),r=n(this),i=r.children(g.menu),f=r.siblings(g.item).children(g.menu),e=i.length>0,o=i.find(u).length>0;!o&&e&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",i);n.each(f,function(){w.animate.hide(!1,n(this))});w.animate.show(!1,i)},b.delay.show),t.preventDefault())},mouseleave:function(){var t=n(this).children(g.menu);t.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",t);w.animate.hide(!1,t)},b.delay.hide))},click:function(t,r){var u=n(this),o=t?n(t.target):n(""),f=u.find(g.menu),e=w.get.choiceText(u),s=w.get.choiceValue(u,e),h=f.length>0,c=f.find(o).length>0;w.has.menuSearch()&&n(i.activeElement).blur();c||h&&!b.allowCategorySelection||(w.is.searchSelection()&&(b.allowAdditions&&w.remove.userAddition(),w.remove.searchTerm(),w.is.focusedOnSearch()||r==!0||w.focusSearch(!0)),b.useLabels||(w.remove.filteredItem(),w.set.scrollPosition(u)),w.determine.selectAction.call(this,e,s))}},document:{keydown:function(n){var u=n.which,a=w.is.inObject(u,ft);if(a){var i=d.find(g.label),t=i.filter("."+k.active),p=t.data(rt.value),o=i.index(t),v=i.length,r=t.length>0,s=t.length>1,y=o===0,h=o+1==v,e=w.is.searchSelection(),f=w.is.focusedOnSearch(),c=w.is.focused(),l=f&&w.get.caretPosition()===0;if(e&&!r&&!f)return;u==ft.leftArrow?(c||l)&&!r?(w.verbose("Selecting previous label"),i.last().addClass(k.active)):r&&(n.shiftKey?w.verbose("Adding previous label to selection"):(w.verbose("Selecting previous label"),i.removeClass(k.active)),y&&!s?t.addClass(k.active):t.prev(g.siblingLabel).addClass(k.active).end(),n.preventDefault()):u==ft.rightArrow?(c&&!r&&i.first().addClass(k.active),r&&(n.shiftKey?w.verbose("Adding next label to selection"):(w.verbose("Selecting next label"),i.removeClass(k.active)),h?e?f?i.removeClass(k.active):w.focusSearch():s?t.next(g.siblingLabel).addClass(k.active):t.addClass(k.active):t.next(g.siblingLabel).addClass(k.active),n.preventDefault())):u==ft.deleteKey||u==ft.backspace?r?(w.verbose("Removing active labels"),h&&e&&!f&&w.focusSearch(),t.last().next(g.siblingLabel).addClass(k.active),w.remove.activeLabels(t),n.preventDefault()):l&&!r&&u==ft.backspace&&(w.verbose("Removing last label on input backspace"),t=i.last().addClass(k.active),w.remove.activeLabels(t)):t.removeClass(k.active)}}},keydown:function(n){var t=n.which,v=w.is.inObject(t,ft);if(v){var s=it.not(g.unselectable).filter("."+k.selected).eq(0),y=nt.children("."+k.active).eq(0),i=s.length>0?s:y,p=i.length>0?i.siblings(":not(."+k.filtered+")").addBack():nt.children(":not(."+k.filtered+")"),e=i.children(g.menu),u=i.closest(g.menu),h=u.hasClass(k.visible)||u.hasClass(k.animating)||u.parent(g.menu).length>0,c=e.length>0,f=i.length>0,l=i.not(g.unselectable).length>0,o=t==ft.delimiter&&b.allowAdditions&&w.is.multiple(),d=b.allowAdditions&&b.hideAdditions&&(t==ft.enter||o)&&l,r,a;if(d&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm()),w.is.visible()){if((t==ft.enter||o)&&(t==ft.enter&&f&&c&&!b.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),t=ft.rightArrow):l&&(w.verbose("Selecting item from keyboard shortcut",i),w.event.item.click.call(i,n),w.is.searchSelection()&&w.remove.searchTerm()),n.preventDefault()),f&&(t==ft.leftArrow&&(a=u[0]!==nt[0],a&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,u),i.removeClass(k.selected),u.closest(g.item).addClass(k.selected),n.preventDefault())),t==ft.rightArrow&&c&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,e),i.removeClass(k.selected),e.find(g.item).eq(0).addClass(k.selected),n.preventDefault())),t==ft.upArrow){if(r=f&&h?i.prevAll(g.item+":not("+g.unselectable+")").eq(0):it.eq(0),p.index(r)<0){w.verbose("Up key pressed but reached top of current menu");n.preventDefault();return}w.verbose("Up key pressed, changing active item");i.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}if(t==ft.downArrow){if(r=f&&h?r=i.nextAll(g.item+":not("+g.unselectable+")").eq(0):it.eq(0),r.length===0){w.verbose("Down key pressed but reached bottom of current menu");n.preventDefault();return}w.verbose("Down key pressed, changing active item");it.removeClass(k.selected);r.addClass(k.selected);w.set.scrollPosition(r);b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r);n.preventDefault()}t==ft.pageUp&&(w.scrollPage("up"),n.preventDefault());t==ft.pageDown&&(w.scrollPage("down"),n.preventDefault());t==ft.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide())}else o&&n.preventDefault(),t!=ft.downArrow||w.is.visible()||(w.verbose("Down key pressed, showing dropdown"),w.show(),n.preventDefault())}else w.has.search()||w.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var n=i.createEvent("HTMLEvents"),t=ut[0];t&&(w.verbose("Triggering native change event"),n.initEvent("change",!0,!1),t.dispatchEvent(n))}},determine:{selectAction:function(t,i){w.verbose("Determining action",b.action);n.isFunction(w.action[b.action])?(w.verbose("Triggering preset action",b.action,t,i),w.action[b.action].call(ot,t,i,this)):n.isFunction(b.action)?(w.verbose("Triggering user action",b.action,t,i),b.action.call(ot,t,i,this)):w.error(vt.action,b.action)},eventInModule:function(t,r){var u=n(t.target),f=u.closest(i.documentElement).length>0,e=u.closest(d).length>0;return r=n.isFunction(r)?r:function(){},f&&!e?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,r){var u=n(t.target),f=u.closest(g.siblingLabel),e=i.body.contains(t.target),o=d.find(f).length===0,s=u.closest(nt).length===0;return r=n.isFunction(r)?r:function(){},e&&o&&s?(w.verbose("Triggering event",r),r(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,i,u){if(i=i!==r?i:t,w.can.activate(n(u))){if(w.set.selected(i,n(u)),w.is.multiple()&&!w.is.allFiltered())return;w.hideAndClear()}},select:function(t,i,u){if(i=i!==r?i:t,w.can.activate(n(u))){if(w.set.value(i,t,n(u)),w.is.multiple()&&!w.is.allFiltered())return;w.hideAndClear()}},combo:function(t,i,u){i=i!==r?i:t;w.set.selected(i,n(u));w.hideAndClear()},hide:function(n,t){w.set.value(t,n);w.hideAndClear()}},get:{id:function(){return ii},defaultText:function(){return d.data(rt.defaultText)},defaultValue:function(){return d.data(rt.defaultValue)},placeholderText:function(){return b.placeholder!="auto"&&typeof b.placeholder=="string"?b.placeholder:d.data(rt.placeholderText)||""},text:function(){return st.text()},query:function(){return n.trim(et.val())},searchWidth:function(n){return n=n!==r?n:et.val(),gt.text(n),Math.ceil(gt.width()+1)},selectionCount:function(){var t=w.get.values();return w.is.multiple()?n.isArray(t)?t.length:0:w.get.value()!==""?1:0},transition:function(n){return b.transition=="auto"?w.is.upward(n)?"slide up":"slide down":b.transition},userValues:function(){var t=w.get.values();return t?(t=n.isArray(t)?t:[t],n.grep(t,function(n){return w.get.item(n)===!1})):!1},uniqueArray:function(t){return n.grep(t,function(i,r){return n.inArray(i,t)===r})},caretPosition:function(){var n=et.get(0),t,r;return"selectionStart"in n?n.selectionStart:i.selection?(n.focus(),t=i.selection.createRange(),r=t.text.length,t.moveStart("character",-n.value.length),t.text.length-r):void 0},value:function(){var t=ut.length>0?ut.val():d.data(rt.value),i=n.isArray(t)&&t.length===1&&t[0]==="";return t===r||i?"":t},values:function(){var n=w.get.value();return n===""?"":!w.has.selectInput()&&w.is.multiple()?typeof n=="string"?n.split(b.delimiter):"":n},remoteValues:function(){var t=w.get.values(),i=!1;return t&&(typeof t=="string"&&(t=[t]),n.each(t,function(n,t){var r=w.read.remoteData(t);w.verbose("Restoring value from session data",r,t);r&&(i||(i={}),i[t]=r)})),i},choiceText:function(t,i){return i=i!==r?i:b.preserveHTML,t?(t.find(g.menu).length>0&&(w.verbose("Retrieving text of element with sub-menu"),t=t.clone(),t.find(g.menu).remove(),t.find(g.menuIcon).remove()),t.data(rt.text)!==r?t.data(rt.text):i?n.trim(t.html()):n.trim(t.text())):void 0},choiceValue:function(t,i){return(i=i||w.get.choiceText(t),!t)?!1:t.data(rt.value)!==r?String(t.data(rt.value)):typeof i=="string"?n.trim(i.toLowerCase()):String(i)},inputEvent:function(){var n=et[0],i;return n?(i=t.ActiveXObject||"ActiveXObject"in t,i)?"keyup":n.oninput!==r?"input":n.onpropertychange!==r?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=[],d.find("option").each(function(){var i=n(this),u=i.html(),e=i.attr("disabled"),f=i.attr("value")!==r?i.attr("value"):u;b.placeholder==="auto"&&f===""?t.placeholder=u:t.values.push({name:u,value:f,disabled:e})}),b.placeholder&&b.placeholder!=="auto"&&(w.debug("Setting placeholder value to",b.placeholder),t.placeholder=b.placeholder),b.sortSelect?(t.values.sort(function(n,t){return n.name>t.name?1:-1}),w.debug("Retrieved and sorted values from select",t)):w.debug("Retrieved values from select",t),t},activeItem:function(){return it.filter("."+k.active)},selectedItem:function(){var n=it.not(g.unselectable).filter("."+k.selected);return n.length>0?n:it.eq(0)},itemWithAdditions:function(n){var t=w.get.item(n),i=w.create.userChoice(n),r=i&&i.length>0;return r&&(t=t.length>0?t.add(i):i),t},item:function(t,i){var u=!1,e,f;return t=t!==r?t:w.get.values()!==r?w.get.values():w.get.text(),e=f?t.length>0:t!==r&&t!==null,f=w.is.multiple()&&n.isArray(t),i=t===""||t===0?!0:i||!1,e&&it.each(function(){var e=n(this),s=w.get.choiceText(e),o=w.get.choiceValue(e,s);if(o!==null&&o!==r)if(f)(n.inArray(String(o),t)!==-1||n.inArray(s,t)!==-1)&&(u=u?u.add(e):e);else if(i){if(w.verbose("Ambiguous dropdown value using strict type check",e,t),o===t||s===t)return u=e,!0}else if(String(o)==String(t)||s==t)return w.verbose("Found select item by value",o,t),u=e,!0}),u}},check:{maxSelections:function(n){return b.maxSelections?(n=n!==r?n:w.get.selectionCount(),n>=b.maxSelections?(w.debug("Maximum selection count reached"),b.useLabels&&(it.addClass(k.filtered),w.add.message(ct.maxSelections)),!0):(w.verbose("No longer at maximum selection count"),w.remove.message(),w.remove.filteredItem(),w.is.searchSelection()&&w.filterItems(),!1)):!0}},restore:{defaults:function(){w.clear();w.restore.defaultText();w.restore.defaultValue()},defaultText:function(){var n=w.get.defaultText(),t=w.get.placeholderText;n===t?(w.debug("Restoring default placeholder text",n),w.set.placeholderText(n)):(w.debug("Restoring default text",n),w.set.text(n))},placeholderText:function(){w.set.placeholderText()},defaultValue:function(){var n=w.get.defaultValue();n!==r&&(w.debug("Restoring default value",n),n!==""?(w.set.value(n),w.set.selected()):(w.remove.activeItem(),w.remove.selectedItem()))},labels:function(){b.allowAdditions&&(b.useLabels||(w.error(vt.labels),b.useLabels=!0),w.debug("Restoring selected values"),w.create.userLabels());w.check.maxSelections()},selected:function(){w.restore.values();w.is.multiple()?(w.debug("Restoring previously selected values and labels"),w.restore.labels()):w.debug("Restoring previously selected values")},values:function(){w.set.initialLoad();b.apiSettings&&b.saveRemoteData&&w.get.remoteValues()?w.restore.remoteValues():w.set.selected();w.remove.initialLoad()},remoteValues:function(){var t=w.get.remoteValues();w.debug("Recreating selected from session data",t);t&&(w.is.single()?n.each(t,function(n,t){w.set.text(t)}):n.each(t,function(n,t){w.add.label(n,t)}))}},read:{remoteData:function(n){var i;if(t.Storage===r){w.error(vt.noStorage);return}return i=sessionStorage.getItem(n),i!==r?i:!1}},save:{defaults:function(){w.save.defaultText();w.save.placeholderText();w.save.defaultValue()},defaultValue:function(){var n=w.get.value();w.verbose("Saving default value as",n);d.data(rt.defaultValue,n)},defaultText:function(){var n=w.get.text();w.verbose("Saving default text as",n);d.data(rt.defaultText,n)},placeholderText:function(){var n;b.placeholder!==!1&&st.hasClass(k.placeholder)&&(n=w.get.text(),w.verbose("Saving placeholder text as",n),d.data(rt.placeholderText,n))},remoteData:function(n,i){if(t.Storage===r){w.error(vt.noStorage);return}w.verbose("Saving remote data to session storage",i,n);sessionStorage.setItem(i,n)}},clear:function(){w.is.multiple()&&b.useLabels?w.remove.labels():(w.remove.activeItem(),w.remove.selectedItem());w.set.placeholderText();w.clearValue()},clearValue:function(){w.set.value("")},scrollPage:function(n,t){var u=t||w.get.selectedItem(),f=u.closest(g.menu),l=f.outerHeight(),h=f.scrollTop(),s=it.eq(0).outerHeight(),e=Math.floor(l/s),v=f.prop("scrollHeight"),a=n=="up"?h-s*e:h+s*e,i=it.not(g.unselectable),c,r,o;o=n=="up"?i.index(u)-e:i.index(u)+e;c=n=="up"?o>=0:o<i.length;r=c?i.eq(o):n=="up"?i.first():i.last();r.length>0&&(w.debug("Scrolling page",n,r),u.removeClass(k.selected),r.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(r),f.scrollTop(a))},set:{filtered:function(){var n=w.is.multiple(),i=w.is.searchSelection(),r=n&&i,t=i?w.get.query():"",u=typeof t=="string"&&t.length>0,f=w.get.searchWidth(),e=t!=="";n&&u&&(w.verbose("Adjusting input width",f,b.glyphWidth),et.css("width",f));u||r&&e?(w.verbose("Hiding placeholder text"),st.addClass(k.filtered)):n&&(!r||e)||(w.verbose("Showing placeholder text"),st.removeClass(k.filtered))},empty:function(){d.addClass(k.empty)},loading:function(){d.addClass(k.loading)},placeholderText:function(n){n=n||w.get.placeholderText();w.debug("Setting placeholder text",n);w.set.text(n);st.addClass(k.placeholder)},tabbable:function(){w.is.searchSelection()?(w.debug("Added tabindex to searchable dropdown"),et.val("").attr("tabindex",0),nt.attr("tabindex",-1)):(w.debug("Added tabindex to dropdown"),d.attr("tabindex")===r&&(d.attr("tabindex",0),nt.attr("tabindex",-1)))},initialLoad:function(){w.verbose("Setting initial load");oi=!0},activeItem:function(n){b.allowAdditions&&n.filter(g.addition).length>0?n.addClass(k.filtered):n.addClass(k.active)},partialSearch:function(n){var t=w.get.query().length;et.val(n.substr(0,t))},scrollPosition:function(n,t){var o=5,i,s,u,e,h,f,c,l,a;n=n||w.get.selectedItem();i=n.closest(g.menu);s=n&&n.length>0;t=t!==r?t:!1;n&&i.length>0&&s&&(e=n.position().top,i.addClass(k.loading),f=i.scrollTop(),h=i.offset().top,e=n.offset().top,u=f-h+e,t||(c=i.height(),a=f+c<u+o,l=u-o<f),w.debug("Scrolling to active item",u),(t||l||a)&&i.scrollTop(u),i.removeClass(k.loading))},text:function(n){b.action!=="select"&&(b.action=="combo"?(w.debug("Changing combo button text",n,ni),b.preserveHTML?ni.html(n):ni.text(n)):(n!==w.get.placeholderText()&&st.removeClass(k.placeholder),w.debug("Changing text",n,st),st.removeClass(k.filtered),b.preserveHTML?st.html(n):st.text(n)))},selectedItem:function(n){var t=w.get.choiceValue(n),i=w.get.choiceText(n,!1),r=w.get.choiceText(n,!0);w.debug("Setting user selection to item",n);w.remove.activeItem();w.set.partialSearch(i);w.set.activeItem(n);w.set.selected(t,n);w.set.text(r)},selectedLetter:function(t){var r=it.filter("."+k.selected),f=r.length>0&&w.has.firstLetter(r,t),i=!1,u;f&&(u=r.nextAll(it).eq(0),w.has.firstLetter(u,t)&&(i=u));i||it.each(function(){if(w.has.firstLetter(n(this),t))return i=n(this),!1});i&&(w.verbose("Scrolling to next value with letter",t),w.set.scrollPosition(i),r.removeClass(k.selected),i.addClass(k.selected),b.selectOnKeydown&&w.is.single()&&w.set.selectedItem(i))},direction:function(n){b.direction=="auto"?(w.remove.upward(),w.can.openDownward(n)?w.remove.upward(n):w.set.upward(n),w.is.leftward(n)||w.can.openRightward(n)||w.set.leftward(n)):b.direction=="upward"&&w.set.upward(n)},upward:function(n){var t=n||d;t.addClass(k.upward)},leftward:function(n){var t=n||nt;t.addClass(k.leftward)},value:function(n,t,i){var u=w.escape.value(n),o=ut.length>0,f=w.get.values(),e=n!==r?String(n):n;if(o){if(!b.allowReselection&&e==f&&(w.verbose("Skipping value update already same value",n,f),!w.is.initialLoad()))return;w.is.single()&&w.has.selectInput()&&w.can.extendSelect()&&(w.debug("Adding user option",n),w.add.optionValue(n));w.debug("Updating input value",u,f);ei=!0;ut.val(u);b.fireOnInit===!1&&w.is.initialLoad()?w.debug("Input native change event ignored on initial load"):w.trigger.change();ei=!1}else w.verbose("Storing value in metadata",u,ut),u!==f&&d.data(rt.value,e);b.fireOnInit===!1&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onChange):b.onChange.call(ot,n,t,i)},active:function(){d.addClass(k.active)},multiple:function(){d.addClass(k.multiple)},visible:function(){d.addClass(k.visible)},exactly:function(n,t){w.debug("Setting selected to exact values");w.clear();w.set.selected(n,t)},selected:function(t,i){var r=w.is.multiple();(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t),i)&&(w.debug("Setting selected menu item to",i),w.is.multiple()&&w.remove.searchWidth(),w.is.single()?(w.remove.activeItem(),w.remove.selectedItem()):b.useLabels&&w.remove.selectedItem(),i.each(function(){var t=n(this),u=w.get.choiceText(t),f=w.get.choiceValue(t,u),e=t.hasClass(k.filtered),o=t.hasClass(k.active),s=t.hasClass(k.addition),h=r&&i.length==1;r?!o||s?(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),b.useLabels?(w.add.label(f,u,h),w.add.value(f,u,t),w.set.activeItem(t),w.filterActive(),w.select.nextAvailable(i)):(w.add.value(f,u,t),w.set.text(w.add.variables(ct.count)),w.set.activeItem(t))):e||(w.debug("Selected active value, removing label"),w.remove.selected(f)):(b.apiSettings&&b.saveRemoteData&&w.save.remoteData(u,f),w.set.text(u),w.set.value(f,u,t),t.addClass(k.active).addClass(k.selected))}))}},add:{label:function(t,i,r){var e=w.is.searchSelection()?et:st,f=w.escape.value(t),u;if(b.ignoreCase&&(f=f.toLowerCase()),u=n("<a />").addClass(k.label).attr("data-"+rt.value,f).html(ui.label(f,i)),u=b.onLabelCreate.call(u,f,i),w.has.label(t)){w.debug("User selection already exists, skipping",f);return}b.label.variation&&u.addClass(b.label.variation);r===!0?(w.debug("Animating in label",u),u.addClass(k.hidden).insertBefore(e).transition(b.label.transition,b.label.duration)):(w.debug("Adding selection label",u),u.insertBefore(e))},message:function(t){var i=nt.children(g.message),r=b.templates.message(w.add.variables(t));i.length>0?i.html(r):i=n("<div/>").html(r).addClass(k.message).appendTo(nt)},optionValue:function(t){var i=w.escape.value(t),r=ut.find('option[value="'+w.escape.string(i)+'"]'),u=r.length>0;u||(w.disconnect.selectObserver(),w.is.single()&&(w.verbose("Removing previous user addition"),ut.find("option."+k.addition).remove()),n("<option/>").prop("value",i).addClass(k.addition).html(t).appendTo(ut),w.verbose("Adding user addition as an <option>",t),w.observe.select())},userSuggestion:function(n){var t=nt.children(g.addition),i=w.get.item(n),u=i&&i.not(g.addition).length,f=t.length>0,r;if(!b.useLabels||!w.has.maxSelections()){if(n===""||u){t.remove();return}f?(t.data(rt.value,n).data(rt.text,n).attr("data-"+rt.value,n).attr("data-"+rt.text,n).removeClass(k.filtered),b.hideAdditions||(r=b.templates.addition(w.add.variables(ct.addResult,n)),t.html(r)),w.verbose("Replacing user suggestion with new value",t)):(t=w.create.userChoice(n),t.prependTo(nt),w.verbose("Adding item choice to menu corresponding with user choice addition",t));(!b.hideAdditions||w.is.allFiltered())&&t.addClass(k.selected).siblings().removeClass(k.selected);w.refreshItems()}},variables:function(n,t){var u=n.search("{count}")!==-1,f=n.search("{maxCount}")!==-1,e=n.search("{term}")!==-1,i,r;return w.verbose("Adding templated variables to message",n),u&&(i=w.get.selectionCount(),n=n.replace("{count}",i)),f&&(i=w.get.selectionCount(),n=n.replace("{maxCount}",b.maxSelections)),e&&(r=t||w.get.query(),n=n.replace("{term}",r)),n},value:function(t,i,r){var f=w.get.values(),u;if(w.has.value(t)){w.debug("Value already selected");return}if(t===""){w.debug("Cannot select blank values from multiselect");return}n.isArray(f)?(u=f.concat([t]),u=w.get.uniqueArray(u)):u=[t];w.has.selectInput()?w.can.extendSelect()&&(w.debug("Adding value to select",t,u,ut),w.add.optionValue(t)):(u=u.join(b.delimiter),w.debug("Setting hidden input to delimited value",u,ut));b.fireOnInit===!1&&w.is.initialLoad()?w.verbose("Skipping onadd callback on initial load",b.onAdd):b.onAdd.call(ot,t,i,r);w.set.value(u,t,i,r);w.check.maxSelections()}},remove:{active:function(){d.removeClass(k.active)},activeLabel:function(){d.find(g.label).removeClass(k.active)},empty:function(){d.removeClass(k.empty)},loading:function(){d.removeClass(k.loading)},initialLoad:function(){oi=!1},upward:function(n){var t=n||d;t.removeClass(k.upward)},leftward:function(n){var t=n||nt;t.removeClass(k.leftward)},visible:function(){d.removeClass(k.visible)},activeItem:function(){it.removeClass(k.active)},filteredItem:function(){b.useLabels&&w.has.maxSelections()||(b.useLabels&&w.is.multiple()?it.not("."+k.active).removeClass(k.filtered):it.removeClass(k.filtered),w.remove.empty())},optionValue:function(n){var i=w.escape.value(n),t=ut.find('option[value="'+w.escape.string(i)+'"]'),r=t.length>0;r&&t.hasClass(k.addition)&&(at&&(at.disconnect(),w.verbose("Temporarily disconnecting mutation observer")),t.remove(),w.verbose("Removing user addition as an <option>",i),at&&at.observe(ut[0],{childList:!0,subtree:!0}))},message:function(){nt.children(g.message).remove()},searchWidth:function(){et.css("width","")},searchTerm:function(){w.verbose("Cleared search term");et.val("");w.set.filtered()},userAddition:function(){it.filter(g.addition).remove()},selected:function(t,i){if(i=b.allowAdditions?i||w.get.itemWithAdditions(t):i||w.get.item(t),!i)return!1;i.each(function(){var t=n(this),i=w.get.choiceText(t),r=w.get.choiceValue(t,i);w.is.multiple()?b.useLabels?(w.remove.value(r,i,t),w.remove.label(r)):(w.remove.value(r,i,t),w.get.selectionCount()===0?w.set.placeholderText():w.set.text(w.add.variables(ct.count))):w.remove.value(r,i,t);t.removeClass(k.filtered).removeClass(k.active);b.useLabels&&t.removeClass(k.selected)})},selectedItem:function(){it.removeClass(k.selected)},value:function(n,t,i){var u=w.get.values(),r;w.has.selectInput()?(w.verbose("Input is <select> removing selected option",n),r=w.remove.arrayValue(n,u),w.remove.optionValue(n)):(w.verbose("Removing from delimited values",n),r=w.remove.arrayValue(n,u),r=r.join(b.delimiter));b.fireOnInit===!1&&w.is.initialLoad()?w.verbose("No callback on initial load",b.onRemove):b.onRemove.call(ot,n,t,i);w.set.value(r,t,i);w.check.maxSelections()},arrayValue:function(t,i){return n.isArray(i)||(i=[i]),i=n.grep(i,function(n){return t!=n}),w.verbose("Removed value from delimited string",t,i),i},label:function(n){var i=d.find(g.label),t=i.filter("[data-"+rt.value+'="'+w.escape.string(n)+'"]');w.verbose("Removing label",t);t.remove()},activeLabels:function(n){n=n||d.find(g.label).filter("."+k.active);w.verbose("Removing active label selections",n);w.remove.labels(n)},labels:function(t){t=t||d.find(g.label);w.verbose("Removing labels",t);t.each(function(){var u=n(this),t=u.data(rt.value),i=t!==r?String(t):t,f=w.is.userValue(i);if(b.onLabelRemove.call(u,t)===!1){w.debug("Label remove callback cancelled removal");return}w.remove.message();f?(w.remove.value(i),w.remove.label(i)):w.remove.selected(i)})},tabbable:function(){w.is.searchSelection()?(w.debug("Searchable dropdown initialized"),et.removeAttr("tabindex"),nt.removeAttr("tabindex")):(w.debug("Simple selection dropdown initialized"),d.removeAttr("tabindex"),nt.removeAttr("tabindex"))}},has:{menuSearch:function(){return w.has.search()&&et.closest(nt).length>0},search:function(){return et.length>0},sizer:function(){return gt.length>0},selectInput:function(){return ut.is("select")},minCharacters:function(n){return b.minCharacters?(n=n!==r?String(n):String(w.get.query()),n.length>=b.minCharacters):!0},firstLetter:function(n,t){var i,r;return!n||n.length===0||typeof t!="string"?!1:(i=w.get.choiceText(n,!1),t=t.toLowerCase(),r=String(i).charAt(0).toLowerCase(),t==r)},input:function(){return ut.length>0},items:function(){return it.length>0},menu:function(){return nt.length>0},message:function(){return nt.children(g.message).length!==0},label:function(n){var t=w.escape.value(n),i=d.find(g.label);return b.ignoreCase&&(t=t.toLowerCase()),i.filter("[data-"+rt.value+'="'+w.escape.string(t)+'"]').length>0},maxSelections:function(){return b.maxSelections&&w.get.selectionCount()>=b.maxSelections},allResultsFiltered:function(){var n=it.not(g.addition);return n.filter(g.unselectable).length===n.length},userSuggestion:function(){return nt.children(g.addition).length>0},query:function(){return w.get.query()!==""},value:function(n){return b.ignoreCase?w.has.valueIgnoringCase(n):w.has.valueMatchingCase(n)},valueMatchingCase:function(t){var i=w.get.values(),r=n.isArray(i)?i&&n.inArray(t,i)!==-1:i==t;return r?!0:!1},valueIgnoringCase:function(t){var i=w.get.values(),r=!1;return n.isArray(i)||(i=[i]),n.each(i,function(n,i){if(String(t).toLowerCase()==String(i).toLowerCase())return r=!0,!1}),r}},is:{active:function(){return d.hasClass(k.active)},animatingInward:function(){return nt.transition("is inward")},animatingOutward:function(){return nt.transition("is outward")},bubbledLabelClick:function(t){return n(t.target).is("select, input")&&d.closest("label").length>0},bubbledIconClick:function(t){return n(t.target).closest(hi).length>0},alreadySetup:function(){return d.is("select")&&d.parent(g.dropdown).data(wt)!==r&&d.prev().length===0},animating:function(n){return n?n.transition&&n.transition("is animating"):nt.transition&&nt.transition("is animating")},leftward:function(n){var t=n||nt;return t.hasClass(k.leftward)},disabled:function(){return d.hasClass(k.disabled)},focused:function(){return i.activeElement===d[0]},focusedOnSearch:function(){return i.activeElement===et[0]},allFiltered:function(){return(w.is.multiple()||w.has.search())&&!(b.hideAdditions==!1&&w.has.userSuggestion())&&!w.has.message()&&w.has.allResultsFiltered()},hidden:function(n){return!w.is.visible(n)},initialLoad:function(){return oi},inObject:function(t,i){var r=!1;return n.each(i,function(n,i){if(i==t)return r=!0,!0}),r},multiple:function(){return d.hasClass(k.multiple)},remote:function(){return b.apiSettings&&w.can.useAPI()},single:function(){return!w.is.multiple()},selectMutation:function(t){var i=!1;return n.each(t,function(t,r){if(r.target&&n(r.target).is("select"))return i=!0,!0}),i},search:function(){return d.hasClass(k.search)},searchSelection:function(){return w.has.search()&&et.parent(g.dropdown).length===1},selection:function(){return d.hasClass(k.selection)},userValue:function(t){return n.inArray(t,w.get.userValues())!==-1},upward:function(n){var t=n||d;return t.hasClass(k.upward)},visible:function(n){return n?n.hasClass(k.visible):nt.hasClass(k.visible)},verticallyScrollableContext:function(){var n=ht.get(0)!==t?ht.css("overflow-y"):!1;return n=="auto"||n=="scroll"},horizontallyScrollableContext:function(){var n=ht.get(0)!==t?ht.css("overflow-X"):!1;return n=="auto"||n=="scroll"}},can:{activate:function(n){return b.useLabels?!0:w.has.maxSelections()?w.has.maxSelections()&&n.hasClass(k.active)?!0:!1:!0},openDownward:function(n){var u=n||nt,f=!0,r={},i;return u.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollTop:ht.scrollTop(),height:ht.outerHeight()},menu:{offset:u.offset(),height:u.outerHeight()}},w.is.verticallyScrollableContext()&&(i.menu.offset.top+=i.context.scrollTop),r={above:i.context.scrollTop<=i.menu.offset.top-i.context.offset.top-i.menu.height,below:i.context.scrollTop+i.context.height>=i.menu.offset.top-i.context.offset.top+i.menu.height},r.below?(w.verbose("Dropdown can fit in context downward",r),f=!0):r.below||r.above?(w.verbose("Dropdown cannot fit below, opening upward",r),f=!1):(w.verbose("Dropdown cannot fit in either direction, favoring downward",r),f=!0),u.removeClass(k.loading),f},openRightward:function(n){var r=n||nt,f=!0,u=!1,i;return r.addClass(k.loading),i={context:{offset:ht.get(0)===t?{top:0,left:0}:ht.offset(),scrollLeft:ht.scrollLeft(),width:ht.outerWidth()},menu:{offset:r.offset(),width:r.outerWidth()}},w.is.horizontallyScrollableContext()&&(i.menu.offset.left+=i.context.scrollLeft),u=i.menu.offset.left-i.context.offset.left+i.menu.width>=i.context.scrollLeft+i.context.width,u&&(w.verbose("Dropdown cannot fit in context rightward",u),f=!1),r.removeClass(k.loading),f},click:function(){return h||b.on=="click"},extendSelect:function(){return b.allowAdditions||b.apiSettings},show:function(){return!w.is.disabled()&&(w.has.items()||w.has.message())},useAPI:function(){return n.fn.api!==r}},animate:{show:function(t,i){var u=i||nt,e=i?function(){}:function(){w.hideSubMenus();w.hideOthers();w.set.active()},f;t=n.isFunction(t)?t:function(){};w.verbose("Doing menu show animation",u);w.set.direction(i);f=w.get.transition(i);w.is.selection()&&w.set.scrollPosition(w.get.selectedItem(),!0);(w.is.hidden(u)||w.is.animating(u))&&(f=="none"?(e(),u.transition("show"),t.call(ot)):n.fn.transition!==r&&d.transition("is supported")?u.transition({animation:f+" in",debug:b.debug,verbose:b.verbose,duration:b.duration,queue:!0,onStart:e,onComplete:function(){t.call(ot)}}):(u.addClass(k.visible),d.addClass(k.active),u.show(),t.call(ot)))},hide:function(t,i){var u=i||nt,o=i?b.duration*.9:b.duration,f=i?function(){}:function(){w.can.click()&&w.unbind.intent();w.remove.active()},e=w.get.transition(i);t=n.isFunction(t)?t:function(){};(w.is.visible(u)||w.is.animating(u))&&(w.verbose("Doing menu hide animation",u),e=="none"?(f(),u.transition("hide"),t.call(ot)):n.fn.transition!==r&&d.transition("is supported")?u.transition({animation:e+" out",duration:b.duration,debug:b.debug,verbose:b.verbose,queue:!1,onStart:f,onComplete:function(){t.call(ot)}}):(u.removeClass(k.visible),d.removeClass(k.active),u.hide(),nt.hide(),nt.removeClass(k.visible),b.direction=="auto"&&w.remove.upward(i),t.call(ot)))}},hideAndClear:function(){(w.remove.searchTerm(),w.has.maxSelections())||(w.has.search()?w.hide(function(){w.remove.filteredItem()}):w.hide())},delay:{show:function(){w.verbose("Delaying show event to ensure user intent");clearTimeout(w.timer);w.timer=setTimeout(w.show,b.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent");clearTimeout(w.timer);w.timer=setTimeout(w.hide,b.delay.hide)}},escape:{value:function(t){var i=n.isArray(t),r=typeof t=="string",f=!r&&!i,e=r&&t.search(dt.quote)!==-1,u=[];return f||!e?t:(w.debug("Encoding quote values for use in select",t),i)?(n.each(t,function(n,t){u.push(t.replace(dt.quote,"&quot;"))}),u):t.replace(dt.quote,"&quot;")},string:function(n){return n=String(n),n.replace(dt.escape,"\\$&")}},setting:function(t,i){if(w.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else if(i!==r)n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i;else return b[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,w,t);else if(i!==r)w[t]=i;else return w[t]},debug:function(){!b.silent&&b.debug&&(b.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,b.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),w.verbose.apply(console,arguments)))},error:function(){b.silent||(w.error=Function.prototype.bind.call(console.error,console,b.name+":"),w.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;b.performance&&(t=(new Date).getTime(),r=c||t,i=t-r,c=t,s.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ot,"Execution Time":i}));clearTimeout(w.performance.timer);w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=b.name+":",i=0;c=!1;clearTimeout(w.performance.timer);n.each(s,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";l&&(t+=" '"+l+"'");(console.group!==r||console.table!==r)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):n.each(s,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());s=[]}},invoke:function(t,i,u){var e=pt,h,o,s;return i=i||y,u=ot||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):(w.error(vt.method,t),!1)}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};v?(pt===r&&w.initialize(),w.invoke(a)):(pt!==r&&pt.invoke("destroy"),w.initialize())}),f!==r?f:e};n.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:t,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(){},onAdd:function(){},onRemove:function(){},onLabelSelect:function(){},onLabelCreate:function(){return n(this)},onLabelRemove:function(){return!0},onNoResults:function(){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",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"}};n.fn.dropdown.settings.templates={dropdown:function(t){var r=t.placeholder||!1,u=t.values||{},i="";return i+='<i class="dropdown icon"><\/i>',i+=t.placeholder?'<div class="default text">'+r+"<\/div>":'<div class="text"><\/div>',i+='<div class="menu">',n.each(t.values,function(n,t){i+=t.disabled?'<div class="disabled item" data-value="'+t.value+'">'+t.name+"<\/div>":'<div class="item" data-value="'+t.value+'">'+t.name+"<\/div>"}),i+="<\/div>"},menu:function(t,i){var u=t[i.values]||{},r="";return n.each(u,function(n,t){var u=t[i.text]?'data-text="'+t[i.text]+'"':"",f=t[i.disabled]?"disabled ":"";r+='<div class="'+f+'item" data-value="'+t[i.value]+'"'+u+">";r+=t[i.name];r+="<\/div>"}),r},label:function(n,t){return t+'<i class="delete icon"><\/i>'},message:function(n){return n},addition:function(n){return n}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.embed=function(i){var e=n(this),s=e.selector||"",o=(new Date).getTime(),f=[],h=arguments[0],c=typeof h=="string",l=[].slice.call(arguments,1),u;return e.each(function(){var v=n.isPlainObject(i)?n.extend(!0,{},n.fn.embed.settings,i):n.extend({},n.fn.embed.settings),b=v.selector,nt=v.className,w=v.sources,rt=v.error,p=v.metadata,ut=v.namespace,ft=v.templates,tt="."+ut,it="module-"+ut,st=n(t),y=n(this),et=y.find(b.placeholder),ot=y.find(b.icon),k=y.find(b.embed),d=this,g=y.data(it),a;a={initialize:function(){a.debug("Initializing embed");a.determine.autoplay();a.create();a.bind.events();a.instantiate()},instantiate:function(){a.verbose("Storing instance of module",a);g=a;y.data(it,a)},destroy:function(){a.verbose("Destroying previous instance of embed");a.reset();y.removeData(it).off(tt)},refresh:function(){a.verbose("Refreshing selector cache");et=y.find(b.placeholder);ot=y.find(b.icon);k=y.find(b.embed)},bind:{events:function(){if(a.has.placeholder()){a.debug("Adding placeholder events");y.on("click"+tt,b.placeholder,a.createAndShow).on("click"+tt,b.icon,a.createAndShow)}}},create:function(){var n=a.get.placeholder();n?a.createPlaceholder():a.createAndShow()},createPlaceholder:function(n){var t=a.get.icon(),i=a.get.url(),r=a.generate.embed(i);n=n||a.get.placeholder();y.html(ft.placeholder(n,t));a.debug("Creating placeholder for embed",n,t)},createEmbed:function(t){a.refresh();t=t||a.get.url();k=n("<div/>").addClass(nt.embed).html(a.generate.embed(t)).appendTo(y);v.onCreate.call(d,t);a.debug("Creating embed object",k)},changeEmbed:function(n){k.html(a.generate.embed(n))},createAndShow:function(){a.createEmbed();a.show()},change:function(n,t,i){a.debug("Changing video to ",n,t,i);y.data(p.source,n).data(p.id,t);i?y.data(p.url,i):y.removeData(p.url);a.has.embed()?a.changeEmbed():a.create()},reset:function(){a.debug("Clearing embed and showing placeholder");a.remove.active();a.remove.embed();a.showPlaceholder();v.onReset.call(d)},show:function(){a.debug("Showing embed");a.set.active();v.onDisplay.call(d)},hide:function(){a.debug("Hiding embed");a.showPlaceholder()},showPlaceholder:function(){a.debug("Showing placeholder image");a.remove.active();v.onPlaceholderDisplay.call(d)},get:{id:function(){return v.id||y.data(p.id)},placeholder:function(){return v.placeholder||y.data(p.placeholder)},icon:function(){return v.icon?v.icon:y.data(p.icon)!==r?y.data(p.icon):a.determine.icon()},source:function(){return v.source?v.source:y.data(p.source)!==r?y.data(p.source):a.determine.source()},type:function(){var n=a.get.source();return w[n]!==r?w[n].type:!1},url:function(){return v.url?v.url:y.data(p.url)!==r?y.data(p.url):a.determine.url()}},determine:{autoplay:function(){a.should.autoplay()&&(v.autoplay=!0)},source:function(t){var i=!1;return t=t||a.get.url(),t&&n.each(w,function(n,r){if(t.search(r.domain)!==-1)return i=n,!1}),i},icon:function(){var n=a.get.source();return w[n]!==r?w[n].icon:!1},url:function(){var i=v.id||y.data(p.id),t=v.source||y.data(p.source),n;return n=w[t]!==r?w[t].url.replace("{id}",i):!1,n&&y.data(p.url,n),n}},set:{active:function(){y.addClass(nt.active)}},remove:{active:function(){y.removeClass(nt.active)},embed:function(){k.empty()}},encode:{parameters:function(n){var t=[];for(var i in n)t.push(encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return t.join("&amp;")}},generate:{embed:function(n){a.debug("Generating embed html");var r=a.get.source(),t,i;return n=a.get.url(n),n?(i=a.generate.parameters(r),t=ft.iframe(n,i)):a.error(rt.noURL,y),t},parameters:function(t,i){var u=w[t]&&w[t].parameters!==r?w[t].parameters(v):{};return i=i||v.parameters,i&&(u=n.extend({},u,i)),u=v.onEmbed(u),a.encode.parameters(u)}},has:{embed:function(){return k.length>0},placeholder:function(){return v.placeholder||y.data(p.placeholder)}},should:{autoplay:function(){return v.autoplay==="auto"?v.placeholder||y.data(p.placeholder)!==r:v.autoplay}},is:{video:function(){return a.get.type()=="video"}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,v,t);else if(i!==r)n.isPlainObject(v[t])?n.extend(!0,v[t],i):v[t]=i;else return v[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else if(i!==r)a[t]=i;else return a[t]},debug:function(){!v.silent&&v.debug&&(v.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,v.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),a.verbose.apply(console,arguments)))},error:function(){v.silent||(a.error=Function.prototype.bind.call(console.error,console,v.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;v.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=g,h,o,s;return i=i||l,f=d||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):(a.error(rt.method,t),!1)}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(g===r&&a.initialize(),a.invoke(h)):(g!==r&&g.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(){},onEmbed:function(n){return n},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(n){return{autohide:!n.brandedUI,autoplay:n.autoplay,color:n.color||r,hq:n.hd,jsapi:n.api,modestbranding:!n.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(n){return{api:n.api,autoplay:n.autoplay,byline:n.brandedUI,color:n.color||r,portrait:n.brandedUI,title:n.brandedUI}}}},templates:{iframe:function(n,t){var i=n;return t&&(i+="?"+t),'<iframe src="'+i+'" width="100%" height="100%" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe>'},placeholder:function(n,t){var i="";return t&&(i+='<i class="'+t+' icon"><\/i>'),n&&(i+='<img class="placeholder" src="'+n+'">'),i}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.modal=function(u){var h=n(this),c=n(t),l=n(i),o=n("body"),a=h.selector||"",s=(new Date).getTime(),e=[],v=arguments[0],y=typeof v=="string",p=[].slice.call(arguments,1),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},f;return h.each(function(){var b=n.isPlainObject(u)?n.extend(!0,{},n.fn.modal.settings,u):n.extend({},n.fn.modal.settings),rt=b.selector,d=b.className,yt=b.namespace,st=b.error,nt="."+yt,lt="module-"+yt,k=n(this),ht=n(b.context),wt=k.find(rt.close),pt,ut,ct,g,it,tt=this,ft=k.data(lt),et=!1,ot,at,vt,h;h={initialize:function(){h.verbose("Initializing dimmer",ht);h.create.id();h.create.dimmer();h.refreshModals();h.bind.events();b.observeChanges&&h.observeChanges();h.instantiate()},instantiate:function(){h.verbose("Storing instance of modal");ft=h;k.data(lt,ft)},create:{dimmer:function(){var t={debug:b.debug,variation:b.centered?!1:"top aligned",dimmerName:"modals"},i=n.extend(!0,t,b.dimmerSettings);if(n.fn.dimmer===r){h.error(st.dimmer);return}h.debug("Creating dimmer");g=ht.dimmer(i);b.detachable?(h.verbose("Modal is detachable, moving content into dimmer"),g.dimmer("add content",k)):h.set.undetached();it=g.dimmer("get dimmer")},id:function(){at=(Math.random().toString(16)+"000000000").substr(2,8);ot="."+at;h.verbose("Creating unique id for element",at)}},destroy:function(){h.verbose("Destroying previous modal");k.removeData(lt).off(nt);c.off(ot);it.off(ot);wt.off(nt);ht.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&(vt=new MutationObserver(function(){h.debug("DOM tree modified, refreshing");h.refresh()}),vt.observe(tt,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",vt))},refresh:function(){h.remove.scrolling();h.cacheSizes();h.set.screenHeight();h.set.type()},refreshModals:function(){ut=k.siblings(rt.modal);pt=ut.add(k)},attachEvents:function(t,i){var r=n(t);if(i=n.isFunction(h[i])?h[i]:h.toggle,r.length>0){h.debug("Attaching modal events to element",t,i);r.off(nt).on("click"+nt,i)}else h.error(st.notFound,t)},bind:{events:function(){h.verbose("Attaching events");k.on("click"+nt,rt.close,h.event.close).on("click"+nt,rt.approve,h.event.approve).on("click"+nt,rt.deny,h.event.deny);c.on("resize"+ot,h.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){if(et||b.onApprove.call(tt,n(this))===!1){h.verbose("Approve callback returned false cancelling hide");return}et=!0;h.hide(function(){et=!1})},deny:function(){if(et||b.onDeny.call(tt,n(this))===!1){h.verbose("Deny callback returned false cancelling hide");return}et=!0;h.hide(function(){et=!1})},close:function(){h.hide()},click:function(t){if(!b.closable){h.verbose("Dimmer clicked but closable setting is disabled");return}var r=n(t.target),u=r.closest(rt.modal).length>0,f=n.contains(i.documentElement,t.target);!u&&f&&h.is.active()&&(h.debug("Dimmer clicked, hiding all modals"),h.remove.clickaway(),b.allowMultiple?h.hide():h.hideAll())},debounce:function(n,t){clearTimeout(h.timer);h.timer=setTimeout(n,t)},keyboard:function(n){var t=n.which;t==27&&(b.closable?(h.debug("Escape key pressed hiding modal"),h.hide()):h.debug("Escape key pressed, but closable is set to false"),n.preventDefault())},resize:function(){g.dimmer("is active")&&(h.is.animating()||h.is.active())&&w(h.refresh)}},toggle:function(){h.is.active()||h.is.animating()?h.hide():h.show()},show:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.set.dimmerSettings();h.showModal(t)},hide:function(t){t=n.isFunction(t)?t:function(){};h.refreshModals();h.hideModal(t)},showModal:function(t){t=n.isFunction(t)?t:function(){};h.is.animating()||!h.is.active()?(h.showDimmer(),h.cacheSizes(),h.set.screenHeight(),h.set.type(),h.set.clickaway(),!b.allowMultiple&&h.others.active()?h.hideOthers(h.showModal):(b.allowMultiple&&b.detachable&&k.detach().appendTo(it),b.onShow.call(tt),b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.debug("Showing modal with css animations"),k.transition({debug:b.debug,animation:b.transition+" in",queue:b.queue,duration:b.duration,useFailSafe:!0,onComplete:function(){b.onVisible.apply(tt);b.keyboardShortcuts&&h.add.keyboardShortcuts();h.save.focus();h.set.active();b.autofocus&&h.set.autofocus();t()}})):h.error(st.noTransition))):h.debug("Modal is already visible")},hideModal:function(t,i){if(t=n.isFunction(t)?t:function(){},h.debug("Hiding modal"),b.onHide.call(tt,n(this))===!1){h.verbose("Hide callback returned false cancelling hide");return}(h.is.animating()||h.is.active())&&(b.transition&&n.fn.transition!==r&&k.transition("is supported")?(h.remove.active(),k.transition({debug:b.debug,animation:b.transition+" out",queue:b.queue,duration:b.duration,useFailSafe:!0,onStart:function(){h.others.active()||i||h.hideDimmer();b.keyboardShortcuts&&h.remove.keyboardShortcuts()},onComplete:function(){b.onHidden.call(tt);h.restore.focus();t()}})):h.error(st.noTransition))},showDimmer:function(){g.dimmer("is animating")||!g.dimmer("is active")?(h.debug("Showing dimmer"),g.dimmer("show")):h.debug("Dimmer already visible")},hideDimmer:function(){if(g.dimmer("is animating")||g.dimmer("is active"))g.dimmer("hide",function(){h.remove.clickaway();h.remove.screenHeight()});else{h.debug("Dimmer is not visible cannot hide");return}},hideAll:function(t){var i=pt.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(h.debug("Hiding all visible modals"),h.hideDimmer(),i.modal("hide modal",t))},hideOthers:function(t){var i=ut.filter("."+d.active+", ."+d.animating);t=n.isFunction(t)?t:function(){};i.length>0&&(h.debug("Hiding other modals",ut),i.modal("hide modal",t,!0))},others:{active:function(){return ut.filter("."+d.active).length>0},animating:function(){return ut.filter("."+d.animating).length>0}},add:{keyboardShortcuts:function(){h.verbose("Adding keyboard shortcuts");l.on("keyup"+nt,h.event.keyboard)}},save:{focus:function(){var t=n(i.activeElement),r=t.closest(k).length>0;r||(ct=n(i.activeElement).blur())}},restore:{focus:function(){ct&&ct.length>0&&ct.focus()}},remove:{active:function(){k.removeClass(d.active)},clickaway:function(){it.off("click"+ot)},bodyStyle:function(){o.attr("style")===""&&(h.verbose("Removing style attribute"),o.removeAttr("style"))},screenHeight:function(){h.debug("Removing page height");o.css("height","")},keyboardShortcuts:function(){h.verbose("Removing keyboard shortcuts");l.off("keyup"+nt)},scrolling:function(){g.removeClass(d.scrolling);k.removeClass(d.scrolling)}},cacheSizes:function(){k.addClass(d.loading);var f=k.prop("scrollHeight"),u=k.outerHeight();(h.cache===r||u!==0)&&(h.cache={pageHeight:n(i).outerHeight(),height:u+b.offset,scrollHeight:f+b.offset,contextHeight:b.context=="body"?n(t).height():g.height()},h.cache.topOffset=-(h.cache.height/2));k.removeClass(d.loading);h.debug("Caching modal and container sizes",h.cache)},can:{fit:function(){var n=h.cache.contextHeight,u=h.cache.contextHeight/2,f=h.cache.topOffset,t=h.cache.scrollHeight,i=h.cache.height,r=b.padding,e=u+f;return t>i?e+t+r<n:i+r*2<n}},is:{active:function(){return k.hasClass(d.active)},animating:function(){return k.transition("is supported")?k.transition("is animating"):k.is(":visible")},scrolling:function(){return g.hasClass(d.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){var n=k.find("[tabindex], :input").filter(":visible"),t=n.filter("[autofocus]"),i=t.length>0?t.first():n.first();i.length>0&&i.focus()},clickaway:function(){it.on("click"+ot,h.event.click)},dimmerSettings:function(){if(n.fn.dimmer===r){h.error(st.dimmer);return}var i={debug:b.debug,dimmerName:"modals",closable:"auto",variation:b.centered?!1:"top aligned",duration:{show:b.duration,hide:b.duration}},t=n.extend(!0,i,b.dimmerSettings);b.inverted?(t.variation=t.variation!==r?t.variation+" inverted":"inverted",it.addClass(d.inverted)):it.removeClass(d.inverted);b.blurring?g.addClass(d.blurring):g.removeClass(d.blurring);ht.dimmer("setting",t)},screenHeight:function(){h.can.fit()?o.css("height",""):(h.debug("Modal is taller than page content, resizing page height"),o.css("height",h.cache.height+b.padding*2))},active:function(){k.addClass(d.active)},scrolling:function(){g.addClass(d.scrolling);k.addClass(d.scrolling)},type:function(){h.can.fit()?(h.verbose("Modal fits on screen"),h.others.active()||h.others.animating()||h.remove.scrolling()):(h.verbose("Modal cannot fit on screen setting to scrolling"),h.set.scrolling())},undetached:function(){g.addClass(d.undetached)}},setting:function(t,i){if(h.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,b,t);else if(i!==r)n.isPlainObject(b[t])?n.extend(!0,b[t],i):b[t]=i;else return b[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,h,t);else if(i!==r)h[t]=i;else return h[t]},debug:function(){!b.silent&&b.debug&&(b.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,b.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),h.verbose.apply(console,arguments)))},error:function(){b.silent||(h.error=Function.prototype.bind.call(console.error,console,b.name+":"),h.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;b.performance&&(t=(new Date).getTime(),r=s||t,i=t-r,s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:tt,"Execution Time":i}));clearTimeout(h.performance.timer);h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=b.name+":",i=0;s=!1;clearTimeout(h.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=ft,h,o,s;return i=i||p,u=tt||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};y?(ft===r&&h.initialize(),h.invoke(v)):(ft!==r&&ft.invoke("destroy"),h.initialize())}),f!==r?f:this};n.fn.modal.settings={name:"Modal",namespace:"modal",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,offset:0,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",loading:"loading",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.nag=function(i){var o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c=typeof h=="string",l=[].slice.call(arguments,1),u;return o.each(function(){var o=n.isPlainObject(i)?n.extend(!0,{},n.fn.nag.settings,i):n.extend({},n.fn.nag.settings),tt=o.className,b=o.selector,y=o.error,k=o.namespace,d="."+k,w=k+"-module",v=n(this),it=v.find(b.close),g=o.context?n(o.context):n("body"),nt=this,p=v.data(w),a,rt=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)};a={initialize:function(){a.verbose("Initializing element");v.on("click"+d,b.close,a.dismiss).data(w,a);o.detachable&&v.parent()[0]!==g[0]&&v.detach().prependTo(g);o.displayTime>0&&setTimeout(a.hide,o.displayTime);a.show()},destroy:function(){a.verbose("Destroying instance");v.removeData(w).off(d)},show:function(){a.should.show()&&!v.is(":visible")&&(a.debug("Showing nag",o.animation.show),o.animation.show=="fade"?v.fadeIn(o.duration,o.easing):v.slideDown(o.duration,o.easing))},hide:function(){a.debug("Showing nag",o.animation.hide);o.animation.show=="fade"?v.fadeIn(o.duration,o.easing):v.slideUp(o.duration,o.easing)},onHide:function(){a.debug("Removing nag",o.animation.hide);v.remove();o.onHide&&o.onHide()},dismiss:function(n){o.storageMethod&&a.storage.set(o.key,o.value);a.hide();n.stopImmediatePropagation();n.preventDefault()},should:{show:function(){return o.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(o.key)!=o.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(o.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(o.key)),!1)}},get:{storageOptions:function(){var n={};return o.expires&&(n.expires=o.expires),o.domain&&(n.domain=o.domain),o.path&&(n.path=o.path),n}},clear:function(){a.storage.remove(o.key)},storage:{set:function(i,u){var f=a.get.storageOptions();if(o.storageMethod=="localstorage"&&t.localStorage!==r)t.localStorage.setItem(i,u),a.debug("Value stored using local storage",i,u);else if(o.storageMethod=="sessionstorage"&&t.sessionStorage!==r)t.sessionStorage.setItem(i,u),a.debug("Value stored using session storage",i,u);else if(n.cookie!==r)n.cookie(i,u,f),a.debug("Value stored using cookie",i,u,f);else{a.error(y.noCookieStorage);return}},get:function(i){var u;return o.storageMethod=="localstorage"&&t.localStorage!==r?u=t.localStorage.getItem(i):o.storageMethod=="sessionstorage"&&t.sessionStorage!==r?u=t.sessionStorage.getItem(i):n.cookie!==r?u=n.cookie(i):a.error(y.noCookieStorage),(u=="undefined"||u=="null"||u===r||u===null)&&(u=r),u},remove:function(i){var u=a.get.storageOptions();o.storageMethod=="localstorage"&&t.localStorage!==r?t.localStorage.removeItem(i):o.storageMethod=="sessionstorage"&&t.sessionStorage!==r?t.sessionStorage.removeItem(i):n.cookie!==r?n.removeCookie(i,u):a.error(y.noStorage)}},setting:function(t,i){if(a.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,o,t);else if(i!==r)n.isPlainObject(o[t])?n.extend(!0,o[t],i):o[t]=i;else return o[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,a,t);else if(i!==r)a[t]=i;else return a[t]},debug:function(){!o.silent&&o.debug&&(o.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,o.name+":"),a.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),a.verbose.apply(console,arguments)))},error:function(){o.silent||(a.error=Function.prototype.bind.call(console.error,console,o.name+":"),a.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;o.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(a.performance.timer);a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=o.name+":",i=0;e=!1;clearTimeout(a.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=p,h,o,s;return i=i||l,f=nt||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):(a.error(y.method,t),!1)}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o}};c?(p===r&&a.initialize(),a.invoke(h)):(p!==r&&p.invoke("destroy"),a.initialize())}),u!==r?u:this};n.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noCookieStorage:"$.cookie is not included. A storage solution is required.",noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}};n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}})}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.popup=function(u){var l=n(this),s=n(i),o=n(t),h=n("body"),a=l.selector||"",y=!0,c=(new Date).getTime(),e=[],v=arguments[0],p=typeof v=="string",w=[].slice.call(arguments,1),f;return l.each(function(){var b=n.isPlainObject(u)?n.extend(!0,{},n.fn.popup.settings,u):n.extend({},n.fn.popup.settings),st=b.selector,nt=b.className,ht=b.error,tt=b.metadata,kt=b.namespace,ft="."+b.namespace,yt="module-"+kt,d=n(this),wt=n(b.context),bt=n(b.scrollContext),lt=n(b.boundary),it=b.target?n(b.target):d,k,rt,at=0,et=!1,pt=!1,g=this,ot=d.data(yt),ct,ut,vt,l;l={initialize:function(){l.debug("Initializing",d);l.createID();l.bind.events();!l.exists()&&b.preserve&&l.create();b.observeChanges&&l.observeChanges();l.instantiate()},instantiate:function(){l.verbose("Storing instance",l);ot=l;d.data(yt,ot)},observeChanges:function(){"MutationObserver"in t&&(ct=new MutationObserver(l.event.documentChanged),ct.observe(i,{childList:!0,subtree:!0}),l.debug("Setting up mutation observer",ct))},refresh:function(){b.popup?k=n(b.popup).eq(0):b.inline&&(k=it.nextAll(st.popup).eq(0),b.popup=k);b.popup?(k.addClass(nt.loading),rt=l.get.offsetParent(),k.removeClass(nt.loading),b.movePopup&&l.has.popup()&&l.get.offsetParent(k)[0]!==rt[0]&&(l.debug("Moving popup to the same offset parent as target"),k.detach().appendTo(rt))):rt=b.inline?l.get.offsetParent(it):l.has.popup()?l.get.offsetParent(k):h;rt.is("html")&&rt[0]!==h[0]&&(l.debug("Setting page as offset parent"),rt=h);l.get.variation()&&l.set.variation()},reposition:function(){l.refresh();l.set.position()},destroy:function(){l.debug("Destroying previous module");ct&&ct.disconnect();k&&!b.preserve&&l.removePopup();clearTimeout(l.hideTimer);clearTimeout(l.showTimer);l.unbind.close();l.unbind.events();d.removeData(yt)},event:{start:function(){var t=n.isPlainObject(b.delay)?b.delay.show:b.delay;clearTimeout(l.hideTimer);pt||(l.showTimer=setTimeout(l.show,t))},end:function(){var t=n.isPlainObject(b.delay)?b.delay.hide:b.delay;clearTimeout(l.showTimer);l.hideTimer=setTimeout(l.hide,t)},touchstart:function(){pt=!0;l.show()},resize:function(){l.is.visible()&&l.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==g||n(t).find(g).length>0)&&(l.debug("Element removed from DOM, tearing down events"),l.destroy())})})},hideGracefully:function(t){var r=n(t.target),u=n.contains(i.documentElement,t.target),f=r.closest(st.popup).length>0;t&&!f&&u?(l.debug("Click occurred outside popup hiding popup"),l.hide()):l.debug("Click was inside popup, keeping popup open")}},create:function(){var t=l.get.html(),i=l.get.title(),r=l.get.content();t||r||i?(l.debug("Creating pop-up html"),t||(t=b.templates.popup({title:i,content:r})),k=n("<div/>").addClass(nt.popup).data(tt.activator,d).html(t),b.inline?(l.verbose("Inserting popup element inline",k),k.insertAfter(d)):(l.verbose("Appending popup element to body",k),k.appendTo(wt)),l.refresh(),l.set.variation(),b.hoverable&&l.bind.popup(),b.onCreate.call(k,g)):it.next(st.popup).length!==0?(l.verbose("Pre-existing popup found"),b.inline=!0,b.popup=it.next(st.popup).data(tt.activator,d),l.refresh(),b.hoverable&&l.bind.popup()):b.popup?(n(b.popup).data(tt.activator,d),l.verbose("Used popup specified in settings"),l.refresh(),b.hoverable&&l.bind.popup()):l.debug("No content specified skipping display",g)},createID:function(){vt=(Math.random().toString(16)+"000000000").substr(2,8);ut="."+vt;l.verbose("Creating unique id for element",vt)},toggle:function(){l.debug("Toggling pop-up");l.is.hidden()?(l.debug("Popup is hidden, showing pop-up"),l.unbind.close(),l.show()):(l.debug("Popup is visible, hiding pop-up"),l.hide())},show:function(n){if(n=n||function(){},l.debug("Showing pop-up",b.transition),l.is.hidden()&&!(l.is.active()&&l.is.dropdown())){if(l.exists()||l.create(),b.onShow.call(k,g)===!1){l.debug("onShow callback returned false, cancelling popup animation");return}b.preserve||b.popup||l.refresh();k&&l.set.position()&&(l.save.conditions(),b.exclusive&&l.hideAll(),l.animate.show(n))}},hide:function(n){if(n=n||function(){},l.is.visible()||l.is.animating()){if(b.onHide.call(k,g)===!1){l.debug("onHide callback returned false, cancelling popup animation");return}l.remove.visible();l.unbind.close();l.restore.conditions();l.animate.hide(n)}},hideAll:function(){n(st.popup).filter("."+nt.popupVisible).each(function(){n(this).data(tt.activator).popup("hide")})},exists:function(){return k?b.inline||b.popup?l.has.popup():k.closest(wt).length>=1?!0:!1:!1},removePopup:function(){l.has.popup()&&!b.popup&&(l.debug("Removing popup",k),k.remove(),k=r,b.onRemove.call(k,g))},save:{conditions:function(){l.cache={title:d.attr("title")};l.cache.title&&d.removeAttr("title");l.verbose("Saving original attributes",l.cache.title)}},restore:{conditions:function(){return l.cache&&l.cache.title&&(d.attr("title",l.cache.title),l.verbose("Restoring original attributes",l.cache.title)),!0}},supports:{svg:function(){return typeof SVGGraphicsElement=="undefined"}},animate:{show:function(t){t=n.isFunction(t)?t:function(){};b.transition&&n.fn.transition!==r&&d.transition("is supported")?(l.set.visible(),k.transition({animation:b.transition+" in",queue:!1,debug:b.debug,verbose:b.verbose,duration:b.duration,onComplete:function(){l.bind.close();t.call(k,g);b.onVisible.call(k,g)}})):l.error(ht.noTransition)},hide:function(t){if(t=n.isFunction(t)?t:function(){},l.debug("Hiding pop-up"),b.onHide.call(k,g)===!1){l.debug("onHide callback returned false, cancelling popup animation");return}b.transition&&n.fn.transition!==r&&d.transition("is supported")?k.transition({animation:b.transition+" out",queue:!1,duration:b.duration,debug:b.debug,verbose:b.verbose,onComplete:function(){l.reset();t.call(k,g);b.onHidden.call(k,g)}}):l.error(ht.noTransition)}},change:{content:function(n){k.html(n)}},get:{html:function(){return d.removeData(tt.html),d.data(tt.html)||b.html},title:function(){return d.removeData(tt.title),d.data(tt.title)||b.title},content:function(){return d.removeData(tt.content),d.data(tt.content)||b.content||d.attr("title")},variation:function(){return d.removeData(tt.variation),d.data(tt.variation)||b.variation},popup:function(){return k},popupOffset:function(){return k.offset()},calculations:function(){var r=l.get.offsetParent(k),u=it[0],e=lt[0]==t,s=b.inline||b.popup&&b.movePopup?it.position():it.offset(),h=e?{top:0,left:0}:lt.offset(),n={},c=e?{top:o.scrollTop(),left:o.scrollLeft()}:{top:0,left:0},i,f;return n={target:{element:it[0],width:it.outerWidth(),height:it.outerHeight(),top:s.top,left:s.left,margin:{}},popup:{width:k.outerWidth(),height:k.outerHeight()},parent:{width:rt.outerWidth(),height:rt.outerHeight()},screen:{top:h.top,left:h.left,scroll:{top:c.top,left:c.left},width:lt.width(),height:lt.height()}},r.get(0)!==rt.get(0)&&(f=r.offset(),n.target.top-=f.top,n.target.left-=f.left,n.parent.width=r.outerWidth(),n.parent.height=r.outerHeight()),b.setFluidWidth&&l.is.fluid()&&(n.container={width:k.parent().outerWidth()},n.popup.width=n.container.width),n.target.margin.top=b.inline?parseInt(t.getComputedStyle(u).getPropertyValue("margin-top"),10):0,n.target.margin.left=b.inline?l.is.rtl()?parseInt(t.getComputedStyle(u).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(u).getPropertyValue("margin-left"),10):0,i=n.screen,n.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},n},id:function(){return vt},startEvent:function(){return b.on=="hover"?"mouseenter":b.on=="focus"?"focus":!1},scrollEvent:function(){return"scroll"},endEvent:function(){return b.on=="hover"?"mouseleave":b.on=="focus"?"blur":!1},distanceFromBoundary:function(n,t){var r={},u,i;return t=t||l.get.calculations(),u=t.popup,i=t.boundary,n&&(r={top:n.top-i.top,left:n.left-i.left,right:i.right-(n.left+u.width),bottom:i.bottom-(n.top+u.height)},l.verbose("Distance from boundaries determined",n,r)),r},offsetParent:function(t){var s=t!==r?t[0]:it[0],u=s.parentNode,i=n(u);if(u)for(var f=i.css("transform")==="none",e=i.css("position")==="static",o=i.is("body");u&&!o&&e&&f;)u=u.parentNode,i=n(u),f=i.css("transform")==="none",e=i.css("position")==="static",o=i.is("body");return i&&i.length>0?i:n()},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(n){var r=n.split(" "),i=r[0],u=r[1],o=i=="top"||i=="bottom",f=!1,e=!1,t=!1;return et||(l.verbose("All available positions available"),et=l.get.positions()),l.debug("Recording last position tried",n),et[n]=!0,b.prefer==="opposite"&&(t=[{top:"bottom",bottom:"top",left:"right",right:"left"}[i],u],t=t.join(" "),f=et[t]===!0,l.debug("Trying opposite strategy",t)),b.prefer==="adjacent"&&o&&(t=[i,{left:"center",center:"right",right:"left"}[u]],t=t.join(" "),e=et[t]===!0,l.debug("Trying adjacent strategy",t)),(e||f)&&(l.debug("Using backup position",t),t={"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"}[n]),t}},set:{position:function(n,t){if(it.length===0||k.length===0){l.error(ht.notFound);return}var u,f,i,s,o,e,h,c;if(t=t||l.get.calculations(),n=n||d.data(tt.position)||b.position,u=d.data(tt.offset)||b.offset,f=b.distanceAway,i=t.target,s=t.popup,o=t.parent,l.should.centerArrow(t)&&(l.verbose("Adjusting offset to center arrow on small target element"),(n=="top left"||n=="bottom left")&&(u+=i.width/2,u-=b.arrowPixelsFromEdge),(n=="top right"||n=="bottom right")&&(u-=i.width/2,u+=b.arrowPixelsFromEdge)),i.width===0&&i.height===0&&!l.is.svg(i.element))return l.debug("Popup target is hidden, no action taken"),!1;b.inline&&(l.debug("Adding margin to calculation",i.margin),n=="left center"||n=="right center"?(u+=i.margin.top,f+=-i.margin.left):n=="top left"||n=="top center"||n=="top right"?(u+=i.margin.left,f-=i.margin.top):(u+=i.margin.left,f+=i.margin.top));l.debug("Determining popup position from calculations",n,t);l.is.rtl()&&(n=n.replace(/left|right/g,function(n){return n=="left"?"right":"left"}),l.debug("RTL: Popup position updated",n));at==b.maxSearchDepth&&typeof b.lastResort=="string"&&(n=b.lastResort);switch(n){case"top left":e={top:"auto",bottom:o.height-i.top+f,left:i.left+u,right:"auto"};break;case"top center":e={bottom:o.height-i.top+f,left:i.left+i.width/2-s.width/2+u,top:"auto",right:"auto"};break;case"top right":e={bottom:o.height-i.top+f,right:o.width-i.left-i.width-u,top:"auto",left:"auto"};break;case"left center":e={top:i.top+i.height/2-s.height/2+u,right:o.width-i.left+f,left:"auto",bottom:"auto"};break;case"right center":e={top:i.top+i.height/2-s.height/2+u,left:i.left+i.width+f,bottom:"auto",right:"auto"};break;case"bottom left":e={top:i.top+i.height+f,left:i.left+u,bottom:"auto",right:"auto"};break;case"bottom center":e={top:i.top+i.height+f,left:i.left+i.width/2-s.width/2+u,bottom:"auto",right:"auto"};break;case"bottom right":e={top:i.top+i.height+f,right:o.width-i.left-i.width-u,left:"auto",bottom:"auto"}}if(e===r&&l.error(ht.invalidPosition,n),l.debug("Calculated popup positioning values",e),k.css(e).removeClass(nt.position).addClass(n).addClass(nt.loading),h=l.get.popupOffset(),c=l.get.distanceFromBoundary(h,t),l.is.offstage(c,n)){if(l.debug("Position is outside viewport",n),at<b.maxSearchDepth)return at++,n=l.get.nextPosition(n),l.debug("Trying new position",n),k?l.set.position(n,t):!1;if(b.lastResort)l.debug("No position found, showing with last position");else return l.debug("Popup could not find a position to display",k),l.error(ht.cannotPlace,g),l.remove.attempts(),l.remove.loading(),l.reset(),b.onUnplaceable.call(k,g),!1}return l.debug("Position is on stage",n),l.remove.attempts(),l.remove.loading(),b.setFluidWidth&&l.is.fluid()&&l.set.fluidWidth(t),!0},fluidWidth:function(n){n=n||l.get.calculations();l.debug("Automatically setting element width to parent width",n.parent.width);k.css("width",n.container.width)},variation:function(n){n=n||l.get.variation();n&&l.has.popup()&&(l.verbose("Adding variation to popup",n),k.addClass(n))},visible:function(){d.addClass(nt.visible)}},remove:{loading:function(){k.removeClass(nt.loading)},variation:function(n){n=n||l.get.variation();n&&(l.verbose("Removing variation",n),k.removeClass(n))},visible:function(){d.removeClass(nt.visible)},attempts:function(){l.verbose("Resetting all searched positions");at=0;et=!1}},bind:{events:function(){if(l.debug("Binding popup events to module"),b.on=="click")d.on("click"+ft,l.toggle);if(b.on=="hover"&&y)d.on("touchstart"+ft,l.event.touchstart);if(l.get.startEvent())d.on(l.get.startEvent()+ft,l.event.start).on(l.get.endEvent()+ft,l.event.end);b.target&&l.debug("Target set to element",it);o.on("resize"+ut,l.event.resize)},popup:function(){if(l.verbose("Allowing hover events on popup to prevent closing"),k&&l.has.popup())k.on("mouseenter"+ft,l.event.start).on("mouseleave"+ft,l.event.end)},close:function(){(b.hideOnScroll===!0||b.hideOnScroll=="auto"&&b.on!="click")&&l.bind.closeOnScroll();b.on=="hover"&&pt&&l.bind.touchClose();b.on=="click"&&b.closable&&l.bind.clickaway()},closeOnScroll:function(){l.verbose("Binding scroll close event to document");bt.one(l.get.scrollEvent()+ut,l.event.hideGracefully)},touchClose:function(){l.verbose("Binding popup touchclose event to document");s.on("touchstart"+ut,function(n){l.verbose("Touched away from popup");l.event.hideGracefully.call(g,n)})},clickaway:function(){l.verbose("Binding popup close event to document");s.on("click"+ut,function(n){l.verbose("Clicked away from popup");l.event.hideGracefully.call(g,n)})}},unbind:{events:function(){o.off(ut);d.off(ft)},close:function(){s.off(ut);bt.off(ut)}},has:{popup:function(){return k&&k.length>0}},should:{centerArrow:function(n){return!l.is.basic()&&n.target.width<=b.arrowPixelsFromEdge*2}},is:{offstage:function(t,i){var r=[];return n.each(t,function(n,t){t<-b.jitter&&(l.debug("Position exceeds allowable distance from edge",n,t,i),r.push(n))}),r.length>0?!0:!1},svg:function(n){return l.supports.svg()&&n instanceof SVGGraphicsElement},basic:function(){return d.hasClass(nt.basic)},active:function(){return d.hasClass(nt.active)},animating:function(){return k!==r&&k.hasClass(nt.animating)},fluid:function(){return k!==r&&k.hasClass(nt.fluid)},visible:function(){return k!==r&&k.hasClass(nt.popupVisible)},dropdown:function(){return d.hasClass(nt.dropdown)},hidden:function(){return!l.is.visible()},rtl:function(){return d.css("direction")=="rtl"}},reset:function(){l.remove.visible();b.preserve?n.fn.transition!==r&&k.transition("remove transition"):l.removePopup()},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,b,t);else if(i!==r)b[t]=i;else return b[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else if(i!==r)l[t]=i;else return l[t]},debug:function(){!b.silent&&b.debug&&(b.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,b.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),l.verbose.apply(console,arguments)))},error:function(){b.silent||(l.error=Function.prototype.bind.call(console.error,console,b.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;b.performance&&(t=(new Date).getTime(),r=c||t,i=t-r,c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:g,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=b.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";a&&(t+=" '"+a+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=ot,h,o,s;return i=i||w,u=g||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};p?(ot===r&&l.initialize(),l.invoke(v)):(ot!==r&&ot.invoke("destroy"),l.initialize())}),f!==r?f:this};n.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:t,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:t,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(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=function(n){return t[n]};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,i):n},popup:function(t){var i="",u=n.fn.popup.settings.templates.escape;return typeof t!==r&&(typeof t.title!==r&&t.title&&(t.title=u(t.title),i+='<div class="header">'+t.title+"<\/div>"),typeof t.content!==r&&t.content&&(t.content=u(t.content),i+='<div class="content">'+t.content+"<\/div>")),i}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();var u=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.progress=function(t){var o=n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c=typeof h=="string",l=[].slice.call(arguments,1),u;return o.each(function(){var a=n.isPlainObject(t)?n.extend(!0,{},n.fn.progress.settings,t):n.extend({},n.fn.progress.settings),y=a.className,g=a.metadata,rt=a.namespace,nt=a.selector,k=a.error,ut="."+rt,tt="module-"+rt,v=n(this),b=n(this).find(nt.bar),it=n(this).find(nt.progress),ft=n(this).find(nt.label),p=this,w=v.data(tt),d=!1,et,o;o={initialize:function(){o.debug("Initializing progress bar",a);o.set.duration();o.set.transitionEvent();o.read.metadata();o.read.settings();o.instantiate()},instantiate:function(){o.verbose("Storing instance of progress",o);w=o;v.data(tt,o)},destroy:function(){o.verbose("Destroying previous progress for",v);clearInterval(w.interval);o.remove.state();v.removeData(tt);w=r},reset:function(){o.remove.nextValue();o.update.progress(0)},complete:function(){(o.percent===r||o.percent<100)&&(o.remove.progressPoll(),o.set.percent(100))},read:{metadata:function(){var n={percent:v.data(g.percent),total:v.data(g.total),value:v.data(g.value)};n.percent&&(o.debug("Current percent value set from metadata",n.percent),o.set.percent(n.percent));n.total&&(o.debug("Total value set from metadata",n.total),o.set.total(n.total));n.value&&(o.debug("Current value set from metadata",n.value),o.set.value(n.value),o.set.progress(n.value))},settings:function(){a.total!==!1&&(o.debug("Current total set in settings",a.total),o.set.total(a.total));a.value!==!1&&(o.debug("Current value set in settings",a.value),o.set.value(a.value),o.set.progress(o.value));a.percent!==!1&&(o.debug("Current percent set in settings",a.percent),o.set.percent(a.percent))}},bind:{transitionEnd:function(n){var t=o.get.transitionEnd();b.one(t+ut,function(t){clearTimeout(o.failSafeTimer);n.call(this,t)});o.failSafeTimer=setTimeout(function(){b.triggerHandler(t)},a.duration+a.failSafeDelay);o.verbose("Adding fail safe timer",o.timer)}},increment:function(n){var r,i,t;o.has.total()?(i=o.get.value(),n=n||1,t=i+n):(i=o.get.percent(),n=n||o.get.randomValue(),t=i+n,r=100,o.debug("Incrementing percentage by",i,t));t=o.get.normalizedValue(t);o.set.progress(t)},decrement:function(n){var r=o.get.total(),t,i;r?(t=o.get.value(),n=n||1,i=t-n,o.debug("Decrementing value by",n,t)):(t=o.get.percent(),n=n||o.get.randomValue(),i=t-n,o.debug("Decrementing percentage by",n,t));i=o.get.normalizedValue(i);o.set.progress(i)},has:{progressPoll:function(){return o.progressPoll},total:function(){return o.get.total()!==!1}},get:{text:function(n){var t=o.value||0,i=o.total||0,r=d?o.get.displayPercent():o.percent||0,u=o.total>0?i-t:100-r;return n=n||"",n=n.replace("{value}",t).replace("{total}",i).replace("{left}",u).replace("{percent}",r),o.verbose("Adding variables to progress bar text",n),n},normalizedValue:function(n){if(n<0)return o.debug("Value cannot decrement below 0"),0;if(o.has.total()){if(n>o.total)return o.debug("Value cannot increment above total",o.total),o.total}else if(n>100)return o.debug("Value cannot increment above 100 percent"),100;return n},updateInterval:function(){return a.updateInterval=="auto"?a.duration:a.updateInterval},randomValue:function(){return o.debug("Generating random increment percentage"),Math.floor(Math.random()*a.random.max+a.random.min)},numericValue:function(n){return typeof n=="string"?n.replace(/[^\d.]/g,"")!==""?+n.replace(/[^\d.]/g,""):!1:n},transitionEnd:function(){var u=i.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var t in n)if(u.style[t]!==r)return n[t]},displayPercent:function(){var n=b.width(),i=v.width(),r=parseInt(b.css("min-width"),10),t=n>r?n/i*100:o.percent;return a.precision>0?Math.round(t*10*a.precision)/(10*a.precision):Math.round(t)},percent:function(){return o.percent||0},value:function(){return o.nextValue||o.value||0},total:function(){return o.total||!1}},create:{progressPoll:function(){o.progressPoll=setTimeout(function(){o.update.toNextValue();o.remove.progressPoll()},o.get.updateInterval())}},is:{complete:function(){return o.is.success()||o.is.warning()||o.is.error()},success:function(){return v.hasClass(y.success)},warning:function(){return v.hasClass(y.warning)},error:function(){return v.hasClass(y.error)},active:function(){return v.hasClass(y.active)},visible:function(){return v.is(":visible")}},remove:{progressPoll:function(){o.verbose("Removing progress poll timer");o.progressPoll&&(clearTimeout(o.progressPoll),delete o.progressPoll)},nextValue:function(){o.verbose("Removing progress value stored for next update");delete o.nextValue},state:function(){o.verbose("Removing stored state");delete o.total;delete o.percent;delete o.value},active:function(){o.verbose("Removing active state");v.removeClass(y.active)},success:function(){o.verbose("Removing success state");v.removeClass(y.success)},warning:function(){o.verbose("Removing warning state");v.removeClass(y.warning)},error:function(){o.verbose("Removing error state");v.removeClass(y.error)}},set:{barWidth:function(n){n>100?o.error(k.tooHigh,n):n<0?o.error(k.tooLow,n):(b.css("width",n+"%"),v.attr("data-percent",parseInt(n,10)))},duration:function(n){n=n||a.duration;n=typeof n=="number"?n+"ms":n;o.verbose("Setting progress bar transition duration",n);b.css({"transition-duration":n})},percent:function(n){n=typeof n=="string"?+n.replace("%",""):n;n=a.precision>0?Math.round(n*10*a.precision)/(10*a.precision):Math.round(n);o.percent=n;o.has.total()||(o.value=a.precision>0?Math.round(n/100*o.total*10*a.precision)/(10*a.precision):Math.round(n/100*o.total*10)/10,a.limitValues&&(o.value=o.value>100?100:o.value<0?0:o.value));o.set.barWidth(n);o.set.labelInterval();o.set.labels();a.onChange.call(p,n,o.value,o.total)},labelInterval:function(){var t=function(){o.verbose("Bar finished animating, removing continuous label updates");clearInterval(o.interval);d=!1;o.set.labels()};clearInterval(o.interval);o.bind.transitionEnd(t);d=!0;o.interval=setInterval(function(){var t=n.contains(i.documentElement,p);t||(clearInterval(o.interval),d=!1);o.set.labels()},a.framerate)},labels:function(){o.verbose("Setting both bar progress and outer label text");o.set.barLabel();o.set.state()},label:function(n){n=n||"";n&&(n=o.get.text(n),o.verbose("Setting label to text",n),ft.text(n))},state:function(n){n=n!==r?n:o.percent;n===100?!a.autoSuccess||o.is.warning()||o.is.error()||o.is.success()?(o.verbose("Reached 100% removing active state"),o.remove.active(),o.remove.progressPoll()):(o.set.success(),o.debug("Automatically triggering success at 100%")):n>0?(o.verbose("Adjusting active progress bar label",n),o.set.active()):(o.remove.active(),o.set.label(a.text.active))},barLabel:function(n){n!==r?it.text(o.get.text(n)):a.label=="ratio"&&o.total?(o.verbose("Adding ratio to bar label"),it.text(o.get.text(a.text.ratio))):a.label=="percent"&&(o.verbose("Adding percentage to bar label"),it.text(o.get.text(a.text.percent)))},active:function(n){n=n||a.text.active;o.debug("Setting active state");a.showActivity&&!o.is.active()&&v.addClass(y.active);o.remove.warning();o.remove.error();o.remove.success();n=a.onLabelUpdate("active",n,o.value,o.total);n&&o.set.label(n);o.bind.transitionEnd(function(){a.onActive.call(p,o.value,o.total)})},success:function(n){n=n||a.text.success||a.text.active;o.debug("Setting success state");v.addClass(y.success);o.remove.active();o.remove.warning();o.remove.error();o.complete();a.text.success?(n=a.onLabelUpdate("success",n,o.value,o.total),o.set.label(n)):(n=a.onLabelUpdate("active",n,o.value,o.total),o.set.label(n));o.bind.transitionEnd(function(){a.onSuccess.call(p,o.total)})},warning:function(n){n=n||a.text.warning;o.debug("Setting warning state");v.addClass(y.warning);o.remove.active();o.remove.success();o.remove.error();o.complete();n=a.onLabelUpdate("warning",n,o.value,o.total);n&&o.set.label(n);o.bind.transitionEnd(function(){a.onWarning.call(p,o.value,o.total)})},error:function(n){n=n||a.text.error;o.debug("Setting error state");v.addClass(y.error);o.remove.active();o.remove.success();o.remove.warning();o.complete();n=a.onLabelUpdate("error",n,o.value,o.total);n&&o.set.label(n);o.bind.transitionEnd(function(){a.onError.call(p,o.value,o.total)})},transitionEvent:function(){et=o.get.transitionEnd()},total:function(n){o.total=n},value:function(n){o.value=n},progress:function(n){o.has.progressPoll()?(o.debug("Updated within interval, setting next update to use new value",n),o.set.nextValue(n)):(o.debug("First update in progress update interval, immediately updating",n),o.update.progress(n),o.create.progressPoll())},nextValue:function(n){o.nextValue=n}},update:{toNextValue:function(){var n=o.nextValue;n&&(o.debug("Update interval complete using last updated value",n),o.update.progress(n),o.remove.nextValue())},progress:function(n){var t;n=o.get.numericValue(n);n===!1&&o.error(k.nonNumeric,n);n=o.get.normalizedValue(n);o.has.total()?(o.set.value(n),t=n/o.total*100,o.debug("Calculating percent complete from total",t),o.set.percent(t)):(t=n,o.debug("Setting value to exact percentage value",t),o.set.percent(t))}},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else if(i!==r)n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i;else return a[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else if(i!==r)o[t]=i;else return o[t]},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:p,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=w,c,s,h;return i=i||l,f=p||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(n.isPlainObject(e[u])&&i!=c)e=e[u];else return e[u]!==r?(s=e[u],!1):(o.error(k.method,t),!1)}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),n.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(w===r&&o.initialize(),o.invoke(h)):(w!==r&&w.invoke("destroy"),o.initialize())}),u!==r?u:this};n.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(n,t){return t},onChange:function(){},onSuccess:function(){},onActive:function(){},onError:function(){},onWarning:function(){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}"},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.rating=function(t){var f=n(this),o=f.selector||"",e=(new Date).getTime(),u=[],s=arguments[0],h=typeof s=="string",c=[].slice.call(arguments,1),i;return f.each(function(){var a=n.isPlainObject(t)?n.extend(!0,{},n.fn.rating.settings,t):n.extend({},n.fn.rating.settings),it=a.namespace,y=a.className,w=a.metadata,k=a.selector,rt=a.error,d="."+it,g="module-"+it,nt=this,b=n(this).data(g),v=n(this),p=v.find(k.icon),tt,l;l={initialize:function(){l.verbose("Initializing rating module",a);p.length===0&&l.setup.layout();a.interactive?l.enable():l.disable();l.set.initialLoad();l.set.rating(l.get.initialRating());l.remove.initialLoad();l.instantiate()},instantiate:function(){l.verbose("Instantiating module",a);b=l;v.data(g,l)},destroy:function(){l.verbose("Destroying previous instance",b);l.remove.events();v.removeData(g)},refresh:function(){p=v.find(k.icon)},setup:{layout:function(){var t=l.get.maxRating(),i=n.fn.rating.settings.templates.icon(t);l.debug("Generating icon html dynamically");v.html(i);l.refresh()}},event:{mouseenter:function(){var t=n(this);t.nextAll().removeClass(y.selected);v.addClass(y.selected);t.addClass(y.selected).prevAll().addClass(y.selected)},mouseleave:function(){v.removeClass(y.selected);p.removeClass(y.selected)},click:function(){var i=n(this),r=l.get.rating(),t=p.index(i)+1,u=a.clearable=="auto"?p.length===1:a.clearable;u&&r==t?l.clearRating():l.set.rating(t)}},clearRating:function(){l.debug("Clearing current rating");l.set.rating(0)},bind:{events:function(){l.verbose("Binding events");v.on("mouseenter"+d,k.icon,l.event.mouseenter).on("mouseleave"+d,k.icon,l.event.mouseleave).on("click"+d,k.icon,l.event.click)}},remove:{events:function(){l.verbose("Removing events");v.off(d)},initialLoad:function(){tt=!1}},enable:function(){l.debug("Setting rating to interactive mode");l.bind.events();v.removeClass(y.disabled)},disable:function(){l.debug("Setting rating to read-only mode");l.remove.events();v.addClass(y.disabled)},is:{initialLoad:function(){return tt}},get:{initialRating:function(){return v.data(w.rating)!==r?(v.removeData(w.rating),v.data(w.rating)):a.initialRating},maxRating:function(){return v.data(w.maxRating)!==r?(v.removeData(w.maxRating),v.data(w.maxRating)):a.maxRating},rating:function(){var n=p.filter("."+y.active).length;return l.verbose("Current rating retrieved",n),n}},set:{rating:function(n){var t=n-1>=0?n-1:0,i=p.eq(t);v.removeClass(y.selected);p.removeClass(y.selected).removeClass(y.active);n>0&&(l.verbose("Setting current rating to",n),i.prevAll().addBack().addClass(y.active));l.is.initialLoad()||a.onRate.call(nt,n)},initialLoad:function(){tt=!0}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else if(i!==r)n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i;else return a[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else if(i!==r)l[t]=i;else return l[t]},debug:function(){!a.silent&&a.debug&&(a.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,a.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),l.verbose.apply(console,arguments)))},error:function(){a.silent||(l.error=Function.prototype.bind.call(console.error,console,a.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,u.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(l.performance.timer);n.each(u,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";o&&(t+=" '"+o+"'");f.length>1&&(t+=" ("+f.length+")");(console.group!==r||console.table!==r)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):n.each(u,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());u=[]}},invoke:function(t,u,f){var e=b,h,o,s;return u=u||c,f=nt||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(f,u):o!==r&&(s=o),n.isArray(i)?i.push(s):i!==r?i=[i,s]:s!==r&&(i=s),o}};h?(b===r&&l.initialize(),l.invoke(s)):(b!==r&&b.invoke("destroy"),l.initialize())}),i!==r?i:this};n.fn.rating.settings={name:"Rating",namespace:"rating",slent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(n){for(var t=1,i="";t<=n;)i+='<i class="icon"><\/i>',t++;return i}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.search=function(u){var o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=arguments[0],l=typeof c=="string",a=[].slice.call(arguments,1),f;return n(this).each(function(){var y=n.isPlainObject(u)?n.extend(!0,{},n.fn.search.settings,u):n.extend({},n.fn.search.settings),b=y.className,d=y.metadata,ct=y.regExp,g=y.fields,w=y.selector,rt=y.error,lt=y.namespace,nt="."+lt,ft=lt+"-module",p=n(this),tt=p.find(w.prompt),et=p.find(w.searchButton),k=p.find(w.results),ot=p.find(w.result),at=p.find(w.category),it=this,ut=p.data(ft),st=!1,ht=!1,v;v={initialize:function(){v.verbose("Initializing module");v.get.settings();v.determine.searchFields();v.bind.events();v.set.type();v.create.results();v.instantiate()},instantiate:function(){v.verbose("Storing instance of module",v);ut=v;p.data(ft,v)},destroy:function(){v.verbose("Destroying instance");p.off(nt).removeData(ft)},refresh:function(){v.debug("Refreshing selector cache");tt=p.find(w.prompt);et=p.find(w.searchButton);at=p.find(w.category);k=p.find(w.results);ot=p.find(w.result)},refreshResults:function(){k=p.find(w.results);ot=p.find(w.result)},bind:{events:function(){if(v.verbose("Binding events to search"),y.automatic){p.on(v.get.inputEvent()+nt,w.prompt,v.event.input);tt.attr("autocomplete","off")}p.on("focus"+nt,w.prompt,v.event.focus).on("blur"+nt,w.prompt,v.event.blur).on("keydown"+nt,w.prompt,v.handleKeyboard).on("click"+nt,w.searchButton,v.query).on("mousedown"+nt,w.results,v.event.result.mousedown).on("mouseup"+nt,w.results,v.event.result.mouseup).on("click"+nt,w.result,v.event.result.click)}},determine:{searchFields:function(){u&&u.searchFields!==r&&(y.searchFields=u.searchFields)}},event:{input:function(){y.searchDelay?(clearTimeout(v.timer),v.timer=setTimeout(function(){v.is.focused()&&v.query()},y.searchDelay)):v.query()},focus:function(){v.set.focus();y.searchOnFocus&&v.has.minimumCharacters()&&v.query(function(){v.can.show()&&v.showResults()})},blur:function(){var t=i.activeElement===this,n=function(){v.cancel.query();v.remove.focus();v.timer=setTimeout(v.hideResults,y.hideDelay)};if(!t)if(ht=!1,v.resultsClicked){v.debug("Determining if user action caused search to close");p.one("click.close"+nt,w.results,function(t){if(v.is.inMessage(t)||st){tt.focus();return}st=!1;v.is.animating()||v.is.hidden()||n()})}else v.debug("Input blurred without user action, closing results"),n()},result:{mousedown:function(){v.resultsClicked=!0},mouseup:function(){v.resultsClicked=!1},click:function(i){v.debug("Search result selected");var r=n(this),u=r.find(w.title).eq(0),f=r.is("a[href]")?r:r.find("a[href]").eq(0),e=f.attr("href")||!1,h=f.attr("target")||!1,l=u.html(),o=u.length>0?u.text():!1,s=v.get.results(),c=r.data(d.result)||v.get.result(o,s);if(n.isFunction(y.onSelect)&&y.onSelect.call(it,c,s)===!1){v.debug("Custom onSelect callback cancelled default select action");st=!0;return}v.hideResults();o&&v.set.value(o);e&&(v.verbose("Opening search link found in result",f),h=="_blank"||i.ctrlKey?t.open(e):t.location.href=e)}}},handleKeyboard:function(n){var t=p.find(w.result),f=p.find(w.category),o=t.filter("."+b.active),i=t.index(o),s=t.length,h=o.length>0,r=n.which,u={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},e;if(r==u.escape&&(v.verbose("Escape key pressed, blurring search field"),v.hideResults(),ht=!0),v.is.visible())if(r==u.enter){if(v.verbose("Enter key pressed, selecting active result"),t.filter("."+b.active).length>0)return v.event.result.click.call(t.filter("."+b.active),n),n.preventDefault(),!1}else r==u.upArrow&&h?(v.verbose("Up key pressed, changing active result"),e=i-1<0?i:i-1,f.removeClass(b.active),t.removeClass(b.active).eq(e).addClass(b.active).closest(f).addClass(b.active),n.preventDefault()):r==u.downArrow&&(v.verbose("Down key pressed, changing active result"),e=i+1>=s?i:i+1,f.removeClass(b.active),t.removeClass(b.active).eq(e).addClass(b.active).closest(f).addClass(b.active),n.preventDefault());else if(r==u.enter){v.verbose("Enter key pressed, executing query");v.query();v.set.buttonPressed();tt.one("keyup",v.remove.buttonFocus)}},setup:{api:function(t,i){var r={debug:y.debug,on:!1,cache:y.cache,action:"search",urlData:{query:t},onSuccess:function(n){v.parse.response.call(it,n,t);i()},onFailure:function(){v.displayMessage(rt.serverError);i()},onAbort:function(){},onError:v.error};n.extend(!0,r,y.apiSettings);v.verbose("Setting up API request",r);p.api(r)}},can:{useAPI:function(){return n.fn.api!==r},show:function(){return v.is.focused()&&!v.is.visible()&&!v.is.empty()},transition:function(){return y.transition&&n.fn.transition!==r&&p.transition("is supported")}},is:{animating:function(){return k.hasClass(b.animating)},hidden:function(){return k.hasClass(b.hidden)},inMessage:function(t){if(t.target){var r=n(t.target),u=n.contains(i.documentElement,t.target);return u&&r.closest(w.message).length>0}},empty:function(){return k.html()===""},visible:function(){return k.filter(":visible").length>0},focused:function(){return tt.filter(":focus").length>0}},get:{settings:function(){n.isPlainObject(u)&&u.searchFullText&&(y.fullTextSearch=u.searchFullText,v.error(y.error.oldSearchSyntax,it))},inputEvent:function(){var n=tt[0];return n!==r&&n.oninput!==r?"input":n!==r&&n.onpropertychange!==r?"propertychange":"keyup"},value:function(){return tt.val()},results:function(){return p.data(d.results)},result:function(t,i){var f=["title","id"],u=!1;return t=t!==r?t:v.get.value(),i=i!==r?i:v.get.results(),y.type==="category"?(v.debug("Finding result that matches",t),n.each(i,function(i,r){if(n.isArray(r.results)&&(u=v.search.object(t,r.results,f)[0],u))return!1})):(v.debug("Finding result in results object",t),u=v.search.object(t,i,f)[0]),u||!1}},select:{firstResult:function(){v.verbose("Selecting first result");ot.first().addClass(b.active)}},set:{focus:function(){p.addClass(b.focus)},loading:function(){p.addClass(b.loading)},value:function(n){v.verbose("Setting search input value",n);tt.val(n)},type:function(n){n=n||y.type;y.type=="category"&&p.addClass(y.type)},buttonPressed:function(){et.addClass(b.pressed)}},remove:{loading:function(){p.removeClass(b.loading)},focus:function(){p.removeClass(b.focus)},buttonPressed:function(){et.removeClass(b.pressed)}},query:function(t){t=n.isFunction(t)?t:function(){};var i=v.get.value(),r=v.read.cache(i);t=t||function(){};v.has.minimumCharacters()?(r?(v.debug("Reading result from cache",i),v.save.results(r.results),v.addResults(r.html),v.inject.id(r.results),t()):(v.debug("Querying for",i),n.isPlainObject(y.source)||n.isArray(y.source)?(v.search.local(i),t()):v.can.useAPI()?v.search.remote(i,t):(v.error(rt.source),t())),y.onSearchQuery.call(it,i)):v.hideResults()},search:{local:function(n){var t=v.search.object(n,y.content),i;v.set.loading();v.save.results(t);v.debug("Returned full local search results",t);y.maxResults>0&&(v.debug("Using specified max results",t),t=t.slice(0,y.maxResults));y.type=="category"&&(t=v.create.categoryResults(t));i=v.generateResults({results:t});v.remove.loading();v.addResults(i);v.inject.id(t);v.write.cache(n,{html:i,results:t})},remote:function(t,i){i=n.isFunction(i)?i:function(){};p.api("is loading")&&p.api("abort");v.setup.api(t,i);p.api("query")},object:function(t,i,u){var f=[],e=[],o=[],h=t.toString().replace(ct.escape,"\\$&"),c=new RegExp(ct.beginsWith+h,"i"),s=function(t,i){var r=n.inArray(i,f)==-1,u=n.inArray(i,o)==-1,s=n.inArray(i,e)==-1;r&&u&&s&&t.push(i)};return(i=i||y.source,u=u!==r?u:y.searchFields,n.isArray(u)||(u=[u]),i===r||i===!1)?(v.error(rt.source),[]):(n.each(u,function(r,u){n.each(i,function(n,i){var r=typeof i[u]=="string";r&&(i[u].search(c)!==-1?s(f,i):y.fullTextSearch==="exact"&&v.exactSearch(t,i[u])?s(e,i):y.fullTextSearch==!0&&v.fuzzySearch(t,i[u])&&s(o,i))})}),n.merge(e,o),n.merge(f,e),f)}},exactSearch:function(n,t){return(n=n.toLowerCase(),t=t.toLowerCase(),t.indexOf(n)>-1)?!0:!1},fuzzySearch:function(n,t){var r=t.length,u=n.length,i,f,e;if(typeof n!="string"||(n=n.toLowerCase(),t=t.toLowerCase(),u>r))return!1;if(u===r)return n===t;n:for(i=0,f=0;i<u;i++){for(e=n.charCodeAt(i);f<r;)if(t.charCodeAt(f++)===e)continue n;return!1}return!0},parse:{response:function(n,t){var i=v.generateResults(n);v.verbose("Parsing server response",n);n!==r&&t!==r&&n[g.results]!==r&&(v.addResults(i),v.inject.id(n[g.results]),v.write.cache(t,{html:i,results:n[g.results]}),v.save.results(n[g.results]))}},cancel:{query:function(){v.can.useAPI()&&p.api("abort")}},has:{minimumCharacters:function(){var n=v.get.value(),t=n.length;return t>=y.minCharacters},results:function(){if(k.length===0)return!1;var n=k.html();return n!=""}},clear:{cache:function(n){var t=p.data(d.cache);n?n&&t&&t[n]&&(v.debug("Removing value from cache",n),delete t[n],p.data(d.cache,t)):(v.debug("Clearing cache",n),p.removeData(d.cache))}},read:{cache:function(n){var t=p.data(d.cache);return y.cache?(v.verbose("Checking cache for generated html for query",n),typeof t=="object"&&t[n]!==r?t[n]:!1):!1}},create:{categoryResults:function(t){var i={};return n.each(t,function(n,t){t.category&&(i[t.category]===r?(v.verbose("Creating new category of results",t.category),i[t.category]={name:t.category,results:[t]}):i[t.category].results.push(t))}),i},id:function(n,t){var u=n+1,e=t+1,f,i;return t!==r?(f=String.fromCharCode(97+t),i=f+u,v.verbose("Creating category result id",i)):(i=u,v.verbose("Creating result id",i)),i},results:function(){k.length===0&&(k=n("<div />").addClass(b.results).appendTo(p))}},inject:{result:function(n,t,i){v.verbose("Injecting result into results");var u=i!==r?k.children().eq(i).children(w.results).first().children(w.result).eq(t):k.children(w.result).eq(t);v.verbose("Injecting results metadata",u);u.data(d.result,n)},id:function(t){v.debug("Injecting unique ids into results");var u=0,i=0;return y.type==="category"?n.each(t,function(t,f){i=0;n.each(f.results,function(n){var t=f.results[n];t.id===r&&(t.id=v.create.id(i,u));v.inject.result(t,i,u);i++});u++}):n.each(t,function(n){var u=t[n];u.id===r&&(u.id=v.create.id(i));v.inject.result(u,i);i++}),t}},save:{results:function(n){v.verbose("Saving current search results to metadata",n);p.data(d.results,n)}},write:{cache:function(n,t){var i=p.data(d.cache)!==r?p.data(d.cache):{};y.cache&&(v.verbose("Writing generated html to cache",n,t),i[n]=t,p.data(d.cache,i))}},addResults:function(t){if(n.isFunction(y.onResultsAdd)&&y.onResultsAdd.call(k,t)===!1)return v.debug("onResultsAdd callback cancelled default action"),!1;t?(k.html(t),v.refreshResults(),y.selectFirstResult&&v.select.firstResult(),v.showResults()):v.hideResults(function(){k.empty()})},showResults:function(t){(t=n.isFunction(t)?t:function(){},ht)||!v.is.visible()&&v.has.results()&&(v.can.transition()?(v.debug("Showing results with css animations"),k.transition({animation:y.transition+" in",debug:y.debug,verbose:y.verbose,duration:y.duration,onComplete:function(){t()},queue:!0})):(v.debug("Showing results with javascript"),k.stop().fadeIn(y.duration,y.easing)),y.onResultsOpen.call(k))},hideResults:function(t){t=n.isFunction(t)?t:function(){};v.is.visible()&&(v.can.transition()?(v.debug("Hiding results with css animations"),k.transition({animation:y.transition+" out",debug:y.debug,verbose:y.verbose,duration:y.duration,onComplete:function(){t()},queue:!0})):(v.debug("Hiding results with javascript"),k.stop().fadeOut(y.duration,y.easing)),y.onResultsClose.call(k))},generateResults:function(t){v.debug("Generating html from response",t);var r=y.templates[y.type],u=n.isPlainObject(t[g.results])&&!n.isEmptyObject(t[g.results]),f=n.isArray(t[g.results])&&t[g.results].length>0,i="";return u||f?(y.maxResults>0&&(u?y.type=="standard"&&v.error(rt.maxResults):t[g.results]=t[g.results].slice(0,y.maxResults)),n.isFunction(r)?i=r(t,g):v.error(rt.noTemplate,!1)):y.showNoResults&&(i=v.displayMessage(rt.noResults,"empty")),y.onResults.call(it,t),i},displayMessage:function(n,t){return t=t||"standard",v.debug("Displaying message",n,t),v.addResults(y.templates.message(n,t)),y.templates.message(n,t)},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else if(i!==r)y[t]=i;else return y[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else if(i!==r)v[t]=i;else return v[t]},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;y.performance&&(t=(new Date).getTime(),r=s||t,i=t-r,s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:it,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;s=!1;clearTimeout(v.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");o.length>1&&(t+=" ("+o.length+")");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=ut,h,o,s;return i=i||a,u=it||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(ut===r&&v.initialize(),v.invoke(c)):(ut!==r&&ut.invoke("destroy"),v.initialize())}),f!==r?f:this};n.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(){},onResults:function(){},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(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=function(n){return t[n]};return/[&<>"'`]/.test(n)?n.replace(/[&<>"'`]/g,i):n},message:function(n,t){var i="";return n!==r&&t!==r&&(i+='<div class="message '+t+'">',i+=t=="empty"?'<div class="header">No Results<\/div class="header"><div class="description">'+n+'<\/div class="description">':' <div class="description">'+n+"<\/div>",i+="<\/div>"),i},category:function(t,i){var u="",f=n.fn.search.settings.templates.escape;return t[i.categoryResults]!==r?(n.each(t[i.categoryResults],function(t,f){f[i.results]!==r&&f.results.length>0&&(u+='<div class="category">',f[i.categoryName]!==r&&(u+='<div class="name">'+f[i.categoryName]+"<\/div>"),u+='<div class="results">',n.each(f.results,function(n,t){u+=t[i.url]?'<a class="result" href="'+t[i.url]+'">':'<a class="result">';t[i.image]!==r&&(u+='<div class="image"> <img src="'+t[i.image]+'"><\/div>');u+='<div class="content">';t[i.price]!==r&&(u+='<div class="price">'+t[i.price]+"<\/div>");t[i.title]!==r&&(u+='<div class="title">'+t[i.title]+"<\/div>");t[i.description]!==r&&(u+='<div class="description">'+t[i.description]+"<\/div>");u+="<\/div>";u+="<\/a>"}),u+="<\/div>",u+="<\/div>")}),t[i.action]&&(u+='<a href="'+t[i.action][i.actionURL]+'" class="action">'+t[i.action][i.actionText]+"<\/a>"),u):!1},standard:function(t,i){var u="";return t[i.results]!==r?(n.each(t[i.results],function(n,t){u+=t[i.url]?'<a class="result" href="'+t[i.url]+'">':'<a class="result">';t[i.image]!==r&&(u+='<div class="image"> <img src="'+t[i.image]+'"><\/div>');u+='<div class="content">';t[i.price]!==r&&(u+='<div class="price">'+t[i.price]+"<\/div>");t[i.title]!==r&&(u+='<div class="title">'+t[i.title]+"<\/div>");t[i.description]!==r&&(u+='<div class="description">'+t[i.description]+"<\/div>");u+="<\/div>";u+="<\/a>"}),t[i.action]&&(u+='<a href="'+t[i.action][i.actionURL]+'" class="action">'+t[i.action][i.actionText]+"<\/a>"),u):!1}}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.shape=function(u){var o=n(this),v=n("body"),s=(new Date).getTime(),e=[],h=arguments[0],c=typeof h=="string",l=[].slice.call(arguments,1),a=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},f;return o.each(function(){var ut=o.selector||"",v=n.isPlainObject(u)?n.extend(!0,{},n.fn.shape.settings,u):n.extend({},n.fn.shape.settings),ft=v.namespace,k=v.selector,et=v.error,b=v.className,ot="."+ft,rt="module-"+ft,w=n(this),d=w.find(k.sides),g=w.find(k.side),it=!1,p,y,nt=this,tt=w.data(rt),t;t={initialize:function(){t.verbose("Initializing module for",nt);t.set.defaultSide();t.instantiate()},instantiate:function(){t.verbose("Storing instance of module",t);tt=t;w.data(rt,tt)},destroy:function(){t.verbose("Destroying previous module for",nt);w.removeData(rt).off(ot)},refresh:function(){t.verbose("Refreshing selector cache for",nt);w=n(nt);d=n(this).find(k.shape);g=n(this).find(k.side)},repaint:function(){t.verbose("Forcing repaint event");var n=d[0]||i.createElement("div"),r=n.offsetWidth},animate:function(n,i){if(t.verbose("Animating box with properties",n),i=i||function(n){t.verbose("Executing animation callback");n!==r&&n.stopPropagation();t.reset();t.set.active()},v.beforeChange.call(y[0]),t.get.transitionEvent()){t.verbose("Starting CSS animation");w.addClass(b.animating);d.css(n).one(t.get.transitionEvent(),i);t.set.duration(v.duration);a(function(){w.addClass(b.animating);p.addClass(b.hidden)})}else i()},queue:function(n){t.debug("Queueing animation of",n);d.one(t.get.transitionEvent(),function(){t.debug("Executing queued animation");setTimeout(function(){w.shape(n)},0)})},reset:function(){t.verbose("Animating states reset");w.removeClass(b.animating).attr("style","").removeAttr("style");d.attr("style","").removeAttr("style");g.attr("style","").removeAttr("style").removeClass(b.hidden);y.removeClass(b.animating).attr("style","").removeAttr("style")},is:{complete:function(){return g.filter("."+b.active)[0]==y[0]},animating:function(){return w.hasClass(b.animating)}},set:{defaultSide:function(){p=w.find("."+v.className.active);y=p.next(k.side).length>0?p.next(k.side):w.find(k.side).first();it=!1;t.verbose("Active side set to",p);t.verbose("Next side set to",y)},duration:function(n){n=n||v.duration;n=typeof n=="number"?n+"ms":n;t.verbose("Setting animation duration",n);(v.duration||v.duration===0)&&d.add(g).css({"-webkit-transition-duration":n,"-moz-transition-duration":n,"-ms-transition-duration":n,"-o-transition-duration":n,"transition-duration":n})},currentStageSize:function(){var n=w.find("."+v.className.active),t=n.outerWidth(!0),i=n.outerHeight(!0);w.css({width:t,height:i})},stageSize:function(){var n=w.clone().addClass(b.loading),i=n.find("."+v.className.active),r=it?n.find(k.side).eq(it):i.next(k.side).length>0?i.next(k.side):n.find(k.side).first(),u=v.width=="next"?r.outerWidth(!0):v.width=="initial"?w.width():v.width,f=v.height=="next"?r.outerHeight(!0):v.height=="initial"?w.height():v.height;i.removeClass(b.active);r.addClass(b.active);n.insertAfter(w);n.remove();v.width!="auto"&&(w.css("width",u+v.jitter),t.verbose("Specifying width during animation",u));v.height!="auto"&&(w.css("height",f+v.jitter),t.verbose("Specifying height during animation",f))},nextSide:function(n){it=n;y=g.filter(n);it=g.index(y);y.length===0&&(t.set.defaultSide(),t.error(et.side));t.verbose("Next side manually set to",y)},active:function(){t.verbose("Setting new side to active",y);g.removeClass(b.active);y.addClass(b.active);v.onChange.call(y[0]);t.set.defaultSide()}},flip:{up:function(){if(t.is.complete()&&!t.is.animating()&&!v.allowRepeats){t.debug("Side already visible",y);return}if(t.is.animating())t.queue("flip up");else{t.debug("Flipping up",y);var n=t.get.transform.up();t.set.stageSize();t.stage.above();t.animate(n)}},down:function(){if(t.is.complete()&&!t.is.animating()&&!v.allowRepeats){t.debug("Side already visible",y);return}if(t.is.animating())t.queue("flip down");else{t.debug("Flipping down",y);var n=t.get.transform.down();t.set.stageSize();t.stage.below();t.animate(n)}},left:function(){if(t.is.complete()&&!t.is.animating()&&!v.allowRepeats){t.debug("Side already visible",y);return}if(t.is.animating())t.queue("flip left");else{t.debug("Flipping left",y);var n=t.get.transform.left();t.set.stageSize();t.stage.left();t.animate(n)}},right:function(){if(t.is.complete()&&!t.is.animating()&&!v.allowRepeats){t.debug("Side already visible",y);return}if(t.is.animating())t.queue("flip right");else{t.debug("Flipping right",y);var n=t.get.transform.right();t.set.stageSize();t.stage.right();t.animate(n)}},over:function(){if(t.is.complete()&&!t.is.animating()&&!v.allowRepeats){t.debug("Side already visible",y);return}t.is.animating()?t.queue("flip over"):(t.debug("Flipping over",y),t.set.stageSize(),t.stage.behind(),t.animate(t.get.transform.over()))},back:function(){if(t.is.complete()&&!t.is.animating()&&!v.allowRepeats){t.debug("Side already visible",y);return}t.is.animating()?t.queue("flip back"):(t.debug("Flipping back",y),t.set.stageSize(),t.stage.behind(),t.animate(t.get.transform.back()))}},get:{transform:{up:function(){var n={y:-((p.outerHeight(!0)-y.outerHeight(!0))/2),z:-(p.outerHeight(!0)/2)};return{transform:"translateY("+n.y+"px) translateZ("+n.z+"px) rotateX(-90deg)"}},down:function(){var n={y:-((p.outerHeight(!0)-y.outerHeight(!0))/2),z:-(p.outerHeight(!0)/2)};return{transform:"translateY("+n.y+"px) translateZ("+n.z+"px) rotateX(90deg)"}},left:function(){var n={x:-((p.outerWidth(!0)-y.outerWidth(!0))/2),z:-(p.outerWidth(!0)/2)};return{transform:"translateX("+n.x+"px) translateZ("+n.z+"px) rotateY(90deg)"}},right:function(){var n={x:-((p.outerWidth(!0)-y.outerWidth(!0))/2),z:-(p.outerWidth(!0)/2)};return{transform:"translateX("+n.x+"px) translateZ("+n.z+"px) rotateY(-90deg)"}},over:function(){var n={x:-((p.outerWidth(!0)-y.outerWidth(!0))/2)};return{transform:"translateX("+n.x+"px) rotateY(180deg)"}},back:function(){var n={x:-((p.outerWidth(!0)-y.outerWidth(!0))/2)};return{transform:"translateX("+n.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var u=i.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var t in n)if(u.style[t]!==r)return n[t]},nextSide:function(){return p.next(k.side).length>0?p.next(k.side):w.find(k.side).first()}},stage:{above:function(){var n={origin:(p.outerHeight(!0)-y.outerHeight(!0))/2,depth:{active:y.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as above",y,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});y.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(90deg) translateZ("+n.depth.next+"px)"})},below:function(){var n={origin:(p.outerHeight(!0)-y.outerHeight(!0))/2,depth:{active:y.outerHeight(!0)/2,next:p.outerHeight(!0)/2}};t.verbose("Setting the initial animation position as below",y,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});y.addClass(b.animating).css({top:n.origin+"px",transform:"rotateX(-90deg) translateZ("+n.depth.next+"px)"})},left:function(){var i={active:p.outerWidth(!0),next:y.outerWidth(!0)},n={origin:(i.active-i.next)/2,depth:{active:i.next/2,next:i.active/2}};t.verbose("Setting the initial animation position as left",y,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});y.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(-90deg) translateZ("+n.depth.next+"px)"})},right:function(){var i={active:p.outerWidth(!0),next:y.outerWidth(!0)},n={origin:(i.active-i.next)/2,depth:{active:i.next/2,next:i.active/2}};t.verbose("Setting the initial animation position as left",y,n);d.css({transform:"translateZ(-"+n.depth.active+"px)"});p.css({transform:"rotateY(0deg) translateZ("+n.depth.active+"px)"});y.addClass(b.animating).css({left:n.origin+"px",transform:"rotateY(90deg) translateZ("+n.depth.next+"px)"})},behind:function(){var n={active:p.outerWidth(!0),next:y.outerWidth(!0)},i={origin:(n.active-n.next)/2,depth:{active:n.next/2,next:n.active/2}};t.verbose("Setting the initial animation position as behind",y,i);p.css({transform:"rotateY(0deg)"});y.addClass(b.animating).css({left:i.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(i,u){if(t.debug("Changing setting",i,u),n.isPlainObject(i))n.extend(!0,v,i);else if(u!==r)n.isPlainObject(v[i])?n.extend(!0,v[i],u):v[i]=u;else return v[i]},internal:function(i,u){if(n.isPlainObject(i))n.extend(!0,t,i);else if(u!==r)t[i]=u;else return t[i]},debug:function(){!v.silent&&v.debug&&(v.performance?t.performance.log(arguments):(t.debug=Function.prototype.bind.call(console.info,console,v.name+":"),t.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?t.performance.log(arguments):(t.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),t.verbose.apply(console,arguments)))},error:function(){v.silent||(t.error=Function.prototype.bind.call(console.error,console,v.name+":"),t.error.apply(console,arguments))},performance:{log:function(n){var i,r,u;v.performance&&(i=(new Date).getTime(),u=s||i,r=i-u,s=i,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":r}));clearTimeout(t.performance.timer);t.performance.timer=setTimeout(t.performance.display,500)},display:function(){var i=v.name+":",u=0;s=!1;clearTimeout(t.performance.timer);n.each(e,function(n,t){u+=t["Execution Time"]});i+=" "+u+"ms";ut&&(i+=" '"+ut+"'");o.length>1&&(i+=" ("+o.length+")");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(i),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=tt,h,o,s;return i=i||l,u=nt||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};c?(tt===r&&t.initialize(),t.invoke(h)):(tt!==r&&tt.invoke("destroy"),t.initialize())}),f!==r?f:this};n.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.sidebar=function(u){var l=n(this),s=n(t),h=n(i),a=n("html"),p=n("head"),v=l.selector||"",c=(new Date).getTime(),e=[],y=arguments[0],w=typeof y=="string",b=[].slice.call(arguments,1),o=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},f;return l.each(function(){var k=n.isPlainObject(u)?n.extend(!0,{},n.fn.sidebar.settings,u):n.extend({},n.fn.sidebar.settings),rt=k.selector,g=k.className,yt=k.namespace,lt=k.regExp,st=k.error,ht="."+yt,at="module-"+yt,d=n(this),tt=n(k.context),et=d.children(rt.sidebar),wt=tt.children(rt.fixed),ut=tt.children(rt.pusher),ot,nt=this,ct=d.data(at),it,vt,pt,ft,l;l={initialize:function(){l.debug("Initializing sidebar",u);l.create.id();ft=l.get.transitionEvent();k.delaySetup?o(l.setup.layout):l.setup.layout();o(function(){l.setup.cache()});l.instantiate()},instantiate:function(){l.verbose("Storing instance of module",l);ct=l;d.data(at,l)},create:{id:function(){vt=(Math.random().toString(16)+"000000000").substr(2,8);it="."+vt;l.verbose("Creating unique id for element",vt)}},destroy:function(){l.verbose("Destroying previous module for",d);d.off(ht).removeData(at);l.is.ios()&&l.remove.ios();tt.off(it);s.off(it);h.off(it)},event:{clickaway:function(n){var t=ut.find(n.target).length>0||ut.is(n.target),i=tt.is(n.target);t&&(l.verbose("User clicked on dimmed page"),l.hide());i&&(l.verbose("User clicked on dimmable context (scaled out page)"),l.hide())},touch:function(){},containScroll:function(){nt.scrollTop<=0&&(nt.scrollTop=1);nt.scrollTop+nt.offsetHeight>=nt.scrollHeight&&(nt.scrollTop=nt.scrollHeight-nt.offsetHeight-1)},scroll:function(t){n(t.target).closest(rt.sidebar).length===0&&t.preventDefault()}},bind:{clickaway:function(){if(l.verbose("Adding clickaway events to context",tt),k.closable)tt.on("click"+it,l.event.clickaway).on("touchend"+it,l.event.clickaway)},scrollLock:function(){if(k.scrollLock){l.debug("Disabling page scroll");s.on("DOMMouseScroll"+it,l.event.scroll)}l.verbose("Adding events to contain sidebar scroll");h.on("touchmove"+it,l.event.touch);d.on("scroll"+ht,l.event.containScroll)}},unbind:{clickaway:function(){l.verbose("Removing clickaway events from context",tt);tt.off(it)},scrollLock:function(){l.verbose("Removing scroll lock from page");h.off(it);s.off(it);d.off("scroll"+ht)}},add:{inlineCSS:function(){var u=l.cache.width||d.outerWidth(),f=l.cache.height||d.outerHeight(),e=l.is.rtl(),t=l.get.direction(),i={left:u,right:-u,top:f,bottom:-f},r;e&&(l.verbose("RTL detected, flipping widths"),i.left=-u,i.right=u);r="<style>";t==="left"||t==="right"?(l.debug("Adding CSS rules for animation distance",u),r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):(t==="top"||t=="bottom")&&(r+=" .ui.visible."+t+".sidebar ~ .fixed, .ui.visible."+t+".sidebar ~ .pusher {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }");l.is.ie()&&(t==="left"||t==="right"?(l.debug("Adding CSS rules for animation distance",u),r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d("+i[t]+"px, 0, 0);           transform: translate3d("+i[t]+"px, 0, 0); }"):(t==="top"||t=="bottom")&&(r+=" body.pushable > .ui.visible."+t+".sidebar ~ .pusher:after {   -webkit-transform: translate3d(0, "+i[t]+"px, 0);           transform: translate3d(0, "+i[t]+"px, 0); }"),r+=" 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); }");r+="<\/style>";ot=n(r).appendTo(p);l.debug("Adding sizing css to head",ot)}},refresh:function(){l.verbose("Refreshing selector cache");tt=n(k.context);et=tt.children(rt.sidebar);ut=tt.children(rt.pusher);wt=tt.children(rt.fixed);l.clear.cache()},refreshSidebars:function(){l.verbose("Refreshing other sidebars");et=tt.children(rt.sidebar)},repaint:function(){l.verbose("Forcing repaint event");nt.style.display="none";var n=nt.offsetHeight;nt.scrollTop=nt.scrollTop;nt.style.display=""},setup:{cache:function(){l.cache={width:d.outerWidth(),height:d.outerHeight(),rtl:d.css("direction")=="rtl"}},layout:function(){tt.children(rt.pusher).length===0&&(l.debug("Adding wrapper element for sidebar"),l.error(st.pusher),ut=n('<div class="pusher" />'),tt.children().not(rt.omitted).not(et).wrapAll(ut),l.refresh());(d.nextAll(rt.pusher).length===0||d.nextAll(rt.pusher)[0]!==ut[0])&&(l.debug("Moved sidebar to correct parent element"),l.error(st.movedSidebar,nt),d.detach().prependTo(tt),l.refresh());l.clear.cache();l.set.pushable();l.set.direction()}},attachEvents:function(t,i){var r=n(t);if(i=n.isFunction(l[i])?l[i]:l.toggle,r.length>0){l.debug("Attaching sidebar events to element",t,i);r.on("click"+ht,i)}else l.error(st.notFound,t)},show:function(t){if(t=n.isFunction(t)?t:function(){},l.is.hidden()){if(l.refreshSidebars(),k.overlay&&(l.error(st.overlay),k.transition="overlay"),l.refresh(),l.othersActive())if(l.debug("Other sidebars currently visible"),k.exclusive){if(k.transition!="overlay"){l.hideOthers(l.show);return}l.hideOthers()}else k.transition="overlay";l.pushPage(function(){t.call(nt);k.onShow.call(nt)});k.onChange.call(nt);k.onVisible.call(nt)}else l.debug("Sidebar is already visible")},hide:function(t){t=n.isFunction(t)?t:function(){};(l.is.visible()||l.is.animating())&&(l.debug("Hiding sidebar",t),l.refreshSidebars(),l.pullPage(function(){t.call(nt);k.onHidden.call(nt)}),k.onChange.call(nt),k.onHide.call(nt))},othersAnimating:function(){return et.not(d).filter("."+g.animating).length>0},othersVisible:function(){return et.not(d).filter("."+g.visible).length>0},othersActive:function(){return l.othersVisible()||l.othersAnimating()},hideOthers:function(n){var t=et.not(d).filter("."+g.visible),r=t.length,i=0;n=n||function(){};t.sidebar("hide",function(){i++;i==r&&n()})},toggle:function(){l.verbose("Determining toggled direction");l.is.hidden()?l.show():l.hide()},pushPage:function(t){var u=l.get.transition(),i=u==="overlay"||l.othersActive()?d:ut,f,e,r;t=n.isFunction(t)?t:function(){};k.transition=="scale down"&&l.scrollToTop();l.set.transition(u);l.repaint();f=function(){l.bind.clickaway();l.add.inlineCSS();l.set.animating();l.set.visible()};e=function(){l.set.dimmed()};r=function(n){n.target==i[0]&&(i.off(ft+it,r),l.remove.animating(),l.bind.scrollLock(),t.call(nt))};i.off(ft+it);i.on(ft+it,r);o(f);k.dimPage&&!l.othersVisible()&&o(e)},pullPage:function(t){var r=l.get.transition(),i=r=="overlay"||l.othersActive()?d:ut,f,u;t=n.isFunction(t)?t:function(){};l.verbose("Removing context push state",l.get.direction());l.unbind.clickaway();l.unbind.scrollLock();f=function(){l.set.transition(r);l.set.animating();l.remove.visible();k.dimPage&&!l.othersVisible()&&ut.removeClass(g.dimmed)};u=function(n){n.target==i[0]&&(i.off(ft+it,u),l.remove.animating(),l.remove.transition(),l.remove.inlineCSS(),(r=="scale down"||k.returnScroll&&l.is.mobile())&&l.scrollBack(),t.call(nt))};i.off(ft+it);i.on(ft+it,u);o(f)},scrollToTop:function(){l.verbose("Scrolling to top of page to avoid animation issues");pt=n(t).scrollTop();d.scrollTop(0);t.scrollTo(0,0)},scrollBack:function(){l.verbose("Scrolling back to original page position");t.scrollTo(0,pt)},clear:{cache:function(){l.verbose("Clearing cached dimensions");l.cache={}}},set:{ios:function(){a.addClass(g.ios)},pushed:function(){tt.addClass(g.pushed)},pushable:function(){tt.addClass(g.pushable)},dimmed:function(){ut.addClass(g.dimmed)},active:function(){d.addClass(g.active)},animating:function(){d.addClass(g.animating)},transition:function(n){n=n||l.get.transition();d.addClass(n)},direction:function(n){n=n||l.get.direction();d.addClass(g[n])},visible:function(){d.addClass(g.visible)},overlay:function(){d.addClass(g.overlay)}},remove:{inlineCSS:function(){l.debug("Removing inline css styles",ot);ot&&ot.length>0&&ot.remove()},ios:function(){a.removeClass(g.ios)},pushed:function(){tt.removeClass(g.pushed)},pushable:function(){tt.removeClass(g.pushable)},active:function(){d.removeClass(g.active)},animating:function(){d.removeClass(g.animating)},transition:function(n){n=n||l.get.transition();d.removeClass(n)},direction:function(n){n=n||l.get.direction();d.removeClass(g[n])},visible:function(){d.removeClass(g.visible)},overlay:function(){d.removeClass(g.overlay)}},get:{direction:function(){return d.hasClass(g.top)?g.top:d.hasClass(g.right)?g.right:d.hasClass(g.bottom)?g.bottom:g.left},transition:function(){var t=l.get.direction(),n;return n=l.is.mobile()?k.mobileTransition=="auto"?k.defaultTransition.mobile[t]:k.mobileTransition:k.transition=="auto"?k.defaultTransition.computer[t]:k.transition,l.verbose("Determined transition",n),n},transitionEvent:function(){var u=i.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var t in n)if(u.style[t]!==r)return n[t]}},is:{ie:function(){var n=!t.ActiveXObject&&"ActiveXObject"in t,i="ActiveXObject"in t;return n||i},ios:function(){var n=navigator.userAgent,t=n.match(lt.ios),i=n.match(lt.mobileChrome);return t&&!i?(l.verbose("Browser was found to be iOS",n),!0):!1},mobile:function(){var n=navigator.userAgent,t=n.match(lt.mobile);return t?(l.verbose("Browser was found to be mobile",n),!0):(l.verbose("Browser is not mobile, using regular transition",n),!1)},hidden:function(){return!l.is.visible()},visible:function(){return d.hasClass(g.visible)},open:function(){return l.is.visible()},closed:function(){return l.is.hidden()},vertical:function(){return d.hasClass(g.top)},animating:function(){return tt.hasClass(g.animating)},rtl:function(){return l.cache.rtl===r&&(l.cache.rtl=d.css("direction")=="rtl"),l.cache.rtl}},setting:function(t,i){if(l.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,k,t);else if(i!==r)n.isPlainObject(k[t])?n.extend(!0,k[t],i):k[t]=i;else return k[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,l,t);else if(i!==r)l[t]=i;else return l[t]},debug:function(){!k.silent&&k.debug&&(k.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,k.name+":"),l.debug.apply(console,arguments)))},verbose:function(){!k.silent&&k.verbose&&k.debug&&(k.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),l.verbose.apply(console,arguments)))},error:function(){k.silent||(l.error=Function.prototype.bind.call(console.error,console,k.name+":"),l.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;k.performance&&(t=(new Date).getTime(),r=c||t,i=t-r,c=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:nt,"Execution Time":i}));clearTimeout(l.performance.timer);l.performance.timer=setTimeout(l.performance.display,500)},display:function(){var t=k.name+":",i=0;c=!1;clearTimeout(l.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";v&&(t+=" '"+v+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=ct,h,o,s;return i=i||b,u=nt||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):(l.error(st.method,t),!1)}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};w?(ct===r&&l.initialize(),l.invoke(y)):(ct!==r&&l.invoke("destroy"),l.initialize())}),f!==r?f:this};n.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(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.sticky=function(u){var s=n(this),h=s.selector||"",o=(new Date).getTime(),e=[],c=arguments[0],l=typeof c=="string",a=[].slice.call(arguments,1),f;return s.each(function(){var v=n.isPlainObject(u)?n.extend(!0,{},n.fn.sticky.settings,u):n.extend({},n.fn.sticky.settings),p=v.className,et=v.namespace,rt=v.error,d="."+et,ut="module-"+et,y=n(this),ot=n(t),b=n(v.scrollContext),k,g,st=y.selector||"",tt=y.data(ut),ft=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},w=this,it,nt,s;s={initialize:function(){s.determineContainer();s.determineContext();s.verbose("Initializing sticky",v,k);s.save.positions();s.checkErrors();s.bind.events();v.observeChanges&&s.observeChanges();s.instantiate()},instantiate:function(){s.verbose("Storing instance of module",s);tt=s;y.data(ut,s)},destroy:function(){s.verbose("Destroying previous instance");s.reset();it&&it.disconnect();nt&&nt.disconnect();ot.off("load"+d,s.event.load).off("resize"+d,s.event.resize);b.off("scrollchange"+d,s.event.scrollchange);y.removeData(ut)},observeChanges:function(){"MutationObserver"in t&&(it=new MutationObserver(s.event.documentChanged),nt=new MutationObserver(s.event.changed),it.observe(i,{childList:!0,subtree:!0}),nt.observe(w,{childList:!0,subtree:!0}),nt.observe(g[0],{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",nt))},determineContainer:function(){k=v.container?n(v.container):y.offsetParent()},determineContext:function(){if(g=v.context?n(v.context):k,g.length===0){s.error(rt.invalidContext,v.context,y);return}},checkErrors:function(){if(s.is.hidden()&&s.error(rt.visible,y),s.cache.element.height>s.cache.context.height){s.reset();s.error(rt.elementSize,y);return}},bind:{events:function(){ot.on("load"+d,s.event.load).on("resize"+d,s.event.resize);b.off("scroll"+d).on("scroll"+d,s.event.scroll).on("scrollchange"+d,s.event.scrollchange)}},event:{changed:function(n){clearTimeout(s.timer);s.timer=setTimeout(function(){s.verbose("DOM tree modified, updating sticky menu",n);s.refresh()},100)},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==w||n(t).find(w).length>0)&&(s.debug("Element removed from DOM, tearing down events"),s.destroy())})})},load:function(){s.verbose("Page contents finished loading");ft(s.refresh)},resize:function(){s.verbose("Window resized");ft(s.refresh)},scroll:function(){ft(function(){b.triggerHandler("scrollchange"+d,b.scrollTop())})},scrollchange:function(n,t){s.stick(t);v.onScroll.call(w)}},refresh:function(n){s.reset();v.context||s.determineContext();n&&s.determineContainer();s.save.positions();s.stick();v.onReposition.call(w)},supports:{sticky:function(){var t=n("<div/>"),i=t[0];return t.addClass(p.supported),t.css("position").match("sticky")}},save:{lastScroll:function(n){s.lastScroll=n},elementScroll:function(n){s.elementScroll=n},positions:function(){var t={height:b.height()},n={margin:{top:parseInt(y.css("margin-top"),10),bottom:parseInt(y.css("margin-bottom"),10)},offset:y.offset(),width:y.outerWidth(),height:y.outerHeight()},i={offset:g.offset(),height:g.outerHeight()},r={height:k.outerHeight()};s.is.standardScroll()||(s.debug("Non-standard scroll. Removing scroll offset from element offset"),t.top=b.scrollTop(),t.left=b.scrollLeft(),n.offset.top+=t.top,i.offset.top+=t.top,n.offset.left+=t.left,i.offset.left+=t.left);s.cache={fits:n.height+v.offset<=t.height,sameHeight:n.height==i.height,scrollContext:{height:t.height},element:{margin:n.margin,top:n.offset.top-n.margin.top,left:n.offset.left,width:n.width,height:n.height,bottom:n.offset.top+n.height},context:{top:i.offset.top,height:i.height,bottom:i.offset.top+i.height}};s.set.containerSize();s.stick();s.debug("Caching element positions",s.cache)}},get:{direction:function(n){var t="down";return n=n||b.scrollTop(),s.lastScroll!==r&&(s.lastScroll<n?t="down":s.lastScroll>n&&(t="up")),t},scrollChange:function(n){return n=n||b.scrollTop(),s.lastScroll?n-s.lastScroll:0},currentElementScroll:function(){return s.elementScroll?s.elementScroll:s.is.top()?Math.abs(parseInt(y.css("top"),10))||0:Math.abs(parseInt(y.css("bottom"),10))||0},elementScroll:function(n){n=n||b.scrollTop();var r=s.cache.element,u=s.cache.scrollContext,f=s.get.scrollChange(n),i=r.height-u.height+v.offset,e=s.get.currentElementScroll(),t=e+f;return s.cache.fits||t<0?0:t>i?i:t}},remove:{lastScroll:function(){delete s.lastScroll},elementScroll:function(){delete s.elementScroll},minimumSize:function(){k.css("min-height","")},offset:function(){y.css("margin-top","")}},set:{offset:function(){s.verbose("Setting offset on element",v.offset);y.css("margin-top",v.offset)},containerSize:function(){var n=k.get(0).tagName;n==="HTML"||n=="body"?s.determineContainer():Math.abs(k.outerHeight()-s.cache.context.height)>v.jitter&&(s.debug("Context has padding, specifying exact height for container",s.cache.context.height),k.css({height:s.cache.context.height}))},minimumSize:function(){var n=s.cache.element;k.css("min-height",n.height)},scroll:function(n){(s.debug("Setting scroll on element",n),s.elementScroll!=n)&&(s.is.top()&&y.css("bottom","").css("top",-n),s.is.bottom()&&y.css("top","").css("bottom",n))},size:function(){s.cache.element.height!==0&&s.cache.element.width!==0&&(w.style.setProperty("width",s.cache.element.width+"px","important"),w.style.setProperty("height",s.cache.element.height+"px","important"))}},is:{standardScroll:function(){return b[0]==t},top:function(){return y.hasClass(p.top)},bottom:function(){return y.hasClass(p.bottom)},initialPosition:function(){return!s.is.fixed()&&!s.is.bound()},hidden:function(){return!y.is(":visible")},bound:function(){return y.hasClass(p.bound)},fixed:function(){return y.hasClass(p.fixed)}},stick:function(n){var f=n||b.scrollTop(),u=s.cache,e=u.fits,c=u.sameHeight,t=u.element,l=u.scrollContext,i=u.context,o=s.is.bottom()&&v.pushing?v.bottomOffset:v.offset,n={top:f+o,bottom:f+o+l.height},y=s.get.direction(n.top),r=e?0:s.get.elementScroll(n.top),h=!e,a=t.height!==0;a&&!c&&(s.is.initialPosition()?n.top>=i.bottom?(s.debug("Initial element position is bottom of container"),s.bindBottom()):n.top>t.top&&(t.height+n.top-r>=i.bottom?(s.debug("Initial element position is bottom of container"),s.bindBottom()):(s.debug("Initial element position is fixed"),s.fixTop())):s.is.fixed()?s.is.top()?n.top<=t.top?(s.debug("Fixed element reached top of container"),s.setInitialPosition()):t.height+n.top-r>=i.bottom?(s.debug("Fixed element reached bottom of container"),s.bindBottom()):h&&(s.set.scroll(r),s.save.lastScroll(n.top),s.save.elementScroll(r)):s.is.bottom()&&(n.bottom-t.height<=t.top?(s.debug("Bottom fixed rail has reached top of container"),s.setInitialPosition()):n.bottom>=i.bottom?(s.debug("Bottom fixed rail has reached bottom of container"),s.bindBottom()):h&&(s.set.scroll(r),s.save.lastScroll(n.top),s.save.elementScroll(r))):s.is.bottom()&&(n.top<=t.top?(s.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),s.setInitialPosition()):v.pushing?s.is.bound()&&n.bottom<=i.bottom&&(s.debug("Fixing bottom attached element to bottom of browser."),s.fixBottom()):s.is.bound()&&n.top<=i.bottom-t.height&&(s.debug("Fixing bottom attached element to top of browser."),s.fixTop())))},bindTop:function(){s.debug("Binding element to top of parent container");s.remove.offset();y.css({left:"",top:"",marginBottom:""}).removeClass(p.fixed).removeClass(p.bottom).addClass(p.bound).addClass(p.top);v.onTop.call(w);v.onUnstick.call(w)},bindBottom:function(){s.debug("Binding element to bottom of parent container");s.remove.offset();y.css({left:"",top:""}).removeClass(p.fixed).removeClass(p.top).addClass(p.bound).addClass(p.bottom);v.onBottom.call(w);v.onUnstick.call(w)},setInitialPosition:function(){s.debug("Returning to initial position");s.unfix();s.unbind()},fixTop:function(){s.debug("Fixing element to top of page");v.setSize&&s.set.size();s.set.minimumSize();s.set.offset();y.css({left:s.cache.element.left,bottom:"",marginBottom:""}).removeClass(p.bound).removeClass(p.bottom).addClass(p.fixed).addClass(p.top);v.onStick.call(w)},fixBottom:function(){s.debug("Sticking element to bottom of page");v.setSize&&s.set.size();s.set.minimumSize();s.set.offset();y.css({left:s.cache.element.left,bottom:"",marginBottom:""}).removeClass(p.bound).removeClass(p.top).addClass(p.fixed).addClass(p.bottom);v.onStick.call(w)},unbind:function(){s.is.bound()&&(s.debug("Removing container bound position on element"),s.remove.offset(),y.removeClass(p.bound).removeClass(p.top).removeClass(p.bottom))},unfix:function(){s.is.fixed()&&(s.debug("Removing fixed position on element"),s.remove.minimumSize(),s.remove.offset(),y.removeClass(p.fixed).removeClass(p.top).removeClass(p.bottom),v.onUnstick.call(w))},reset:function(){s.debug("Resetting elements position");s.unbind();s.unfix();s.resetCSS();s.remove.offset();s.remove.lastScroll()},resetCSS:function(){y.css({width:"",height:""});k.css({height:""})},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else if(i!==r)v[t]=i;else return v[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,s,t);else if(i!==r)s[t]=i;else return s[t]},debug:function(){!v.silent&&v.debug&&(v.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,v.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),s.verbose.apply(console,arguments)))},error:function(){v.silent||(s.error=Function.prototype.bind.call(console.error,console,v.name+":"),s.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;v.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:w,"Execution Time":i}));clearTimeout(s.performance.timer);s.performance.timer=setTimeout(s.performance.display,0)},display:function(){var t=v.name+":",i=0;o=!1;clearTimeout(s.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=tt,h,o,s;return i=i||a,u=w||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(f)?f.push(s):f!==r?f=[f,s]:s!==r&&(f=s),o}};l?(tt===r&&s.initialize(),s.invoke(c)):(tt!==r&&tt.invoke("destroy"),s.initialize())}),f!==r?f:this};n.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:t,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to surpress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.tab=function(u){var f=n.isFunction(this)?n(t):n(this),h=f.selector||"",s=(new Date).getTime(),o=[],c=arguments[0],a=typeof c=="string",v=[].slice.call(arguments,1),l=!1,e;return f.each(function(){var p=n.isPlainObject(u)?n.extend(!0,{},n.fn.tab.settings,u):n.extend({},n.fn.tab.settings),w=p.className,it=p.metadata,ft=p.selector,rt=p.error,ct="."+p.namespace,et="module-"+p.namespace,k=n(this),g,b,ot={},lt=!0,st=0,ht=this,ut=k.data(et),d,nt,y,tt;y={initialize:function(){y.debug("Initializing tab menu item",k);y.fix.callbacks();y.determineTabs();y.debug("Determining tabs",p.context,b);p.auto&&y.set.auto();y.bind.events();p.history&&!l&&(y.initializeHistory(),l=!0);y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y);ut=y;k.data(et,y)},destroy:function(){y.debug("Destroying tabs",k);k.removeData(et).off(ct)},bind:{events:function(){if(!n.isWindow(ht)){y.debug("Attaching tab activation events to element",k);k.on("click"+ct,y.event.click)}}},determineTabs:function(){var t;p.context==="parent"?(k.closest(ft.ui).length>0?(t=k.closest(ft.ui),y.verbose("Using closest UI element as parent",t)):t=k,g=t.parent(),y.verbose("Determined parent element for creating context",g)):p.context?(g=n(p.context),y.verbose("Using selector for tab context",p.context,g)):g=n("body");p.childrenOnly?(b=g.children(ft.tabs),y.debug("Searching tab context children for tabs",g,b)):(b=g.find(ft.tabs),y.debug("Searching tab context for tabs",g,b))},fix:{callbacks:function(){n.isPlainObject(u)&&(u.onTabLoad||u.onTabInit)&&(u.onTabLoad&&(u.onLoad=u.onTabLoad,delete u.onTabLoad,y.error(rt.legacyLoad,u.onLoad)),u.onTabInit&&(u.onFirstLoad=u.onTabInit,delete u.onTabInit,y.error(rt.legacyInit,u.onFirstLoad)),p=n.extend(!0,{},n.fn.tab.settings,u))}},initializeHistory:function(){if(y.debug("Initializing page state"),n.address===r)return y.error(rt.state),!1;if(p.historyType=="state")if(y.debug("Using HTML5 to manage state"),p.path!==!1)n.address.history(!0).state(p.path);else return y.error(rt.path),!1;n.address.bind("change",y.event.history.change)},event:{click:function(t){var i=n(this).data(it.tab);i!==r?(p.history?(y.verbose("Updating page state",t),n.address.value(i)):(y.verbose("Changing tab",t),y.changeTab(i)),t.preventDefault()):y.debug("No tab specified")},history:{change:function(t){var i=t.pathNames.join("/")||y.get.initialPath(),u=p.templates.determineTitle(i)||!1;y.performance.display();y.debug("History change event",i,t);tt=t;i!==r&&y.changeTab(i);u&&n.address.title(u)}}},refresh:function(){d&&(y.debug("Refreshing tab",d),y.changeTab(d))},cache:{read:function(n){return n!==r?ot[n]:!1},add:function(n,t){n=n||d;y.debug("Adding cached content for",n);ot[n]=t},remove:function(n){n=n||d;y.debug("Removing cached content for",n);delete ot[n]}},set:{auto:function(){var t=typeof p.path=="string"?p.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";y.verbose("Setting up automatic tab retrieval from server",t);n.isPlainObject(p.apiSettings)?p.apiSettings.url=t:p.apiSettings={url:t}},loading:function(n){var t=y.get.tabElement(n),i=t.hasClass(w.loading);i||(y.verbose("Setting loading state for",t),t.addClass(w.loading).siblings(b).removeClass(w.active+" "+w.loading),t.length>0&&p.onRequest.call(t[0],n))},state:function(t){n.address.value(t)}},changeTab:function(i){var e=t.history&&t.history.pushState,u=e&&p.ignoreFirstLoad&&lt,f=p.auto||n.isPlainObject(p.apiSettings),r=f&&!u?y.utilities.pathToArray(i):y.get.defaultPathArray(i);i=y.utilities.arrayToPath(r);n.each(r,function(t,e){var a=r.slice(0,t+1),o=y.utilities.arrayToPath(a),b=y.is.tab(o),ut=t+1==r.length,s=y.get.tabElement(o),h,l,v,c;if(y.verbose("Looking for tab",e),b){if(y.verbose("Tab was found",e),d=o,nt=y.utilities.filterArray(r,a),ut?c=!0:(l=r.slice(0,t+2),v=y.utilities.arrayToPath(l),c=!y.is.tab(v),c&&y.verbose("Tab parameters found",l)),c&&f)return u?(y.debug("Ignoring remote content on first tab load",o),lt=!1,y.cache.add(i,s.html()),y.activate.all(o),p.onFirstLoad.call(s[0],o,nt,tt),p.onLoad.call(s[0],o,nt,tt)):(y.activate.navigation(o),y.fetch.content(o,i)),!1;y.debug("Opened local tab",o);y.activate.all(o);y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt));p.onLoad.call(s[0],o,nt,tt)}else if(i.search("/")==-1&&i!==""){if(h=n("#"+i+', a[name="'+i+'"]'),o=h.closest("[data-tab]").data(it.tab),s=y.get.tabElement(o),h&&h.length>0&&o)return y.debug("Anchor link used, opening parent tab",s,h),s.hasClass(w.active)||setTimeout(function(){y.scrollTo(h)},0),y.activate.all(o),y.cache.read(o)||(y.cache.add(o,!0),y.debug("First time tab loaded calling tab init"),p.onFirstLoad.call(s[0],o,nt,tt)),p.onLoad.call(s[0],o,nt,tt),!1}else return y.error(rt.missingTab,k,g,o),!1})},scrollTo:function(t){var r=t&&t.length>0?t.offset().top:!1;r!==!1&&(y.debug("Forcing scroll to an in-page link in a hidden tab",r,t),n(i).scrollTop(r))},update:{content:function(t,i,u){var f=y.get.tabElement(t),e=f[0];u=u!==r?u:p.evaluateScripts;typeof p.cacheType=="string"&&p.cacheType.toLowerCase()=="dom"&&typeof i!="string"?f.empty().append(n(i).clone(!0)):u?(y.debug("Updating HTML and evaluating inline scripts",t,i),f.html(i)):(y.debug("Updating HTML",t,i),e.innerHTML=i)}},fetch:{content:function(t,i){var u=y.get.tabElement(t),s={dataType:"html",encodeParameters:!1,on:"now",cache:p.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(n){p.cacheType=="response"&&y.cache.add(i,n);y.update.content(t,n);t==d?(y.debug("Content loaded",t),y.activate.tab(t)):y.debug("Content loaded in background",t);p.onFirstLoad.call(u[0],t,nt,tt);p.onLoad.call(u[0],t,nt,tt);p.loadOnce?y.cache.add(i,!0):typeof p.cacheType=="string"&&p.cacheType.toLowerCase()=="dom"&&u.children().length>0?setTimeout(function(){var n=u.children().clone(!0);n=n.not("script");y.cache.add(i,n)},0):y.cache.add(i,u.html())},urlData:{tab:i}},o=u.api("get request")||!1,h=o&&o.state()==="pending",e,f;i=i||t;f=y.cache.read(i);p.cache&&f?(y.activate.tab(t),y.debug("Adding cached content",i),p.loadOnce||(p.evaluateScripts=="once"?y.update.content(t,f,!1):y.update.content(t,f)),p.onLoad.call(u[0],t,nt,tt)):h?(y.set.loading(t),y.debug("Content is already loading",i)):n.api!==r?(e=n.extend(!0,{},p.apiSettings,s),y.debug("Retrieving remote content",i,e),y.set.loading(t),u.api(e)):y.error(rt.api)}},activate:{all:function(n){y.activate.tab(n);y.activate.navigation(n)},tab:function(n){var t=y.get.tabElement(n),i=p.deactivate=="siblings"?t.siblings(b):b.not(t),r=t.hasClass(w.active);y.verbose("Showing tab content for",t);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading),t.length>0&&p.onVisible.call(t[0],n))},navigation:function(n){var t=y.get.navElement(n),i=p.deactivate=="siblings"?t.siblings(f):f.not(t),r=t.hasClass(w.active);y.verbose("Activating tab navigation for",t,n);r||(t.addClass(w.active),i.removeClass(w.active+" "+w.loading))}},deactivate:{all:function(){y.deactivate.navigation();y.deactivate.tabs()},navigation:function(){f.removeClass(w.active)},tabs:function(){b.removeClass(w.active+" "+w.loading)}},is:{tab:function(n){return n!==r?y.get.tabElement(n).length>0:!1}},get:{initialPath:function(){return f.eq(0).data(it.tab)||b.eq(0).data(it.tab)},path:function(){return n.address.value()},defaultPathArray:function(n){return y.utilities.pathToArray(y.get.defaultPath(n))},defaultPath:function(n){var i=f.filter("[data-"+it.tab+'^="'+n+'/"]').eq(0),t=i.data(it.tab)||!1;if(t){if(y.debug("Found default tab",t),st<p.maxDepth)return st++,y.get.defaultPath(t);y.error(rt.recursion)}else y.debug("No default tabs found for",n,b);return st=0,n},navElement:function(n){return n=n||d,f.filter("[data-"+it.tab+'="'+n+'"]')},tabElement:function(n){var t,i,r,u;return n=n||d,r=y.utilities.pathToArray(n),u=y.utilities.last(r),t=b.filter("[data-"+it.tab+'="'+n+'"]'),i=b.filter("[data-"+it.tab+'="'+u+'"]'),t.length>0?t:i},tab:function(){return d}},utilities:{filterArray:function(t,i){return n.grep(t,function(t){return n.inArray(t,i)==-1})},last:function(t){return n.isArray(t)?t[t.length-1]:!1},pathToArray:function(n){return n===r&&(n=d),typeof n=="string"?n.split("/"):[n]},arrayToPath:function(t){return n.isArray(t)?t.join("/"):!1}},setting:function(t,i){if(y.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,p,t);else if(i!==r)n.isPlainObject(p[t])?n.extend(!0,p[t],i):p[t]=i;else return p[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,y,t);else if(i!==r)y[t]=i;else return y[t]},debug:function(){!p.silent&&p.debug&&(p.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,p.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),y.verbose.apply(console,arguments)))},error:function(){p.silent||(y.error=Function.prototype.bind.call(console.error,console,p.name+":"),y.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;p.performance&&(t=(new Date).getTime(),r=s||t,i=t-r,s=t,o.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:ht,"Execution Time":i}));clearTimeout(y.performance.timer);y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(y.performance.timer);n.each(o,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&o.length>0&&(console.groupCollapsed(t),console.table?console.table(o):n.each(o,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());o=[]}},invoke:function(t,i,u){var f=ut,h,o,s;return i=i||v,u=ht||u,typeof t=="string"&&f!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var e=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(f[e])&&i!=h)f=f[e];else{if(f[e]!==r)return o=f[e],!1;if(n.isPlainObject(f[u])&&i!=h)f=f[u];else return f[u]!==r?(o=f[u],!1):(y.error(rt.method,t),!1)}})),n.isFunction(o)?s=o.apply(u,i):o!==r&&(s=o),n.isArray(e)?e.push(s):e!==r?e=[e,s]:s!==r&&(e=s),o}};a?(ut===r&&y.initialize(),y.invoke(c)):(ut!==r&&ut.invoke("destroy"),y.initialize())}),e!==r?e:this};n.tab=function(){n(t).tab.apply(this,arguments)};n.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(){},onLoad:function(){},onVisible:function(){},onRequest:function(){},templates:{determineTitle:function(){}},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(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.transition=function(){var e=n(this),h=e.selector||"",o=(new Date).getTime(),f=[],c=arguments,l=c[0],a=[].slice.call(arguments,1),s=typeof l=="string",v=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},u;return e.each(function(t){var p=n(this),b=this,y,d,it,w,nt,k,tt,g,v;v={initialize:function(){y=v.get.settings.apply(b,c);w=y.className;it=y.error;nt=y.metadata;g="."+y.namespace;tt="module-"+y.namespace;d=p.data(tt)||v;k=v.get.animationEndEvent();s&&(s=v.invoke(l));s===!1&&(v.verbose("Converted arguments into settings object",y),y.interval?v.delay(y.animate):v.animate(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v);d=v;p.data(tt,d)},destroy:function(){v.verbose("Destroying previous module for",b);p.removeData(tt)},refresh:function(){v.verbose("Refreshing display type on next animation");delete v.displayType},forceRepaint:function(){v.verbose("Forcing element repaint");var t=p.parent(),n=p.next();n.length===0?p.detach().appendTo(t):p.detach().insertBefore(n)},repaint:function(){v.verbose("Repainting element");var n=b.offsetWidth},delay:function(n){var i=v.get.animationDirection(),f,u;i||(i=v.can.transition()?v.get.direction():"static");n=n!==r?n:y.interval;f=y.reverse=="auto"&&i==w.outward;u=f||y.reverse==!0?(e.length-t)*y.interval:t*y.interval;v.debug("Delaying animation by",u);setTimeout(v.animate,u)},animate:function(n){if(y=n||y,!v.is.supported())return v.error(it.support),!1;if(v.debug("Preparing animation",y.animation),v.is.animating()){if(y.queue)return!y.allowRepeats&&v.has.direction()&&v.is.occurring()&&v.queuing!==!0?v.debug("Animation is currently occurring, preventing queueing same animation",y.animation):v.queue(y.animation),!1;if(!y.allowRepeats&&v.is.occurring())return v.debug("Animation is already occurring, will not execute repeated animation",y.animation),!1;v.debug("New animation started, completing previous early",y.animation);d.complete()}v.can.animate()?v.set.animating(y.animation):v.error(it.noAnimation,y.animation,b)},reset:function(){v.debug("Resetting animation to beginning conditions");v.remove.animationCallbacks();v.restore.conditions();v.remove.animating()},queue:function(n){v.debug("Queueing animation of",n);v.queuing=!0;p.one(k+".queue"+g,function(){v.queuing=!1;v.repaint();v.animate.apply(this,y)})},complete:function(){v.debug("Animation complete",y.animation);v.remove.completeCallback();v.remove.failSafe();v.is.looping()||(v.is.outward()?(v.verbose("Animation is outward, hiding element"),v.restore.conditions(),v.hide()):v.is.inward()?(v.verbose("Animation is outward, showing element"),v.restore.conditions(),v.show()):(v.verbose("Static animation completed"),v.restore.conditions(),y.onComplete.call(b)))},force:{visible:function(){var t=p.attr("style"),i=v.get.userStyle(),n=v.get.displayType(),u=i+"display: "+n+" !important;",f=p.css("display"),e=t===r||t==="";f!==n?(v.verbose("Overriding default display to show element",n),p.attr("style",u)):e&&p.removeAttr("style")},hidden:function(){var n=p.attr("style"),t=p.css("display"),i=n===r||n==="";t==="none"||v.is.hidden()?i&&p.removeAttr("style"):(v.verbose("Overriding default display to hide element"),p.css("display","none"))}},has:{direction:function(t){var i=!1;return t=t||y.animation,typeof t=="string"&&(t=t.split(" "),n.each(t,function(n,t){(t===w.inward||t===w.outward)&&(i=!0)})),i},inlineDisplay:function(){var t=p.attr("style")||"";return n.isArray(t.match(/display.*?;/,""))}},set:{animating:function(n){var t;v.remove.completeCallback();n=n||y.animation;t=v.get.animationClass(n);v.save.animation(t);v.force.visible();v.remove.hidden();v.remove.direction();v.start.animation(t)},duration:function(n,t){t=t||y.duration;t=typeof t=="number"?t+"ms":t;(t||t===0)&&(v.verbose("Setting animation duration",t),p.css({"animation-duration":t}))},direction:function(n){n=n||v.get.direction();n==w.inward?v.set.inward():v.set.outward()},looping:function(){v.debug("Transition set to loop");p.addClass(w.looping)},hidden:function(){p.addClass(w.transition).addClass(w.hidden)},inward:function(){v.debug("Setting direction to inward");p.removeClass(w.outward).addClass(w.inward)},outward:function(){v.debug("Setting direction to outward");p.removeClass(w.inward).addClass(w.outward)},visible:function(){p.addClass(w.transition).addClass(w.visible)}},start:{animation:function(n){n=n||v.get.animationClass();v.debug("Starting tween",n);p.addClass(n).one(k+".complete"+g,v.complete);y.useFailSafe&&v.add.failSafe();v.set.duration(y.duration);y.onStart.call(b)}},save:{animation:function(n){v.cache||(v.cache={});v.cache.animation=n},displayType:function(n){n!=="none"&&p.data(nt.displayType,n)},transitionExists:function(t,i){n.fn.transition.exists[t]=i;v.verbose("Saving existence of transition",t,i)}},restore:{conditions:function(){var n=v.get.currentAnimation();n&&(p.removeClass(n),v.verbose("Removing animation class",v.cache));v.remove.duration()}},add:{failSafe:function(){var n=v.get.duration();v.timer=setTimeout(function(){p.triggerHandler(k)},n+y.failSafeDelay);v.verbose("Adding fail safe timer",v.timer)}},remove:{animating:function(){p.removeClass(w.animating)},animationCallbacks:function(){v.remove.queueCallback();v.remove.completeCallback()},queueCallback:function(){p.off(".queue"+g)},completeCallback:function(){p.off(".complete"+g)},display:function(){p.css("display","")},direction:function(){p.removeClass(w.inward).removeClass(w.outward)},duration:function(){p.css("animation-duration","")},failSafe:function(){v.verbose("Removing fail safe timer",v.timer);v.timer&&clearTimeout(v.timer)},hidden:function(){p.removeClass(w.hidden)},visible:function(){p.removeClass(w.visible)},looping:function(){v.debug("Transitions are no longer looping");v.is.looping()&&(v.reset(),p.removeClass(w.looping))},transition:function(){p.removeClass(w.visible).removeClass(w.hidden)}},get:{settings:function(t,i,r){return typeof t=="object"?n.extend(!0,{},n.fn.transition.settings,t):typeof r=="function"?n.extend({},n.fn.transition.settings,{animation:t,onComplete:r,duration:i}):typeof i=="string"||typeof i=="number"?n.extend({},n.fn.transition.settings,{animation:t,duration:i}):typeof i=="object"?n.extend({},n.fn.transition.settings,i,{animation:t}):typeof i=="function"?n.extend({},n.fn.transition.settings,{animation:t,onComplete:i}):n.extend({},n.fn.transition.settings,{animation:t})},animationClass:function(n){var t=n||y.animation,i=v.can.transition()&&!v.has.direction()?v.get.direction()+" ":"";return w.animating+" "+w.transition+" "+i+t},currentAnimation:function(){return v.cache&&v.cache.animation!==r?v.cache.animation:!1},currentDirection:function(){return v.is.inward()?w.inward:w.outward},direction:function(){return v.is.hidden()||!v.is.visible()?w.inward:w.outward},animationDirection:function(t){var i;return(t=t||y.animation,typeof t=="string"&&(t=t.split(" "),n.each(t,function(n,t){t===w.inward?i=w.inward:t===w.outward&&(i=w.outward)})),i)?i:!1},duration:function(n){return n=n||y.duration,n===!1&&(n=p.css("animation-duration")||0),typeof n=="string"?n.indexOf("ms")>-1?parseFloat(n):parseFloat(n)*1e3:n},displayType:function(n){return(n=n!==r?n:!0,y.displayType)?y.displayType:(n&&p.data(nt.displayType)===r&&v.can.transition(!0),p.data(nt.displayType))},userStyle:function(n){return n=n||p.attr("style")||"",n.replace(/display.*?;/,"")},transitionExists:function(t){return n.fn.transition.exists[t]},animationStartEvent:function(){var u=i.createElement("div"),n={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(var t in n)if(u.style[t]!==r)return n[t];return!1},animationEndEvent:function(){var u=i.createElement("div"),n={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(var t in n)if(u.style[t]!==r)return n[t];return!1}},can:{transition:function(t){var i=y.animation,s=v.get.transitionExists(i),u=v.get.displayType(!1),h,c,f,e,l,o;if(s===r||t){if(v.verbose("Determining whether animation exists"),h=p.attr("class"),c=p.prop("tagName"),f=n("<"+c+" />").addClass(h).insertAfter(p),e=f.addClass(i).removeClass(w.inward).removeClass(w.outward).addClass(w.animating).addClass(w.transition).css("animationName"),l=f.addClass(w.inward).css("animationName"),u||(u=f.attr("class",h).removeAttr("style").removeClass(w.hidden).removeClass(w.visible).show().css("display"),v.verbose("Determining final display state",u),v.save.displayType(u)),f.remove(),e!=l)v.debug("Direction exists for animation",i),o=!0;else if(e!="none"&&e)v.debug("Static animation found",i,u),o=!1;else{v.debug("No animation defined in css",i);return}v.save.transitionExists(i,o)}return s!==r?s:o},animate:function(){return v.can.transition()!==r}},is:{animating:function(){return p.hasClass(w.animating)},inward:function(){return p.hasClass(w.inward)},outward:function(){return p.hasClass(w.outward)},looping:function(){return p.hasClass(w.looping)},occurring:function(n){return n=n||y.animation,n="."+n.replace(" ","."),p.filter(n).length>0},visible:function(){return p.is(":visible")},hidden:function(){return p.css("visibility")==="hidden"},supported:function(){return k!==!1}},hide:function(){v.verbose("Hiding element");v.is.animating()&&v.reset();b.blur();v.remove.display();v.remove.visible();v.set.hidden();v.force.hidden();y.onHide.call(b);y.onComplete.call(b)},show:function(n){v.verbose("Showing element",n);v.remove.hidden();v.set.visible();v.force.visible();y.onShow.call(b);y.onComplete.call(b)},toggle:function(){v.is.visible()?v.hide():v.show()},stop:function(){v.debug("Stopping current animation");p.triggerHandler(k)},stopAll:function(){v.debug("Stopping all animation");v.remove.queueCallback();p.triggerHandler(k)},clear:{queue:function(){v.debug("Clearing animation queue");v.remove.queueCallback()}},enable:function(){v.verbose("Starting animation");p.removeClass(w.disabled)},disable:function(){v.debug("Stopping animation");p.addClass(w.disabled)},setting:function(t,i){if(v.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,y,t);else if(i!==r)n.isPlainObject(y[t])?n.extend(!0,y[t],i):y[t]=i;else return y[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,v,t);else if(i!==r)v[t]=i;else return v[t]},debug:function(){!y.silent&&y.debug&&(y.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,y.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),v.verbose.apply(console,arguments)))},error:function(){y.silent||(v.error=Function.prototype.bind.call(console.error,console,y.name+":"),v.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;y.performance&&(t=(new Date).getTime(),r=o||t,i=t-r,o=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:b,"Execution Time":i}));clearTimeout(v.performance.timer);v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var t=y.name+":",i=0;o=!1;clearTimeout(v.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");e.length>1&&(t+=" ("+e.length+")");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=d,h,o,s;return i=i||a,f=b||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),h=t.length-1,n.each(t,function(i,u){var f=i!=h?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=h)e=e[f];else{if(e[f]!==r)return o=e[f],!1;if(n.isPlainObject(e[u])&&i!=h)e=e[u];else return e[u]!==r?(o=e[u],!1):!1}})),n.isFunction(o)?s=o.apply(f,i):o!==r&&(s=o),n.isArray(u)?u.push(s):u!==r?u=[u,s]:s!==r&&(u=s),o!==r?o:!1}};v.initialize()}),u!==r?u:this};n.fn.transition.exists={};n.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(n,t,i,r){"use strict";var t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.api=n.fn.api=function(i){var o=n.isFunction(this)?n(t):n(this),s=o.selector||"",e=(new Date).getTime(),f=[],h=arguments[0],c=typeof h=="string",l=[].slice.call(arguments,1),u;return o.each(function(){var a=n.isPlainObject(i)?n.extend(!0,{},n.fn.api.settings,i):n.extend({},n.fn.api.settings),ft=a.namespace,et=a.metadata,ot=a.selector,w=a.error,tt=a.className,st="."+ft,rt="module-"+ft,v=n(this),ht=v.closest(ot.form),p=a.stateContext?n(a.stateContext):v,k,nt,y,it,ut,d=this,b=p[0],g=v.data(rt),o;o={initialize:function(){c||o.bind.events();o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o);g=o;v.data(rt,g)},destroy:function(){o.verbose("Destroying previous module for",d);v.removeData(rt).off(st)},bind:{events:function(){var n=o.get.event();if(n){o.verbose("Attaching API events to element",n);v.on(n+st,o.event.trigger)}else a.on=="now"&&(o.debug("Querying API endpoint immediately"),o.query())}},decode:{json:function(n){if(n!==r&&typeof n=="string")try{n=JSON.parse(n)}catch(t){}return n}},read:{cachedResponse:function(n){var i;if(t.Storage===r){o.error(w.noStorage);return}return i=sessionStorage.getItem(n),o.debug("Using cached response",n,i),o.decode.json(i)}},write:{cachedResponse:function(i,u){if(u&&u===""){o.debug("Response empty, not caching",u);return}if(t.Storage===r){o.error(w.noStorage);return}n.isPlainObject(u)&&(u=JSON.stringify(u));sessionStorage.setItem(i,u);o.verbose("Storing cached response for url",i,u)}},query:function(){if(o.is.disabled()){o.debug("Element is disabled API request aborted");return}if(o.is.loading())if(a.interruptRequests)o.debug("Interrupting previous request"),o.abort();else{o.debug("Cancelling request, previous request is still pending");return}if(a.defaultData&&n.extend(!0,a.urlData,o.get.defaultData()),a.serializeForm&&(a.data=o.add.formData(a.data)),nt=o.get.settings(),nt===!1){o.cancelled=!0;o.error(w.beforeSend);return}if(o.cancelled=!1,y=o.get.templatedURL(),!y&&!o.is.mocked()){o.error(w.missingURL);return}if(y=o.add.urlData(y),y||o.is.mocked()){if(nt.url=a.base+y,k=n.extend(!0,{},a,{type:a.method||a.type,data:it,url:a.base+y,beforeSend:a.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),o.debug("Querying URL",k.url),o.verbose("Using AJAX settings",k),a.cache==="local"&&o.read.cachedResponse(y)){o.debug("Response returned from local cache");o.request=o.create.request();o.request.resolveWith(b,[o.read.cachedResponse(y)]);return}a.throttle?a.throttleFirstRequest||o.timer?(o.debug("Throttling request",a.throttle),clearTimeout(o.timer),o.timer=setTimeout(function(){o.timer&&delete o.timer;o.debug("Sending throttled request",it,k.method);o.send.request()},a.throttle)):(o.debug("Sending request",it,k.method),o.send.request(),o.timer=setTimeout(function(){},a.throttle)):(o.debug("Sending request",it,k.method),o.send.request())}},should:{removeError:function(){return a.hideError===!0||a.hideError==="auto"&&!o.is.form()}},is:{disabled:function(){return v.filter(ot.disabled).length>0},expectingJSON:function(){return a.dataType==="json"||a.dataType==="jsonp"},form:function(){return v.is("form")||p.is("form")},mocked:function(){return a.mockResponse||a.mockResponseAsync||a.response||a.responseAsync},input:function(){return v.is("input")},loading:function(){return o.request?o.request.state()=="pending":!1},abortedRequest:function(n){return n&&n.readyState!==r&&n.readyState===0?(o.verbose("XHR request determined to be aborted"),!0):(o.verbose("XHR request was not aborted"),!1)},validResponse:function(t){return!o.is.expectingJSON()||!n.isFunction(a.successTest)?(o.verbose("Response is not JSON, skipping validation",a.successTest,t),!0):(o.debug("Checking JSON returned success",a.successTest,t),a.successTest(t)?(o.debug("Response passed success test",t),!0):(o.debug("Response failed success test",t),!1))}},was:{cancelled:function(){return o.cancelled||!1},succesful:function(){return o.request&&o.request.state()=="resolved"},failure:function(){return o.request&&o.request.state()=="rejected"},complete:function(){return o.request&&(o.request.state()=="resolved"||o.request.state()=="rejected")}},add:{urlData:function(t,i){var u,f;return t&&(u=t.match(a.regExp.required),f=t.match(a.regExp.optional),i=i||a.urlData,u&&(o.debug("Looking for required URL variables",u),n.each(u,function(u,f){var e=f.indexOf("$")!==-1?f.substr(2,f.length-3):f.substr(1,f.length-2),s=n.isPlainObject(i)&&i[e]!==r?i[e]:v.data(e)!==r?v.data(e):p.data(e)!==r?p.data(e):i[e];if(s===r)return o.error(w.requiredParameter,e,t),t=!1,!1;o.verbose("Found required variable",e,s);s=a.encodeParameters?o.get.urlEncodedValue(s):s;t=t.replace(f,s)})),f&&(o.debug("Looking for optional URL variables",u),n.each(f,function(u,f){var e=f.indexOf("$")!==-1?f.substr(3,f.length-4):f.substr(2,f.length-3),s=n.isPlainObject(i)&&i[e]!==r?i[e]:v.data(e)!==r?v.data(e):p.data(e)!==r?p.data(e):i[e];s!==r?(o.verbose("Optional variable Found",e,s),t=t.replace(f,s)):(o.verbose("Optional variable not found",e),t=t.indexOf("/"+f)!==-1?t.replace("/"+f,""):t.replace(f,""))}))),t},formData:function(t){var u=n.fn.serializeObject!==r,i=u?ht.serializeObject():ht.serialize(),f;return t=t||a.data,f=n.isPlainObject(t),f?u?(o.debug("Extending existing data with form data",t,i),t=n.extend(!0,{},t,i)):(o.error(w.missingSerialize),o.debug("Cant extend data. Replacing data with form data",t,i),t=i):(o.debug("Adding form data",i),t=i),t}},send:{request:function(){o.set.loading();o.request=o.create.request();o.is.mocked()?o.mockedXHR=o.create.mockedXHR():o.xhr=o.create.xhr();a.onRequest.call(b,o.request,o.xhr)}},event:{trigger:function(n){o.query();(n.type=="submit"||n.type=="click")&&n.preventDefault()},xhr:{always:function(){},done:function(t,i,r){var f=this,s=(new Date).getTime()-ut,u=a.loadingDuration-s,e=n.isFunction(a.onResponse)?o.is.expectingJSON()?a.onResponse.call(f,n.extend(!0,{},t)):a.onResponse.call(f,t):!1;u=u>0?u:0;e&&(o.debug("Modified API response in onResponse callback",a.onResponse,e,t),t=e);u>0&&o.debug("Response completed early delaying state change by",u);setTimeout(function(){o.is.validResponse(t)?o.request.resolveWith(f,[t,r]):o.request.rejectWith(f,[r,"invalid"])},u)},fail:function(n,t,i){var u=this,f=(new Date).getTime()-ut,r=a.loadingDuration-f;r=r>0?r:0;r>0&&o.debug("Response completed early delaying state change by",r);setTimeout(function(){o.is.abortedRequest(n)?o.request.rejectWith(u,[n,"aborted",i]):o.request.rejectWith(u,[n,"error",t,i])},r)}},request:{done:function(n,t){o.debug("Successful API Response",n);a.cache==="local"&&y&&(o.write.cachedResponse(y,n),o.debug("Saving server response locally",o.cache));a.onSuccess.call(b,n,v,t)},complete:function(n,t){var i,r;o.was.succesful()?(r=n,i=t):(i=n,r=o.get.responseFromXHR(i));o.remove.loading();a.onComplete.call(b,r,v,i)},fail:function(n,t,i){var u=o.get.responseFromXHR(n),f=o.get.errorFromRequest(u,t,i);if(t=="aborted")return o.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,i),a.onAbort.call(b,t,v,n),!0;t=="invalid"?o.debug("JSON did not pass success test. A server-side error has most likely occurred",u):t=="error"&&n!==r&&(o.debug("XHR produced a server error",t,i),n.status!=200&&i!==r&&i!==""&&o.error(w.statusMessage+i,k.url),a.onError.call(b,f,v,n));a.errorDuration&&t!=="aborted"&&(o.debug("Adding error state"),o.set.error(),o.should.removeError()&&setTimeout(o.remove.error,a.errorDuration));o.debug("API Request failed",f,n);a.onFailure.call(b,u,v,n)}}},create:{request:function(){return n.Deferred().always(o.event.request.complete).done(o.event.request.done).fail(o.event.request.fail)},mockedXHR:function(){var f=!1,s=!1,h=!1,t=a.mockResponse||a.response,u=a.mockResponseAsync||a.responseAsync,e,r,i;return i=n.Deferred().always(o.event.xhr.complete).done(o.event.xhr.done).fail(o.event.xhr.fail),t?(n.isFunction(t)?(o.debug("Using specified synchronous callback",t),r=t.call(b,nt)):(o.debug("Using settings specified response",t),r=t),i.resolveWith(b,[r,f,{responseText:r}])):n.isFunction(u)&&(e=function(n){o.debug("Async callback returned response",n);n?i.resolveWith(b,[n,f,{responseText:n}]):i.rejectWith(b,[{responseText:n},s,h])},o.debug("Using specified async response callback",u),u.call(b,nt,e)),i},xhr:function(){var t;return t=n.ajax(k).always(o.event.xhr.always).done(o.event.xhr.done).fail(o.event.xhr.fail),o.verbose("Created server request",t,k),t}},set:{error:function(){o.verbose("Adding error state to element",p);p.addClass(tt.error)},loading:function(){o.verbose("Adding loading state to element",p);p.addClass(tt.loading);ut=(new Date).getTime()}},remove:{error:function(){o.verbose("Removing error state from element",p);p.removeClass(tt.error)},loading:function(){o.verbose("Removing loading state from element",p);p.removeClass(tt.loading)}},get:{responseFromXHR:function(t){return n.isPlainObject(t)?o.is.expectingJSON()?o.decode.json(t.responseText):t.responseText:!1},errorFromRequest:function(t,i,u){return n.isPlainObject(t)&&t.error!==r?t.error:a.error[i]!==r?a.error[i]:u},request:function(){return o.request||!1},xhr:function(){return o.xhr||!1},settings:function(){var t;return(t=a.beforeSend.call(b,a),t&&(t.success!==r&&(o.debug("Legacy success callback detected",t),o.error(w.legacyParameters,t.success),t.onSuccess=t.success),t.failure!==r&&(o.debug("Legacy failure callback detected",t),o.error(w.legacyParameters,t.failure),t.onFailure=t.failure),t.complete!==r&&(o.debug("Legacy complete callback detected",t),o.error(w.legacyParameters,t.complete),t.onComplete=t.complete)),t===r&&o.error(w.noReturnedValue),t===!1)?t:t!==r?n.extend(!0,{},t):n.extend(!0,{},a)},urlEncodedValue:function(n){var r=t.decodeURIComponent(n),i=t.encodeURIComponent(n),u=r!==n;return u?(o.debug("URL value is already encoded, avoiding double encoding",n),n):(o.verbose("Encoding value using encodeURIComponent",n,i),i)},defaultData:function(){var t={};return n.isWindow(d)||(o.is.input()?t.value=v.val():o.is.form()||(t.text=v.text())),t},event:function(){return n.isWindow(d)||a.on=="now"?(o.debug("API called without element, no events attached"),!1):a.on=="auto"?v.is("input")?d.oninput!==r?"input":d.onpropertychange!==r?"propertychange":"keyup":v.is("form")?"submit":"click":a.on},templatedURL:function(n){if(n=n||v.data(et.action)||a.action||!1,y=v.data(et.url)||a.url||!1,y)return o.debug("Using specified url",y),y;if(n){if(o.debug("Looking up url for action",n,a.api),a.api[n]===r&&!o.is.mocked()){o.error(w.missingAction,a.action,a.api);return}y=a.api[n]}else o.is.form()&&(y=v.attr("action")||p.attr("action")||!1,o.debug("No url or action specified, defaulting to form action",y));return y}},abort:function(){var n=o.get.xhr();n&&n.state()!=="resolved"&&(o.debug("Cancelling API request"),n.abort())},reset:function(){o.remove.error();o.remove.loading()},setting:function(t,i){if(o.debug("Changing setting",t,i),n.isPlainObject(t))n.extend(!0,a,t);else if(i!==r)n.isPlainObject(a[t])?n.extend(!0,a[t],i):a[t]=i;else return a[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else if(i!==r)o[t]=i;else return o[t]},debug:function(){!a.silent&&a.debug&&(a.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,a.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),o.verbose.apply(console,arguments)))},error:function(){a.silent||(o.error=Function.prototype.bind.call(console.error,console,a.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;a.performance&&(t=(new Date).getTime(),r=e||t,i=t-r,e=t,f.push({Name:n[0],Arguments:[].slice.call(n,1)||"","Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=a.name+":",i=0;e=!1;clearTimeout(o.performance.timer);n.each(f,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";s&&(t+=" '"+s+"'");(console.group!==r||console.table!==r)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):n.each(f,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());f=[]}},invoke:function(t,i,f){var e=g,c,s,h;return i=i||l,f=d||f,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(n.isPlainObject(e[u])&&i!=c)e=e[u];else return e[u]!==r?(s=e[u],!1):(o.error(w.method,t),!1)}})),n.isFunction(s)?h=s.apply(f,i):s!==r&&(h=s),n.isArray(u)?u.push(h):u!==r?u=[u,h]:h!==r&&(u=h),s}};c?(g===r&&o.initialize(),o.invoke(h)):(g!==r&&g.invoke("destroy"),o.initialize())}),u!==r?u:this};n.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(n){return n},beforeXHR:function(){},onRequest:function(){},onResponse:!1,onSuccess:function(){},onComplete:function(){},onFailure:function(){},onError:function(){},onAbort:function(){},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(n,t,i,r){"use strict";t=typeof t!="undefined"&&t.Math==Math?t:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();n.fn.visibility=function(u){var o=n(this),h=o.selector||"",s=(new Date).getTime(),e=[],c=arguments[0],l=typeof c=="string",v=[].slice.call(arguments,1),f,y=o.length,a=0;return o.each(function(){var p=n.isPlainObject(u)?n.extend(!0,{},n.fn.visibility.settings,u):n.extend({},n.fn.visibility.settings),it=p.className,st=p.namespace,ht=p.error,ct=p.metadata,k="."+st,ut="module-"+st,ft=n(t),w=n(this),b=n(p.context),nt,lt=w.selector||"",g=w.data(ut),et=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(n){setTimeout(n,0)},d=this,ot=!1,rt,tt,o;o={initialize:function(){o.debug("Initializing",p);o.setup.cache();o.should.trackChanges()&&(p.type=="image"&&o.setup.image(),p.type=="fixed"&&o.setup.fixed(),p.observeChanges&&o.observeChanges(),o.bind.events());o.save.position();o.is.visible()||o.error(ht.visible,w);p.initialCheck&&o.checkVisibility();o.instantiate()},instantiate:function(){o.debug("Storing instance",o);w.data(ut,o);g=o},destroy:function(){o.verbose("Destroying previous module");tt&&tt.disconnect();rt&&rt.disconnect();ft.off("load"+k,o.event.load).off("resize"+k,o.event.resize);b.off("scroll"+k,o.event.scroll).off("scrollchange"+k,o.event.scrollchange);p.type=="fixed"&&(o.resetFixed(),o.remove.placeholder());w.off(k).removeData(ut)},observeChanges:function(){"MutationObserver"in t&&(rt=new MutationObserver(o.event.contextChanged),tt=new MutationObserver(o.event.changed),rt.observe(i,{childList:!0,subtree:!0}),tt.observe(d,{childList:!0,subtree:!0}),o.debug("Setting up mutation observer",tt))},bind:{events:function(){if(o.verbose("Binding visibility events to scroll and resize"),p.refreshOnLoad)ft.on("load"+k,o.event.load);ft.on("resize"+k,o.event.resize);b.off("scroll"+k).on("scroll"+k,o.event.scroll).on("scrollchange"+k,o.event.scrollchange)}},event:{changed:function(){o.verbose("DOM tree modified, updating visibility calculations");o.timer=setTimeout(function(){o.verbose("DOM tree modified, updating sticky menu");o.refresh()},100)},contextChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==d||n(t).find(d).length>0)&&(o.debug("Element removed from DOM, tearing down events"),o.destroy())})})},resize:function(){o.debug("Window resized");p.refreshOnResize&&et(o.refresh)},load:function(){o.debug("Page finished loading");et(o.refresh)},scroll:function(){p.throttle?(clearTimeout(o.timer),o.timer=setTimeout(function(){b.triggerHandler("scrollchange"+k,[b.scrollTop()])},p.throttle)):et(function(){b.triggerHandler("scrollchange"+k,[b.scrollTop()])})},scrollchange:function(n,t){o.checkVisibility(t)}},precache:function(t,r){t instanceof Array||(t=[t]);for(var f=t.length,e=0,s=[],u=i.createElement("img"),o=function(){e++;e>=t.length&&n.isFunction(r)&&r()};f--;)u=i.createElement("img"),u.onload=o,u.onerror=o,u.src=t[f],s.push(u)},enableCallbacks:function(){o.debug("Allowing callbacks to occur");ot=!1},disableCallbacks:function(){o.debug("Disabling all callbacks temporarily");ot=!0},should:{trackChanges:function(){return l?(o.debug("One time query, no need to bind events"),!1):(o.debug("Callbacks being attached"),!0)}},setup:{cache:function(){o.cache={occurred:{},screen:{},element:{}}},image:function(){var n=w.data(ct.src);n&&(o.verbose("Lazy loading image",n),p.once=!0,p.observeChanges=!1,p.onOnScreen=function(){o.debug("Image on screen",d);o.precache(n,function(){o.set.image(n,function(){a++;a==y&&p.onAllLoaded.call(this);p.onLoad.call(this)})})})},fixed:function(){o.debug("Setting up fixed");p.once=!1;p.observeChanges=!1;p.initialCheck=!0;p.refreshOnLoad=!0;u.transition||(p.transition=!1);o.create.placeholder();o.debug("Added placeholder",nt);p.onTopPassed=function(){o.debug("Element passed, adding fixed position",w);o.show.placeholder();o.set.fixed();p.transition&&n.fn.transition!==r&&w.transition(p.transition,p.duration)};p.onTopPassedReverse=function(){o.debug("Element returned to position, removing fixed",w);o.hide.placeholder();o.remove.fixed()}}},create:{placeholder:function(){o.verbose("Creating fixed position placeholder");nt=w.clone(!1).css("display","none").addClass(it.placeholder).insertAfter(w)}},show:{placeholder:function(){o.verbose("Showing placeholder");nt.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){o.verbose("Hiding placeholder");nt.css("display","none").css("visibility","")}},set:{fixed:function(){o.verbose("Setting element to fixed position");w.addClass(it.fixed).css({position:"fixed",top:p.offset+"px",left:"auto",zIndex:p.zIndex});p.onFixed.call(d)},image:function(t,i){if(w.attr("src",t),p.transition)if(n.fn.transition!==r){if(w.hasClass(it.visible)){o.debug("Transition already occurred on this image, skipping animation");return}w.transition(p.transition,p.duration,i)}else w.fadeIn(p.duration,i);else w.show()}},is:{onScreen:function(){var n=o.get.elementCalculations();return n.onScreen},offScreen:function(){var n=o.get.elementCalculations();return n.offScreen},visible:function(){return o.cache&&o.cache.element?!(o.cache.element.width===0&&o.cache.element.offset.top===0):!1},verticallyScrollableContext:function(){var n=b.get(0)!==t?b.css("overflow-y"):!1;return n=="auto"||n=="scroll"},horizontallyScrollableContext:function(){var n=b.get(0)!==t?b.css("overflow-x"):!1;return n=="auto"||n=="scroll"}},refresh:function(){o.debug("Refreshing constants (width/height)");p.type=="fixed"&&o.resetFixed();o.reset();o.save.position();p.checkOnRefresh&&o.checkVisibility();p.onRefresh.call(d)},resetFixed:function(){o.remove.fixed();o.remove.occurred()},reset:function(){o.verbose("Resetting all cached values");n.isPlainObject(o.cache)&&(o.cache.screen={},o.cache.element={})},checkVisibility:function(n){o.verbose("Checking visibility of element",o.cache.element);!ot&&o.is.visible()&&(o.save.scroll(n),o.save.calculations(),o.passed(),o.passingReverse(),o.topVisibleReverse(),o.bottomVisibleReverse(),o.topPassedReverse(),o.bottomPassedReverse(),o.onScreen(),o.offScreen(),o.passing(),o.topVisible(),o.bottomVisible(),o.topPassed(),o.bottomPassed(),p.onUpdate&&p.onUpdate.call(d,o.get.elementCalculations()))},passed:function(t,i){var u=o.get.elementCalculations();if(t&&i)p.onPassed[t]=i;else{if(t!==r)return o.get.pixelsPassed(t)>u.pixelsPassed;u.passing&&n.each(p.onPassed,function(n,t){u.bottomVisible||u.pixelsPassed>o.get.pixelsPassed(n)?o.execute(t,n):p.once||o.remove.occurred(t)})}},onScreen:function(n){var t=o.get.elementCalculations(),u=n||p.onOnScreen,i="onScreen";return n&&(o.debug("Adding callback for onScreen",n),p.onOnScreen=n),t.onScreen?o.execute(u,i):p.once||o.remove.occurred(i),n!==r?t.onOnScreen:void 0},offScreen:function(n){var t=o.get.elementCalculations(),u=n||p.onOffScreen,i="offScreen";return n&&(o.debug("Adding callback for offScreen",n),p.onOffScreen=n),t.offScreen?o.execute(u,i):p.once||o.remove.occurred(i),n!==r?t.onOffScreen:void 0},passing:function(n){var t=o.get.elementCalculations(),u=n||p.onPassing,i="passing";return n&&(o.debug("Adding callback for passing",n),p.onPassing=n),t.passing?o.execute(u,i):p.once||o.remove.occurred(i),n!==r?t.passing:void 0},topVisible:function(n){var t=o.get.elementCalculations(),u=n||p.onTopVisible,i="topVisible";return n&&(o.debug("Adding callback for top visible",n),p.onTopVisible=n),t.topVisible?o.execute(u,i):p.once||o.remove.occurred(i),n===r?t.topVisible:void 0},bottomVisible:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomVisible,i="bottomVisible";return n&&(o.debug("Adding callback for bottom visible",n),p.onBottomVisible=n),t.bottomVisible?o.execute(u,i):p.once||o.remove.occurred(i),n===r?t.bottomVisible:void 0},topPassed:function(n){var t=o.get.elementCalculations(),u=n||p.onTopPassed,i="topPassed";return n&&(o.debug("Adding callback for top passed",n),p.onTopPassed=n),t.topPassed?o.execute(u,i):p.once||o.remove.occurred(i),n===r?t.topPassed:void 0},bottomPassed:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomPassed,i="bottomPassed";return n&&(o.debug("Adding callback for bottom passed",n),p.onBottomPassed=n),t.bottomPassed?o.execute(u,i):p.once||o.remove.occurred(i),n===r?t.bottomPassed:void 0},passingReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onPassingReverse,i="passingReverse";return n&&(o.debug("Adding callback for passing reverse",n),p.onPassingReverse=n),t.passing?p.once||o.remove.occurred(i):o.get.occurred("passing")&&o.execute(u,i),n!==r?!t.passing:void 0},topVisibleReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onTopVisibleReverse,i="topVisibleReverse";return n&&(o.debug("Adding callback for top visible reverse",n),p.onTopVisibleReverse=n),t.topVisible?p.once||o.remove.occurred(i):o.get.occurred("topVisible")&&o.execute(u,i),n===r?!t.topVisible:void 0},bottomVisibleReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomVisibleReverse,i="bottomVisibleReverse";return n&&(o.debug("Adding callback for bottom visible reverse",n),p.onBottomVisibleReverse=n),t.bottomVisible?p.once||o.remove.occurred(i):o.get.occurred("bottomVisible")&&o.execute(u,i),n===r?!t.bottomVisible:void 0},topPassedReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onTopPassedReverse,i="topPassedReverse";return n&&(o.debug("Adding callback for top passed reverse",n),p.onTopPassedReverse=n),t.topPassed?p.once||o.remove.occurred(i):o.get.occurred("topPassed")&&o.execute(u,i),n===r?!t.onTopPassed:void 0},bottomPassedReverse:function(n){var t=o.get.elementCalculations(),u=n||p.onBottomPassedReverse,i="bottomPassedReverse";return n&&(o.debug("Adding callback for bottom passed reverse",n),p.onBottomPassedReverse=n),t.bottomPassed?p.once||o.remove.occurred(i):o.get.occurred("bottomPassed")&&o.execute(u,i),n===r?!t.bottomPassed:void 0},execute:function(n,t){var i=o.get.elementCalculations(),r=o.get.screenCalculations();n=n||!1;n&&(p.continuous?(o.debug("Callback being called continuously",t,i),n.call(d,i,r)):o.get.occurred(t)||(o.debug("Conditions met",t,i),n.call(d,i,r)));o.save.occurred(t)},remove:{fixed:function(){o.debug("Removing fixed position");w.removeClass(it.fixed).css({position:"",top:"",left:"",zIndex:""});p.onUnfixed.call(d)},placeholder:function(){o.debug("Removing placeholder content");nt&&nt.remove()},occurred:function(n){if(n){var t=o.cache.occurred;t[n]!==r&&t[n]===!0&&(o.debug("Callback can now be called again",n),o.cache.occurred[n]=!1)}else o.cache.occurred={}}},save:{calculations:function(){o.verbose("Saving all calculations necessary to determine positioning");o.save.direction();o.save.screenCalculations();o.save.elementCalculations()},occurred:function(n){n&&(o.cache.occurred[n]===r||o.cache.occurred[n]!==!0)&&(o.verbose("Saving callback occurred",n),o.cache.occurred[n]=!0)},scroll:function(n){n=n+p.offset||b.scrollTop()+p.offset;o.cache.scroll=n},direction:function(){var t=o.get.scroll(),n=o.get.lastScroll(),i;return i=t>n&&n?"down":t<n&&n?"up":"static",o.cache.direction=i,o.cache.direction},elementPosition:function(){var n=o.cache.element,t=o.get.screenSize();return o.verbose("Saving element position"),n.fits=n.height<t.height,n.offset=w.offset(),n.width=w.outerWidth(),n.height=w.outerHeight(),o.is.verticallyScrollableContext()&&(n.offset.top+=b.scrollTop()-b.offset().top),o.is.horizontallyScrollableContext()&&(n.offset.left+=b.scrollLeft-b.offset().left),o.cache.element=n,n},elementCalculations:function(){var t=o.get.screenCalculations(),n=o.get.elementPosition();return p.includeMargin?(n.margin={},n.margin.top=parseInt(w.css("margin-top"),10),n.margin.bottom=parseInt(w.css("margin-bottom"),10),n.top=n.offset.top-n.margin.top,n.bottom=n.offset.top+n.height+n.margin.bottom):(n.top=n.offset.top,n.bottom=n.offset.top+n.height),n.topPassed=t.top>=n.top,n.bottomPassed=t.top>=n.bottom,n.topVisible=t.bottom>=n.top&&!n.topPassed,n.bottomVisible=t.bottom>=n.bottom&&!n.bottomPassed,n.pixelsPassed=0,n.percentagePassed=0,n.onScreen=(n.topVisible||n.passing)&&!n.bottomPassed,n.passing=n.topPassed&&!n.bottomPassed,n.offScreen=!n.onScreen,n.passing&&(n.pixelsPassed=t.top-n.top,n.percentagePassed=(t.top-n.top)/n.height),o.cache.element=n,o.verbose("Updated element calculations",n),n},screenCalculations:function(){var n=o.get.scroll();return o.save.direction(),o.cache.screen.top=n,o.cache.screen.bottom=n+o.cache.screen.height,o.cache.screen},screenSize:function(){o.verbose("Saving window position");o.cache.screen={height:b.height()}},position:function(){o.save.screenSize();o.save.elementPosition()}},get:{pixelsPassed:function(n){var t=o.get.elementCalculations();return n.search("%")>-1?t.height*(parseInt(n,10)/100):parseInt(n,10)},occurred:function(n){return o.cache.occurred!==r?o.cache.occurred[n]||!1:!1},direction:function(){return o.cache.direction===r&&o.save.direction(),o.cache.direction},elementPosition:function(){return o.cache.element===r&&o.save.elementPosition(),o.cache.element},elementCalculations:function(){return o.cache.element===r&&o.save.elementCalculations(),o.cache.element},screenCalculations:function(){return o.cache.screen===r&&o.save.screenCalculations(),o.cache.screen},screenSize:function(){return o.cache.screen===r&&o.save.screenSize(),o.cache.screen},scroll:function(){return o.cache.scroll===r&&o.save.scroll(),o.cache.scroll},lastScroll:function(){return o.cache.screen===r?(o.debug("First scroll event, no last scroll could be found"),!1):o.cache.screen.top}},setting:function(t,i){if(n.isPlainObject(t))n.extend(!0,p,t);else if(i!==r)p[t]=i;else return p[t]},internal:function(t,i){if(n.isPlainObject(t))n.extend(!0,o,t);else if(i!==r)o[t]=i;else return o[t]},debug:function(){!p.silent&&p.debug&&(p.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,p.name+":"),o.debug.apply(console,arguments)))},verbose:function(){!p.silent&&p.verbose&&p.debug&&(p.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),o.verbose.apply(console,arguments)))},error:function(){p.silent||(o.error=Function.prototype.bind.call(console.error,console,p.name+":"),o.error.apply(console,arguments))},performance:{log:function(n){var t,i,r;p.performance&&(t=(new Date).getTime(),r=s||t,i=t-r,s=t,e.push({Name:n[0],Arguments:[].slice.call(n,1)||"",Element:d,"Execution Time":i}));clearTimeout(o.performance.timer);o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=p.name+":",i=0;s=!1;clearTimeout(o.performance.timer);n.each(e,function(n,t){i+=t["Execution Time"]});t+=" "+i+"ms";h&&(t+=" '"+h+"'");(console.group!==r||console.table!==r)&&e.length>0&&(console.groupCollapsed(t),console.table?console.table(e):n.each(e,function(n,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd());e=[]}},invoke:function(t,i,u){var e=g,c,s,h;return i=i||v,u=d||u,typeof t=="string"&&e!==r&&(t=t.split(/[\. ]/),c=t.length-1,n.each(t,function(i,u){var f=i!=c?u+t[i+1].charAt(0).toUpperCase()+t[i+1].slice(1):t;if(n.isPlainObject(e[f])&&i!=c)e=e[f];else{if(e[f]!==r)return s=e[f],!1;if(n.isPlainObject(e[u])&&i!=c)e=e[u];else return e[u]!==r?(s=e[u],!1):(o.error(ht.method,t),!1)}})),n.isFunction(s)?h=s.apply(u,i):s!==r&&(h=s),n.isArray(f)?f.push(h):f!==r?f=[f,h]:h!==r&&(f=h),s}};l?(g===r&&o.initialize(),g.save.scroll(),g.save.calculations(),o.invoke(c)):(g!==r&&g.invoke("destroy"),o.initialize())}),f!==r?f:this};n.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document)