/*
* # Semantic UI - 2.0.0
* https://github.com/Semantic-Org/Semantic-UI
* http://www.semantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(e,t,n,i){e.site=e.fn.site=function(o){var a,r,s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1),m=e.isPlainObject(o)?e.extend(!0,{},e.site.settings,o):e.extend({},e.site.settings),f=m.namespace,g=m.error,p="module-"+f,v=e(n),h=v,b=this,y=h.data(p);return a={initialize:function(){a.instantiate()},instantiate:function(){a.verbose("Storing instance of site",a),y=a,h.data(p,a)},normalize:function(){a.fix.console(),a.fix.requestAnimationFrame()},fix:{console:function(){a.debug("Normalizing window.console"),(console===i||console.log===i)&&(a.verbose("Console not available, normalizing events"),a.disable.console()),("undefined"==typeof console.group||"undefined"==typeof console.groupEnd||"undefined"==typeof console.groupCollapsed)&&(a.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(a.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){a.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){a.debug("Normalizing requestAnimationFrame"),t.requestAnimationFrame===i&&(a.debug("RequestAnimationFrame not available, normailizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return e.fn[t]!==i&&e.fn[t].settings!==i},enabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,o,r){o="string"==typeof o?"all"===o?m.modules:[o]:o||m.modules,r=r!==i?r:!0,e.each(o,function(i,o){var s,c=a.moduleExists(o)?e.fn[o].settings.namespace||!1:!0;a.moduleExists(o)&&(a.verbose("Changing default setting",t,n,o),e.fn[o].settings[t]=n,r&&c&&(s=e(":data(module-"+c+")"),s.length>0&&(a.verbose("Modifying existing settings",s),s[o]("setting",t,n))))})},settings:function(t,n,o){n="string"==typeof n?[n]:n||m.modules,o=o!==i?o:!0,e.each(n,function(n,i){var r;a.moduleExists(i)&&(a.verbose("Changing default setting",t,i),e.extend(!0,e.fn[i].settings,t),o&&f&&(r=e(":data(module-"+f+")"),r.length>0&&(a.verbose("Modifying existing settings",r),r[i]("setting",t))))})}},enable:{console:function(){a.console(!0)},debug:function(e,t){e=e||m.modules,a.debug("Enabling debug for modules",e),a.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Enabling verbose debug for modules",e),a.change.setting("verbose",!0,e,t)}},disable:{console:function(){a.console(!1)},debug:function(e,t){e=e||m.modules,a.debug("Disabling debug for modules",e),a.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Disabling verbose debug for modules",e),a.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(y.cache.console===i)return void a.error(g.console);a.debug("Restoring console function"),t.console=y.cache.console}else a.debug("Disabling console function"),y.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(){a.verbose("Destroying previous site for",h),h.removeData(p)},cache:{},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,m.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Element:b,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var s,c,l,u=y;return n=n||d,o=b||o,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(c=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(c)?l=c.apply(o,n):c!==i&&(l=c),e.isArray(r)?r.push(l):r!==i?r=[r,l]:l!==i&&(r=l),c}},u?(y===i&&a.initialize(),a.invoke(l)):(y!==i&&a.destroy(),a.initialize()),r!==i?r:this},e.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","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","video","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,i){return!!e.data(t,i[3])}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.form=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u=arguments[1],d="string"==typeof l,m=[].slice.call(arguments,1);return a.each(function(){var f,g,p,v,h,b,y,x,C,w,k,T,S,A,P,E,R,F,O=e(this),D=this,q=[],z=!1;F={initialize:function(){F.get.settings(),d?(R===i&&F.instantiate(),F.invoke(l)):(F.verbose("Initializing form validation",O,x),F.bindEvents(),F.set.defaults(),F.instantiate())},instantiate:function(){F.verbose("Storing instance of module",F),R=F,O.data(P,F)},destroy:function(){F.verbose("Destroying previous module",R),F.removeEvents(),O.removeData(P)},refresh:function(){F.verbose("Refreshing selector cache"),f=O.find(k.field),g=O.find(k.group),p=O.find(k.message),v=O.find(k.prompt),h=O.find(k.submit),b=O.find(k.clear),y=O.find(k.reset)},submit:function(){F.verbose("Submitting form",O),O.submit()},attachEvents:function(t,n){n=n||"submit",e(t).on("click"+E,function(e){F[n](),e.preventDefault()})},bindEvents:function(){F.verbose("Attaching form events"),O.on("submit"+E,F.validate.form).on("blur"+E,k.field,F.event.field.blur).on("click"+E,k.submit,F.submit).on("click"+E,k.reset,F.reset).on("click"+E,k.clear,F.clear),x.keyboardShortcuts&&O.on("keydown"+E,k.field,F.event.field.keydown),f.each(function(){var t=e(this),n=t.prop("type"),i=F.get.changeEvent(n,t);e(this).on(i+E,F.event.field.change)})},clear:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(g),o=i.find(k.prompt),a=t.data(w.defaultValue)||"",r=n.is(k.uiCheckbox),s=n.is(k.uiDropdown),c=i.hasClass(T.error);c&&(F.verbose("Resetting error on field",i),i.removeClass(T.error),o.remove()),s?(F.verbose("Resetting dropdown value",n,a),n.dropdown("clear")):r?n.checkbox("uncheck"):(F.verbose("Resetting field value",t,a),t.val(""))})},reset:function(){f.each(function(){var t=e(this),n=t.parent(),i=t.closest(g),o=i.find(k.prompt),a=t.data(w.defaultValue)||"",r=n.is(k.uiCheckbox),s=n.is(k.uiDropdown),c=i.hasClass(T.error);c&&(F.verbose("Resetting error on field",i),i.removeClass(T.error),o.remove()),s?(F.verbose("Resetting dropdown value",n,a),n.dropdown("restore defaults")):r?(F.verbose("Resetting checkbox value",n,a),n.checkbox(a===!0?"check":"uncheck")):(F.verbose("Resetting field value",t,a),t.val(a))})},removeEvents:function(){O.off(E),f.off(E),h.off(E),f.off(E)},event:{field:{keydown:function(t){var n=e(this),i=t.which,o={enter:13,escape:27};i==o.escape&&(F.verbose("Escape key pressed blurring field"),n.blur()),!t.ctrlKey&&i==o.enter&&n.is(k.input)&&n.not(k.checkbox).length>0&&(z||(n.one("keyup"+E,F.event.field.keyup),F.submit(),F.debug("Enter pressed on input submitting form")),z=!0)},keyup:function(){z=!1},blur:function(){var t=e(this),n=t.closest(g);n.hasClass(T.error)?(F.debug("Revalidating field",t,F.get.validation(t)),F.validate.field(F.get.validation(t))):("blur"==x.on||"change"==x.on)&&F.validate.field(F.get.validation(t))},change:function(){var t=e(this),n=t.closest(g);("change"==x.on||n.hasClass(T.error)&&x.revalidate)&&(clearTimeout(F.timer),F.timer=setTimeout(function(){F.debug("Revalidating field",t,F.get.validation(t)),F.validate.field(F.get.validation(t))},x.delay))}}},get:{changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":F.get.inputEvent()},inputEvent:function(){return n.createElement("input").oninput!==i?"input":n.createElement("input").onpropertychange!==i?"propertychange":"keyup"},settings:function(){if(e.isPlainObject(t)){var n=Object.keys(t),o=n.length>0?t[n[0]].identifier!==i:!1;o?(x=e.extend(!0,{},e.fn.form.settings,u),C=e.extend({},e.fn.form.settings.defaults,t),F.error(x.error.oldSyntax,D),F.verbose("Extending settings from legacy parameters",C,x)):(x=e.extend(!0,{},e.fn.form.settings,t),C=e.extend({},e.fn.form.settings.defaults,x.fields),F.verbose("Extending settings",C,x))}else x=e.fn.form.settings,C=e.fn.form.settings.defaults,F.verbose("Using default form validation",C,x);A=x.namespace,w=x.metadata,k=x.selector,T=x.className,S=x.error,P="module-"+A,E="."+A,R=O.data(P),F.refresh()},field:function(t){return F.verbose("Finding field with identifier",t),f.filter("#"+t).length>0?f.filter("#"+t):f.filter('[name="'+t+'"]').length>0?f.filter('[name="'+t+'"]'):f.filter('[name="'+t+'[]"]').length>0?f.filter('[name="'+t+'[]"]'):f.filter("[data-"+w.validate+'="'+t+'"]').length>0?f.filter("[data-"+w.validate+'="'+t+'"]'):e(" ")},fields:function(t){var n=e();return e.each(t,function(e,t){n=n.add(F.get.field(t))}),n},validation:function(t){var n;return e.each(C,function(e,i){F.get.field(i.identifier).get(0)==t.get(0)&&(n=i)}),n||!1},value:function(e){var t,n=[];return n.push(e),t=F.get.values.call(D,n),t[e]},values:function(t){var n=e.isArray(t)?F.get.fields(t):f,i={};return n.each(function(t,n){var o=e(n),a=(o.prop("type"),o.prop("name")),r=o.val(),s=o.is(k.checkbox),c=o.is(k.radio),l=-1!==a.indexOf("[]"),u=s?o.is(":checked"):!1;if(a)if(l)if(a=a.replace("[]",""),i[a]||(i[a]=[]),s){if(!u)return F.debug("Omitted unchecked checkbox",o),!0;i[a].push(r)}else i[a].push(r);else if(c)u&&(i[a]=r);else if(s){if(!u)return F.debug("Omitted unchecked checkbox",o),!0;i[a]=!0}else i[a]=r}),i}},has:{field:function(e){return F.verbose("Checking for existence of a field with identifier",e),f.filter("#"+e).length>0?!0:f.filter('[name="'+e+'"]').length>0?!0:f.filter("[data-"+w.validate+'="'+e+'"]').length>0?!0:!1}},add:{prompt:function(t,n){var o=F.get.field(t),a=o.closest(g),r=a.children(k.prompt),s=0!==r.length;n="string"==typeof n?[n]:n,F.verbose("Adding field error state",t),a.addClass(T.error),x.inline&&(s||(r=x.templates.prompt(n),r.appendTo(a)),r.html(n[0]),s?F.verbose("Inline errors are disabled, no inline error added",t):x.transition&&e.fn.transition!==i&&O.transition("is supported")?(F.verbose("Displaying error with css transition",x.transition),r.transition(x.transition+" in",x.duration)):(F.verbose("Displaying error with fallback javascript animation"),r.fadeIn(x.duration)))},errors:function(e){F.debug("Adding form error messages",e),p.html(x.templates.error(e))}},remove:{prompt:function(t){var n=F.get.field(t.identifier),o=n.closest(g),a=o.children(k.prompt);o.removeClass(T.error),x.inline&&a.is(":visible")&&(F.verbose("Removing prompt for field",t),x.transition&&e.fn.transition!==i&&O.transition("is supported")?a.transition(x.transition+" out",x.duration,function(){a.remove()}):a.fadeOut(x.duration,function(){a.remove()}))}},set:{success:function(){O.removeClass(T.error).addClass(T.success)},defaults:function(){f.each(function(){var t=e(this),n=t.filter(k.checkbox).length>0,i=n?t.is(":checked"):t.val();t.data(w.defaultValue,i)})},error:function(){O.removeClass(T.success).addClass(T.error)},value:function(e,t){var n={};return n[e]=t,F.set.values.call(D,n)},values:function(t){e.isEmptyObject(t)||e.each(t,function(t,n){var i,o=F.get.field(t),a=o.parent(),r=e.isArray(n),s=a.is(k.uiCheckbox),c=a.is(k.uiDropdown),l=o.is(k.radio)&&s,u=o.length>0;u&&(r&&s?(F.verbose("Selecting multiple",n,o),a.checkbox("uncheck"),e.each(n,function(e,t){i=o.filter('[value="'+t+'"]'),a=i.parent(),i.length>0&&a.checkbox("check")})):l?(F.verbose("Selecting radio value",n,o),o.filter('[value="'+n+'"]').parent(k.uiCheckbox).checkbox("check")):s?(F.verbose("Setting checkbox value",n,a),a.checkbox(n===!0?"check":"uncheck")):c?(F.verbose("Setting dropdown value",n,a),a.dropdown("set selected",n)):(F.verbose("Setting field value",n,o),o.val(n)))})}},validate:{form:function(t){var n=!0;return z?!1:(q=[],e.each(C,function(e,t){F.validate.field(t)||(n=!1)}),n?(F.debug("Form has no validation errors, submitting"),F.set.success(),x.onSuccess.call(D,t)):(F.debug("Form has errors"),F.set.error(),x.inline||F.add.errors(q),O.data("moduleApi")!==i&&t.stopImmediatePropagation(),x.onFailure.call(D,q)))},field:function(t){var n=F.get.field(t.identifier),o=!0,a=[];return n.prop("disabled")?(F.debug("Field is disabled. Skipping",t.identifier),o=!0):t.optional&&""===e.trim(n.val())?(F.debug("Field is optional and empty. Skipping",t.identifier),o=!0):t.rules!==i&&e.each(t.rules,function(e,n){F.has.field(t.identifier)&&!F.validate.rule(t,n)&&(F.debug("Field is invalid",t.identifier,n.type),a.push(n.prompt),o=!1)}),o?(F.remove.prompt(t,a),x.onValid.call(n),!0):(q=q.concat(a),F.add.prompt(t.identifier,a),x.onInvalid.call(n,a),!1)},rule:function(t,n){var i,o,a,r=F.get.field(t.identifier),s=n.type,c=r.val(),l=s.match(x.regExp.bracket),u=!0;if(c=e.trim(r.val()+""),l){if(o=""+l[1],a=s.replace(l[0],""),i=x.rules[a],!e.isFunction(i))return void F.error(S.noRule,a);u=i.call(r,c,o)}else{if(i=x.rules[s],!e.isFunction(i))return void F.error(S.noRule,s);u=i.call(r,c)}return u}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,F,t);else{if(n===i)return F[t];F[t]=n}},debug:function(){x.debug&&(x.performance?F.performance.log(arguments):(F.debug=Function.prototype.bind.call(console.info,console,x.name+":"),F.debug.apply(console,arguments)))},verbose:function(){x.verbose&&x.debug&&(x.performance?F.performance.log(arguments):(F.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),F.verbose.apply(console,arguments)))},error:function(){F.error=Function.prototype.bind.call(console.error,console,x.name+":"),F.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:D,"Execution Time":n})),clearTimeout(F.performance.timer),F.performance.timer=setTimeout(F.performance.display,500)},display:function(){var t=x.name+":",n=0;s=!1,clearTimeout(F.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=R;return n=n||m,a=D||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},F.initialize()}),o!==i?o:this},e.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:{bracket:/\[(.*)\]/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,email:"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",integer:/^\-?\d+$/,flags:/^\/(.*)\/(.*)?/,url:/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i},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:{oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noRule:"There is no rule matching the one you specified",method:"The method you called is not defined."},templates:{error:function(t){var n='
';return e.each(t,function(e,t){n+=""+t+" "}),n+=" ",e(n)},prompt:function(t){return e("
").addClass("ui red pointing prompt label").html(t[0])}},rules:{checked:function(){return e(this).filter(":checked").length>0},contains:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n,"i"))},containsExactly:function(t,n){return n=n.replace(e.fn.form.settings.regExp.escape,"\\$&"),-1!==t.search(new RegExp(n))},email:function(t){var n=new RegExp(e.fn.form.settings.regExp.email,"i");return n.test(t)},empty:function(t){return!(t===i||""===t||e.isArray(t)&&0===t.length)},integer:function(t,n){var o,a,r,s=e.fn.form.settings.regExp.integer;return n===i||""===n||".."===n||(-1==n.indexOf("..")?s.test(n)&&(o=a=n-0):(r=n.split("..",2),s.test(r[0])&&(o=r[0]-0),s.test(r[1])&&(a=r[1]-0))),s.test(t)&&(o===i||t>=o)&&(a===i||a>=t)},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,e="string"==typeof e?e.toLowerCase():e,e==t},isExactly:function(e,t){return e==t},length:function(e,t){return e!==i?e.length>=t:!1},different:function(t,n){{var o;e(this)}return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i?t.toString()!==o.toString():!1},match:function(t,n){{var o;e(this)}return e('[data-validate="'+n+'"]').length>0?o=e('[data-validate="'+n+'"]').val():e("#"+n).length>0?o=e("#"+n).val():e('[name="'+n+'"]').length>0?o=e('[name="'+n+'"]').val():e('[name="'+n+'[]"]').length>0&&(o=e('[name="'+n+'[]"]')),o!==i?t.toString()==o.toString():!1},maxCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length<=n},exactCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length==n},minCount:function(t,n){return t=t.split(","),e.isArray(t)&&t.length>=n},regExp:function(t,n){var i,o=n.match(e.fn.form.settings.regExp.flags);return o&&(n=o.length>=2?o[1]:n,i=o.length>=3?o[2]:""),t.match(new RegExp(n,i))},maxLength:function(e,t){return e!==i?e.length<=t:!1},not:function(e,t){return e="string"==typeof e?e.toLowerCase():e,t="string"==typeof t?t.toLowerCase():t,e!=t},notExactly:function(e,t){return e!=t},url:function(t){return e.fn.form.settings.regExp.url.match(t)}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.accordion=function(n){{var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(){var d,m,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),g=f.className,p=f.namespace,v=f.selector,h=f.error,b="."+p,y="module-"+p,x=a.selector||"",C=e(this),w=C.find(v.title),k=C.find(v.content),T=this,S=C.data(y);m={initialize:function(){m.debug("Initializing",C),m.bind.events(),m.observeChanges(),m.instantiate()},instantiate:function(){S=m,C.data(y,m)},destroy:function(){m.debug("Destroying previous instance",C),C.off(b).removeData(y)},refresh:function(){w=C.find(v.title),k=C.find(v.content)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),d.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",d))},bind:{events:function(){m.debug("Binding delegated events"),C.on(f.on+b,v.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r&&!a,c=!r&&a;m.debug("Toggling visibility of content",n),s||c?f.collapsible?m.close.call(n):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(n)},open:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=r||a;return s?void m.debug("Accordion already open, skipping",o):(m.debug("Opening accordion content",n),f.onOpening.call(o),f.exclusive&&m.closeOthers.call(n),n.addClass(g.active),o.stop(!0,!0).addClass(g.animating),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):o.children().stop(!0,!0).animate({opacity:1},f.duration,m.resetOpacity)),void o.slideDown(f.duration,f.easing,function(){o.removeClass(g.animating).addClass(g.active),m.reset.display.call(this),f.onOpen.call(this),f.onChange.call(this)}))},close:function(t){var n=t!==i?"number"==typeof t?w.eq(t):e(t).closest(v.title):e(this).closest(v.title),o=n.next(k),a=o.hasClass(g.animating),r=o.hasClass(g.active),s=!r&&a,c=r&&a;!r&&!s||c||(m.debug("Closing accordion content",o),f.onClosing.call(o),n.removeClass(g.active),o.stop(!0,!0).addClass(g.animating),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?o.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):o.children().stop(!0,!0).animate({opacity:0},f.duration,m.resetOpacity)),o.slideUp(f.duration,f.easing,function(){o.removeClass(g.animating).removeClass(g.active),m.reset.display.call(this),f.onClose.call(this),f.onChange.call(this)}))},closeOthers:function(t){var n,o,a,r=t!==i?w.eq(t):e(this).closest(v.title),s=r.parents(v.content).prev(v.title),c=r.closest(v.accordion),l=v.title+"."+g.active+":visible",u=v.content+"."+g.active+":visible";f.closeNested?(n=c.find(l).not(s),a=n.next(k)):(n=c.find(l).not(s),o=c.find(u).find(l).not(s),n=n.not(o),a=n.next(k)),n.length>0&&(m.debug("Exclusive enabled, closing other content",n),n.removeClass(g.active),a.removeClass(g.animating).stop(!0,!0),f.animateChildren&&(e.fn.transition!==i&&C.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:f.debug,verbose:f.verbose,duration:f.duration}):a.children().stop(!0,!0).animate({opacity:0},f.duration,m.resetOpacity)),a.slideUp(f.duration,f.easing,function(){e(this).removeClass(g.active),m.reset.display.call(this)}))},reset:{display:function(){m.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){return m.debug("Changing internal",t,n),n===i?m[t]:void(e.isPlainObject(t)?e.extend(!0,m,t):m[t]=n)},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;r=!1,clearTimeout(m.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",x&&(t+=" '"+x+"'"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,c,l=S;return n=n||u,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},l?(S===i&&m.initialize(),m.invoke(c)):(S!==i&&S.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!1,verbose:!1,performance:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",on:"click",onOpening:function(){},onOpen:function(){},onClosing: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"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.checkbox=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f=e.extend(!0,{},e.fn.checkbox.settings,n),g=f.className,p=f.namespace,v=f.selector,h=f.error,b="."+p,y="module-"+p,x=e(this),C=e(this).find(v.label),w=e(this).find(v.input),k=x.data(y),T=this;m={initialize:function(){m.verbose("Initializing checkbox",f),m.create.label(),m.add.events(),m.setup(),m.observeChanges(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),k=m,x.data(y,m)},destroy:function(){m.verbose("Destroying module"),m.remove.events(),x.removeData(y)},setup:function(){m.is.checked()?(m.debug("Setting initial value to checked"),m.set.checked(),f.fireOnInit&&f.onChecked.call(w.get())):(m.debug("Setting initial value to unchecked"),m.remove.checked(),f.fireOnInit&&f.onUnchecked.call(w.get()))},refresh:function(){C=x.find(v.label),w=x.find(v.input)},observeChanges:function(){"MutationObserver"in t&&(a=new MutationObserver(function(e){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),a.observe(T,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",a))},attachEvents:function(t,n){var i=e(t);n=e.isFunction(m[n])?m[n]:m.toggle,i.length>0?(m.debug("Attaching checkbox events to element",t,n),i.on("click"+b,n)):m.error(h.notFound)},event:{keydown:function(e){var t=e.which,n={enter:13,space:32,escape:27};t==n.escape&&(m.verbose("Escape key pressed blurring field"),x.blur()),e.ctrlKey||t!=n.enter&&t!=n.space||(m.verbose("Enter key pressed, toggling checkbox"),m.toggle.call(this),e.preventDefault())}},get:{radios:function(){return e('input[name="'+m.get.name()+'"]').closest(v.checkbox)},name:function(){return w.attr("name")}},is:{radio:function(){return w.hasClass(g.radio)||"radio"==w.attr("type")},checked:function(){return w.prop("checked")!==i&&w.prop("checked")},unchecked:function(){return!m.is.checked()}},can:{change:function(){return!(x.hasClass(g.disabled)||x.hasClass(g.readOnly)||w.prop("disabled"))},uncheck:function(){return"boolean"==typeof f.uncheckable?f.uncheckable:!m.is.radio()}},set:{checked:function(){var e;m.is.radio()&&(e=m.get.radios(),m.debug("Unchecking other radios",e),e.removeClass(g.checked)),x.addClass(g.checked)},tab:function(){w.attr("tabindex")===i&&w.attr("tabindex",0)}},create:{label:function(){w.prevAll(v.label).length>0?(w.prev(v.label).detach().insertAfter(w),m.debug("Moving existing label",C)):m.has.label()||(C=e("").insertAfter(w),m.debug("Creating label",C))}},has:{label:function(){return C.length>0}},add:{events:function(){m.verbose("Attaching checkbox events"),x.on("click"+b,m.toggle).on("keydown"+b,v.input,m.event.keydown)}},remove:{checked:function(){x.removeClass(g.checked)},events:function(){m.debug("Removing events"),x.off(b).removeData(y),w.off(b,m.event.keydown),C.off(b)}},enable:function(){m.debug("Enabling checkbox functionality"),x.removeClass(g.disabled),w.prop("disabled",!1),f.onEnabled.call(w[0])},disable:function(){m.debug("Disabling checkbox functionality"),x.addClass(g.disabled),w.prop("disabled","disabled"),f.onDisabled.call(w[0])},check:function(){m.debug("Enabling checkbox",w),w.prop("checked",!0).trigger("change"),m.set.checked(),w.trigger("blur"),f.onChange.call(w[0]),f.onChecked.call(w[0])},uncheck:function(){m.debug("Disabling checkbox"),w.prop("checked",!1).trigger("change"),m.remove.checked(),w.trigger("blur"),f.onChange.call(w[0]),f.onUnchecked.call(w[0])},toggle:function(e){return m.can.change()?(m.verbose("Determining new checkbox state"),void(m.is.unchecked()?m.check():m.is.checked()&&m.can.uncheck()&&m.uncheck())):void(m.is.radio()||m.debug("Checkbox is read-only or disabled, ignoring toggle"))},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",
Element:T,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=k;return n=n||d,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(k===i&&m.initialize(),m.invoke(l)):(k!==i&&k.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!0,onChange:function(){},onChecked:function(){},onUnchecked:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",disabled:"disabled",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",input:'> input[type="checkbox"], > input[type="radio"]',label:"> label"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.dimmer=function(t){var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);return a.each(function(){var d,m,f,g=e.isPlainObject(t)?e.extend(!0,{},e.fn.dimmer.settings,t):e.extend({},e.fn.dimmer.settings),p=g.selector,v=g.namespace,h=g.className,b=g.error,y="."+v,x="module-"+v,C=a.selector||"",w="ontouchstart"in n.documentElement?"touchstart":"click",k=e(this),T=this,S=k.data(x);f={preinitialize:function(){f.is.dimmer()?(m=k.parent(),d=k):(m=k,d=f.has.dimmer()?g.dimmerName?m.find(p.dimmer).filter("."+g.dimmerName):m.find(p.dimmer):f.create())},initialize:function(){f.debug("Initializing dimmer",g),"hover"==g.on?m.on("mouseenter"+y,f.show).on("mouseleave"+y,f.hide):"click"==g.on&&m.on(w+y,f.toggle),f.is.page()&&(f.debug("Setting as a page dimmer",m),f.set.pageDimmer()),f.is.closable()&&(f.verbose("Adding dimmer close event",d),m.on(w+y,p.dimmer,f.event.click)),f.set.dimmable(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),S=f,k.data(x,S)},destroy:function(){f.verbose("Destroying previous module",d),k.removeData(x),m.off(y)},event:{click:function(t){f.verbose("Determining if event occured on dimmer",t),(0===d.find(t.target).length||e(t.target).is(p.content))&&(f.hide(),t.stopImmediatePropagation())}},addContent:function(t){var n=e(t);f.debug("Add content to dimmer",n),n.parent()[0]!==d[0]&&n.detach().appendTo(d)},create:function(){var t=e(g.template.dimmer());return g.variation&&(f.debug("Creating dimmer with variation",g.variation),t.addClass(g.variation)),g.dimmerName&&(f.debug("Creating named dimmer",g.dimmerName),t.addClass(g.dimmerName)),t.appendTo(m),t},show:function(t){t=e.isFunction(t)?t:function(){},f.debug("Showing dimmer",d,g),f.is.dimmed()&&!f.is.animating()||!f.is.enabled()?f.debug("Dimmer is already shown or disabled"):(f.animate.show(t),g.onShow.call(T),g.onChange.call(T))},hide:function(t){t=e.isFunction(t)?t:function(){},f.is.dimmed()||f.is.animating()?(f.debug("Hiding dimmer",d),f.animate.hide(t),g.onHide.call(T),g.onChange.call(T)):f.debug("Dimmer is not visible")},toggle:function(){f.verbose("Toggling dimmer visibility",d),f.is.dimmed()?f.hide():f.show()},animate:{show:function(t){t=e.isFunction(t)?t:function(){},g.useCSS&&e.fn.transition!==i&&d.transition("is supported")?("auto"!==g.opacity&&f.set.opacity(),d.transition({animation:g.transition+" in",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.set.dimmed()},onComplete:function(){f.set.active(),t()}})):(f.verbose("Showing dimmer animation with javascript"),f.set.dimmed(),"auto"==g.opacity&&(g.opacity=.8),d.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(f.get.duration(),g.opacity,function(){d.removeAttr("style"),f.set.active(),t()}))},hide:function(t){t=e.isFunction(t)?t:function(){},g.useCSS&&e.fn.transition!==i&&d.transition("is supported")?(f.verbose("Hiding dimmer with css"),d.transition({animation:g.transition+" out",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.remove.dimmed()},onComplete:function(){f.remove.active(),t()}})):(f.verbose("Hiding dimmer with javascript"),f.remove.dimmed(),d.stop().fadeOut(f.get.duration(),function(){f.remove.active(),d.removeAttr("style"),t()}))}},get:{dimmer:function(){return d},duration:function(){return"object"==typeof g.duration?f.is.active()?g.duration.hide:g.duration.show:g.duration}},has:{dimmer:function(){return g.dimmerName?k.find(p.dimmer).filter("."+g.dimmerName).length>0:k.find(p.dimmer).length>0}},is:{active:function(){return d.hasClass(h.active)},animating:function(){return d.is(":animated")||d.hasClass(h.animating)},closable:function(){return"auto"==g.closable?"hover"==g.on?!1:!0:g.closable},dimmer:function(){return k.hasClass(h.dimmer)},dimmable:function(){return k.hasClass(h.dimmable)},dimmed:function(){return m.hasClass(h.dimmed)},disabled:function(){return m.hasClass(h.disabled)},enabled:function(){return!f.is.disabled()},page:function(){return m.is("body")},pageDimmer:function(){return d.hasClass(h.pageDimmer)}},can:{show:function(){return!d.hasClass(h.disabled)}},set:{opacity:function(e){var e=g.opacity||e,t=d.css("background-color"),n=t.split(","),i=n&&4==n.length;i?(n[3]=e+")",t=n.join(",")):t="rgba(0, 0, 0, "+e+")",f.debug("Setting opacity to",e),d.css("background-color",t)},active:function(){d.addClass(h.active)},dimmable:function(){m.addClass(h.dimmable)},dimmed:function(){m.addClass(h.dimmed)},pageDimmer:function(){d.addClass(h.pageDimmer)},disabled:function(){d.addClass(h.disabled)}},remove:{active:function(){d.removeClass(h.active)},dimmed:function(){m.removeClass(h.dimmed)},disabled:function(){d.removeClass(h.disabled)}},setting:function(t,n){if(f.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;g.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=g.name+":",n=0;r=!1,clearTimeout(f.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",C&&(t+=" '"+C+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[]}},invoke:function(t,n,a){var r,s,c,l=S;return n=n||u,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(f.error(b.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},f.preinitialize(),l?(S===i&&f.initialize(),f.invoke(c)):(S!==i&&S.invoke("destroy"),f.initialize())}),o!==i?o:this},e.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",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 e("
").attr("class","ui dimmer")}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.dropdown=function(o){var a,r=e(this),s=e(n),c=r.selector||"",l="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],m=arguments[0],f="string"==typeof m,g=[].slice.call(arguments,1);return r.each(function(){var p,v,h,b,y,x=e.isPlainObject(o)?e.extend(!0,{},e.fn.dropdown.settings,o):e.extend({},e.fn.dropdown.settings),C=x.className,w=x.message,k=x.metadata,T=x.namespace,S=x.regExp,A=x.selector,P=x.error,E=x.templates,R="."+T,F="module-"+T,O=e(this),D=O.find(A.text),q=O.find(A.search),z=O.find(A.input),j=O.find(A.icon),N=O.prev().find(A.text).length>0?O.prev().find(A.text):O.prev(),I=O.children(A.menu),M=I.find(A.item),L=!1,V=!1,H=this,U=O.data(F);y={initialize:function(){y.debug("Initializing dropdown",x),y.is.alreadySetup()?y.setup.reference():(y.setup.layout(),y.save.defaults(),y.set.selected(),y.is.multiple()&&(x.allowAdditions&&(x.useLabels||(y.error(P.labels),x.useLabels=!0),y.create.userLabels()),y.check.maxSelections()),y.create.id(),l&&y.bind.touchEvents(),y.bind.mouseEvents(),y.bind.keyboardEvents(),y.observeChanges(),y.instantiate())},instantiate:function(){y.verbose("Storing instance of dropdown",y),U=y,O.data(F,y)},destroy:function(){y.verbose("Destroying previous dropdown for",O),y.remove.tabbable(),O.off(R).removeData(F),I.off(R),s.off(p),h&&h.disconnect(),b&&b.disconnect()},observeChanges:function(){"MutationObserver"in t&&(h=new MutationObserver(function(e){y.debug(" modified, recreating menu"),y.setup.select()}),b=new MutationObserver(function(e){y.debug("Menu modified, updating selector cache"),y.refresh()}),y.has.input()&&h.observe(z[0],{childList:!0,subtree:!0}),y.has.menu()&&b.observe(I[0],{childList:!0,subtree:!0}),y.debug("Setting up mutation observer",h,b))},create:{id:function(){v=(Math.random().toString(16)+"000000000").substr(2,8),p="."+v,y.verbose("Creating unique id for element",v)},userLabels:function(){var t=y.get.userValues();t&&(y.debug("Adding user labels",t),e.each(t,function(e,t){y.verbose("Adding custom user value"),y.add.label(t,t)}))}},search:function(e){e=e!==i?e:y.get.query(),y.verbose("Searching for query",e),y.filter(e),x.allowAdditions&&y.add.userChoice(e),y.is.searchSelection()&&y.can.show()&&y.show()},select:{firstUnfiltered:function(){y.verbose("Selecting first non-filtered element"),y.remove.selectedItem(),M.not("."+C.filtered).eq(0).addClass(C.selected)},nextAvailable:function(e){e=e.eq(0);var t=e.nextAll(A.item).not("."+C.filtered).eq(0),n=e.prevAll(A.item).not("."+C.filtered).eq(0),i=t.length>0;i?(y.verbose("Moving selection to",t),t.addClass(C.selected)):(y.verbose("Moving selection to",n),n.addClass(C.selected))}},setup:{layout:function(){O.is("select")&&y.setup.select(),y.is.search()&&!y.has.search()&&(y.verbose("Adding search input"),q=e(" ").addClass(C.search).insertBefore(D)),x.allowTab&&y.set.tabbable()},select:function(){var t=y.get.selectValues();y.debug("Dropdown initialized on a select",t),O.is("select")&&(z=O),z.parent(A.dropdown).length>0?(y.debug("UI dropdown already exists. Creating dropdown menu only"),O=z.closest(A.dropdown),I=O.children(A.menu),0===I.length&&(I=e("
").addClass(C.menu).appendTo(O)),I.html(E.menu(t))):(y.debug("Creating entire dropdown from select"),O=e("
").attr("class",z.attr("class")).addClass(C.selection).addClass(C.dropdown).html(E.dropdown(t)).insertBefore(z),z.removeAttr("class").detach().prependTo(O)),z.is("[multiple]")&&y.set.multiple(),y.refresh()},reference:function(){var e,t,n=r.index(O);y.debug("Dropdown behavior was called on select, replacing with closest dropdown"),O=O.parent(A.dropdown),y.refresh(),e=r.slice(0,n),t=r.slice(n+1),r=e.add(O).add(t),f&&(U=y,y.invoke(m))}},refresh:function(){y.verbose("Refreshing selector cache"),D=O.find(A.text),q=O.find(A.search),z=O.find(A.input),j=O.find(A.icon),N=O.prev().find(A.text).length>0?O.prev().find(A.text):O.prev(),I=O.children(A.menu),M=I.find(A.item)},toggle:function(){y.verbose("Toggling menu visibility"),y.is.active()?y.hide():y.show()},show:function(t){if(t=e.isFunction(t)?t:function(){},y.can.show()&&!y.is.active()){if(y.debug("Showing dropdown"),y.is.multiple()&&!y.has.search()&&y.is.allFiltered())return!0;y.animate.show(function(){y.can.click()&&y.bind.intent(),y.set.visible(),t.call(H)}),x.onShow.call(H)}},hide:function(t){t=e.isFunction(t)?t:function(){},y.is.active()&&(y.debug("Hiding dropdown"),y.animate.hide(function(){y.remove.visible(),t.call(H)}),x.onHide.call(H))},hideOthers:function(){y.verbose("Finding other dropdowns to hide"),r.not(O).has(A.menu+"."+C.visible).dropdown("hide")},hideMenu:function(){y.verbose("Hiding menu instantaneously"),y.remove.active(),y.remove.visible(),I.transition("hide")},hideSubMenus:function(){var e=I.children(A.item).find(A.menu);y.verbose("Hiding sub menus",e),e.transition("hide")},bind:{keyboardEvents:function(){y.debug("Binding keyboard events"),O.on("keydown"+R,y.event.keydown),y.has.search()&&O.on(y.get.inputEvent()+R,A.search,y.event.input),y.is.multiple()&&s.on("keydown"+p,y.event.document.keydown)},touchEvents:function(){y.debug("Touch device detected binding additional touch events"),y.is.searchSelection()||O.on("touchstart"+R,y.event.test.toggle),I.on("touchstart"+R,A.item,y.event.item.mouseenter)},mouseEvents:function(){y.debug("Mouse detected binding mouse events"),y.is.multiple()&&O.on("click"+R,A.label,y.event.label.click).on("click"+R,A.remove,y.event.remove.click),y.is.searchSelection()?(O.on("mousedown"+R,A.menu,y.event.menu.mousedown).on("mouseup"+R,A.menu,y.event.menu.mouseup).on("click"+R,A.search,y.show).on("focus"+R,A.search,y.event.search.focus).on("blur"+R,A.search,y.event.search.blur).on("click"+R,A.text,y.event.text.focus),y.is.multiple()&&O.on("click"+R,y.event.click)):("click"==x.on?O.on("click"+R,y.event.test.toggle):"hover"==x.on?O.on("mouseenter"+R,y.delay.show).on("mouseleave"+R,y.delay.hide):O.on(x.on+R,y.toggle),O.on("mousedown"+R,y.event.mousedown).on("mouseup"+R,y.event.mouseup).on("focus"+R,y.event.focus).on("blur"+R,y.event.blur)),I.on("mouseenter"+R,A.item,y.event.item.mouseenter).on("mouseleave"+R,A.item,y.event.item.mouseleave).on("click"+R,A.item,y.event.item.click)},intent:function(){y.verbose("Binding hide intent event to document"),l&&s.on("touchstart"+p,y.event.test.touch).on("touchmove"+p,y.event.test.touch),s.on("click"+p,y.event.test.hide)}},unbind:{intent:function(){y.verbose("Removing hide intent event from document"),l&&s.off("touchstart"+p).off("touchmove"+p),s.off("click"+p)}},filter:function(t){var n,o,a=e();t=t!==i?t:y.get.query(),n=y.escape.regExp(t),o=new RegExp("^"+n,"igm"),y.has.maxSelections()||(""===t?a=M:(y.verbose("Searching for matching values",t),M.each(function(){var n,i,r=e(this);if("both"==x.match||"text"==x.match){if(n=String(y.get.choiceText(r,!1)),-1!==n.search(o))return a=a.add(r),!0;if(x.fullTextSearch&&y.fuzzySearch(t,n))return a=a.add(r),!0}if("both"==x.match||"value"==x.match){if(i=String(y.get.choiceValue(r,n)),-1!==i.search(o))return a=a.add(r),!0;if(x.fullTextSearch&&y.fuzzySearch(t,i))return a=a.add(r),!0}})),y.debug("Showing only matched items",t),y.remove.filteredItem(),M.not(a).addClass(C.filtered),y.is.multiple()&&y.filterActive(),y.select.firstUnfiltered(),y.has.allResultsFiltered()?x.onNoResults.call(H,t)?x.allowAdditions||(y.verbose("All items filtered, showing message",t),y.add.message(w.noResults)):(y.verbose("All items filtered, hiding dropdown",t),y.hideMenu()):y.remove.message())},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;i>o;o++){for(var r=e.charCodeAt(o);n>a;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},filterActive:function(){x.useLabels&&M.filter("."+C.active).addClass(C.filtered)},focusSearch:function(){y.is.search()&&!y.is.focusedOnSearch()&&q[0].focus()},forceSelection:function(){var e=M.not(C.filtered).filter("."+C.selected).eq(0),t=M.not(C.filtered).filter("."+C.active).eq(0),n=e.length>0?e:t,i=n.size()>0;i?(y.debug("Forcing partial selection to selected item",n),y.event.item.click.call(n),y.remove.filteredItem()):y.hide()},event:{focus:function(){x.showOnFocus&&!L&&y.is.hidden()&&y.show()},click:function(t){var n=e(t.target);!n.is(O)&&!n.is(j)||y.is.focusedOnSearch()||q.focus()},blur:function(e){var t=n.activeElement===this;L||t||(y.remove.activeLabel(),y.hide())},mousedown:function(){L=!0},mouseup:function(){L=!1},search:{focus:function(){L=!0,y.is.multiple()&&y.remove.activeLabel(),x.showOnFocus&&y.show()},blur:function(e){var t=n.activeElement===this;V||t||(y.is.multiple()?(y.remove.activeLabel(),y.hide()):x.forceSelection?y.forceSelection():y.hide())}},text:{focus:function(e){L=!0,q.focus()}},input:function(e){(y.is.multiple()||y.is.searchSelection())&&y.set.filtered(),clearTimeout(y.timer),y.timer=setTimeout(y.search,x.delay.search)},label:{click:function(t){var n=e(this),i=O.find(A.label),o=i.filter("."+C.active),a=n.nextAll("."+C.active),r=n.prevAll("."+C.active),s=a.length>0?n.nextUntil(a).add(o).add(n):n.prevUntil(r).add(o).add(n);t.shiftKey?(o.removeClass(C.active),s.addClass(C.active)):t.ctrlKey?n.toggleClass(C.active):(o.removeClass(C.active),n.addClass(C.active)),x.onLabelSelect.apply(this,i.filter("."+C.active))}},remove:{click:function(){var t=e(this).parent();t.hasClass(C.active)?y.remove.labels():y.remove.labels(t)}},test:{toggle:function(e){var t=y.is.multiple()?y.show:y.toggle;y.determine.eventOnElement(e,t)&&e.preventDefault()},touch:function(e){y.determine.eventOnElement(e,function(){"touchstart"==e.type?y.timer=setTimeout(y.hide,x.delay.touch):"touchmove"==e.type&&clearTimeout(y.timer)}),e.stopPropagation()},hide:function(e){y.determine.eventInModule(e,y.hide)}},menu:{mousedown:function(){V=!0},mouseup:function(){V=!1}},item:{mouseenter:function(t){var n=e(this).children(A.menu),i=e(this).siblings(A.item).children(A.menu);n.length>0&&(clearTimeout(y.itemTimer),y.itemTimer=setTimeout(function(){y.verbose("Showing sub-menu",n),e.each(i,function(){y.animate.hide(!1,e(this))}),y.animate.show(!1,n)},x.delay.show),t.preventDefault())},mouseleave:function(t){var n=e(this).children(A.menu);n.length>0&&(clearTimeout(y.itemTimer),y.itemTimer=setTimeout(function(){y.verbose("Hiding sub-menu",n),y.animate.hide(!1,n)},x.delay.hide))},click:function(t){var n=e(this),i=e(t?t.target:""),o=n.find(A.menu),a=y.get.choiceText(n),r=y.get.choiceValue(n,a),s=o.length>0,c=o.find(i).length>0;c||s&&!x.allowCategorySelection||y.determine.selectAction.call(this,a,r)}},document:{keydown:function(e){var t=e.which,n=y.get.shortcutKeys(),i=y.is.inObject(t,n);if(i){var o=O.find(A.label),a=o.filter("."+C.active),r=(a.data("value"),o.index(a)),s=o.length,c=a.length>0,l=a.length>1,u=0===r,d=r+1==s,m=y.is.searchSelection(),f=y.is.focusedOnSearch(),g=y.is.focused(),p=f&&0===y.get.caretPosition();if(m&&!c&&!f)return;t==n.leftArrow?!g&&!p||c?c&&(e.shiftKey?y.verbose("Adding previous label to selection"):(y.verbose("Selecting previous label"),o.removeClass(C.active)),u&&!l?a.addClass(C.active):a.prev(A.siblingLabel).addClass(C.active).end(),e.preventDefault()):(y.verbose("Selecting previous label"),o.last().addClass(C.active)):t==n.rightArrow?(g&&!c&&o.first().addClass(C.active),c&&(e.shiftKey?y.verbose("Adding next label to selection"):(y.verbose("Selecting next label"),o.removeClass(C.active)),d?m?f?o.removeClass(C.active):y.focusSearch():l?a.next(A.siblingLabel).addClass(C.active):a.addClass(C.active):a.next(A.siblingLabel).addClass(C.active),e.preventDefault())):t==n.deleteKey||t==n.backspace?c?(y.verbose("Removing active labels"),d&&m&&!f&&y.focusSearch(),a.last().next(A.siblingLabel).addClass(C.active),y.remove.labels(a),e.preventDefault()):p&&!c&&t==n.backspace&&(y.verbose("Removing last label on input backspace"),a=o.last().addClass(C.active),y.remove.labels(a),e.preventDefault()):a.removeClass(C.active)}}},keydown:function(e){var t=e.which,n=y.get.shortcutKeys(),i=y.is.inObject(t,n);if(i){var o,a,r=M.not("."+C.filtered).filter("."+C.selected).eq(0),s=I.children("."+C.active).eq(0),c=r.length>0?r:s,l=c.length>0?c.siblings(":not(."+C.filtered+")").andSelf():I.children(":not(."+C.filtered+")"),u=c.children(A.menu),d=c.closest(A.menu),m=d.hasClass(C.visible)||d.hasClass(C.animating)||d.parent(A.menu).length>0,f=u.length>0,g=c.length>0,p=c.not("."+C.filtered).length>0;if(y.is.visible()){if((t==n.enter||t==n.delimiter)&&(t==n.enter&&g&&f&&!x.allowCategorySelection?(y.verbose("Pressed enter on unselectable category, opening sub menu"),t=n.rightArrow):p&&(y.verbose("Selecting item from keyboard shortcut",c),y.event.item.click.call(c,e),x.useLabels&&y.is.searchSelection()?y.hideAndClear():y.remove.searchTerm()),e.preventDefault()),t==n.leftArrow&&(a=d[0]!==I[0],a&&(y.verbose("Left key pressed, closing sub-menu"),y.animate.hide(!1,d),c.removeClass(C.selected),d.closest(A.item).addClass(C.selected),e.preventDefault())),t==n.rightArrow&&f&&(y.verbose("Right key pressed, opening sub-menu"),y.animate.show(!1,u),c.removeClass(C.selected),u.find(A.item).eq(0).addClass(C.selected),e.preventDefault()),t==n.upArrow){if(o=g&&m?c.prevAll(A.item+":not(."+C.filtered+")").eq(0):M.eq(0),l.index(o)<0)return y.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();y.verbose("Up key pressed, changing active item"),c.removeClass(C.selected),o.addClass(C.selected),y.set.scrollPosition(o),e.preventDefault()}if(t==n.downArrow){if(o=g&&m?o=c.nextAll(A.item+":not(."+C.filtered+")").eq(0):M.eq(0),0===o.length)return y.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();y.verbose("Down key pressed, changing active item"),M.removeClass(C.selected),o.addClass(C.selected),y.set.scrollPosition(o),e.preventDefault()}t==n.pageUp&&(y.scrollPage("up"),e.preventDefault()),t==n.pageDown&&(y.scrollPage("down"),e.preventDefault()),t==n.escape&&(y.verbose("Escape key pressed, closing dropdown"),y.hide())}else t==n.delimiter&&e.preventDefault(),t==n.downArrow&&(y.verbose("Down key pressed, showing dropdown"),y.show(),e.preventDefault())}else y.is.selection()&&!y.is.search()&&y.set.selectedLetter(String.fromCharCode(t))}},determine:{selectAction:function(t,n){y.verbose("Determining action",x.action),e.isFunction(y.action[x.action])?(y.verbose("Triggering preset action",x.action,t,n),y.action[x.action].call(this,t,n)):e.isFunction(x.action)?(y.verbose("Triggering user action",x.action,t,n),x.action.call(this,t,n)):y.error(P.action,x.action)},eventInModule:function(t,n){return n=e.isFunction(n)?n:function(){},0===e(t.target).closest(O).length?(y.verbose("Triggering event",n),n(),!0):(y.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(t,n){var i=e(t.target);return n=e.isFunction(n)?n:function(){},0===i.closest(I).length?(y.verbose("Triggering event",n),n(),!0):(y.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(t,n){n=n!==i?n:t,y.set.selected(n,e(this)),(!y.is.multiple()||y.is.allFiltered())&&y.hideAndClear()},select:function(e,t){y.action.activate.call(this)},combo:function(t,n){n=n!==i?n:t,y.set.selected(n,e(this)),y.hideAndClear()},hide:function(){y.hideAndClear()}},get:{id:function(){return v},text:function(){return D.text()},query:function(){return e.trim(q.val())},searchWidth:function(e){return e*x.glyphWidth+"em"},selectionCount:function(){var t=y.get.values();return y.is.multiple()&&e.isArray(t)?t.length:""!==y.get.value()?1:0},transition:function(e){return"auto"==x.transition?y.is.upward(e)?"slide up":"slide down":x.transition},userValues:function(){var t=y.get.values();return t?e.grep(t,function(e){return y.get.item(e)===!1}):!1},uniqueArray:function(t){return e.grep(t,function(n,i){return e.inArray(n,t)===i})},caretPosition:function(){var e,t,i=q.get(0);return"selectionStart"in i?i.selectionStart:n.selection?(i.focus(),e=n.selection.createRange(),t=e.text.length,e.moveStart("character",-i.value.length),e.text.length-t):void 0},shortcutKeys:function(){return{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40}},value:function(){return z.length>0?z.val():O.data(k.value)},values:function(){var e=y.get.value();return""===e?"":!z.is("select")&&y.is.multiple()?"string"==typeof e?e.split(x.delimiter):"":e},choiceText:function(e,t){return t=t!==i?t:x.preserveHTML,e?(e.find(A.menu).length>0&&(y.verbose("Retreiving text of element with sub-menu"),e=e.clone(),e.find(A.menu).remove(),e.find(A.menuIcon).remove()),e.data(k.text)!==i?e.data(k.text):t?e.html().trim():e.text().trim()):void 0},choiceValue:function(e,t){return t=t||y.get.choiceText(e),e?e.data(k.value)!==i?e.data(k.value):"string"==typeof t?t.toLowerCase().trim():t:!1},inputEvent:function(){var e=q[0];return e?e.oninput!==i?"input":e.onpropertychange!==i?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=[],O.find("option").each(function(){var n=e(this).html(),o=e(this).attr("value")!==i?e(this).attr("value"):n;"auto"===x.placeholder&&""===o?t.placeholder=n:t.values.push({name:n,value:o})}),x.placeholder&&"auto"!==x.placeholder&&(y.debug("Setting placeholder value to",x.placeholder),t.placeholder=x.placeholder),x.sortSelect?(t.values.sort(function(e,t){return e.name>t.name?1:-1}),y.debug("Retrieved and sorted values from select",t)):y.debug("Retreived values from select",t),t},activeItem:function(){return M.filter("."+C.active)},selectedItem:function(){var e=M.not("."+C.filtered).filter("."+C.selected);return e.length>0?e:M.eq(0)},item:function(t,n){var o,a=!1;return t=t!==i?t:y.get.values()!==i?y.get.values():y.get.text(),o=y.is.multiple()&&e.isArray(t),n=""===t||0===t?!0:n||!1,t!==i&&M.each(function(){var i=e(this),r=y.get.choiceText(i),s=y.get.choiceValue(i,r);if(o)(-1!==e.inArray(s.toString(),t)||-1!==e.inArray(r,t))&&(a=a?a.add(i):i);else if(n){if(y.verbose("Ambiguous dropdown value using strict type check",i,t),s===t||r===t)return a=i,!0}else if(s==t||r==t)return y.verbose("Found select item by value",s,t),a=i,!0}),a}},check:{maxSelections:function(e){return x.maxSelections?(e=e!==i?e:y.get.selectionCount(),e>=x.maxSelections?(y.debug("Maximum selection count reached"),M.addClass(C.filtered),y.add.message(w.maxSelections),!0):(y.verbose("No longer maximum selection count, removing message"),y.remove.message(),y.remove.filteredItem(),y.is.searchSelection()&&y.filter(),!1)):!0}},restore:{defaults:function(){y.restore.defaultText(),y.restore.defaultValue()},defaultText:function(){var e=O.data(k.defaultText);y.debug("Restoring default text",e),y.set.text(e),D.addClass(C.placeholder)},defaultValue:function(){var e=O.data(k.defaultValue);e!==i&&(y.debug("Restoring default value",e),e.length?y.set.selected(e):(y.remove.activeItem(),y.remove.selectedItem()))}},save:{defaults:function(){y.save.defaultText(),y.save.placeholderText(),y.save.defaultValue()},defaultValue:function(){O.data(k.defaultValue,y.get.value())},defaultText:function(){O.data(k.defaultText,D.text())},placeholderText:function(){D.hasClass(C.placeholder)&&O.data(k.placeholderText,D.text())}},clear:function(){y.set.placeholderText(),y.clearValue(),y.remove.activeItem(),y.remove.selectedItem()},clearValue:function(){y.set.value("")},scrollPage:function(e,t){var n,i,o,a=I.outerHeight(),r=I.scrollTop(),s=M.eq(0).outerHeight(),c=Math.floor(a/s),l=(I.prop("scrollHeight"),"up"==e?r-s*c:r+s*c),u=M.not("."+C.filtered);t=t||y.get.selectedItem(),o="up"==e?u.index(t)-c:u.index(t)+c,n="up"==e?o>=0:o0&&(y.debug("Scrolling page",e,i),t.removeClass(C.selected),i.addClass(C.selected),I.scrollTop(l))},set:{filtered:function(){var e=y.is.multiple(),t=y.is.searchSelection(),n=e&&t,i=t?y.get.query():"",o="string"==typeof i&&i.length>0,a=y.get.searchWidth(i.length),r=""!==i;e&&o&&(y.verbose("Adjusting input width",a,x.glyphWidth),q.css("width",a)),o||n&&r?(y.verbose("Hiding placeholder text"),D.addClass(C.filtered)):(!e||n&&!r)&&(y.verbose("Showing placeholder text"),D.removeClass(C.filtered))},placeholderText:function(e){y.debug("Restoring placeholder text"),e=e||O.data(k.placeholderText),y.set.text(e),D.addClass(C.placeholder)},tabbable:function(){y.has.search()?(y.debug("Added tabindex to searchable dropdown"),q.val("").attr("tabindex",0)):(y.debug("Added tabindex to dropdown"),O.attr("tabindex")||O.attr("tabindex",0))},scrollPosition:function(e,t){var n,o,a,r,s,c,l,u,d,m=5;e=e||y.get.selectedItem(),n=e.closest(A.menu),o=e&&e.length>0,t=t!==i?t:!1,e&&n.length>0&&o&&(r=e.position().top,n.addClass(C.loading),c=n.scrollTop(),s=n.offset().top,r=e.offset().top,a=c-s+r,t||(l=n.height(),d=a+m>c+l,u=c>a-m),y.debug("Scrolling to active item",a),(t||u||d)&&n.scrollTop(a).removeClass(C.loading))},text:function(e){"select"!==x.action&&("combo"==x.action?(y.debug("Changing combo button text",e,N),x.preserveHTML?N.html(e):N.text(e)):(y.debug("Changing text",e,D),D.removeClass(C.filtered).removeClass(C.placeholder),x.preserveHTML?D.html(e):D.text(e)))},selectedLetter:function(t){var n=M.filter("."+C.selected),i=!1;M.each(function(){var n=e(this),o=y.get.choiceText(n,!1),a=String(o).charAt(0).toLowerCase(),r=t.toLowerCase();return a==r?(i=n,!1):void 0}),i&&(y.verbose("Scrolling to next value with letter",t),y.set.scrollPosition(i),n.removeClass(C.selected),i.addClass(C.selected))},upward:function(e){var t=e||O;t.addClass(C.upward)},value:function(t,n,i){var o=(z.length>0,!y.has.value(t),y.get.values());if(z.length>0){if(y.is.multiple()){if(""===t)return void y.debug("Cannot select blank values from multiselect");t=[t],e.isArray(o)&&(t=o.concat(t),t=y.get.uniqueArray(t)),z.is("select")?(y.debug("Setting multiple values",t,z),x.allowAdditions&&y.add.optionValue(t)):(t=t.join(x.delimiter),y.debug("Setting hidden input to delimited values",t,z))}if(t==o)return void y.verbose("Skipping value update already same value",t,o);y.debug("Updating input value",t,o),z.val(t).trigger("change"),x.onChange.call(H,t,n,i)}else y.verbose("Storing value in metadata",t,z),t!==o&&(O.data(k.value,t),x.onChange.call(H,t,n,i));y.check.maxSelections()},active:function(){O.addClass(C.active)},multiple:function(){O.addClass(C.multiple)},visible:function(){O.addClass(C.visible)},selected:function(t,n){var i=y.is.multiple();return(n=n||y.get.item(t))?(y.debug("Setting selected menu item to",n),y.is.single()?(y.remove.activeItem(),y.remove.selectedItem()):x.useLabels&&y.remove.selectedItem(),void n.each(function(){var t=e(this),o=y.get.choiceText(t),a=y.get.choiceValue(t,o),r=t.hasClass(C.filtered),s=t.hasClass(C.active),c=t.hasClass(C.addition),l=i&&1==n.length;i?!s||c?x.useLabels?(y.add.label(a,o,l),y.set.value(a,o,t),t.addClass(C.active),y.filterActive(),y.select.nextAvailable(n)):(y.set.value(a,o,t),y.set.text(y.add.variables(w.count)),t.addClass(C.active)):r||(y.debug("Selected active value, removing label"),y.remove.selected(a)):(y.set.value(a,o,t),y.set.text(o),t.addClass(C.active).addClass(C.selected));
})):!1}},add:{label:function(t,n,i){var o,a=y.is.searchSelection()?q:D;return o=e(" ").addClass(C.label).attr("data-value",t).html(E.label(t,n)),o=x.onLabelCreate.call(o,t,n),y.has.label(t)?void y.debug("Label already exists, skipping",t):(x.label.variation&&o.addClass(x.label.variation),void(i===!0?(y.debug("Animating in label",o),o.addClass(C.hidden).insertBefore(a).transition(x.label.transition,x.label.duration)):(y.debug("Adding selection label",o),o.insertBefore(a))))},message:function(t){var n=I.children(A.message),i=x.templates.message(y.add.variables(t));n.length>0?n.html(i):n=e("
").html(i).addClass(C.message).appendTo(I)},optionValue:function(t){return z.is("select")?(h&&h.disconnect(),e.each(t,function(t,n){var i=z.find('option[value="'+n+'"]'),o=i.length>0;o||(e(" ").prop("value",n).html(n).appendTo(z),y.verbose("Adding user addition as an ",n))}),void(h&&h.observe(z[0],{childList:!0,subtree:!0}))):!1},userChoice:function(t){var n,i=y.get.item(t),o=I.children(A.addition);if(!y.has.maxSelections()){if(""===t||i)return void o.remove();n=x.templates.addition(t),M.removeClass(C.selected),o.length>0?o.html(n).data(k.value,t).removeClass(C.filtered).addClass(C.selected):o=e("
").html(n).data(k.value,t).addClass(C.addition).addClass(C.item).prependTo(I).addClass(C.selected)}},variables:function(e){var t,n,i=-1!==e.search("{count}"),o=-1!==e.search("{maxCount}"),a=-1!==e.search("{term}");return i&&(t=y.get.selectionCount(),e=e.replace("{count}",t)),o&&(t=y.get.selectionCount(),e=e.replace("{maxCount}",x.maxSelections)),a&&(n=y.get.query(),e=e.replace("{term}",n)),e}},remove:{active:function(){O.removeClass(C.active)},activeLabel:function(){O.find(A.label).removeClass(C.active)},upward:function(e){var t=e||O;t.removeClass(C.upward)},visible:function(){O.removeClass(C.visible)},activeItem:function(){M.removeClass(C.active)},filteredItem:function(){y.has.maxSelections()||(x.useLabels?M.not("."+C.active).removeClass(C.filtered):M.removeClass(C.filtered))},message:function(){I.children(A.message).remove()},searchTerm:function(){y.verbose("Cleared search term"),q.val(""),y.set.filtered()},selected:function(e){var t=y.get.item(e),n=y.get.choiceValue(t);return t?(y.remove.value(n),y.is.multiple()&&(x.useLabels?y.remove.label(n):y.set.text(y.add.variables(w.count))),t.removeClass(C.filtered).removeClass(C.active),void(x.useLabels&&t.removeClass(C.selected))):!1},selectedItem:function(){M.removeClass(C.selected)},value:function(e){var t=z.val();z.is("select")?(y.verbose("Input is removing selected"),z.find('option[value="'+e+'"]').prop("selected",!1)):(y.verbose("Input is csv removing value"),t=y.remove.delimitedValue(e,t),z.val(t).trigger("change")),y.check.maxSelections()},delimitedValue:function(t,n){return"string"!=typeof n?!1:(n=n.split(x.delimiter),n=e.grep(n,function(e){return t!=e}),n=n.join(x.delimiter),y.verbose("Removed value from delimited string",t,n),n)},label:function(e){var t=O.find(A.label),n=t.filter('[data-value="'+e+'"]'),i=t.length,o=t.index(n)+1==i,a=(!y.is.searchSelection()||!y.is.focusedOnSearch())&&o;a?(y.verbose("Animating and removing label",n),n.transition(x.label.transition,x.label.duration,function(){n.remove()})):(y.verbose("Removing label",n),n.remove())},labels:function(t){t=t||O.find(A.label).filter("."+C.active),y.verbose("Removing active label selections",t),t.each(function(){var t=e(this).data("value"),n=y.is.userValue(t);n?(y.remove.value(t),y.remove.label(t)):y.remove.selected(t)})},tabbable:function(){y.has.search()?(y.debug("Searchable dropdown initialized"),q.attr("tabindex","-1"),I.attr("tabindex","-1")):(y.debug("Simple selection dropdown initialized"),O.attr("tabindex","-1"),I.attr("tabindex","-1"))}},has:{search:function(){return q.length>0},input:function(){return z.length>0},menu:function(){return I.length>0},message:function(){return 0!==I.children(A.message).length},label:function(e){var t=O.find(A.label);return t.filter('[data-value="'+e+'"]').length>0},maxSelections:function(){return x.maxSelections&&y.get.selectionCount()>=x.maxSelections},allResultsFiltered:function(){return M.filter("."+C.filtered).length===M.length},value:function(t){var n=y.get.values(),i=e.isArray(n)?n&&-1!==e.inArray(t,n):n==t;return i?!0:!1}},is:{active:function(){return O.hasClass(C.active)},alreadySetup:function(){return O.is("select")&&O.parent(A.dropdown).length>0&&0===O.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):I.transition&&I.transition("is animating")},focused:function(){return n.activeElement===O[0]},focusedOnSearch:function(){return n.activeElement===q[0]},allFiltered:function(){return(y.is.multiple()||y.has.search())&&!y.has.message()&&y.has.allResultsFiltered()},hidden:function(e){return!y.is.visible(e)},onScreen:function(n){var i,o=n||I;return o.addClass(C.loading),i=e("body").scrollTop()+e(t).height()>=o.offset().top+o.height(),y.debug("Checking if menu can fit on screen",i,I),o.removeClass(C.loading),i},inObject:function(t,n){var i=!1;return e.each(n,function(e,n){return n==t?(i=!0,!0):void 0}),i},multiple:function(){return O.hasClass(C.multiple)},single:function(){return!y.is.multiple()},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){return i.target&&e(i.target).is("select")?(n=!0,!0):void 0}),n},search:function(){return O.hasClass(C.search)},searchSelection:function(){return y.has.search()&&0===q.closest(A.menu).length},selection:function(){return O.hasClass(C.selection)},userValue:function(t){return-1!==e.inArray(t,y.get.userValues())},upward:function(e){var t=e||O;return t.hasClass(C.upward)},visible:function(e){return e?e.hasClass(C.visible):I.hasClass(C.visible)}},can:{click:function(){return l||"click"==x.on},show:function(){return!O.hasClass(C.disabled)}},animate:{show:function(t,n){var o,a=n||I,r=n?function(){}:function(){y.hideSubMenus(),y.hideOthers(),y.set.active()};t=e.isFunction(t)?t:function(){},y.verbose("Doing menu show animation",a),x.keepOnScreen&&(y.is.onScreen(n)?y.remove.upward(n):y.set.upward(n)),o=y.get.transition(n),y.is.selection()&&y.set.scrollPosition(y.get.selectedItem(),!0),(y.is.hidden(a)||y.is.animating(a))&&("none"==o?(r(),a.transition("show"),t.call(H)):e.fn.transition!==i&&O.transition("is supported")?a.transition({animation:o+" in",debug:x.debug,verbose:x.verbose,duration:x.duration,queue:!0,onStart:r,onComplete:function(){t.call(H)}}):y.error(P.noTransition,o))},hide:function(t,n){var o=n||I,a=(n?.9*x.duration:x.duration,n?function(){}:function(){y.can.click()&&y.unbind.intent(),y.focusSearch(),y.remove.active()}),r=y.get.transition(n);t=e.isFunction(t)?t:function(){},(y.is.visible(o)||y.is.animating(o))&&(y.verbose("Doing menu hide animation",o),"none"==r?(a(),o.transition("hide"),t.call(H)):e.fn.transition!==i&&O.transition("is supported")?o.transition({animation:r+" out",duration:x.duration,debug:x.debug,verbose:x.verbose,queue:!0,onStart:a,onComplete:function(){y.remove.upward(n),t.call(H)}}):y.error(P.transition))}},hideAndClear:function(){y.is.searchSelection()?(y.remove.searchTerm(),y.hide(function(){y.remove.filteredItem()})):y.hide()},delay:{show:function(){y.verbose("Delaying show event to ensure user intent"),clearTimeout(y.timer),y.timer=setTimeout(y.show,x.delay.show)},hide:function(){y.verbose("Delaying hide event to ensure user intent"),clearTimeout(y.timer),y.timer=setTimeout(y.hide,x.delay.hide)}},escape:{regExp:function(e){return e=String(e),e.replace(S.escape,"\\$&")}},setting:function(t,n){if(y.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,x,t);else{if(n===i)return x[t];x[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,y,t);else{if(n===i)return y[t];y[t]=n}},debug:function(){x.debug&&(x.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,x.name+":"),y.debug.apply(console,arguments)))},verbose:function(){x.verbose&&x.debug&&(x.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),y.verbose.apply(console,arguments)))},error:function(){y.error=Function.prototype.bind.call(console.error,console,x.name+":"),y.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;x.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:H,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var t=x.name+":",n=0;u=!1,clearTimeout(y.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,o){var r,s,c,l=U;return n=n||g,o=H||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(y.error(P.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},f?(U===i&&y.initialize(),y.invoke(m)):(U!==i&&U.invoke("destroy"),y.initialize())}),a!==i?a:r},e.fn.dropdown.settings={debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowTab:!0,allowCategorySelection:!1,transition:"auto",duration:200,glyphWidth:1.0714,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:0,touch:50},onChange:function(e,t,n){},onLabelSelect:function(e){},onLabelCreate:function(t,n){return e(this)},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term} ",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found."},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.",method:"The method you called is not defined.",noTransition:"This module requires ui transitions "},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholderText",text:"text",value:"value"},selector:{addition:".addition",dropdown:".ui.dropdown",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",text:"> .text:not(.icon)"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},e.fn.dropdown.settings.templates={dropdown:function(t){var n=t.placeholder||!1,i=(t.values||{},"");return i+=' ',i+=t.placeholder?''+n+"
":'
',i+='"},menu:function(t){var n=(t.placeholder||!1,t.values||{},"");return e.each(t.values,function(e,t){n+=''+t.name+"
"}),n},label:function(e,t){return t+' '},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.embed=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var m,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.embed.settings,n):e.extend({},e.fn.embed.settings),g=f.selector,p=f.className,v=f.sources,h=f.error,b=f.metadata,y=f.namespace,x=f.templates,C="."+y,w="module-"+y,k=(e(t),e(this)),T=k.find(g.placeholder),S=k.find(g.play),A=k.find(g.embed),P=this,E=k.data(w);m={initialize:function(){m.debug("Initializing embed"),m.create(),m.bind.events(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),E=m,k.data(w,m)},destroy:function(){m.verbose("Destroying previous instance of embed"),m.reset(),k.removeData(w).off(C)},refresh:function(){m.verbose("Refreshing selector cache"),T=k.find(g.placeholder),S=k.find(g.play),A=k.find(g.embed)},bind:{events:function(){m.is.video()&&(m.debug("Adding placeholder events"),k.on("click"+C,g.placeholder,m.createAndShow).on("click"+C,g.play,m.createAndShow))}},create:function(){var e=m.get.placeholder();e?m.createPlaceholder():m.createAndShow()},createPlaceholder:function(e){{var t=m.get.icon(),n=m.get.url();m.generate.embed(n)}e=e||m.get.placeholder(),k.html(x.placeholder(e,t)),m.debug("Creating placeholder for embed",e,t)},createEmbed:function(t){m.refresh(),t=t||m.get.url(),A=e("
").addClass(p.embed).html(m.generate.embed(t)).appendTo(k),m.debug("Creating embed object",A)},createAndShow:function(){m.createEmbed(),m.show()},change:function(e,t,n){m.debug("Changing video to ",e,t,n),k.data(b.source,e).data(b.id,t).data(b.url,n),m.create(),f.onChange.call(P)},reset:function(){m.debug("Clearing embed and showing placeholder"),m.remove.active(),m.remove.embed(),m.showPlaceholder(),f.onReset.call(P)},show:function(){m.debug("Showing embed"),m.set.active(),f.onDisplay.call(P)},hide:function(){m.debug("Hiding embed"),m.showPlaceholder()},showPlaceholder:function(){m.debug("Showing placeholder image"),m.remove.active(),f.onPlaceholderDisplay.call(P)},get:{id:function(){return f.id||k.data(b.id)},placeholder:function(){return f.placeholder||k.data(b.placeholder)},icon:function(){return f.icon?f.icon:k.data(b.icon)!==i?k.data(b.icon):m.determine.icon()},source:function(e){return f.source?f.source:k.data(b.source)!==i?k.data(b.source):m.determine.source()},type:function(){var e=m.get.source();return v[e]!==i?v[e].type:!1},url:function(){return f.url?f.url:k.data(b.url)!==i?k.data(b.url):m.determine.url()}},determine:{source:function(t){var n=!1;return t=t||m.get.url(),t&&e.each(v,function(e,i){return-1!==t.search(i.domain)?(n=e,!1):void 0}),n},icon:function(){var e=m.get.source();return v[e]!==i?v[e].icon:!1},url:function(){var e,t=f.id||k.data(b.id),n=f.source||k.data(b.source);return e=v[n]!==i?v[n].url.replace("{id}",t):!1,e&&k.data(b.url,e),e}},set:{active:function(){k.addClass(p.active)}},remove:{active:function(){k.removeClass(p.active)},embed:function(){A.empty()}},encode:{parameters:function(e){var t,n=[];for(t in e)n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.join("&")}},generate:{embed:function(e){m.debug("Generating embed html");var t,n,i=m.get.source();return e=m.get.url(e),e?(n=m.generate.parameters(i),t=x.iframe(e,n)):m.error(h.noURL,k),t},parameters:function(t,n){var o,a=v[t].parameters!==i?v[t].parameters(f):{};return n&&(o=e.extend({},a,n)),o=f.onEmbed(o),m.encode.parameters(o)}},has:{placeholder:function(){return f.placeholder||k.data(b.placeholder)}},is:{autoplay:function(){return"auto"===f.autoplay?k.data("image")!==i:f.autoplay},video:function(){return"video"==m.get.type()}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=E;return n=n||d,a=P||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(E===i&&m.initialize(),m.invoke(l)):(E!==i&&E.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.embed.settings={name:"Embed",namespace:"embed",debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,showUI:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onChange:function(){},onEmbed:function(e){return e},width:"auto",height:"auto",parameters:!1,api:!0,onPause:function(){},onStop:function(){},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",play:".play"}},e.fn.embed.settings.sources={youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{autohide:!e.showUI,autoplay:e.autoplay,color:e.colors||i,hq:e.hd,jsapi:e.api,modestbranding:1}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{api:e.api,autoplay:e.autoplay,byline:e.showUI,color:e.colors||i,portrait:e.showUI,title:e.showUI}}}},e.fn.embed.settings.templates={iframe:function(e,t){return''},placeholder:function(e,t){var n="";return t&&(n+=' '),e&&(n+=' '),n}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.modal=function(o){var a,r=e(this),s=e(t),c=e(n),l=e("body"),u=r.selector||"",d=(new Date).getTime(),m=[],f=arguments[0],g="string"==typeof f,p=[].slice.call(arguments,1),v=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var r,h,b,y,x,C,w,k,T,S=e.isPlainObject(o)?e.extend(!0,{},e.fn.modal.settings,o):e.extend({},e.fn.modal.settings),A=S.selector,P=S.className,E=S.namespace,R=S.error,F="."+E,O="module-"+E,D=e(this),q=e(S.context),z=D.find(A.close),j=this,N=D.data(O);T={initialize:function(){T.verbose("Initializing dimmer",q),T.create.id(),T.create.dimmer(),T.refreshModals(),T.bind.events(),S.observeChanges&&T.observeChanges(),T.instantiate()},instantiate:function(){T.verbose("Storing instance of modal"),N=T,D.data(O,N)},create:{dimmer:function(){var t={debug:S.debug,dimmerName:"modals",duration:{show:S.duration,hide:S.duration}},n=e.extend(!0,t,S.dimmerSettings);return S.inverted&&(n.variation=n.variation!==i?n.variation+" inverted":"inverted"),e.fn.dimmer===i?void T.error(R.dimmer):(T.debug("Creating dimmer with settings",n),y=q.dimmer(n),S.detachable?(T.verbose("Modal is detachable, moving content into dimmer"),y.dimmer("add content",D)):T.set.undetached(),S.blurring&&y.addClass(P.blurring),void(x=y.dimmer("get dimmer")))},id:function(){w=(Math.random().toString(16)+"000000000").substr(2,8),C="."+w,T.verbose("Creating unique id for element",w)}},destroy:function(){T.verbose("Destroying previous modal"),D.removeData(O).off(F),s.off(C),z.off(F),q.dimmer("destroy")},observeChanges:function(){"MutationObserver"in t&&(k=new MutationObserver(function(e){T.debug("DOM tree modified, refreshing"),T.refresh()}),k.observe(j,{childList:!0,subtree:!0}),T.debug("Setting up mutation observer",k))},refresh:function(){T.remove.scrolling(),T.cacheSizes(),T.set.screenHeight(),T.set.type(),T.set.position()},refreshModals:function(){h=D.siblings(A.modal),r=h.add(D)},attachEvents:function(t,n){var i=e(t);n=e.isFunction(T[n])?T[n]:T.toggle,i.length>0?(T.debug("Attaching modal events to element",t,n),i.off(F).on("click"+F,n)):T.error(R.notFound,t)},bind:{events:function(){T.verbose("Attaching events"),D.on("click"+F,A.close,T.event.close),s.on("resize"+C,T.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{close:function(){var t=e(this);T.verbose("Closing element activated"),t.is(A.approve)?S.onApprove.call(j,t)!==!1?T.hide():T.verbose("Approve callback returned false cancelling hide"):t.is(A.deny)?S.onDeny.call(j,t)!==!1?T.hide():T.verbose("Deny callback returned false cancelling hide"):T.hide()},click:function(t){var i=e(t.target),o=i.closest(A.modal).length>0,a=e.contains(n.documentElement,t.target);!o&&a&&(T.debug("Dimmer clicked, hiding all modals"),T.is.active()&&(T.remove.clickaway(),S.allowMultiple?T.hide():T.hideAll()))},debounce:function(e,t){clearTimeout(T.timer),T.timer=setTimeout(e,t)},keyboard:function(e){var t=e.which,n=27;t==n&&(S.closable?(T.debug("Escape key pressed hiding modal"),T.hide()):T.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){y.dimmer("is active")&&v(T.refresh)}},toggle:function(){T.is.active()||T.is.animating()?T.hide():T.show()},show:function(t){t=e.isFunction(t)?t:function(){},T.refreshModals(),T.showModal(t)},hide:function(t){t=e.isFunction(t)?t:function(){},T.refreshModals(),T.hideModal(t)},showModal:function(t){t=e.isFunction(t)?t:function(){},T.is.animating()||!T.is.active()?(T.showDimmer(),T.cacheSizes(),T.set.position(),T.set.screenHeight(),T.set.type(),T.set.clickaway(),!S.allowMultiple&&h.filter("."+P.active).length>0?(T.debug("Other modals visible, queueing show animation"),T.hideOthers(T.showModal)):(S.onShow.call(j),S.transition&&e.fn.transition!==i&&D.transition("is supported")?(T.debug("Showing modal with css animations"),D.transition({debug:S.debug,animation:S.transition+" in",queue:S.queue,duration:S.duration,useFailSafe:!0,onComplete:function(){S.onVisible.apply(j),T.add.keyboardShortcuts(),T.save.focus(),T.set.active(),T.set.autofocus(),t()}})):(T.debug("Showing modal with javascript"),D.fadeIn(S.duration,S.easing,function(){S.onVisible.apply(j),T.add.keyboardShortcuts(),T.save.focus(),T.set.active(),t()})))):T.debug("Modal is already visible")},hideModal:function(t,n){t=e.isFunction(t)?t:function(){},T.debug("Hiding modal"),S.onHide.call(j),(T.is.animating()||T.is.active())&&(S.transition&&e.fn.transition!==i&&D.transition("is supported")?(T.remove.active(),D.transition({debug:S.debug,animation:S.transition+" out",queue:S.queue,duration:S.duration,useFailSafe:!0,onStart:function(){T.othersActive()||n||T.hideDimmer(),T.remove.keyboardShortcuts()},onComplete:function(){S.onHidden.call(j),T.restore.focus(),t()}})):(T.remove.active(),T.othersActive()||T.hideDimmer(),T.remove.keyboardShortcuts(),D.fadeOut(S.duration,S.easing,function(){S.onHidden.call(j),T.restore.focus(),t()})))},showDimmer:function(){y.dimmer("is animating")||!y.dimmer("is active")?(T.debug("Showing dimmer"),y.dimmer("show")):T.debug("Dimmer already visible")},hideDimmer:function(){return y.dimmer("is animating")||y.dimmer("is active")?void y.dimmer("hide",function(){S.transition&&e.fn.transition!==i&&D.transition("is supported")&&(T.remove.clickaway(),T.remove.screenHeight())}):void T.debug("Dimmer is not visible cannot hide")},hideAll:function(t){var n=r.filter(":visible");t=e.isFunction(t)?t:function(){},n.length>0&&(T.debug("Hiding all visible modals"),T.hideDimmer(),n.modal("hide modal",t))},hideOthers:function(t){var n=h.filter(":visible");t=e.isFunction(t)?t:function(){},n.length>0&&(T.debug("Hiding other modals",h),n.modal("hide modal",t,!0))},othersActive:function(){return h.filter("."+P.active+", ."+P.animating).length>0},add:{keyboardShortcuts:function(){T.verbose("Adding keyboard shortcuts"),c.on("keyup"+F,T.event.keyboard)}},save:{focus:function(){b=e(n.activeElement).blur()}},restore:{focus:function(){b&&b.length>0&&b.focus()}},remove:{active:function(){D.removeClass(P.active)},clickaway:function(){S.closable&&x.off("click"+C)},screenHeight:function(){T.cache.height>T.cache.pageHeight&&(T.debug("Removing page height"),l.css("height",""))},keyboardShortcuts:function(){T.verbose("Removing keyboard shortcuts"),c.off("keyup"+F)},scrolling:function(){y.removeClass(P.scrolling),D.removeClass(P.scrolling)}},cacheSizes:function(){var o=D.outerHeight();(T.cache===i||0!==o)&&(T.cache={pageHeight:e(n).outerHeight(),height:o+S.offset,contextHeight:"body"==S.context?e(t).height():y.height()}),T.debug("Caching modal and container sizes",T.cache)},can:{fit:function(){return T.cache.height+2*S.padding0?t:e;n.first().focus()}},clickaway:function(){S.closable&&x.on("click"+C,T.event.click)},screenHeight:function(){T.can.fit()?l.css("height",""):(T.debug("Modal is taller than page content, resizing page height"),l.css("height",T.cache.height+2*S.padding))},active:function(){D.addClass(P.active)},scrolling:function(){y.addClass(P.scrolling),D.addClass(P.scrolling)},type:function(){T.can.fit()?(T.verbose("Modal fits on screen"),T.othersActive()||T.remove.scrolling()):(T.verbose("Modal cannot fit on screen setting to scrolling"),T.set.scrolling())},position:function(){T.verbose("Centering modal on page",T.cache),D.css(T.can.fit()?{top:"",marginTop:-(T.cache.height/2)}:{marginTop:"",top:c.scrollTop()})},undetached:function(){y.addClass(P.undetached)}},setting:function(t,n){if(T.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,S,t);else{if(n===i)return S[t];S[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,T,t);else{if(n===i)return T[t];T[t]=n}},debug:function(){S.debug&&(S.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,S.name+":"),T.debug.apply(console,arguments)))},verbose:function(){S.verbose&&S.debug&&(S.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,S.name+":"),T.verbose.apply(console,arguments)))},error:function(){T.error=Function.prototype.bind.call(console.error,console,S.name+":"),T.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;S.performance&&(t=(new Date).getTime(),i=d||t,n=t-i,d=t,m.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:j,"Execution Time":n})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var t=S.name+":",n=0;d=!1,clearTimeout(T.performance.timer),e.each(m,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",u&&(t+=" '"+u+"'"),(console.group!==i||console.table!==i)&&m.length>0&&(console.groupCollapsed(t),console.table?console.table(m):e.each(m,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(t,n,o){var r,s,c,l=N;return n=n||p,o=j||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},g?(N===i&&T.initialize(),T.invoke(f)):(N!==i&&N.invoke("destroy"),T.initialize())}),a!==i?a:this},e.fn.modal.settings={name:"Modal",namespace:"modal",debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,dimmerSettings:{closable:!1,useCSS:!0},context:"body",queue:!1,duration:500,easing:"easeOutExpo",offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:".close, .actions .button",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",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.nag=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){{var a,m=e.isPlainObject(n)?e.extend(!0,{},e.fn.nag.settings,n):e.extend({},e.fn.nag.settings),f=(m.className,m.selector),g=m.error,p=m.namespace,v="."+p,h=p+"-module",b=e(this),y=(b.find(f.close),e(m.context?m.context:"body")),x=this,C=b.data(h);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}a={initialize:function(){a.verbose("Initializing element"),b.on("click"+v,f.close,a.dismiss).data(h,a),m.detachable&&b.parent()[0]!==y[0]&&b.detach().prependTo(y),m.displayTime>0&&setTimeout(a.hide,m.displayTime),a.show()},destroy:function(){a.verbose("Destroying instance"),b.removeData(h).off(v)},show:function(){a.should.show()&&!b.is(":visible")&&(a.debug("Showing nag",m.animation.show),"fade"==m.animation.show?b.fadeIn(m.duration,m.easing):b.slideDown(m.duration,m.easing))},hide:function(){a.debug("Showing nag",m.animation.hide),"fade"==m.animation.show?b.fadeIn(m.duration,m.easing):b.slideUp(m.duration,m.easing)},onHide:function(){a.debug("Removing nag",m.animation.hide),b.remove(),m.onHide&&m.onHide()},dismiss:function(e){m.storageMethod&&a.storage.set(m.key,m.value),a.hide(),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return m.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(m.key)!=m.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(m.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(m.key)),!1)}},get:{storageOptions:function(){var e={};return m.expires&&(e.expires=m.expires),m.domain&&(e.domain=m.domain),m.path&&(e.path=m.path),
e}},clear:function(){a.storage.remove(m.key)},storage:{set:function(n,o){var r=a.get.storageOptions();if("localstorage"==m.storageMethod&&t.localStorage!==i)t.localStorage.setItem(n,o),a.debug("Value stored using local storage",n,o);else{if(e.cookie===i)return void a.error(g.noCookieStorage);e.cookie(n,o,r),a.debug("Value stored using cookie",n,o,r)}},get:function(n,o){var r;return"localstorage"==m.storageMethod&&t.localStorage!==i?r=t.localStorage.getItem(n):e.cookie!==i?r=e.cookie(n):a.error(g.noCookieStorage),("undefined"==r||"null"==r||r===i||null===r)&&(r=i),r},remove:function(n){var o=a.get.storageOptions();"local"==m.storageMethod&&t.store!==i?t.localStorage.removeItem(n):e.cookie!==i?e.removeCookie(n,o):a.error(g.noStorage)}},setting:function(t,n){if(a.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,m.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,r){var s,c,l,u=C;return n=n||d,r=x||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(c=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(c)?l=c.apply(r,n):c!==i&&(l=c),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),c}},u?(C===i&&a.initialize(),a.invoke(l)):(C!==i&&C.invoke("destroy"),a.initialize())}),o!==i?o:this},e.fn.nag.settings={name:"Nag",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(){}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.popup=function(o){var a,r=e(this),s=e(n),c=r.selector||"",l="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],m=arguments[0],f="string"==typeof m,g=[].slice.call(arguments,1);return r.each(function(){var n,r,p,v,h,b=e.isPlainObject(o)?e.extend(!0,{},e.fn.popup.settings,o):e.extend({},e.fn.popup.settings),y=b.selector,x=b.className,C=b.error,w=b.metadata,k=b.namespace,T="."+b.namespace,S="module-"+k,A=e(this),P=e(b.context),E=b.target?e(b.target):A,R=e(t),F=e("body"),O=0,D=!1,q=this,z=A.data(S);h={initialize:function(){h.debug("Initializing",A),h.createID(),h.bind.events(),!h.exists()&&b.preserve&&h.create(),h.instantiate()},instantiate:function(){h.verbose("Storing instance",h),z=h,A.data(S,z)},refresh:function(){b.popup?n=e(b.popup).eq(0):b.inline&&(n=E.next(y.popup).eq(0),b.popup=n),b.popup?(n.addClass(x.loading),r=h.get.offsetParent(),n.removeClass(x.loading),b.movePopup&&h.has.popup()&&h.get.offsetParent(n)[0]!==r[0]&&(h.debug("Moving popup to the same offset parent as activating element"),n.detach().appendTo(r))):r=b.inline?h.get.offsetParent(E):h.has.popup()?h.get.offsetParent(n):F,r.is("html")&&(h.debug("Setting page as offset parent"),r=F)},reposition:function(){h.refresh(),h.set.position()},destroy:function(){h.debug("Destroying previous module"),n&&!b.preserve&&h.removePopup(),clearTimeout(h.hideTimer),clearTimeout(h.showTimer),R.off(p),A.off(T).removeData(S)},event:{start:function(t){var n=e.isPlainObject(b.delay)?b.delay.show:b.delay;clearTimeout(h.hideTimer),h.showTimer=setTimeout(h.show,n)},end:function(){var t=e.isPlainObject(b.delay)?b.delay.hide:b.delay;clearTimeout(h.showTimer),h.hideTimer=setTimeout(h.hide,t)},resize:function(){h.is.visible()&&h.set.position()}},create:function(){var t=A.data(w.html)||b.html,i=A.data(w.variation)||b.variation,o=A.data(w.title)||b.title,a=A.data(w.content)||A.attr("title")||b.content;t||a||o?(h.debug("Creating pop-up html"),t||(t=b.templates.popup({title:o,content:a})),n=e("
").addClass(x.popup).addClass(i).data(w.activator,A).html(t),i&&n.addClass(i),b.inline?(h.verbose("Inserting popup element inline",n),n.insertAfter(A)):(h.verbose("Appending popup element to body",n),n.appendTo(P)),h.refresh(),b.hoverable&&h.bind.popup(),b.onCreate.call(n,q)):0!==E.next(y.popup).length?(h.verbose("Pre-existing popup found"),b.inline=!0,b.popups=E.next(y.popup).data(w.activator,A),h.refresh(),b.hoverable&&h.bind.popup()):b.popup?(e(b.popup).data(w.activator,A),h.verbose("Used popup specified in settings"),h.refresh(),b.hoverable&&h.bind.popup()):h.debug("No content specified skipping display",q)},createID:function(){v=(Math.random().toString(16)+"000000000").substr(2,8),p="."+v,h.verbose("Creating unique id for element",v)},toggle:function(){h.debug("Toggling pop-up"),h.is.hidden()?(h.debug("Popup is hidden, showing pop-up"),h.unbind.close(),h.show()):(h.debug("Popup is visible, hiding pop-up"),h.hide())},show:function(t){t=e.isFunction(t)?t:function(){},h.debug("Showing pop-up",b.transition),!h.is.hidden()||h.is.active()&&h.is.dropdown()||(h.exists()?b.preserve||b.popup||h.refresh():h.create(),n&&h.set.position()&&(h.save.conditions(),b.exclusive&&h.hideAll(),h.animate.show(t)))},hide:function(t){t=e.isFunction(t)?t:function(){},(h.is.visible()||h.is.animating())&&(h.remove.visible(),h.unbind.close(),h.restore.conditions(),h.animate.hide(t))},hideAll:function(){e(y.popup).filter("."+x.visible).each(function(){e(this).data(w.activator).popup("hide")})},hideGracefully:function(t){t&&0===e(t.target).closest(y.popup).length?(h.debug("Click occurred outside popup hiding popup"),h.hide()):h.debug("Click was inside popup, keeping popup open")},exists:function(){return n?b.inline||b.popup?h.has.popup():n.closest(P).length>=1?!0:!1:!1},removePopup:function(){h.debug("Removing popup",n),h.has.popup()&&!b.popup&&(n.remove(),n=i),b.onRemove.call(n,q)},save:{conditions:function(){h.cache={title:A.attr("title")},h.cache.title&&A.removeAttr("title"),h.verbose("Saving original attributes",h.cache.title)}},restore:{conditions:function(){return h.cache&&h.cache.title&&(A.attr("title",h.cache.title),h.verbose("Restoring original attributes",h.cache.title)),!0}},animate:{show:function(t){t=e.isFunction(t)?t:function(){},b.transition&&e.fn.transition!==i&&A.transition("is supported")?(h.set.visible(),n.transition({animation:b.transition+" in",queue:!1,debug:b.debug,verbose:b.verbose,duration:b.duration,onComplete:function(){h.bind.close(),t.call(n,q),b.onVisible.call(n,q)}})):h.error(C.noTransition),b.onShow.call(n,q)},hide:function(t){t=e.isFunction(t)?t:function(){},h.debug("Hiding pop-up"),b.transition&&e.fn.transition!==i&&A.transition("is supported")?n.transition({animation:b.transition+" out",queue:!1,duration:b.duration,debug:b.debug,verbose:b.verbose,onComplete:function(){h.reset(),t.call(n,q),b.onHidden.call(n,q)}}):h.error(C.noTransition),b.onHide.call(n,q)}},get:{id:function(){return v},startEvent:function(){return"hover"==b.on?l?"touchstart mouseenter":"mouseenter":"focus"==b.on?"focus":!1},scrollEvent:function(){return l?"touchmove scroll":"scroll"},endEvent:function(){return"hover"==b.on?"mouseleave":"focus"==b.on?"blur":!1},offsetParent:function(t){var n=t!==i?t[0]:A[0],o=n.parentNode,a=e(o);if(o)for(var r="none"===a.css("transform"),s="static"===a.css("position"),c=a.is("html");o&&!c&&s&&r;)o=o.parentNode,a=e(o),r="none"===a.css("transform"),s="static"===a.css("position"),c=a.is("html");return a&&a.length>0?a:e()},offstagePosition:function(i){var o={top:e(t).scrollTop(),bottom:e(t).scrollTop()+e(t).height(),left:0,right:e(t).width()},a={width:n.width(),height:n.height(),offset:n.offset()},r={},s=[];return i=i||!1,a.offset&&i&&(h.verbose("Checking if outside viewable area",a.offset),r={top:a.offset.topo.bottom,right:a.offset.left+a.width>o.right,left:a.offset.left0?s.join(" "):!1},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(e){var t=e.split(" "),n=t[0],i=t[1],o={top:"bottom",bottom:"top",left:"right",right:"left"},a={left:"center",center:"right",right:"left"},r={"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"},s="top"==n||"bottom"==n,c=!1,l=!1,u=!1;return D||(h.verbose("All available positions available"),D=h.get.positions()),h.debug("Recording last position tried",e),D[e]=!0,"opposite"===b.prefer&&(u=[o[n],i],u=u.join(" "),c=D[u]===!0,h.debug("Trying opposite strategy",u)),"adjacent"===b.prefer&&s&&(u=[n,a[i]],u=u.join(" "),l=D[u]===!0,h.debug("Trying adjacent strategy",u)),(l||c)&&(h.debug("Using backup position",u),u=r[e]),u}},set:{position:function(o,a){if(0===E.length||0===n.length)return void h.error(C.notFound);var s,c,l,u=(e(t).width(),e(t).height(),E.outerWidth()),d=E.outerHeight(),m=n.outerWidth(),f=n.outerHeight(),g=r.outerWidth(),p=r.outerHeight(),v=b.distanceAway,y=E[0],k=b.inline?parseInt(t.getComputedStyle(y).getPropertyValue("margin-top"),10):0,T=b.inline?h.is.rtl()?parseInt(t.getComputedStyle(y).getPropertyValue("margin-right"),10):parseInt(t.getComputedStyle(y).getPropertyValue("margin-left"),10):0,S=b.inline||b.popup?E.position():E.offset();if(o=o||A.data(w.position)||b.position,a=a||A.data(w.offset)||b.offset,0===S.top&&0===S.left)return h.debug("Popup target is hidden, no action taken"),!1;switch(O==b.maxSearchDepth&&b.lastResort&&(h.debug("Using last resort position to display",b.lastResort),o=b.lastResort),b.inline&&(h.debug("Adding targets margin to calculation"),"left center"==o||"right center"==o?(a+=k,v+=-T):"top left"==o||"top center"==o||"top right"==o?(a+=T,v-=k):(a+=T,v+=k)),h.debug("Calculating popup positioning",o),s=o,h.is.rtl()&&(s=s.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),h.debug("RTL: Popup positioning updated",s)),s){case"top left":c={top:"auto",bottom:p-S.top+v,left:S.left+a,right:"auto"};break;case"top center":c={bottom:p-S.top+v,left:S.left+u/2-m/2+a,top:"auto",right:"auto"};break;case"top right":c={bottom:p-S.top+v,right:g-S.left-u-a,top:"auto",left:"auto"};break;case"left center":c={top:S.top+d/2-f/2+a,right:g-S.left+v,left:"auto",bottom:"auto"};break;case"right center":c={top:S.top+d/2-f/2+a,left:S.left+u+v,bottom:"auto",right:"auto"};break;case"bottom left":c={top:S.top+d+v,left:S.left+a,bottom:"auto",right:"auto"};break;case"bottom center":c={top:S.top+d+v,left:S.left+u/2-m/2+a,bottom:"auto",right:"auto"};break;case"bottom right":c={top:S.top+d+v,right:g-S.left-u-a,left:"auto",bottom:"auto"}}if(c===i&&h.error(C.invalidPosition,o),h.debug("Calculated popup positioning values",c),n.css(c).removeClass(x.position).addClass(o).addClass(x.loading),l=h.get.offstagePosition(o)){if(h.debug("Popup cant fit into viewport",l),O0}},is:{active:function(){return A.hasClass(x.active)},animating:function(){return n&&n.hasClass(x.animating)},visible:function(){return n&&n.hasClass(x.visible)},dropdown:function(){return A.hasClass(x.dropdown)},hidden:function(){return!h.is.visible()},rtl:function(){return"rtl"==A.css("direction")}},reset:function(){h.remove.visible(),b.preserve?e.fn.transition!==i&&n.transition("remove transition"):h.removePopup()},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,b,t);else{if(n===i)return b[t];b[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(n===i)return h[t];h[t]=n}},debug:function(){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.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(){h.error=Function.prototype.bind.call(console.error,console,b.name+":"),h.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;b.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:q,"Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var t=b.name+":",n=0;u=!1,clearTimeout(h.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,o){var r,s,c,l=z;return n=n||g,o=q||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},f?(z===i&&h.initialize(),h.invoke(m)):(z!==i&&z.invoke("destroy"),h.initialize())}),a!==i?a:this},e.fn.popup.settings={name:"Popup",debug:!1,verbose:!1,performance:!0,namespace:"popup",onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},on:"hover",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",prefer:"opposite",lastResort:!1,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,easing:"easeOutQuint",transition:"scale",distanceAway:0,offset:0,maxSearchDepth:20,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"No visible position could be found for the popup",method:"The method you called is not defined.",noTransition:"This module requires ui transitions ",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",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},popup:function(t){var n="",o=e.fn.popup.settings.templates.escape;return typeof t!==i&&(typeof t.title!==i&&t.title&&(t.title=o(t.title),n+='"),typeof t.content!==i&&t.content&&(t.content=o(t.content),n+=''+t.content+"
")),n}}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.progress=function(t){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f=e.isPlainObject(t)?e.extend(!0,{},e.fn.progress.settings,t):e.extend({},e.fn.progress.settings),g=f.className,p=f.metadata,v=f.namespace,h=f.selector,b=f.error,y="."+v,x="module-"+v,C=e(this),w=e(this).find(h.bar),k=e(this).find(h.progress),T=e(this).find(h.label),S=this,A=C.data(x),P=!1;m={initialize:function(){m.debug("Initializing progress bar",f),a=m.get.transitionEnd(),m.read.metadata(),m.set.duration(),m.set.initials(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of progress",m),A=m,C.data(x,m)},destroy:function(){m.verbose("Destroying previous progress for",C),clearInterval(A.interval),m.remove.state(),C.removeData(x),A=i},reset:function(){m.set.percent(0)},complete:function(){(m.percent===i||m.percent<100)&&m.set.percent(100)},read:{metadata:function(){C.data(p.percent)&&(m.verbose("Current percent value set from metadata"),m.percent=C.data(p.percent)),C.data(p.total)&&(m.verbose("Total value set from metadata"),m.total=C.data(p.total)),C.data(p.value)&&(m.verbose("Current value set from metadata"),m.value=C.data(p.value))},currentValue:function(){return m.value!==i?m.value:!1}},increment:function(e){var t,n,i,o=m.total||!1;o?(n=m.value||0,e=e||1,i=n+e,t=m.total,m.debug("Incrementing value by",e,n,t),i>t&&(m.debug("Value cannot increment above total",t),i=t),m.set.progress(i)):(n=m.percent||0,e=e||m.get.randomValue(),i=n+e,t=100,m.debug("Incrementing percentage by",e,n),i>t&&(m.debug("Value cannot increment above 100 percent"),i=t),m.set.progress(i))},decrement:function(e){var t,n,i=m.total||!1,o=0;i?(t=m.value||0,e=e||1,n=t-e,m.debug("Decrementing value by",e,t)):(t=m.percent||0,e=e||m.get.randomValue(),n=t-e,m.debug("Decrementing percentage by",e,t)),o>n&&(m.debug("Value cannot decrement below 0"),n=0),m.set.progress(n)},get:{text:function(e){var t=m.value||0,n=m.total||0,i=m.is.visible()&&P?m.get.displayPercent():m.percent||0,o=m.total>0?n-t:100-i;return e=e||"",e=e.replace("{value}",t).replace("{total}",n).replace("{left}",o).replace("{percent}",i),m.debug("Adding variables to progress bar text",e),e},randomValue:function(){return m.debug("Generating random increment percentage"),Math.floor(Math.random()*f.random.max+f.random.min)},transitionEnd:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]},displayPercent:function(){var e=w.width(),t=C.width(),n=parseInt(w.css("min-width"),10),i=e>n?e/t*100:m.percent;return Math.round(0===f.precision?i:10*i*f.precision/(10*f.precision))},percent:function(){return m.percent||0},value:function(){return m.value||!1},total:function(){return m.total||!1}},is:{success:function(){return C.hasClass(g.success)},warning:function(){return C.hasClass(g.warning)},error:function(){return C.hasClass(g.error)},active:function(){return C.hasClass(g.active)},visible:function(){return C.is(":visible")}},remove:{state:function(){m.verbose("Removing stored state"),delete m.total,delete m.percent,delete m.value},active:function(){m.verbose("Removing active state"),C.removeClass(g.active)},success:function(){m.verbose("Removing success state"),C.removeClass(g.success)},warning:function(){m.verbose("Removing warning state"),C.removeClass(g.warning)},error:function(){m.verbose("Removing error state"),C.removeClass(g.error)}},set:{barWidth:function(e){e>100?m.error(b.tooHigh,e):0>e?m.error(b.tooLow,e):(w.css("width",e+"%"),C.attr("data-percent",parseInt(e,10)))},duration:function(e){e=e||f.duration,e="number"==typeof e?e+"ms":e,m.verbose("Setting progress bar transition duration",e),w.css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},initials:function(){f.total!==!1&&(m.verbose("Current total set in settings",f.total),m.total=f.total),f.value!==!1&&(m.verbose("Current value set in settings",f.value),m.value=f.value),f.percent!==!1&&(m.verbose("Current percent set in settings",f.percent),m.percent=f.percent),m.percent!==i?m.set.percent(m.percent):m.value!==i&&m.set.progress(m.value)},percent:function(e){e="string"==typeof e?+e.replace("%",""):e,e>0&&1>e&&(m.verbose("Module percentage passed as decimal, converting"),e=100*e),e=Math.round(0===f.precision?e:10*e*f.precision/(10*f.precision)),m.percent=e,m.total?m.value=Math.round(e/100*m.total):f.limitValues&&(m.value=m.value>100?100:m.value<0?0:m.value),m.set.barWidth(e),m.is.visible()&&m.set.labelInterval(),m.set.labels(),f.onChange.call(S,e,m.value,m.total)},labelInterval:function(){var e=function(){m.verbose("Bar finished animating, removing continuous label updates"),clearInterval(m.interval),P=!1,m.set.labels()};clearInterval(m.interval),w.one(a+y,e),m.timer=setTimeout(e,f.duration+100),P=!0,m.interval=setInterval(m.set.labels,f.framerate)},labels:function(){m.verbose("Setting both bar progress and outer label text"),m.set.barLabel(),m.set.state()},label:function(e){e=e||"",e&&(e=m.get.text(e),m.debug("Setting label to text",e),T.text(e))},state:function(e){e=e!==i?e:m.percent,100===e?!f.autoSuccess||m.is.warning()||m.is.error()?(m.verbose("Reached 100% removing active state"),m.remove.active()):(m.set.success(),m.debug("Automatically triggering success at 100%")):e>0?(m.verbose("Adjusting active progress bar label",e),m.set.active()):(m.remove.active(),m.set.label(f.text.active))},barLabel:function(e){e!==i?k.text(m.get.text(e)):"ratio"==f.label&&m.total?(m.debug("Adding ratio to bar label"),k.text(m.get.text(f.text.ratio))):"percent"==f.label&&(m.debug("Adding percentage to bar label"),k.text(m.get.text(f.text.percent)))},active:function(e){e=e||f.text.active,m.debug("Setting active state"),f.showActivity&&!m.is.active()&&C.addClass(g.active),m.remove.warning(),m.remove.error(),m.remove.success(),e&&m.set.label(e),f.onActive.call(S,m.value,m.total)},success:function(e){e=e||f.text.success,m.debug("Setting success state"),C.addClass(g.success),m.remove.active(),m.remove.warning(),m.remove.error(),m.complete(),e&&m.set.label(e),f.onSuccess.call(S,m.total)},warning:function(e){e=e||f.text.warning,m.debug("Setting warning state"),C.addClass(g.warning),m.remove.active(),m.remove.success(),m.remove.error(),m.complete(),e&&m.set.label(e),f.onWarning.call(S,m.value,m.total)},error:function(e){e=e||f.text.error,m.debug("Setting error state"),C.addClass(g.error),m.remove.active(),m.remove.success(),m.remove.warning(),m.complete(),e&&m.set.label(e),f.onError.call(S,m.value,m.total)},total:function(e){m.total=e},progress:function(e){var t,n="string"==typeof e?""!==e.replace(/[^\d.]/g,"")?+e.replace(/[^\d.]/g,""):!1:e;n===!1&&m.error(b.nonNumeric,e),m.total?(m.value=n,t=n/m.total*100,m.debug("Calculating percent complete from total",t),m.set.percent(t)):(t=n,m.debug("Setting value to exact percentage value",t),m.set.percent(t))}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=A;return n=n||d,a=S||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(b.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(A===i&&m.initialize(),m.invoke(l)):(A!==i&&A.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.progress.settings={name:"Progress",namespace:"progress",debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:1,framerate:1e3/30,percent:!1,total:!1,value:!1,onChange:function(e,t,n){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},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(e,t,n,i){"use strict";e.fn.rating=function(t){var n,o=e(this),a=o.selector||"",r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);return o.each(function(){var d,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.rating.settings,t):e.extend({},e.fn.rating.settings),f=m.namespace,g=m.className,p=m.metadata,v=m.selector,h=(m.error,"."+f),b="module-"+f,y=this,x=e(this).data(b),C=e(this),w=C.find(v.icon);d={initialize:function(){d.verbose("Initializing rating module",m),0===w.length&&d.setup.layout(),m.interactive?d.enable():d.disable(),m.initialRating&&(d.debug("Setting initial rating"),d.setRating(m.initialRating)),C.data(p.rating)&&(d.debug("Rating found in metadata"),d.setRating(C.data(p.rating))),d.instantiate()},instantiate:function(){d.verbose("Instantiating module",m),x=d,C.data(b,d)},destroy:function(){d.verbose("Destroying previous instance",x),d.remove.events(),C.removeData(b)},refresh:function(){w=C.find(v.icon)},setup:{layout:function(){var t=C.data(p.maxRating)||m.maxRating;d.debug("Generating icon html dynamically"),C.html(e.fn.rating.settings.templates.icon(t)),d.refresh()}},event:{mouseenter:function(){var t=e(this);t.nextAll().removeClass(g.selected),C.addClass(g.selected),t.addClass(g.selected).prevAll().addClass(g.selected)},mouseleave:function(){C.removeClass(g.selected),w.removeClass(g.selected)},click:function(){var t=e(this),n=d.getRating(),i=w.index(t)+1,o="auto"==m.clearable?1===w.length:m.clearable;o&&n==i?d.clearRating():d.setRating(i)}},clearRating:function(){d.debug("Clearing current rating"),d.setRating(0)},getRating:function(){var e=w.filter("."+g.active).length;return d.verbose("Current rating retrieved",e),e},bind:{events:function(){d.verbose("Binding events"),C.on("mouseenter"+h,v.icon,d.event.mouseenter).on("mouseleave"+h,v.icon,d.event.mouseleave).on("click"+h,v.icon,d.event.click)}},remove:{events:function(){d.verbose("Removing events"),C.off(h)}},enable:function(){d.debug("Setting rating to interactive mode"),d.bind.events(),C.removeClass(g.disabled)},disable:function(){d.debug("Setting rating to read-only mode"),d.remove.events(),C.addClass(g.disabled)},setRating:function(e){var t=e-1>=0?e-1:0,n=w.eq(t);C.removeClass(g.selected),w.removeClass(g.selected).removeClass(g.active),e>0&&(d.verbose("Setting current rating to",e),n.prevAll().andSelf().addClass(g.active)),m.onRate.call(y,e)},setting:function(t,n){if(d.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,d,t);else{if(n===i)return d[t];d[t]=n}},debug:function(){m.debug&&(m.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,m.name+":"),d.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),d.verbose.apply(console,arguments)))},error:function(){d.error=Function.prototype.bind.call(console.error,console,m.name+":"),d.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTimeout(d.performance.timer),d.performance.timer=setTimeout(d.performance.display,500)},display:function(){var t=m.name+":",n=0;r=!1,clearTimeout(d.performance.timer),e.each(s,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",a&&(t+=" '"+a+"'"),o.length>1&&(t+=" ("+o.length+")"),(console.group!==i||console.table!==i)&&s.length>0&&(console.groupCollapsed(t),console.table?console.table(s):e.each(s,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),s=[];
}},invoke:function(t,o,a){var r,s,c,l=x;return o=o||u,a=y||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,o):s!==i&&(c=s),e.isArray(n)?n.push(c):n!==i?n=[n,c]:c!==i&&(n=c),s}},l?(x===i&&d.initialize(),d.invoke(c)):(x!==i&&x.invoke("destroy"),d.initialize())}),n!==i?n:this},e.fn.rating.settings={name:"Rating",namespace:"rating",debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",onRate:function(e){},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(e){for(var t=1,n="";e>=t;)n+=' ',t++;return n}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.search=function(o){var a,r=e(this),s=r.selector||"",c=(new Date).getTime(),l=[],u=arguments[0],d="string"==typeof u,m=[].slice.call(arguments,1);return e(this).each(function(){var f,g=e.isPlainObject(o)?e.extend(!0,{},e.fn.search.settings,o):e.extend({},e.fn.search.settings),p=g.className,v=g.metadata,h=g.regExp,b=g.selector,y=g.error,x=g.namespace,C="."+x,w=x+"-module",k=e(this),T=k.find(b.prompt),S=k.find(b.searchButton),A=k.find(b.results),P=(k.find(b.result),k.find(b.category),this),E=k.data(w);f={initialize:function(){f.verbose("Initializing module"),f.determine.searchFields(),f.bind.events(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),E=f,k.data(w,f)},destroy:function(){f.verbose("Destroying instance"),k.off(C).removeData(w)},bind:{events:function(){f.verbose("Binding events to search"),g.automatic&&(k.on(f.get.inputEvent()+C,b.prompt,f.throttle),T.attr("autocomplete","off")),k.on("focus"+C,b.prompt,f.event.focus).on("blur"+C,b.prompt,f.event.blur).on("keydown"+C,b.prompt,f.handleKeyboard).on("click"+C,b.searchButton,f.query).on("mousedown"+C,b.results,f.event.result.mousedown).on("mouseup"+C,b.results,f.event.result.mouseup).on("click"+C,b.result,f.event.result.click)}},determine:{searchFields:function(){o&&o.searchFields!==i&&(g.searchFields=o.searchFields)}},event:{focus:function(){f.set.focus(),f.has.minimumCharacters()&&(f.query(),f.showResults())},blur:function(e){var t=n.activeElement===this;t||f.resultsClicked||(f.cancel.query(),f.remove.focus(),f.timer=setTimeout(f.hideResults,g.hideDelay))},result:{mousedown:function(){f.resultsClicked=!0},mouseup:function(){f.resultsClicked=!1},click:function(n){f.debug("Search result selected");var i=e(this),o=i.find(b.title).eq(0),a=i.find("a[href]").eq(0),r=a.attr("href")||!1,s=a.attr("target")||!1,c=(o.html(),o.length>0?o.text():!1),l=f.get.results(),u=i.data(v.result)||f.get.result(c,l);return e.isFunction(g.onSelect)&&g.onSelect.call(P,u,l)===!1?void f.debug("Custom onSelect callback cancelled default select action"):(f.hideResults(),c&&f.set.value(c),void(r&&(f.verbose("Opening search link found in result",a),"_blank"==s||n.ctrlKey?t.open(r):t.location.href=r)))}}},handleKeyboard:function(e){var t,n=k.find(b.result),i=k.find(b.category),o=n.index(n.filter("."+p.active)),a=n.length,r=e.which,s={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(r==s.escape&&(f.verbose("Escape key pressed, blurring search field"),T.trigger("blur")),f.is.visible())if(r==s.enter){if(f.verbose("Enter key pressed, selecting active result"),n.filter("."+p.active).length>0)return f.event.result.click.call(n.filter("."+p.active),e),e.preventDefault(),!1}else r==s.upArrow?(f.verbose("Up key pressed, changing active result"),t=0>o-1?o:o-1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault()):r==s.downArrow&&(f.verbose("Down key pressed, changing active result"),t=o+1>=a?o:o+1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault());else r==s.enter&&(f.verbose("Enter key pressed, executing query"),f.query(),f.set.buttonPressed(),T.one("keyup",f.remove.buttonFocus))},setup:{api:function(){var e={debug:g.debug,on:!1,action:"search",onFailure:f.error};f.verbose("First request, initializing API"),k.api(e)}},can:{useAPI:function(){return e.fn.api!==i},transition:function(){return g.transition&&e.fn.transition!==i&&k.transition("is supported")}},is:{empty:function(){return""===A.html()},visible:function(){return A.filter(":visible").length>0},focused:function(){return T.filter(":focus").length>0}},get:{inputEvent:function(){var e=T[0],t=e!==i&&e.oninput!==i?"input":e!==i&&e.onpropertychange!==i?"propertychange":"keyup";return t},value:function(){return T.val()},results:function(){var e=k.data(v.results);return e},result:function(t,n){var o=["title","id"],a=!1;return t=t!==i?t:f.get.value(),n=n!==i?n:f.get.results(),"category"===g.type?(f.debug("Finding result that matches",t),e.each(n,function(n,i){return e.isArray(i.results)&&(a=f.search.object(t,i.results,o)[0])?!1:void 0})):(f.debug("Finding result in results object",t),a=f.search.object(t,n,o)[0]),a||!1}},set:{focus:function(){k.addClass(p.focus)},loading:function(){k.addClass(p.loading)},value:function(e){f.verbose("Setting search input value",e),T.val(e)},buttonPressed:function(){S.addClass(p.pressed)}},remove:{loading:function(){k.removeClass(p.loading)},focus:function(){k.removeClass(p.focus)},buttonPressed:function(){S.removeClass(p.pressed)}},query:function(){var t=f.get.value(),n=f.read.cache(t);n?(f.debug("Reading result from cache",t),f.save.results(n.results),f.addResults(n.html),f.inject.id(n.results)):(f.debug("Querying for",t),e.isPlainObject(g.source)||e.isArray(g.source)?f.search.local(t):f.can.useAPI()?f.search.remote(t):f.error(y.source),g.onSearchQuery.call(P,t))},search:{local:function(e){var t,n=f.search.object(e,g.content);f.set.loading(),f.save.results(n),f.debug("Returned local search results",n),t=f.generateResults({results:n}),f.remove.loading(),f.addResults(t),f.inject.id(n),f.write.cache(e,{html:t,results:n})},remote:function(t){var n={onSuccess:function(e){f.parse.response.call(P,e,t)},urlData:{query:t}};k.api("get request")||f.setup.api(),e.extend(!0,n,g.apiSettings),f.debug("Executing search",n),f.cancel.query(),k.api("setting",n).api("query")},object:function(t,n,o){var a=[],r=[],s=t.toString().replace(h.escape,"\\$&"),c=new RegExp(h.beginsWith+s,"i"),l=function(t,n){var i=-1==e.inArray(n,a),o=-1==e.inArray(n,r);i&&o&&t.push(n)};return n=n||g.source,o=o!==i?o:g.searchFields,e.isArray(o)||(o=[o]),n===i?(f.error(y.source),[]):(e.each(o,function(i,o){e.each(n,function(e,n){var i="string"==typeof n[o];i&&(-1!==n[o].search(c)?l(a,n):g.searchFullText&&f.fuzzySearch(t,n[o])&&l(r,n))})}),e.merge(a,r))}},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),i>n)return!1;if(i===n)return e===t;e:for(var o=0,a=0;i>o;o++){for(var r=e.charCodeAt(o);n>a;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},parse:{response:function(e,t){var n=f.generateResults(e);f.verbose("Parsing server response",e),e!==i&&t!==i&&e.results!==i&&(f.addResults(n),f.inject.id(e.results),f.write.cache(t,{html:n,results:e.results}),f.save.results(e.results))}},throttle:function(){clearTimeout(f.timer),f.has.minimumCharacters()?f.timer=setTimeout(f.query,g.searchDelay):f.hideResults()},cancel:{query:function(){f.can.useAPI()&&k.api("abort")}},has:{minimumCharacters:function(){var e=f.get.value(),t=e.length;return t>=g.minCharacters}},clear:{cache:function(e){var t=k.data(v.cache);e?e&&t&&t[e]&&(f.debug("Removing value from cache",e),delete t[e],k.data(v.cache,t)):(f.debug("Clearing cache",e),k.removeData(v.cache))}},read:{cache:function(e){var t=k.data(v.cache);return g.cache?(f.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==i?t[e]:!1):!1}},create:{id:function(e,t){var n=97,o=t!==i?String.fromCharCode(n+t):"",a=e,r=o+a;return f.verbose("Creating unique id",r),r}},inject:{result:function(e,t,n){f.verbose("Injecting result into results");var o=t-1,a=n-1,r=n!==i?A.children().eq(a).children().eq(o):A.children().eq(o);f.verbose("Injecting results metadata",r),r.data(v.result,e)},id:function(t){f.debug("Injecting unique ids into results");var n=1,o=1;return"category"===g.type?(o=1,e.each(t,function(t,a){e.each(a.results,function(e,t){var r=a.results[e];r.id===i&&(r.id=f.create.id(o,n)),f.inject.result(r,o,n),o++}),n++})):e.each(t,function(e,n){var a=t[e];a.id===i&&(a.id=f.create.id(o)),f.inject.result(a,o),o++}),t}},save:{results:function(e){f.verbose("Saving current search results to metadata",e),k.data(v.results,e)}},write:{cache:function(e,t){var n=k.data(v.cache)!==i?k.data(v.cache):{};g.cache&&(f.verbose("Writing generated html to cache",e,t),n[e]=t,k.data(v.cache,n))}},addResults:function(t){return e.isFunction(g.onResultsAdd)&&g.onResultsAdd.call(A,t)===!1?(f.debug("onResultsAdd callback cancelled default action"),!1):(A.html(t),void f.showResults())},showResults:function(){f.is.visible()||!f.is.focused()||f.is.empty()||(f.can.transition()?(f.debug("Showing results with css animations"),A.transition({animation:g.transition+" in",debug:g.debug,verbose:g.verbose,duration:g.duration,queue:!0})):(f.debug("Showing results with javascript"),A.stop().fadeIn(g.duration,g.easing)),g.onResultsOpen.call(A))},hideResults:function(){f.is.visible()&&(f.can.transition()?(f.debug("Hiding results with css animations"),A.transition({animation:g.transition+" out",debug:g.debug,verbose:g.verbose,duration:g.duration,queue:!0})):(f.debug("Hiding results with javascript"),A.stop().fadeOut(g.duration,g.easing)),g.onResultsClose.call(A))},generateResults:function(t){f.debug("Generating html from response",t);var n=g.templates[g.type],i=e.isPlainObject(t.results)&&!e.isEmptyObject(t.results),o=e.isArray(t.results)&&t.results.length>0,a="";return i||o?(g.maxResults>0&&(i?"standard"==g.type&&f.error(y.maxResults):t.results=t.results.slice(0,g.maxResults)),e.isFunction(n)?a=n(t):f.error(y.noTemplate,!1)):a=f.displayMessage(y.noResults,"empty"),g.onResults.call(P,t),a},displayMessage:function(e,t){return t=t||"standard",f.debug("Displaying message",e,t),f.addResults(g.templates.message(e,t)),g.templates.message(e,t)},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;g.performance&&(t=(new Date).getTime(),i=c||t,n=t-i,c=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=g.name+":",n=0;c=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,o){var r,s,c,l=E;return n=n||m,o=P||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},d?(E===i&&f.initialize(),f.invoke(u)):(E!==i&&E.invoke("destroy"),f.initialize())}),a!==i?a:this},e.fn.search.settings={name:"Search Module",namespace:"search",debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,apiSettings:!1,source:!1,searchFields:["title","description"],searchFullText:!0,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,transition:"scale",duration:300,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{active:"active",empty:"empty",focus:"focus",loading:"loading",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.",serverError:"There was an issue with 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|^)"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e){var t=/[&<>"'`]/g,n=/[&<>"'`]/,i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=function(e){return i[e]};return n.test(e)?e.replace(t,o):e},message:function(e,t){var n="";return e!==i&&t!==i&&(n+='',n+="empty"==t?'
'+e+'
':'
'+e+"
",n+="
"),n},category:function(t){var n="",o=e.fn.search.settings.templates.escape;return t.results!==i?(e.each(t.results,function(t,a){a.results!==i&&a.results.length>0&&(n+=''+a.name+"
",e.each(a.results,function(e,t){n+='
',t.url&&(n+='
'),t.image!==i&&(t.image=o(t.image),n+='
'),n+='
',t.price!==i&&(t.price=o(t.price),n+='
'+t.price+"
"),t.title!==i&&(t.title=o(t.title),n+='
'+t.title+"
"),t.description!==i&&(n+='
'+t.description+"
"),n+="
"}),n+="
")}),t.action&&(n+=''+t.action.text+" "),n):!1},standard:function(t){var n="";return t.results!==i?(e.each(t.results,function(e,t){n+=t.url?'':' ',t.image!==i&&(n+=''),n+='',t.price!==i&&(n+='
'+t.price+"
"),t.title!==i&&(n+='
'+t.title+"
"),t.description!==i&&(n+='
'+t.description+"
"),n+="
",n+=" "}),t.action&&(n+=''+t.action.text+" "),n):!1}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.shape=function(o){var a,r=e(this),s=(e("body"),(new Date).getTime()),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1),m=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var t,f,g,p=r.selector||"",v=e.isPlainObject(o)?e.extend(!0,{},e.fn.shape.settings,o):e.extend({},e.fn.shape.settings),h=v.namespace,b=v.selector,y=v.error,x=v.className,C="."+h,w="module-"+h,k=e(this),T=k.find(b.sides),S=k.find(b.side),A=!1,P=this,E=k.data(w);g={initialize:function(){g.verbose("Initializing module for",P),g.set.defaultSide(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),E=g,k.data(w,E)},destroy:function(){g.verbose("Destroying previous module for",P),k.removeData(w).off(C)},refresh:function(){g.verbose("Refreshing selector cache for",P),k=e(P),T=e(this).find(b.shape),S=e(this).find(b.side)},repaint:function(){g.verbose("Forcing repaint event");{var e=T.get(0)||n.createElement("div");e.offsetWidth}},animate:function(e,n){g.verbose("Animating box with properties",e),n=n||function(e){g.verbose("Executing animation callback"),e!==i&&e.stopPropagation(),g.reset(),g.set.active()},v.beforeChange.call(f.get()),g.get.transitionEvent()?(g.verbose("Starting CSS animation"),k.addClass(x.animating),T.css(e).one(g.get.transitionEvent(),n),g.set.duration(v.duration),m(function(){k.addClass(x.animating),t.addClass(x.hidden)})):n()},queue:function(e){g.debug("Queueing animation of",e),T.one(g.get.transitionEvent(),function(){g.debug("Executing queued animation"),setTimeout(function(){k.shape(e)},0)})},reset:function(){g.verbose("Animating states reset"),k.removeClass(x.animating).attr("style","").removeAttr("style"),T.attr("style","").removeAttr("style"),S.attr("style","").removeAttr("style").removeClass(x.hidden),f.removeClass(x.animating).attr("style","").removeAttr("style")},is:{complete:function(){return S.filter("."+x.active)[0]==f[0]},animating:function(){return k.hasClass(x.animating)}},set:{defaultSide:function(){t=k.find("."+v.className.active),f=t.next(b.side).length>0?t.next(b.side):k.find(b.side).first(),A=!1,g.verbose("Active side set to",t),g.verbose("Next side set to",f)},duration:function(e){e=e||v.duration,e="number"==typeof e?e+"ms":e,g.verbose("Setting animation duration",e),T.add(S).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},currentStageSize:function(){var e=k.find("."+v.className.active),t=e.outerWidth(!0),n=e.outerHeight(!0);k.css({width:t,height:n})},stageSize:function(){var e=k.clone().addClass(x.loading),t=e.find("."+v.className.active),n=A?e.find(b.side).eq(A):t.next(b.side).length>0?t.next(b.side):e.find(b.side).first(),i={};g.set.currentStageSize(),t.removeClass(x.active),n.addClass(x.active),e.insertAfter(k),i={width:n.outerWidth(!0),height:n.outerHeight(!0)},e.remove(),k.css(i),g.verbose("Resizing stage to fit new content",i)},nextSide:function(e){A=e,f=S.filter(e),A=S.index(f),0===f.length&&(g.set.defaultSide(),g.error(y.side)),g.verbose("Next side manually set to",f)},active:function(){g.verbose("Setting new side to active",f),S.removeClass(x.active),f.addClass(x.active),v.onChange.call(f.get()),g.set.defaultSide()}},flip:{up:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip up"):(g.debug("Flipping up",f),g.set.stageSize(),g.stage.above(),g.animate(g.get.transform.up()))):void g.debug("Side already visible",f)},down:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip down"):(g.debug("Flipping down",f),g.set.stageSize(),g.stage.below(),g.animate(g.get.transform.down()))):void g.debug("Side already visible",f)},left:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip left"):(g.debug("Flipping left",f),g.set.stageSize(),g.stage.left(),g.animate(g.get.transform.left()))):void g.debug("Side already visible",f)},right:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip right"):(g.debug("Flipping right",f),g.set.stageSize(),g.stage.right(),g.animate(g.get.transform.right()))):void g.debug("Side already visible",f)},over:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip over"):(g.debug("Flipping over",f),g.set.stageSize(),g.stage.behind(),g.animate(g.get.transform.over()))):void g.debug("Side already visible",f)},back:function(){return!g.is.complete()||g.is.animating()||v.allowRepeats?void(g.is.animating()?g.queue("flip back"):(g.debug("Flipping back",f),g.set.stageSize(),g.stage.behind(),g.animate(g.get.transform.back()))):void g.debug("Side already visible",f)}},get:{transform:{up:function(){var e={y:-((t.outerHeight(!0)-f.outerHeight(!0))/2),z:-(t.outerHeight(!0)/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(-90deg)"}},down:function(){var e={y:-((t.outerHeight(!0)-f.outerHeight(!0))/2),z:-(t.outerHeight(!0)/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(90deg)"}},left:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2),z:-(t.outerWidth(!0)/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(90deg)"}},right:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2),z:-(t.outerWidth(!0)/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(-90deg)"}},over:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2)};return{transform:"translateX("+e.x+"px) rotateY(180deg)"}},back:function(){var e={x:-((t.outerWidth(!0)-f.outerWidth(!0))/2)};return{transform:"translateX("+e.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]},nextSide:function(){return t.next(b.side).length>0?t.next(b.side):k.find(b.side).first()}},stage:{above:function(){var e={origin:(t.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};g.verbose("Setting the initial animation position as above",f,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),f.addClass(x.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px)"})},below:function(){var e={origin:(t.outerHeight(!0)-f.outerHeight(!0))/2,depth:{active:f.outerHeight(!0)/2,next:t.outerHeight(!0)/2}};g.verbose("Setting the initial animation position as below",f,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),f.addClass(x.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px)"})},left:function(){var e={origin:(t.outerWidth(!0)-f.outerWidth(!0))/2,depth:{active:f.outerWidth(!0)/2,next:t.outerWidth(!0)/2}};g.verbose("Setting the initial animation position as left",f,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),f.addClass(x.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-90deg) translateZ("+e.depth.next+"px)"})},right:function(){var e={origin:(t.outerWidth(!0)-f.outerWidth(!0))/2,depth:{active:f.outerWidth(!0)/2,next:t.outerWidth(!0)/2}};g.verbose("Setting the initial animation position as left",f,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),f.addClass(x.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(90deg) translateZ("+e.depth.next+"px)"})},behind:function(){var e={origin:(t.outerWidth(!0)-f.outerWidth(!0))/2,depth:{active:f.outerWidth(!0)/2,next:t.outerWidth(!0)/2}};g.verbose("Setting the initial animation position as behind",f,e),t.css({transform:"rotateY(0deg)"}),f.addClass(x.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){if(g.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,v,t);else{if(n===i)return v[t];v[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},debug:function(){v.debug&&(v.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,v.name+":"),g.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),g.verbose.apply(console,arguments)))},error:function(){g.error=Function.prototype.bind.call(console.error,console,v.name+":"),g.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;v.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var t=v.name+":",n=0;s=!1,clearTimeout(g.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",p&&(t+=" '"+p+"'"),r.length>1&&(t+=" ("+r.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,o){var r,s,c,l=E;return n=n||d,o=P||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},u?(E===i&&g.initialize(),g.invoke(l)):(E!==i&&E.invoke("destroy"),g.initialize())}),a!==i?a:this},e.fn.shape.settings={name:"Shape",debug:!1,verbose:!1,performance:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:700,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(e,t,n,i){"use strict";e.fn.sidebar=function(o){var a,r=e(this),s=e(t),c=e(n),l=e("html"),u=e("head"),d=r.selector||"",m=(new Date).getTime(),f=[],g=arguments[0],p="string"==typeof g,v=[].slice.call(arguments,1),h=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var r,b,y,x,C,w,k=e.isPlainObject(o)?e.extend(!0,{},e.fn.sidebar.settings,o):e.extend({},e.fn.sidebar.settings),T=k.selector,S=k.className,A=k.namespace,P=k.regExp,E=k.error,R="."+A,F="module-"+A,O=e(this),D=e(k.context),q=O.children(T.sidebar),z=D.children(T.fixed),j=D.children(T.pusher),N=this,I=O.data(F);w={initialize:function(){w.debug("Initializing sidebar",o),w.create.id(),C=w.get.transitionEvent(),("auto"==k.useLegacy&&w.is.legacy()||k.useLegacy===!0)&&(k.transition="overlay",k.useLegacy=!0),w.is.ios()&&w.set.ios(),k.delaySetup?h(w.setup.layout):w.setup.layout(),h(function(){w.setup.cache()}),w.instantiate()},instantiate:function(){w.verbose("Storing instance of module",w),I=w,O.data(F,w)},create:{id:function(){y=(Math.random().toString(16)+"000000000").substr(2,8),b="."+y,w.verbose("Creating unique id for element",y)}},destroy:function(){w.verbose("Destroying previous module for",O),w.remove.direction(),O.off(R).removeData(F),D.off(b),s.off(b),c.off(b)},event:{clickaway:function(e){var t=j.find(e.target).length>0||j.is(e.target),n=D.is(e.target);t&&(w.verbose("User clicked on dimmed page"),w.hide()),n&&(w.verbose("User clicked on dimmable context (scaled out page)"),w.hide())},touch:function(e){},containScroll:function(e){N.scrollTop<=0&&(N.scrollTop=1),N.scrollTop+N.offsetHeight>=N.scrollHeight&&(N.scrollTop=N.scrollHeight-N.offsetHeight-1)},scroll:function(t){0===e(t.target).closest(T.sidebar).length&&t.preventDefault()}},bind:{clickaway:function(){w.verbose("Adding clickaway events to context",D),k.closable&&D.on("click"+b,w.event.clickaway).on("touchend"+b,w.event.clickaway)},scrollLock:function(){k.scrollLock&&(w.debug("Disabling page scroll"),s.on("DOMMouseScroll"+b,w.event.scroll)),w.verbose("Adding events to contain sidebar scroll"),c.on("touchmove"+b,w.event.touch),O.on("scroll"+R,w.event.containScroll)}},unbind:{clickaway:function(){w.verbose("Removing clickaway events from context",D),D.off(b)},scrollLock:function(){w.verbose("Removing scroll lock from page"),c.off(b),s.off(b),O.off("scroll"+R)}},add:{bodyCSS:function(){var t,n=w.cache.width||O.outerWidth(),i=w.cache.height||O.outerHeight(),o=w.is.rtl(),a=w.get.direction(),s={left:n,right:-n,top:i,bottom:-i};o&&(w.verbose("RTL detected, flipping widths"),s.left=-n,s.right=n),t="",r=e(t).appendTo(u),w.debug("Adding sizing css to head",r)}},refresh:function(){w.verbose("Refreshing selector cache"),D=e(k.context),q=D.children(T.sidebar),j=D.children(T.pusher),z=D.children(T.fixed),w.clear.cache()},refreshSidebars:function(){w.verbose("Refreshing other sidebars"),q=D.children(T.sidebar)},repaint:function(){w.verbose("Forcing repaint event"),N.style.display="none";N.offsetHeight;N.scrollTop=N.scrollTop,N.style.display=""},setup:{cache:function(){w.cache={width:O.outerWidth(),height:O.outerHeight(),rtl:"rtl"==O.css("direction")}},layout:function(){0===D.children(T.pusher).length&&(w.debug("Adding wrapper element for sidebar"),w.error(E.pusher),j=e('
'),D.children().not(T.omitted).not(q).wrapAll(j),w.refresh()),(0===O.nextAll(T.pusher).length||O.nextAll(T.pusher)[0]!==j[0])&&(w.debug("Moved sidebar to correct parent element"),w.error(E.movedSidebar,N),O.detach().prependTo(D),w.refresh()),w.clear.cache(),w.set.pushable(),w.set.direction()}},attachEvents:function(t,n){var i=e(t);n=e.isFunction(w[n])?w[n]:w.toggle,i.length>0?(w.debug("Attaching sidebar events to element",t,n),i.on("click"+R,n)):w.error(E.notFound,t)},show:function(t){var n=k.useLegacy===!0?w.legacyPushPage:w.pushPage;if(t=e.isFunction(t)?t:function(){},w.is.hidden()){if(w.refreshSidebars(),k.overlay&&(w.error(E.overlay),k.transition="overlay"),w.refresh(),w.othersActive())if(w.debug("Other sidebars currently visible"),k.exclusive){if("overlay"!=k.transition)return void w.hideOthers(w.show);w.hideOthers()}else k.transition="overlay";n(function(){t.call(N),k.onShow.call(N)}),k.onChange.call(N),k.onVisible.call(N)}else w.debug("Sidebar is already visible")},hide:function(t){var n=k.useLegacy===!0?w.legacyPullPage:w.pullPage;t=e.isFunction(t)?t:function(){},(w.is.visible()||w.is.animating())&&(w.debug("Hiding sidebar",t),w.refreshSidebars(),n(function(){t.call(N),k.onHidden.call(N)}),k.onChange.call(N),k.onHide.call(N))},othersAnimating:function(){return q.not(O).filter("."+S.animating).length>0},othersVisible:function(){
return q.not(O).filter("."+S.visible).length>0},othersActive:function(){return w.othersVisible()||w.othersAnimating()},hideOthers:function(e){var t=q.not(O).filter("."+S.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){i++,i==n&&e()})},toggle:function(){w.verbose("Determining toggled direction"),w.is.hidden()?w.show():w.hide()},pushPage:function(t){var n,i,o,a=w.get.transition(),r="safe"==a?D:"overlay"===a||w.othersActive()?O:j;t=e.isFunction(t)?t:function(){},"scale down"==k.transition&&w.scrollToTop(),w.set.transition(a),w.repaint(),n=function(){w.bind.clickaway(),w.add.bodyCSS(),w.set.animating(),w.set.visible()},i=function(){w.set.dimmed()},o=function(e){e.target==r[0]&&(r.off(C+b,o),w.remove.animating(),w.bind.scrollLock(),t.call(N))},r.off(C+b),r.on(C+b,o),h(n),k.dimPage&&!w.othersVisible()&&h(i)},pullPage:function(t){var n,i,o=w.get.transition(),a="safe"==o?D:"overlay"==o||w.othersActive()?O:j;t=e.isFunction(t)?t:function(){},w.verbose("Removing context push state",w.get.direction()),w.unbind.clickaway(),w.unbind.scrollLock(),n=function(){w.set.transition(o),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersVisible()&&j.removeClass(S.dimmed)},i=function(e){e.target==a[0]&&(a.off(C+b,i),w.remove.animating(),w.remove.transition(),w.remove.bodyCSS(),("scale down"==o||k.returnScroll&&w.is.mobile())&&w.scrollBack(),t.call(N))},a.off(C+b),a.on(C+b,i),h(n)},legacyPushPage:function(t){var n=O.width(),i=w.get.direction(),o={};n=n||O.width(),t=e.isFunction(t)?t:function(){},o[i]=n,w.debug("Using javascript to push context",o),w.set.visible(),w.set.transition(),w.set.animating(),k.dimPage&&j.addClass(S.dimmed),D.css("position","relative").animate(o,k.duration,k.easing,function(){w.remove.animating(),w.bind.clickaway(),t.call(N)})},legacyPullPage:function(t){var n=0,i=w.get.direction(),o={};n=n||O.width(),t=e.isFunction(t)?t:function(){},o[i]="0px",w.debug("Using javascript to pull context",o),w.unbind.clickaway(),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersActive()&&j.removeClass(S.dimmed),D.css("position","relative").animate(o,k.duration,k.easing,function(){w.remove.animating(),t.call(N)})},scrollToTop:function(){w.verbose("Scrolling to top of page to avoid animation issues"),x=e(t).scrollTop(),O.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){w.verbose("Scrolling back to original page position"),t.scrollTo(0,x)},clear:{cache:function(){w.verbose("Clearing cached dimensions"),w.cache={}}},set:{ios:function(){l.addClass(S.ios)},pushed:function(){D.addClass(S.pushed)},pushable:function(){D.addClass(S.pushable)},dimmed:function(){j.addClass(S.dimmed)},active:function(){O.addClass(S.active)},animating:function(){O.addClass(S.animating)},transition:function(e){e=e||w.get.transition(),O.addClass(e)},direction:function(e){e=e||w.get.direction(),O.addClass(S[e])},visible:function(){O.addClass(S.visible)},overlay:function(){O.addClass(S.overlay)}},remove:{bodyCSS:function(){w.debug("Removing body css styles",r),r&&r.length>0&&r.remove()},pushed:function(){D.removeClass(S.pushed)},pushable:function(){D.removeClass(S.pushable)},active:function(){O.removeClass(S.active)},animating:function(){O.removeClass(S.animating)},transition:function(e){e=e||w.get.transition(),O.removeClass(e)},direction:function(e){e=e||w.get.direction(),O.removeClass(S[e])},visible:function(){O.removeClass(S.visible)},overlay:function(){O.removeClass(S.overlay)}},get:{direction:function(){return O.hasClass(S.top)?S.top:O.hasClass(S.right)?S.right:O.hasClass(S.bottom)?S.bottom:S.left},transition:function(){var e,t=w.get.direction();return e=w.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,w.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]}},is:{ie:function(){var e=!t.ActiveXObject&&"ActiveXObject"in t,n="ActiveXObject"in t;return e||n},legacy:function(){var e,o=n.createElement("div"),a={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};n.body.insertBefore(o,null);for(var r in a)o.style[r]!==i&&(o.style[r]="translate3d(1px,1px,1px)",e=t.getComputedStyle(o).getPropertyValue(a[r]));return n.body.removeChild(o),!(e!==i&&e.length>0&&"none"!==e)},ios:function(){var e=navigator.userAgent,t=e.match(P.ios);return t?(w.verbose("Browser was found to be iOS",e),!0):!1},mobile:function(){var e=navigator.userAgent,t=e.match(P.mobile);return t?(w.verbose("Browser was found to be mobile",e),!0):(w.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!w.is.visible()},visible:function(){return O.hasClass(S.visible)},open:function(){return w.is.visible()},closed:function(){return w.is.hidden()},vertical:function(){return O.hasClass(S.top)},animating:function(){return D.hasClass(S.animating)},rtl:function(){return w.cache.rtl===i&&(w.cache.rtl="rtl"==O.css("direction")),w.cache.rtl}},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,k,t);else{if(n===i)return k[t];k[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){k.debug&&(k.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,k.name+":"),w.debug.apply(console,arguments)))},verbose:function(){k.verbose&&k.debug&&(k.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,k.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,k.name+":"),w.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;k.performance&&(t=(new Date).getTime(),i=m||t,n=t-i,m=t,f.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:N,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=k.name+":",n=0;m=!1,clearTimeout(w.performance.timer),e.each(f,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",d&&(t+=" '"+d+"'"),(console.group!==i||console.table!==i)&&f.length>0&&(console.groupCollapsed(t),console.table?console.table(f):e.each(f,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),f=[]}},invoke:function(t,n,o){var r,s,c,l=I;return n=n||v,o=N||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(w.error(E.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},p?(I===i&&w.initialize(),w.invoke(g)):(I!==i&&w.invoke("destroy"),w.initialize())}),a!==i?a:this},e.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",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,useLegacy:!1,duration:500,easing:"easeInOutQuint",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,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"}},e.extend(e.easing,{easeInOutQuint:function(e,t,n,i,o){return(t/=o/2)<1?i/2*t*t*t*t*t+n:i/2*((t-=2)*t*t*t*t+2)+n}})}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.sticky=function(n){var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var a,m,f,g=e.isPlainObject(n)?e.extend(!0,{},e.fn.sticky.settings,n):e.extend({},e.fn.sticky.settings),p=g.className,v=g.namespace,h=g.error,b="."+v,y="module-"+v,x=e(this),C=e(t),w=x.offsetParent(),k=e(g.scrollContext),T=(x.selector||"",x.data(y)),S=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},A=this;f={initialize:function(){f.determineContext(),f.verbose("Initializing sticky",g,w),f.save.positions(),f.checkErrors(),f.bind.events(),g.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),T=f,x.data(y,f)},destroy:function(){f.verbose("Destroying previous instance"),f.reset(),m&&m.disconnect(),C.off("load"+b,f.event.load).off("resize"+b,f.event.resize),k.off("scrollchange"+b,f.event.scrollchange),x.removeData(y)},observeChanges:function(){var e=a[0];"MutationObserver"in t&&(m=new MutationObserver(function(e){clearTimeout(f.timer),f.timer=setTimeout(function(){f.verbose("DOM tree modified, updating sticky menu",e),f.refresh()},100)}),m.observe(A,{childList:!0,subtree:!0}),m.observe(e,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",m))},determineContext:function(){return a=g.context?e(g.context):w,0===a.length?void f.error(h.invalidContext,g.context,x):void 0},checkErrors:function(){return f.is.hidden()&&f.error(h.visible,x),f.cache.element.height>f.cache.context.height?(f.reset(),void f.error(h.elementSize,x)):void 0},bind:{events:function(){C.on("load"+b,f.event.load).on("resize"+b,f.event.resize),k.off("scroll"+b).on("scroll"+b,f.event.scroll).on("scrollchange"+b,f.event.scrollchange)}},event:{load:function(){f.verbose("Page contents finished loading"),S(f.refresh)},resize:function(){f.verbose("Window resized"),S(f.refresh)},scroll:function(){S(function(){k.trigger("scrollchange"+b,k.scrollTop())})},scrollchange:function(e,t){f.stick(t),g.onScroll.call(A)}},refresh:function(e){f.reset(),e&&(w=x.offsetParent()),f.save.positions(),f.stick(),g.onReposition.call(A)},supports:{sticky:function(){{var t=e("
");t.get()}return t.addClass(p.supported),t.css("position").match("sticky")}},save:{lastScroll:function(e){f.lastScroll=e},elementScroll:function(e){f.elementScroll=e},positions:function(){var e={height:C.height()},t={margin:{top:parseInt(x.css("margin-top"),10),bottom:parseInt(x.css("margin-bottom"),10)},offset:x.offset(),width:x.outerWidth(),height:x.outerHeight()},n={offset:a.offset(),height:a.outerHeight(),bottomPadding:parseInt(a.css("padding-bottom"),10)};f.cache={fits:t.heighte&&(t="up")),t},scrollChange:function(e){return e=e||k.scrollTop(),f.lastScroll?e-f.lastScroll:0},currentElementScroll:function(){return f.elementScroll?f.elementScroll:f.is.top()?Math.abs(parseInt(x.css("top"),10))||0:Math.abs(parseInt(x.css("bottom"),10))||0},elementScroll:function(e){e=e||k.scrollTop();var t=f.cache.element,n=f.cache.window,i=f.get.scrollChange(e),o=t.height-n.height+g.offset,a=f.get.currentElementScroll(),r=a+i;return a=f.cache.fits||0>r?0:r>o?o:r}},remove:{offset:function(){x.css("margin-top","")}},set:{offset:function(){f.verbose("Setting offset on element",g.offset),x.css("margin-top",g.offset)},containerSize:function(){var e=w.get(0).tagName;"HTML"===e||"body"==e?w=x.offsetParent():Math.abs(w.height()-f.cache.context.height)>5&&(f.debug("Context has padding, specifying exact height for container",f.cache.context.height),w.css({height:f.cache.context.height}))},scroll:function(e){f.debug("Setting scroll on element",e),f.is.top()&&x.css("bottom","").css("top",-e),f.is.bottom()&&x.css("top","").css("bottom",e)},size:function(){0!==f.cache.element.height&&0!==f.cache.element.width&&x.css({width:f.cache.element.width,height:f.cache.element.height})}},is:{top:function(){return x.hasClass(p.top)},bottom:function(){return x.hasClass(p.bottom)},initialPosition:function(){return!f.is.fixed()&&!f.is.bound()},hidden:function(){return!x.is(":visible")},bound:function(){return x.hasClass(p.bound)},fixed:function(){return x.hasClass(p.fixed)}},stick:function(e){var t=e||k.scrollTop(),n=f.cache,i=n.fits,o=n.element,a=n.window,r=n.context,s=f.is.bottom()&&g.pushing?g.bottomOffset:g.offset,e={top:t+s,bottom:t+s+a.height},c=(f.get.direction(e.top),i?0:f.get.elementScroll(e.top)),l=!i,u=0!==o.height;f.save.lastScroll(e.top),f.save.elementScroll(c),u&&(f.is.initialPosition()?e.top>=r.bottom?(f.debug("Element bottom of container"),f.bindBottom()):e.top>=o.top&&(f.debug("Element passed, fixing element to page"),f.fixTop()):f.is.fixed()?f.is.top()?e.topr.bottom?(f.debug("Fixed element reached bottom of container"),f.bindBottom()):l&&f.set.scroll(c):f.is.bottom()&&(e.bottom-o.heightr.bottom?(f.debug("Bottom fixed rail has reached bottom of container"),f.bindBottom()):l&&f.set.scroll(c)):f.is.bottom()&&(g.pushing?f.is.bound()&&e.bottom0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=T;return n=n||d,a=A||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(T===i&&f.initialize(),f.invoke(l)):(T!==i&&T.invoke("destroy"),f.initialize())}),o!==i?o:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset: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",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(e,t,n,i){"use strict";e.fn.tab=function(n){var o,a,r=e(e.isFunction(this)?t:this),s=e.isPlainObject(n)?e.extend(!0,{},e.fn.tab.settings,n):e.extend({},e.fn.tab.settings),c=r.selector||"",l=(new Date).getTime(),u=[],d=arguments[0],m="string"==typeof d,f=[].slice.call(arguments,1);return r.each(function(){var n,g,p,v,h,b=s.className,y=s.metadata,x=s.selector,C=s.error,w="."+s.namespace,k="module-"+s.namespace,T=e(this),S={},A=!0,P=0,E=this,R=T.data(k);o={initialize:function(){o.debug("Initializing tab menu item",T),o.determineTabs(),o.debug("Determining tabs",s.context,g),s.auto&&o.set.auto(),e.isWindow(E)||(o.debug("Attaching tab activation events to element",T),T.on("click"+w,o.event.click)),o.instantiate()},determineTabs:function(){var t;"parent"===s.context?(T.closest(x.ui).length>0?(t=T.closest(x.ui),o.verbose("Using closest UI element for determining parent",t)):t=T,n=t.parent(),o.verbose("Determined parent element for creating context",n)):s.context?(n=e(s.context),o.verbose("Using selector for tab context",s.context,n)):n=e("body"),s.childrenOnly?(g=n.children(x.tabs),o.debug("Searching tab context children for tabs",n,g)):(g=n.find(x.tabs),o.debug("Searching tab context for tabs",n,g))},initializeHistory:function(){if(s.history){if(o.debug("Initializing page state"),e.address===i)return o.error(C.state),!1;if("state"==s.historyType){if(o.debug("Using HTML5 to manage state"),s.path===!1)return o.error(C.path),!1;e.address.history(!0).state(s.path)}e.address.bind("change",o.event.history.change)}},instantiate:function(){o.verbose("Storing instance of module",o),R=o,T.data(k,o)},destroy:function(){o.debug("Destroying tabs",T),T.removeData(k).off(w)},event:{click:function(t){var n=e(this).data(y.tab);n!==i?(s.history?(o.verbose("Updating page state",t),e.address.value(n)):(o.verbose("Changing tab",t),o.changeTab(n)),t.preventDefault()):o.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||o.get.initialPath(),a=s.templates.determineTitle(n)||!1;o.performance.display(),o.debug("History change event",n,t),h=t,n!==i&&o.changeTab(n),a&&e.address.title(a)}}},refresh:function(){p&&(o.debug("Refreshing tab",p),o.changeTab(p))},cache:{read:function(e){return e!==i?S[e]:!1},add:function(e,t){e=e||p,o.debug("Adding cached content for",e),S[e]=t},remove:function(e){e=e||p,o.debug("Removing cached content for",e),delete S[e]}},set:{auto:function(){var t="string"==typeof s.path?s.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";o.verbose("Setting up automatic tab retrieval from server",t),e.isPlainObject(s.apiSettings)?s.apiSettings.url=t:s.apiSettings={url:t}},state:function(t){e.address.value(t)}},changeTab:function(i){var i="string"==typeof i?i.toLowerCase():i,a=t.history&&t.history.pushState,r=a&&s.ignoreFirstLoad&&A,c=s.auto||e.isPlainObject(s.apiSettings),l=c&&!r?o.utilities.pathToArray(i):o.get.defaultPathArray(i);i=o.utilities.arrayToPath(l),e.each(l,function(t,a){var u,d,m,f,g=l.slice(0,t+1),b=o.utilities.arrayToPath(g),y=o.is.tab(b),x=t+1==l.length,w=o.get.tabElement(b);if(o.verbose("Looking for tab",a),y){if(o.verbose("Tab was found",a),p=b,v=o.utilities.filterArray(l,g),x?f=!0:(d=l.slice(0,t+2),m=o.utilities.arrayToPath(d),f=!o.is.tab(m),f&&o.verbose("Tab parameters found",d)),f&&c)return r?(o.debug("Ignoring remote content on first tab load",b),A=!1,o.cache.add(i,w.html()),o.activate.all(b),s.onTabInit.call(w,b,v,h),s.onTabLoad.call(w,b,v,h)):(o.activate.navigation(b),o.content.fetch(b,i)),!1;o.debug("Opened local tab",b),o.activate.all(b),o.cache.read(b)||(o.cache.add(b,!0),o.debug("First time tab loaded calling tab init"),s.onTabInit.call(w,b,v,h)),s.onTabLoad.call(w,b,v,h)}else{if(-1!=i.search("/")||""===i)return o.error(C.missingTab,T,n,b),!1;if(u=e("#"+i+', a[name="'+i+'"]'),b=u.closest("[data-tab]").data("tab"),w=o.get.tabElement(b),u&&u.length>0&&b)return o.debug("No tab found, but deep anchor link present, opening parent tab"),o.activate.all(b),o.cache.read(b)||(o.cache.add(b,!0),o.debug("First time tab loaded calling tab init"),s.onTabInit.call(w,b,v,h)),!1}})},content:{fetch:function(t,n){var a,r,c=o.get.tabElement(t),l={dataType:"html",on:"now",onSuccess:function(e){o.cache.add(n,e),o.content.update(t,e),t==p?(o.debug("Content loaded",t),o.activate.tab(t)):o.debug("Content loaded in background",t),s.onTabInit.call(c,t,v,h),s.onTabLoad.call(c,t,v,h)},urlData:{tab:n}},u=c.api("get request")||!1,d=u&&"pending"===u.state();n=n||t,r=o.cache.read(n),o.activate.tab(t),s.cache&&r?(o.debug("Adding cached content",n),"once"==s.evaluateScripts?o.content.update(t,r,!1):o.content.update(t,r),s.onTabLoad.call(c,t,v,h)):d?(o.debug("Content is already loading",n),c.addClass(b.loading)):e.api!==i?(a=e.extend(!0,{headers:{"X-Remote":!0}},s.apiSettings,l),o.debug("Retrieving remote content",n,a),c.api(a)):o.error(C.api)},update:function(e,t,n){var a=o.get.tabElement(e),r=a[0];n=n!==i?n:s.evaluateScripts,n?(o.debug("Updating HTML and evaluating inline scripts",e,t),a.html(t)):(o.debug("Updating HTML",e,t),r.innerHTML=t)}},activate:{all:function(e){o.activate.tab(e),o.activate.navigation(e)},tab:function(e){var t=o.get.tabElement(e);o.verbose("Showing tab content for",t),t.addClass(b.active).siblings(g).removeClass(b.active+" "+b.loading)},navigation:function(e){var t=o.get.navElement(e);o.verbose("Activating tab navigation for",t,e),t.addClass(b.active).siblings(r).removeClass(b.active+" "+b.loading)}},deactivate:{all:function(){o.deactivate.navigation(),o.deactivate.tabs()},navigation:function(){r.removeClass(b.active)},tabs:function(){g.removeClass(b.active+" "+b.loading)}},is:{tab:function(e){return e!==i?o.get.tabElement(e).length>0:!1}},get:{initialPath:function(){return r.eq(0).data(y.tab)||g.eq(0).data(y.tab)},path:function(){return e.address.value()},defaultPathArray:function(e){return o.utilities.pathToArray(o.get.defaultPath(e))},defaultPath:function(e){var t=r.filter("[data-"+y.tab+'^="'+e+'/"]').eq(0),n=t.data(y.tab)||!1;if(n){if(o.debug("Found default tab",n),P0?t:n},tab:function(){return p}},utilities:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(t){return e.isArray(t)?t[t.length-1]:!1},pathToArray:function(e){return e===i&&(e=p),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return e.isArray(t)?t.join("/"):!1}},setting:function(t,n){if(o.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,s,t);else{if(n===i)return s[t];s[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,o,t);else{if(n===i)return o[t];o[t]=n}},debug:function(){s.debug&&(s.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,s.name+":"),o.debug.apply(console,arguments)))},verbose:function(){s.verbose&&s.debug&&(s.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,s.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,s.name+":"),o.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;s.performance&&(t=(new Date).getTime(),i=l||t,n=t-i,l=t,u.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:E,"Execution Time":n})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},display:function(){var t=s.name+":",n=0;l=!1,clearTimeout(o.performance.timer),e.each(u,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",c&&(t+=" '"+c+"'"),(console.group!==i||console.table!==i)&&u.length>0&&(console.groupCollapsed(t),console.table?console.table(u):e.each(u,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),u=[]}},invoke:function(t,n,r){var s,c,l,u=R;return n=n||f,r=E||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,a){var r=n!=s?a+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[a])||n==s)return u[a]!==i?(c=u[a],!1):(o.error(C.method,t),!1);u=u[a]}})),e.isFunction(c)?l=c.apply(r,n):c!==i&&(l=c),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),c}},m?(R===i&&o.initialize(),o.invoke(d)):(R!==i&&R.invoke("destroy"),o.initialize())}),o&&!m&&o.initializeHistory(),a!==i?a:this},e.tab=function(){e(t).tab.apply(this,arguments)},e.fn.tab.settings={name:"Tab",namespace:"tab",debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,alwaysRefresh:!1,cache:!0,ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onTabInit:function(e,t,n){},onTabLoad:function(e,t,n){},templates:{determineTitle:function(e){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found for this context.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"History requires Asual's Address library "},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.transition=function(){{var o,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments,u=l[0],d=[].slice.call(arguments,1),m="string"==typeof u;t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(t){var f,g,p,v,h,b,y,x,C,w=e(this),k=this;C={initialize:function(){f=C.get.settings.apply(k,l),v=f.className,p=f.error,h=f.metadata,x="."+f.namespace,y="module-"+f.namespace,g=w.data(y)||C,b=C.get.animationEndEvent(),m&&(m=C.invoke(u)),m===!1&&(C.verbose("Converted arguments into settings object",f),f.interval?C.delay(f.animate):C.animate(),C.instantiate())},instantiate:function(){C.verbose("Storing instance of module",C),g=C,w.data(y,g)},destroy:function(){C.verbose("Destroying previous module for",k),w.removeData(y)},refresh:function(){C.verbose("Refreshing display type on next animation"),delete C.displayType},forceRepaint:function(){C.verbose("Forcing element repaint");var e=w.parent(),t=w.next();0===t.length?w.detach().appendTo(e):w.detach().insertBefore(t)},repaint:function(){C.verbose("Repainting element");k.offsetWidth},delay:function(e){var n,o=f.reverse===!0,r="auto"==f.reverse&&C.get.direction()==v.outward;e=typeof e!==i?e:f.interval,n=o||r?(a.length-t)*f.interval:t*f.interval,C.debug("Delaying animation by",n),setTimeout(C.animate,n)},animate:function(e){if(f=e||f,!C.is.supported())return C.error(p.support),!1;if(C.debug("Preparing animation",f.animation),C.is.animating()){if(f.queue)return!f.allowRepeats&&C.has.direction()&&C.is.occurring()&&C.queuing!==!0?C.debug("Animation is currently occurring, preventing queueing same animation",f.animation):C.queue(f.animation),!1;if(!f.allowRepeats&&C.is.occurring())return C.debug("Animation is already occurring, will not execute repeated animation",f.animation),!1;C.debug("New animation started, completing previous early",f.animation),C.complete()}C.can.animate()?C.set.animating(f.animation):C.error(p.noAnimation,f.animation,k)},reset:function(){C.debug("Resetting animation to beginning conditions"),C.remove.animationCallbacks(),C.restore.conditions(),C.remove.animating()},queue:function(e){C.debug("Queueing animation of",e),C.queuing=!0,w.one(b+".queue"+x,function(){C.queuing=!1,C.repaint(),C.animate.apply(this,f)})},complete:function(e){C.debug("Animation complete",f.animation),C.remove.completeCallback(),C.remove.failSafe(),C.is.looping()||(C.is.outward()?(C.verbose("Animation is outward, hiding element"),C.restore.conditions(),C.hide(),f.onHide.call(this)):C.is.inward()?(C.verbose("Animation is outward, showing element"),C.restore.conditions(),C.show(),f.onShow.call(this)):C.restore.conditions(),C.remove.animation(),C.remove.animating()),f.onComplete.call(this)},has:{direction:function(t){var n=!1;return t=t||f.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){(t===v.inward||t===v.outward)&&(n=!0)})),n},inlineDisplay:function(){var t=w.attr("style")||"";return e.isArray(t.match(/display.*?;/,""))}},set:{animating:function(e){e=e||f.animation,C.is.animating()||C.save.conditions(),C.remove.direction(),C.remove.completeCallback(),C.can.transition()&&!C.has.direction()&&C.set.direction(),C.remove.hidden(),C.set.display(),w.addClass(v.animating+" "+v.transition+" "+e).one(b+".complete"+x,C.complete),f.useFailSafe&&C.add.failSafe(),
C.set.duration(f.duration),f.onStart.call(this),C.debug("Starting tween",e,w.attr("class"))},duration:function(e,t){t=t||f.duration,t="number"==typeof t?t+"ms":t,(t||0===t)&&(C.verbose("Setting animation duration",t),w.css({"animation-duration":t}))},display:function(){var e=C.get.style(),t=C.get.displayType(),n=e+"display: "+t+" !important;";w.css("display",""),C.refresh(),w.css("display")!==t&&(C.verbose("Setting inline visibility to",t),w.attr("style",n))},direction:function(){w.is(":visible")&&!C.is.hidden()?(C.debug("Automatically determining the direction of animation","Outward"),w.removeClass(v.inward).addClass(v.outward)):(C.debug("Automatically determining the direction of animation","Inward"),w.removeClass(v.outward).addClass(v.inward))},looping:function(){C.debug("Transition set to loop"),w.addClass(v.looping)},hidden:function(){C.is.hidden()||w.addClass(v.transition).addClass(v.hidden),"none"!==w.css("display")&&(C.verbose("Overriding default display to hide element"),w.css("display","none"))},visible:function(){w.addClass(v.transition).addClass(v.visible)}},save:{displayType:function(e){"none"!==e&&w.data(h.displayType,e)},transitionExists:function(t,n){e.fn.transition.exists[t]=n,C.verbose("Saving existence of transition",t,n)},conditions:function(){w.removeClass(f.animation),C.remove.direction(),C.cache={className:w.attr("class"),style:C.get.style()},C.verbose("Saving original attributes",C.cache)}},restore:{conditions:function(){return C.cache===i?!1:(C.cache.className?w.attr("class",C.cache.className):w.removeAttr("class"),C.cache.style?(C.verbose("Restoring original style attribute",C.cache.style),w.attr("style",C.cache.style)):(C.verbose("Clearing style attribute"),w.removeAttr("style")),void C.verbose("Restoring original attributes",C.cache))}},add:{failSafe:function(){var e=C.get.duration();C.timer=setTimeout(function(){w.trigger(b)},e+f.failSafeDelay),C.verbose("Adding fail safe timer",C.timer)}},remove:{animating:function(){w.removeClass(v.animating)},animation:function(){w.css({"-webkit-animation":"","-moz-animation":"","-ms-animation":"","-o-animation":"",animation:""})},animationCallbacks:function(){C.remove.queueCallback(),C.remove.completeCallback()},queueCallback:function(){w.off(".queue"+x)},completeCallback:function(){w.off(".complete"+x)},display:function(){w.css("display","")},direction:function(){w.removeClass(v.inward).removeClass(v.outward)},failSafe:function(){C.verbose("Removing fail safe timer",C.timer),C.timer&&clearTimeout(C.timer)},hidden:function(){w.removeClass(v.hidden)},visible:function(){w.removeClass(v.visible)},looping:function(){C.debug("Transitions are no longer looping"),C.is.looping()&&(C.reset(),w.removeClass(v.looping))},transition:function(){w.removeClass(v.visible).removeClass(v.hidden)}},get:{settings:function(t,n,i){return"object"==typeof t?e.extend(!0,{},e.fn.transition.settings,t):"function"==typeof i?e.extend({},e.fn.transition.settings,{animation:t,onComplete:i,duration:n}):"string"==typeof n||"number"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,duration:n}):"object"==typeof n?e.extend({},e.fn.transition.settings,n,{animation:t}):"function"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,onComplete:n}):e.extend({},e.fn.transition.settings,{animation:t})},direction:function(t){return t=t||f.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){return t===v.inward?v.inward:t===v.outward?v.outward:void 0})),C.can.transition()?w.is(":visible")&&!C.is.hidden()?v.outward:v.inward:"static"},duration:function(e){return e=e||f.duration,e===!1&&(e=w.css("animation-duration")||0),"string"==typeof e?e.indexOf("ms")>-1?parseFloat(e):1e3*parseFloat(e):e},displayType:function(){return f.displayType?f.displayType:(w.data(h.displayType)===i&&C.can.transition(!0),w.data(h.displayType))},style:function(){var e=w.attr("style")||"";return e.replace(/display.*?;/,"")},transitionExists:function(t){return e.fn.transition.exists[t]},animationStartEvent:function(){var e,t=n.createElement("div"),o={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in o)if(t.style[e]!==i)return o[e];return!1},animationEndEvent:function(){var e,t=n.createElement("div"),o={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in o)if(t.style[e]!==i)return o[e];return!1}},can:{transition:function(t){var n,o,a,r,s,c,l,u=f.animation,d=C.get.transitionExists(u);if(d===i||t){if(C.verbose("Determining whether animation exists"),n=w.attr("class"),o=w.prop("tagName"),a=e("<"+o+" />").addClass(n).insertAfter(w),r=a.addClass(u).removeClass(v.inward).removeClass(v.outward).addClass(v.animating).addClass(v.transition).css("animationName"),s=a.addClass(v.inward).css("animationName"),l=a.attr("class",n).removeAttr("style").removeClass(v.hidden).removeClass(v.visible).show().css("display"),C.verbose("Determining final display state",l),C.save.displayType(l),a.remove(),r!=s)C.debug("Direction exists for animation",u),c=!0;else{if("none"==r||!r)return void C.debug("No animation defined in css",u);C.debug("Static animation found",u,l),c=!1}C.save.transitionExists(u,c)}return d!==i?d:c},animate:function(){return C.can.transition()!==i}},is:{animating:function(){return w.hasClass(v.animating)},inward:function(){return w.hasClass(v.inward)},outward:function(){return w.hasClass(v.outward)},looping:function(){return w.hasClass(v.looping)},occurring:function(e){return e=e||f.animation,e="."+e.replace(" ","."),w.filter(e).length>0},visible:function(){return w.is(":visible")},hidden:function(){return"hidden"===w.css("visibility")},supported:function(){return b!==!1}},hide:function(){C.verbose("Hiding element"),C.is.animating()&&C.reset(),C.remove.display(),C.remove.visible(),C.set.hidden(),C.repaint()},show:function(e){C.verbose("Showing element",e),C.remove.hidden(),C.set.visible(),C.set.display(),C.repaint()},toggle:function(){C.is.visible()?C.hide():C.show()},stop:function(){C.debug("Stopping current animation"),w.trigger(b)},stopAll:function(){C.debug("Stopping all animation"),C.remove.queueCallback(),w.trigger(b)},clear:{queue:function(){C.debug("Clearing animation queue"),C.remove.queueCallback()}},enable:function(){C.verbose("Starting animation"),w.removeClass(v.disabled)},disable:function(){C.debug("Stopping animation"),w.addClass(v.disabled)},setting:function(t,n){if(C.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,C,t);else{if(n===i)return C[t];C[t]=n}},debug:function(){f.debug&&(f.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,f.name+":"),C.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),C.verbose.apply(console,arguments)))},error:function(){C.error=Function.prototype.bind.call(console.error,console,f.name+":"),C.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(C.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),a.length>1&&(t+=" ("+a.length+")"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=g;return n=n||d,a=k||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s!==i?s:!1}},C.initialize()}),o!==i?o:this},e.fn.transition.exists={},e.fn.transition.settings={name:"Transition",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:"There is no css animation matching the one you specified.",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(e,t,n,i){"use strict";e.api=e.fn.api=function(n){var o,a=e(e.isFunction(this)?t:this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var t,a,m,f,g,p=e.isPlainObject(n)?e.extend(!0,{},e.fn.api.settings,n):e.extend({},e.fn.api.settings),v=p.namespace,h=p.metadata,b=p.selector,y=p.error,x=p.className,C="."+v,w="module-"+v,k=e(this),T=k.closest(b.form),S=p.stateContext?e(p.stateContext):k,A=this,P=S.get(),E=k.data(w);g={initialize:function(){var e=g.get.event();u||(e?(g.debug("Attaching API events to element",e),k.on(e+C,g.event.trigger)):"now"==p.on&&(g.debug("Querying API now",e),g.query())),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),E=g,k.data(w,E)},destroy:function(){g.verbose("Destroying previous module for",A),k.removeData(w).off(C)},query:function(){if(g.is.disabled())return void g.debug("Element is disabled API request aborted");if(g.is.loading()&&0===p.throttle)return void g.debug("Cancelling request, previous request is still pending");if(p.defaultData&&e.extend(!0,p.urlData,g.get.defaultData()),(p.serializeForm!==!1||S.is("form"))&&("json"==p.serializeForm?e.extend(!0,p.data,g.get.formData()):p.data=g.get.formData()),a=g.get.settings(),a===!1)return g.cancelled=!0,void g.error(y.beforeSend);if(g.cancelled=!1,p.url?(g.debug("Using specified url",m),m=g.add.urlData(p.url)):(m=g.add.urlData(g.get.templateURL()),g.debug("Added URL Data to url",m)),!m&&!g.is.mocked()){if(!g.is.form())return void g.error(y.missingURL,p.action);m=k.attr("action")||"",g.debug("No url or action specified, defaulting to form action",m)}g.set.loading(),t=e.extend(!0,{},p,{type:p.method||p.type,data:f,url:p.base+m,beforeSend:p.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),g.debug("Querying URL",t.url),g.debug("Sending data",f,t.method),g.verbose("Using AJAX settings",t),g.is.loading()?g.timer=setTimeout(function(){g.request=g.create.request(),g.xhr=g.create.xhr(),p.onRequest.call(P,g.request,g.xhr)},p.throttle):(g.request=g.create.request(),g.xhr=g.create.xhr(),p.onRequest.call(P,g.request,g.xhr))},is:{disabled:function(){return k.filter(p.filter).length>0},form:function(){return k.is("form")},mocked:function(){return p.mockResponse||p.mockResponseAsync},input:function(){return k.is("input")},loading:function(){return g.request&&"pending"==g.request.state()}},was:{cancelled:function(){return g.cancelled||!1},succesful:function(){return g.request&&"resolved"==g.request.state()},failure:function(){return g.request&&"rejected"==g.request.state()},complete:function(){return g.request&&("resolved"==g.request.state()||"rejected"==g.request.state())}},add:{urlData:function(t,n){var o,a;return t&&(o=t.match(p.regExp.required),a=t.match(p.regExp.optional),n=n||p.urlData,o&&(g.debug("Looking for required URL variables",o),e.each(o,function(o,a){var r=-1!==a.indexOf("$")?a.substr(2,a.length-3):a.substr(1,a.length-2),s=e.isPlainObject(n)&&n[r]!==i?n[r]:k.data(r)!==i?k.data(r):S.data(r)!==i?S.data(r):n[r];return s===i?(g.error(y.requiredParameter,r,t),t=!1,!1):(g.verbose("Found required variable",r,s),void(t=t.replace(a,s)))})),a&&(g.debug("Looking for optional URL variables",o),e.each(a,function(o,a){var r=-1!==a.indexOf("$")?a.substr(3,a.length-4):a.substr(2,a.length-3),s=e.isPlainObject(n)&&n[r]!==i?n[r]:k.data(r)!==i?k.data(r):S.data(r)!==i?S.data(r):n[r];s!==i?(g.verbose("Optional variable Found",r,s),t=t.replace(a,s)):(g.verbose("Optional variable not found",r),t=-1!==t.indexOf("/"+a)?t.replace("/"+a,""):t.replace(a,""))}))),t}},event:{trigger:function(e){g.query(),("submit"==e.type||"click"==e.type)&&e.preventDefault()},xhr:{always:function(){},done:function(e){var t=this,n=(new Date).getTime()-s,i=p.loadingDuration-n;i=i>0?i:0,setTimeout(function(){g.request.resolveWith(t,[e])},i)},fail:function(e,t,n){var i=this,o=(new Date).getTime()-s,a=p.loadingDuration-o;a=a>0?a:0,setTimeout(function(){"abort"!==t?g.request.rejectWith(i,[e,t,n]):g.reset()},a)}},request:{complete:function(e){g.remove.loading(),p.onComplete.call(P,e,k)},done:function(t){var n=e.isFunction(p.onResponse)?p.onResponse.call(P,e.extend(!0,{},t)):!1;g.debug("API Response Received",t),n&&(g.debug("Modified API response in onResponse callback",p.onResponse,n,t),t=n),"json"==p.dataType&&e.isFunction(p.successTest)?(g.debug("Checking JSON returned success",p.successTest,t),p.successTest(t)?p.onSuccess.call(P,t,k):(g.debug("JSON test specified by user and response failed",t),p.onFailure.call(P,t,k))):p.onSuccess.call(P,t,k)},error:function(n,o,a){var r,s=p.error[o]!==i?p.error[o]:a;if(n!==i)if(n.readyState!==i&&4==n.readyState){if(200!=n.status&&a!==i&&""!==a)g.error(y.statusMessage+a,t.url);else if("error"==o&&"json"==p.dataType)try{r=e.parseJSON(n.responseText),r&&r.error!==i&&(s=r.error)}catch(c){g.error(y.JSONParse)}g.remove.loading(),g.set.error(),p.errorDuration&&setTimeout(g.remove.error,p.errorDuration),g.debug("API Request error:",s),p.onError.call(P,s,k)}else p.onAbort.call(P,s,k),g.debug("Request Aborted (Most likely caused by page change or CORS Policy)",o,a)}}},create:{request:function(){return e.Deferred().always(g.event.request.complete).done(g.event.request.done).fail(g.event.request.error)},xhr:function(){var n;return g.is.mocked()?void(p.mockResponse?e.isFunction(p.mockResponse)?(g.debug("Using sync mocked response callback",p.mockResponse),g.request.resolveWith(P,[p.mockResponse.call(P,p)])):(g.debug("Using mocked response",p.mockResponse),g.request.resolveWith(P,[p.mockResponse])):e.isFunction(p.mockResponseAsync)&&(n=function(e){g.verbose("Async callback returned response",e),g.request.resolveWith(P,e)},g.debug("Using async mocked response",p.mockResponseAsync),p.mockResponseAsync.call(P,p,n))):e.ajax(t).always(g.event.xhr.always).done(g.event.xhr.done).fail(g.event.xhr.fail)}},set:{error:function(){g.verbose("Adding error state to element",S),S.addClass(x.error)},loading:function(){g.verbose("Adding loading state to element",S),S.addClass(x.loading)}},remove:{error:function(){g.verbose("Removing error state from element",S),S.removeClass(x.error)},loading:function(){g.verbose("Removing loading state from element",S),S.removeClass(x.loading)}},get:{request:function(){return g.request||!1},xhr:function(){return g.xhr||!1},settings:function(){var e;return e=p.beforeSend.call(k,p),e&&(e.success!==i&&(g.debug("Legacy success callback detected",e),g.error(y.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==i&&(g.debug("Legacy failure callback detected",e),g.error(y.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==i&&(g.debug("Legacy complete callback detected",e),g.error(y.legacyParameters,e.complete),e.onComplete=e.complete)),e===i&&g.error(y.noReturnedValue),e!==i?e:p},defaultData:function(){var t={};return e.isWindow(A)||(g.is.input()?t.value=k.val():g.is.form()&&(t.text=k.text())),t},event:function(){return e.isWindow(A)||"now"==p.on?(g.debug("API called without element, no events attached"),!1):"auto"==p.on?k.is("input")?A.oninput!==i?"input":A.onpropertychange!==i?"propertychange":"keyup":k.is("form")?"submit":"click":p.on},formData:function(){var e;return k.serializeObject!==i?e=T.serializeObject():(g.error(y.missingSerialize),e=T.serialize()),g.debug("Retrieved form data",e),e},templateURL:function(e){var t;return e=e||k.data(h.action)||p.action||!1,e&&(g.debug("Looking up url for action",e,p.api),p.api[e]!==i?(t=p.api[e],g.debug("Found template url",t)):g.is.form()||g.is.mocked()||g.error(y.missingAction,p.action,p.api)),t}},abort:function(){var e=g.get.xhr();e&&"resolved"!==e.state()&&(g.debug("Cancelling API request"),e.abort(),g.request.rejectWith(p.apiSettings))},reset:function(){g.remove.error(),g.remove.loading()},setting:function(t,n){if(g.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,p,t);else{if(n===i)return p[t];p[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},debug:function(){p.debug&&(p.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,p.name+":"),g.debug.apply(console,arguments)))},verbose:function(){p.verbose&&p.debug&&(p.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),g.verbose.apply(console,arguments)))},error:function(){g.error=Function.prototype.bind.call(console.error,console,p.name+":"),g.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;p.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var t=p.name+":",n=0;s=!1,clearTimeout(g.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=E;return n=n||d,a=A||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(g.error(y.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(E===i&&g.initialize(),g.invoke(l)):(E!==i&&E.invoke("destroy"),g.initialize())}),o!==i?o:this},e.api.settings={name:"API",namespace:"api",debug:!0,verbose:!1,performance:!0,on:"auto",filter:".disabled",stateContext:!1,loadingDuration:0,errorDuration:2e3,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},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:"Required dependency jquery-serialize-object missing, using basic serialize",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",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:{form:"form"},metadata:{action:"action"}},e.api.settings.api={}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.state=function(t){var o,a=e(this),r=a.selector||"",s=("ontouchstart"in n.documentElement,(new Date).getTime()),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1);return a.each(function(){var n,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.state.settings,t):e.extend({},e.fn.state.settings),f=m.error,g=m.metadata,p=m.className,v=m.namespace,h=m.states,b=m.text,y="."+v,x=v+"-module",C=e(this),w=this,k=C.data(x);n={initialize:function(){n.verbose("Initializing module"),m.automatic&&n.add.defaults(),m.context&&""!==r?e(m.context).on(r,"mouseenter"+y,n.change.text).on(r,"mouseleave"+y,n.reset.text).on(r,"click"+y,n.toggle.state):C.on("mouseenter"+y,n.change.text).on("mouseleave"+y,n.reset.text).on("click"+y,n.toggle.state),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),k=n,C.data(x,n)},destroy:function(){n.verbose("Destroying previous module",k),C.off(y).removeData(x)},refresh:function(){n.verbose("Refreshing selector cache"),C=e(w)},add:{defaults:function(){var o=t&&e.isPlainObject(t.states)?t.states:{};e.each(m.defaults,function(t,a){n.is[t]!==i&&n.is[t]()&&(n.verbose("Adding default states",t,w),e.extend(m.states,a,o))})}},is:{active:function(){return C.hasClass(p.active)},loading:function(){return C.hasClass(p.loading)},inactive:function(){return!C.hasClass(p.active)},state:function(e){return p[e]===i?!1:C.hasClass(p[e])},enabled:function(){return!C.is(m.filter.active)},disabled:function(){return C.is(m.filter.active)},textEnabled:function(){return!C.is(m.filter.text)},button:function(){return C.is(".button:not(a, .submit)")},input:function(){return C.is("input")},progress:function(){return C.is(".ui.progress")}},allow:function(e){n.debug("Now allowing state",e),h[e]=!0},disallow:function(e){n.debug("No longer allowing",e),h[e]=!1},allows:function(e){return h[e]||!1},enable:function(){C.removeClass(p.disabled)},disable:function(){C.addClass(p.disabled)},setState:function(e){n.allows(e)&&C.addClass(p[e])},removeState:function(e){n.allows(e)&&C.removeClass(p[e])},toggle:{state:function(){var t,o;if(n.allows("active")&&n.is.enabled()){if(n.refresh(),e.fn.api!==i)if(t=C.api("get request"),o=C.api("was cancelled"))n.debug("API Request cancelled by beforesend"),m.activateTest=function(){return!1},m.deactivateTest=function(){return!1};else if(t)return void n.listenTo(t);n.change.state()}}},listenTo:function(t){n.debug("API request detected, waiting for state signal",t),t&&(b.loading&&n.update.text(b.loading),e.when(t).then(function(){"resolved"==t.state()?(n.debug("API request succeeded"),m.activateTest=function(){return!0},m.deactivateTest=function(){return!0}):(n.debug("API request failed"),m.activateTest=function(){return!1},m.deactivateTest=function(){return!1}),n.change.state()}))},change:{state:function(){n.debug("Determining state change direction"),n.is.inactive()?n.activate():n.deactivate(),m.sync&&n.sync(),m.onChange.call(w)},text:function(){n.is.textEnabled()&&(n.is.disabled()?(n.verbose("Changing text to disabled text",b.hover),n.update.text(b.disabled)):n.is.active()?b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.deactivate&&(n.verbose("Changing text to deactivating text",b.deactivate),n.update.text(b.deactivate)):b.hover?(n.verbose("Changing text to hover text",b.hover),n.update.text(b.hover)):b.activate&&(n.verbose("Changing text to activating text",b.activate),n.update.text(b.activate)))}},activate:function(){m.activateTest.call(w)&&(n.debug("Setting state to active"),C.addClass(p.active),n.update.text(b.active),m.onActivate.call(w))},deactivate:function(){m.deactivateTest.call(w)&&(n.debug("Setting state to inactive"),C.removeClass(p.active),n.update.text(b.inactive),m.onDeactivate.call(w))},sync:function(){n.verbose("Syncing other buttons to current state"),a.not(C).state(n.is.active()?"activate":"deactivate")},get:{text:function(){return m.selector.text?C.find(m.selector.text).text():C.html()},textFor:function(e){return b[e]||!1}},flash:{text:function(e,t,i){var o=n.get.text();n.debug("Flashing text message",e,t),e=e||m.text.flash,t=t||m.flashDuration,i=i||function(){},n.update.text(e),setTimeout(function(){n.update.text(o),i.call(w)},t)}},reset:{text:function(){var e=b.active||C.data(g.storedText),t=b.inactive||C.data(g.storedText);n.is.textEnabled()&&(n.is.active()&&e?(n.verbose("Resetting active text",e),n.update.text(e)):t&&(n.verbose("Resetting inactive text",e),n.update.text(t)))}},update:{text:function(e){var t=n.get.text();e&&e!==t?(n.debug("Updating text",e),m.selector.text?C.data(g.storedText,e).find(m.selector.text).text(e):C.data(g.storedText,e).html(e)):n.debug("Text is already set, ignoring update",e)}},setting:function(t,o){if(n.debug("Changing setting",t,o),e.isPlainObject(t))e.extend(!0,m,t);else{if(o===i)return m[t];m[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,n,t);else{if(o===i)return n[t];n[t]=o}},debug:function(){m.debug&&(m.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,m.name+":"),n.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,m.name+":"),n.error.apply(console,arguments)},performance:{log:function(e){var t,i,o;m.performance&&(t=(new Date).getTime(),o=s||t,i=t-o,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":i})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},display:function(){var t=m.name+":",o=0;s=!1,clearTimeout(n.performance.timer),e.each(c,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,a,r){var s,c,l,u=k;return a=a||d,r=w||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(o,a){var r=o!=s?a+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(u[r])&&o!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[a])||o==s)return u[a]!==i?(c=u[a],!1):(n.error(f.method,t),!1);u=u[a]}})),e.isFunction(c)?l=c.apply(r,a):c!==i&&(l=c),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),c}},u?(k===i&&n.initialize(),n.invoke(l)):(k!==i&&k.invoke("destroy"),n.initialize())}),o!==i?o:this},e.fn.state.settings={name:"State",debug:!1,verbose:!1,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:1e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{beforeSend:"The before send function has cancelled state change",method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",error:"error",loading:"loading",success:"success",warning:"warning"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0},progress:{active:!0,success:!0,warning:!0,error:!0}},states:{active:!0,disabled:!0,error:!0,loading:!0,success:!0,warning:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,activate:!1,deactivate:!1}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.visibility=function(o){var a,r=e(this),s=r.selector||"",c=(new Date).getTime(),l=[],u=arguments[0],d="string"==typeof u,m=[].slice.call(arguments,1);return r.each(function(){var r,f,g=e.isPlainObject(o)?e.extend(!0,{},e.fn.visibility.settings,o):e.extend({},e.fn.visibility.settings),p=g.className,v=g.namespace,h=g.error,b="."+v,y="module-"+v,x=e(t),C=e(this),w=e(g.context),k=(C.selector||"",C.data(y)),T=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},S=this;f={initialize:function(){f.debug("Initializing",g),f.setup.cache(),f.save.position(),f.should.trackChanges()&&(f.bind.events(),"image"==g.type&&f.setup.image(),"fixed"==g.type&&f.setup.fixed(),g.observeChanges&&f.observeChanges(),f.is.visible()||f.error(h.visible,C)),g.initialCheck&&f.checkVisibility(),f.instantiate()},instantiate:function(){f.debug("Storing instance",f),C.data(y,f),k=f},destroy:function(){f.verbose("Destroying previous module"),r&&r.disconnect(),x.off("load"+b,f.event.load).off("resize"+b,f.event.resize),w.off("scrollchange"+b,f.event.scrollchange),C.off(b).removeData(y)},observeChanges:function(){w[0];"MutationObserver"in t&&(r=new MutationObserver(function(e){f.verbose("DOM tree modified, updating visibility calculations"),f.timer=setTimeout(function(){f.verbose("DOM tree modified, updating sticky menu"),f.refresh()},100)}),r.observe(S,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",r))},bind:{events:function(){f.verbose("Binding visibility events to scroll and resize"),x.on("load"+b,f.event.load).on("resize"+b,f.event.resize),w.off("scroll"+b).on("scroll"+b,f.event.scroll).on("scrollchange"+b,f.event.scrollchange)},imageLoad:function(){var t=C.find("img"),i=t.length,o=i,a=0,r=[],s=[],c=n.createElement("img"),l=function(){a++,a>=i&&(f.debug("Images finished loading inside element, refreshing position"),f.refresh())};if(i>0)for(t.each(function(){r.push(e(this).attr("src"))});o--;)c=n.createElement("img"),c.onload=l,c.onerror=l,c.src=r[o],s.push(c)}},event:{resize:function(){f.debug("Window resized"),T(f.refresh)},load:function(){f.debug("Page finished loading"),T(f.refresh)},scroll:function(){g.throttle?(clearTimeout(f.timer),f.timer=setTimeout(function(){w.trigger("scrollchange"+b,[w.scrollTop()])},g.throttle)):T(function(){w.trigger("scrollchange"+b,[w.scrollTop()])})},scrollchange:function(e,t){f.checkVisibility(t)}},precache:function(t,i){t instanceof Array||(t=[t]);for(var o=t.length,a=0,r=[],s=n.createElement("img"),c=function(){a++,a>=t.length&&e.isFunction(i)&&i()};o--;)s=n.createElement("img"),s.onload=c,s.onerror=c,s.src=t[o],r.push(s)},should:{trackChanges:function(){return d?(f.debug("One time query, no need to bind events"),!1):(f.debug("Callbacks being attached"),!0)}},setup:{cache:function(){f.cache={occurred:{},screen:{},element:{}}},image:function(){var e=C.data("src");e&&(f.verbose("Lazy loading image",e),g.observeChanges=!1,f.topVisible(function(){f.debug("Image top visible",S),f.precache(e,function(){f.set.image(e),g.onTopVisible=!1})}))},fixed:function(){f.verbose("Setting up fixed on element pass"),g.once=!1,g.onTopPassed=function(){C.addClass(p.fixed).css({top:g.offset+"px"}),g.transition&&e.fn.transition!==i&&C.transition(g.transition,g.duration)},g.onTopPassedReverse=function(){C.removeClass(p.fixed).css({position:"",top:""})}}},set:{image:function(t){var n=f.cache.screen.bottom0:!1;
}},refresh:function(){f.debug("Refreshing constants (width/height)"),f.reset(),f.save.position(),f.checkVisibility(),g.onRefresh.call(S)},reset:function(){f.verbose("Reseting all cached values"),e.isPlainObject(f.cache)&&(f.cache.screen={},f.cache.element={})},checkVisibility:function(e){f.verbose("Checking visibility of element",f.cache.element),f.is.visible()&&(f.save.scroll(e),f.save.calculations(),f.passed(),f.passingReverse(),f.topVisibleReverse(),f.bottomVisibleReverse(),f.topPassedReverse(),f.bottomPassedReverse(),f.onScreen(),f.offScreen(),f.passing(),f.topVisible(),f.bottomVisible(),f.topPassed(),f.bottomPassed(),g.onUpdate&&g.onUpdate.call(S,f.get.elementCalculations()))},passed:function(t,n){var o=f.get.elementCalculations();if(t&&n)g.onPassed[t]=n;else{if(t!==i)return f.get.pixelsPassed(t)>o.pixelsPassed;o.passing&&e.each(g.onPassed,function(e,t){o.bottomVisible||o.pixelsPassed>f.get.pixelsPassed(e)?f.execute(t,e):g.once||f.remove.occurred(t)})}},onScreen:function(e){var t=f.get.elementCalculations(),n=e||g.onOnScreen,o="onScreen";return e&&(f.debug("Adding callback for onScreen",e),g.onOnScreen=e),t.onScreen?f.execute(n,o):g.once||f.remove.occurred(o),e!==i?t.onOnScreen:void 0},offScreen:function(e){var t=f.get.elementCalculations(),n=e||g.onOffScreen,o="offScreen";return e&&(f.debug("Adding callback for offScreen",e),g.onOffScreen=e),t.offScreen?f.execute(n,o):g.once||f.remove.occurred(o),e!==i?t.onOffScreen:void 0},passing:function(e){var t=f.get.elementCalculations(),n=e||g.onPassing,o="passing";return e&&(f.debug("Adding callback for passing",e),g.onPassing=e),t.passing?f.execute(n,o):g.once||f.remove.occurred(o),e!==i?t.passing:void 0},topVisible:function(e){var t=f.get.elementCalculations(),n=e||g.onTopVisible,o="topVisible";return e&&(f.debug("Adding callback for top visible",e),g.onTopVisible=e),t.topVisible?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.topVisible:void 0},bottomVisible:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomVisible,o="bottomVisible";return e&&(f.debug("Adding callback for bottom visible",e),g.onBottomVisible=e),t.bottomVisible?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.bottomVisible:void 0},topPassed:function(e){var t=f.get.elementCalculations(),n=e||g.onTopPassed,o="topPassed";return e&&(f.debug("Adding callback for top passed",e),g.onTopPassed=e),t.topPassed?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.topPassed:void 0},bottomPassed:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomPassed,o="bottomPassed";return e&&(f.debug("Adding callback for bottom passed",e),g.onBottomPassed=e),t.bottomPassed?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.bottomPassed:void 0},passingReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onPassingReverse,o="passingReverse";return e&&(f.debug("Adding callback for passing reverse",e),g.onPassingReverse=e),t.passing?g.once||f.remove.occurred(o):f.get.occurred("passing")&&f.execute(n,o),e!==i?!t.passing:void 0},topVisibleReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onTopVisibleReverse,o="topVisibleReverse";return e&&(f.debug("Adding callback for top visible reverse",e),g.onTopVisibleReverse=e),t.topVisible?g.once||f.remove.occurred(o):f.get.occurred("topVisible")&&f.execute(n,o),e===i?!t.topVisible:void 0},bottomVisibleReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomVisibleReverse,o="bottomVisibleReverse";return e&&(f.debug("Adding callback for bottom visible reverse",e),g.onBottomVisibleReverse=e),t.bottomVisible?g.once||f.remove.occurred(o):f.get.occurred("bottomVisible")&&f.execute(n,o),e===i?!t.bottomVisible:void 0},topPassedReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onTopPassedReverse,o="topPassedReverse";return e&&(f.debug("Adding callback for top passed reverse",e),g.onTopPassedReverse=e),t.topPassed?g.once||f.remove.occurred(o):f.get.occurred("topPassed")&&f.execute(n,o),e===i?!t.onTopPassed:void 0},bottomPassedReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomPassedReverse,o="bottomPassedReverse";return e&&(f.debug("Adding callback for bottom passed reverse",e),g.onBottomPassedReverse=e),t.bottomPassed?g.once||f.remove.occurred(o):f.get.occurred("bottomPassed")&&f.execute(n,o),e===i?!t.bottomPassed:void 0},execute:function(e,t){var n=f.get.elementCalculations(),i=f.get.screenCalculations();e=e||!1,e&&(g.continuous?(f.debug("Callback being called continuously",t,n),e.call(S,n,i)):f.get.occurred(t)||(f.debug("Conditions met",t,n),e.call(S,n,i))),f.save.occurred(t)},remove:{occurred:function(e){e?f.cache.occurred[e]!==i&&f.cache.occurred[e]===!0&&(f.debug("Callback can now be called again",e),f.cache.occurred[e]=!1):f.cache.occurred={}}},save:{calculations:function(){f.verbose("Saving all calculations necessary to determine positioning"),f.save.direction(),f.save.screenCalculations(),f.save.elementCalculations()},occurred:function(e){e&&(f.cache.occurred[e]===i||f.cache.occurred[e]!==!0)&&(f.verbose("Saving callback occurred",e),f.cache.occurred[e]=!0)},scroll:function(e){e=e+g.offset||w.scrollTop()+g.offset,f.cache.scroll=e},direction:function(){var e,t=f.get.scroll(),n=f.get.lastScroll();return e=t>n&&n?"down":n>t&&n?"up":"static",f.cache.direction=e,f.cache.direction},elementPosition:function(){var e=f.cache.element,t=f.get.screenSize();return f.verbose("Saving element position"),e.fits=e.height=t.top,t.topPassed=e.top>=t.top,t.bottomVisible=e.bottom>=t.bottom,t.bottomPassed=e.top>=t.bottom,t.pixelsPassed=0,t.percentagePassed=0,t.onScreen=t.topVisible&&!t.bottomPassed,t.passing=t.topPassed&&!t.bottomPassed,t.offScreen=!t.onScreen,t.passing&&(t.pixelsPassed=e.top-t.top,t.percentagePassed=(e.top-t.top)/t.height),f.cache.element=t,f.verbose("Updated element calculations",t),t},screenCalculations:function(){var e=f.get.scroll();return f.save.direction(),f.cache.screen.top=e,f.cache.screen.bottom=e+f.cache.screen.height,f.cache.screen},screenSize:function(){f.verbose("Saving window position"),f.cache.screen={height:w.height()}},position:function(){f.save.screenSize(),f.save.elementPosition()}},get:{pixelsPassed:function(e){var t=f.get.elementCalculations();return e.search("%")>-1?t.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return f.cache.occurred!==i?f.cache.occurred[e]||!1:!1},direction:function(){return f.cache.direction===i&&f.save.direction(),f.cache.direction},elementPosition:function(){return f.cache.element===i&&f.save.elementPosition(),f.cache.element},elementCalculations:function(){return f.cache.element===i&&f.save.elementCalculations(),f.cache.element},screenCalculations:function(){return f.cache.screen===i&&f.save.screenCalculations(),f.cache.screen},screenSize:function(){return f.cache.screen===i&&f.save.screenSize(),f.cache.screen},scroll:function(){return f.cache.scroll===i&&f.save.scroll(),f.cache.scroll},lastScroll:function(){return f.cache.screen===i?(f.debug("First scroll event, no last scroll could be found"),!1):f.cache.screen.top}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,g,t);else{if(n===i)return g[t];g[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},debug:function(){g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;g.performance&&(t=(new Date).getTime(),i=c||t,n=t-i,c=t,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var t=g.name+":",n=0;c=!1,clearTimeout(f.performance.timer),e.each(l,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",s&&(t+=" '"+s+"'"),(console.group!==i||console.table!==i)&&l.length>0&&(console.groupCollapsed(t),console.table?console.table(l):e.each(l,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(t,n,o){var r,s,c,l=k;return n=n||m,o=S||o,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(f.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(o,n):s!==i&&(c=s),e.isArray(a)?a.push(c):a!==i?a=[a,c]:c!==i&&(a=c),s}},d?(k===i&&f.initialize(),k.save.scroll(),k.save.calculations(),f.invoke(u)):(k!==i&&k.invoke("destroy"),f.initialize())}),a!==i?a:this},e.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,refreshOnLoad:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:t,initialCheck:!0,throttle:!1,type:!1,transition:!1,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,onUpdate:!1,onRefresh:function(){},className:{fixed:"fixed"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);