11 lines
No EOL
369 KiB
JavaScript
11 lines
No EOL
369 KiB
JavaScript
/*
|
|
* # Fomantic UI - 2.9.0-beta.301+42e68bc
|
|
* https://github.com/fomantic/Fomantic-UI
|
|
* http://fomantic-ui.com/
|
|
*
|
|
* Copyright 2022 Contributors
|
|
* Released under the MIT license
|
|
* http://opensource.org/licenses/MIT
|
|
*
|
|
*/
|
|
!function(g,h,v,b){g.isFunction=g.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g.site=g.fn.site=function(e){var s,i=(new Date).getTime(),o=[],t=e,n="string"==typeof t,l=[].slice.call(arguments,1),r=g.isPlainObject(e)?g.extend(!0,{},g.site.settings,e):g.extend({},g.site.settings),a=r.namespace,c=r.error,u="module-"+a,d=g(v),f=this,m=d.data(u),p={initialize:function(){p.instantiate()},instantiate:function(){p.verbose("Storing instance of site",p),m=p,d.data(u,p)},normalize:function(){p.fix.console(),p.fix.requestAnimationFrame()},fix:{console:function(){p.debug("Normalizing window.console"),console!==b&&console.log!==b||(p.verbose("Console not available, normalizing events"),p.disable.console()),void 0!==console.group&&void 0!==console.groupEnd&&void 0!==console.groupCollapsed||(p.verbose("Console group not available, normalizing events"),h.console.group=function(){},h.console.groupEnd=function(){},h.console.groupCollapsed=function(){}),void 0===console.markTimeline&&(p.verbose("Mark timeline not available, normalizing events"),h.console.markTimeline=function(){})},consoleClear:function(){p.debug("Disabling programmatic console clearing"),h.console.clear=function(){}},requestAnimationFrame:function(){p.debug("Normalizing requestAnimationFrame"),h.requestAnimationFrame===b&&(p.debug("RequestAnimationFrame not available, normalizing event"),h.requestAnimationFrame=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(e){return g.fn[e]!==b&&g.fn[e].settings!==b},enabled:{modules:function(e){var n=[];return e=e||r.modules,g.each(e,function(e,t){p.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(e){var n=[];return e=e||r.modules,g.each(e,function(e,t){p.moduleExists(t)||n.push(t)}),n}},change:{setting:function(i,o,e,a){e="string"==typeof e?"all"===e?r.modules:[e]:e||r.modules,a=a===b||a,g.each(e,function(e,t){var n=!p.moduleExists(t)||(g.fn[t].settings.namespace||!1);p.moduleExists(t)&&(p.verbose("Changing default setting",i,o,t),g.fn[t].settings[i]=o,a&&n&&0<(n=g(":data(module-"+n+")")).length&&(p.verbose("Modifying existing settings",n),n[t]("setting",i,o)))})},settings:function(i,e,o){e="string"==typeof e?[e]:e||r.modules,o=o===b||o,g.each(e,function(e,t){var n;p.moduleExists(t)&&(p.verbose("Changing default setting",i,t),g.extend(!0,g.fn[t].settings,i),o&&a&&0<(n=g(":data(module-"+a+")")).length&&(p.verbose("Modifying existing settings",n),n[t]("setting",i)))})}},enable:{console:function(){p.console(!0)},debug:function(e,t){e=e||r.modules,p.debug("Enabling debug for modules",e),p.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||r.modules,p.debug("Enabling verbose debug for modules",e),p.change.setting("verbose",!0,e,t)}},disable:{console:function(){p.console(!1)},debug:function(e,t){e=e||r.modules,p.debug("Disabling debug for modules",e),p.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||r.modules,p.debug("Disabling verbose debug for modules",e),p.change.setting("verbose",!1,e,t)}},console:function(e){e?m.cache.console===b?p.error(c.console):(p.debug("Restoring console function"),h.console=m.cache.console):(p.debug("Disabling console function"),m.cache.console=h.console,h.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}})},destroy:function(){p.verbose("Destroying previous site for",d),d.removeData(u)},cache:{},setting:function(e,t){if(g.isPlainObject(e))g.extend(!0,r,e);else{if(t===b)return r[e];r[e]=t}},internal:function(e,t){if(g.isPlainObject(e))g.extend(!0,p,e);else{if(t===b)return p[e];p[e]=t}},debug:function(){r.debug&&(r.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,r.name+":"),p.debug.apply(console,arguments)))},verbose:function(){r.verbose&&r.debug&&(r.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),p.verbose.apply(console,arguments)))},error:function(){p.error=Function.prototype.bind.call(console.error,console,r.name+":"),p.error.apply(console,arguments)},performance:{log:function(e){var t,n;r.performance&&(n=(t=(new Date).getTime())-(i||t),i=t,o.push({Element:f,Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var e=r.name+":",n=0;i=!1,clearTimeout(p.performance.timer),g.each(o,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",(console.group!==b||console.table!==b)&&0<o.length&&(console.groupCollapsed(e),console.table?console.table(o):g.each(o,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),o=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||l,t=f||t,"string"==typeof i&&r!==b&&(i=i.split(/[\. ]/),o=i.length-1,g.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(g.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==b)return a=r[n],!1;{if(!g.isPlainObject(r[t])||e==o)return r[t]!==b?a=r[t]:p.error(c.method,i),!1;r=r[t]}}})),g.isFunction(a)?n=a.apply(t,e):a!==b&&(n=a),Array.isArray(s)?s.push(n):s!==b?s=[s,n]:n!==b&&(s=n),a}};return n?(m===b&&p.initialize(),p.invoke(t)):(m!==b&&p.destroy(),p.initialize()),s!==b?s:this},g.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","calendar","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","slider","rating","shape","sidebar","state","sticky","tab","toast","transition","visibility","visit"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},g.extend(g.expr[":"],{data:g.expr.createPseudo?g.expr.createPseudo(function(t){return function(e){return!!g.data(e,t)}}):function(e,t,n){return!!g.data(e,n[3])}})}(jQuery,window,document),function(R,I,j,V){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},I=void 0!==I&&I.Math==Math?I:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),R.fn.form=function(k){var T,S=R(this),D=S.selector||"",A=(new Date).getTime(),E=[],F=k,O=arguments[1],P="string"==typeof F,M=[].slice.call(arguments,1);return S.each(function(){var n,d,t,e,f,l,m,p,g,i,c,o,a,s,u,h=R(this),v=this,b=[],y=!1,r=!1,x=!1,C=["clean","clean"],w={initialize:function(){w.get.settings(),P?(u===V&&w.instantiate(),w.invoke(F)):(u!==V&&(u.invoke("destroy"),w.refresh()),w.verbose("Initializing form validation",h,f),w.bindEvents(),w.set.defaults(),f.autoCheckRequired&&w.set.autoCheck(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of module",w),u=w,h.data(a,w)},destroy:function(){w.verbose("Destroying previous module",u),w.removeEvents(),h.removeData(a)},refresh:function(){w.verbose("Refreshing selector cache"),n=h.find(p.field),d=h.find(p.group),t=h.find(p.message),h.find(p.prompt),e=h.find(p.submit),h.find(p.clear),h.find(p.reset)},refreshEvents:function(){w.removeEvents(),w.bindEvents()},submit:function(){w.verbose("Submitting form",h),r=!0,h.submit()},attachEvents:function(e,t){t=t||"submit",R(e).on("click"+s,function(e){w[t](),e.preventDefault()})},bindEvents:function(){w.verbose("Attaching form events"),h.on("submit"+s,w.validate.form).on("blur"+s,p.field,w.event.field.blur).on("click"+s,p.submit,w.submit).on("click"+s,p.reset,w.reset).on("click"+s,p.clear,w.clear),f.keyboardShortcuts&&h.on("keydown"+s,p.field,w.event.field.keydown),n.each(function(e,t){var t=R(t),n=t.prop("type"),n=w.get.changeEvent(n,t);t.on(n+s,w.event.field.change)}),f.preventLeaving&&R(I).on("beforeunload"+s,w.event.beforeUnload),n.on("change click keyup keydown blur",function(e){w.determine.isDirty()}),h.on("dirty"+s,function(e){f.onDirty.call()}),h.on("clean"+s,function(e){f.onClean.call()})},clear:function(){n.each(function(e,t){var t=R(t),n=t.parent(),i=t.closest(d),o=i.find(p.prompt),a=t.closest(p.uiCalendar),r=t.data(m.defaultValue)||"",s=n.is(p.uiCheckbox),l=n.is(p.uiDropdown)&&w.can.useElement("dropdown"),c=0<a.length&&w.can.useElement("calendar");i.hasClass(g.error)&&(w.verbose("Resetting error on field",i),i.removeClass(g.error),o.remove()),l?(w.verbose("Resetting dropdown value",n,r),n.dropdown("clear",!0)):s?t.prop("checked",!1):c?a.calendar("clear"):(w.verbose("Resetting field value",t,r),t.val(""))}),w.remove.states()},reset:function(){n.each(function(e,t){var t=R(t),n=t.parent(),i=t.closest(d),o=t.closest(p.uiCalendar),a=i.find(p.prompt),r=t.data(m.defaultValue),s=n.is(p.uiCheckbox),l=n.is(p.uiDropdown)&&w.can.useElement("dropdown"),c=0<o.length&&w.can.useElement("calendar"),u=i.hasClass(g.error);r!==V&&(u&&(w.verbose("Resetting error on field",i),i.removeClass(g.error),a.remove()),l?(w.verbose("Resetting dropdown value",n,r),n.dropdown("restore defaults",!0)):s?(w.verbose("Resetting checkbox value",n,r),t.prop("checked",r)):c?o.calendar("set date",r):(w.verbose("Resetting field value",t,r),t.val(r)))}),w.remove.states()},determine:{isValid:function(){var n=!0;return R.each(l,function(e,t){w.validate.field(t,e,!0)||(n=!1)}),n},isDirty:function(e){var i=!1;n.each(function(e,t){var t=R(t),n=0<t.filter(p.checkbox).length?w.is.checkboxDirty(t):w.is.fieldDirty(t);t.data(f.metadata.isDirty,n),i|=n}),i?w.set.dirty():w.set.clean()}},is:{bracketedRule:function(e){return e.type&&e.type.match(f.regExp.bracket)},shorthandRules:function(e){return"string"==typeof e||Array.isArray(e)},empty:function(e){return!e||0===e.length||(e.is(p.checkbox)?!e.is(":checked"):w.is.blank(e))},blank:function(e){return""===String(e.val()).trim()},valid:function(e,n){var i=!0;return e?(w.verbose("Checking if field is valid",e),w.validate.field(l[e],e,!!n)):(w.verbose("Checking if form is valid"),R.each(l,function(e,t){w.is.valid(e,n)||(i=!1)}),i)},dirty:function(){return x},clean:function(){return!x},fieldDirty:function(e){var t=e.data(m.defaultValue),e=(null==t?t="":Array.isArray(t)&&(t=t.toString()),e.val()),n=(null==e?e="":Array.isArray(e)&&(e=e.toString()),/^(true|false)$/i);return n.test(t)&&n.test(e)?!new RegExp("^"+t+"$","i").test(e):e!==t},checkboxDirty:function(e){return e.data(m.defaultValue)!==e.is(":checked")},justDirty:function(){return"dirty"===C[0]},justClean:function(){return"clean"===C[0]}},removeEvents:function(){h.off(s),n.off(s),e.off(s)},event:{field:{keydown:function(e){var t=R(this),n=e.which,i=t.is(p.input),o=t.is(p.checkbox),a=0<t.closest(p.uiDropdown).length,r=13;n==27&&(w.verbose("Escape key pressed blurring field"),t[0].blur()),e.ctrlKey||n!=r||!i||a||o||(y||(t.one("keyup"+s,w.event.field.keyup),w.submit(),w.debug("Enter pressed on input submitting form"),e.preventDefault()),y=!0)},keyup:function(){y=!1},blur:function(e){var t=R(this),n=t.closest(d),i=w.get.validation(t);i&&("blur"==f.on||n.hasClass(g.error)&&f.revalidate)&&(w.debug("Revalidating field",t,i),w.validate.field(i),f.inline||w.validate.form(!1,!0))},change:function(e){var t=R(this),n=t.closest(d),i=w.get.validation(t);i&&("change"==f.on||n.hasClass(g.error)&&f.revalidate)&&(clearTimeout(w.timer),w.timer=setTimeout(function(){w.debug("Revalidating field",t,i),w.validate.field(i),f.inline||w.validate.form(!1,!0)},f.delay))}},beforeUnload:function(e){if(w.is.dirty()&&!r)return(e=e||I.event)&&(e.returnValue=f.text.leavingMessage),f.text.leavingMessage}},get:{ancillaryValue:function(e){return!(!e.type||!e.value&&!w.is.bracketedRule(e))&&(e.value!==V?e.value:e.type.match(f.regExp.bracket)[1]+"")},ruleName:function(e){return w.is.bracketedRule(e)?e.type.replace(e.type.match(f.regExp.bracket)[0],""):e.type},changeEvent:function(e,t){return"checkbox"==e||"radio"==e||"hidden"==e||t.is("select")?"change":w.get.inputEvent()},inputEvent:function(){return j.createElement("input").oninput!==V?"input":j.createElement("input").onpropertychange!==V?"propertychange":"keyup"},fieldsFromShorthand:function(e){var i={};return R.each(e,function(n,e){Array.isArray(e)||"object"!=typeof e?("string"==typeof e&&(e=[e]),i[n]={rules:[]},R.each(e,function(e,t){i[n].rules.push({type:t})})):i[n]=e}),i},prompt:function(e,t){var n,i=w.get.ruleName(e),o=w.get.ancillaryValue(e),a=w.get.field(t.identifier),r=a.val(),r=R.isFunction(e.prompt)?e.prompt(r):e.prompt||f.prompt[i]||f.text.unspecifiedRule,s=-1!==r.search("{value}"),l=-1!==r.search("{name}");return o&&0<=["integer","decimal","number"].indexOf(i)&&0<=o.indexOf("..")&&(n=o.split("..",2),e.prompt||(r+=(""===n[0]?f.prompt.maxValue.replace(/\{ruleValue\}/g,"{max}"):""===n[1]?f.prompt.minValue.replace(/\{ruleValue\}/g,"{min}"):f.prompt.range).replace(/\{name\}/g," "+f.text.and)),r=(r=r.replace(/\{min\}/g,n[0])).replace(/\{max\}/g,n[1])),s&&(r=r.replace(/\{value\}/g,a.val())),l&&(s=1==(n=a.closest(p.group).find("label").eq(0)).length?n.text():a.prop("placeholder")||f.text.unspecifiedField,r=r.replace(/\{name\}/g,s)),r=(r=r.replace(/\{identifier\}/g,t.identifier)).replace(/\{ruleValue\}/g,o),e.prompt||w.verbose("Using default validation prompt for type",r,i),r},settings:function(){var e;R.isPlainObject(k)?0<(e=Object.keys(k)).length&&(k[e[0]].identifier!==V&&k[e[0]].rules!==V)?(f=R.extend(!0,{},R.fn.form.settings,O),l=R.extend(!0,{},R.fn.form.settings.defaults,k),w.error(f.error.oldSyntax,v),w.verbose("Extending settings from legacy parameters",l,f)):(k.fields&&(k.fields=w.get.fieldsFromShorthand(k.fields)),f=R.extend(!0,{},R.fn.form.settings,k),l=R.extend(!0,{},R.fn.form.settings.defaults,f.fields),w.verbose("Extending settings",l,f)):(f=R.extend(!0,{},R.fn.form.settings),l=R.extend(!0,{},R.fn.form.settings.defaults),w.verbose("Using default form validation",l,f)),o=f.namespace,m=f.metadata,p=f.selector,g=f.className,i=f.regExp,c=f.error,a="module-"+o,s="."+o,((u=h.data(a))||w).refresh()},field:function(e){var t;return w.verbose("Finding field with identifier",e),e=w.escape.string(e),0<(t=n.filter("#"+e)).length||0<(t=n.filter('[name="'+e+'"]')).length||0<(t=n.filter('[name="'+e+'[]"]')).length||0<(t=n.filter("[data-"+m.validate+'="'+e+'"]')).length?t:R("<input/>")},fields:function(e){var n=R();return R.each(e,function(e,t){n=n.add(w.get.field(t))}),n},validation:function(i){var o,a;return!!l&&(R.each(l,function(e,n){a=n.identifier||e,R.each(w.get.field(a),function(e,t){if(t==i[0])return n.identifier=a,o=n,!1})}),o||!1)},value:function(e){var t=[];return t.push(e),w.get.values.call(v,t)[e]},values:function(e){var e=Array.isArray(e)?w.get.fields(e):n,d={};return e.each(function(e,t){var t=R(t),n=t.closest(p.uiCalendar),i=t.prop("name"),o=t.val(),a=t.is(p.checkbox),r=t.is(p.radio),s=-1!==i.indexOf("[]"),l=0<n.length&&w.can.useElement("calendar"),t=!!a&&t.is(":checked");if(i)if(s)i=i.replace("[]",""),d[i]||(d[i]=[]),a?t?d[i].push(o||!0):d[i].push(!1):d[i].push(o);else if(r)d[i]!==V&&!1!==d[i]||(d[i]=!!t&&(o||!0));else if(a)d[i]=!!t&&(o||!0);else if(l){var c=n.calendar("get date");if(null!==c){if("date"==f.dateHandling)d[i]=c;else if("input"==f.dateHandling)d[i]=n.calendar("get input date");else if("formatter"==f.dateHandling){var u=n.calendar("setting","type");switch(u){case"date":d[i]=f.formatter.date(c);break;case"datetime":d[i]=f.formatter.datetime(c);break;case"time":d[i]=f.formatter.time(c);break;case"month":d[i]=f.formatter.month(c);break;case"year":d[i]=f.formatter.year(c);break;default:w.debug("Wrong calendar mode",n,u),d[i]=""}}}else d[i]=""}else d[i]=o}),d},dirtyFields:function(){return n.filter(function(e,t){return R(t).data(m.isDirty)})}},has:{field:function(e){return w.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=w.escape.string(e))&&w.error(c.identifier,e),0<n.filter("#"+e).length||(0<n.filter('[name="'+e+'"]').length||0<n.filter("[data-"+m.validate+'="'+e+'"]').length)}},can:{useElement:function(e){return R.fn[e]!==V||(w.error(c.noElement.replace("{element}",e)),!1)}},escape:{string:function(e){return(e=String(e)).replace(i.escape,"\\$&")}},add:{rule:function(e,t){w.add.field(e,t)},field:function(n,e){l[n]!==V&&l[n].rules!==V||(l[n]={rules:[]});var i={rules:[]};w.is.shorthandRules(e)?(e=Array.isArray(e)?e:[e],R.each(e,function(e,t){i.rules.push({type:t})})):i.rules=e.rules,R.each(i.rules,function(e,t){0==R.grep(l[n].rules,function(e){return e.type==t.type}).length&&l[n].rules.push(t)}),w.debug("Adding rules",i.rules,l),w.refreshEvents()},fields:function(e){l=R.extend(!0,{},l,w.get.fieldsFromShorthand(e)),w.refreshEvents()},prompt:function(e,t,n){var i=w.get.field(e).closest(d),o=i.children(p.prompt),a=0!==o.length;t="string"==typeof t?[t]:t,w.verbose("Adding field error state",e),n||i.addClass(g.error),f.inline&&(a||(o=R("<div/>").addClass(g.label)).appendTo(i),o.html(f.templates.prompt(t)),a?w.verbose("Inline errors are disabled, no inline error added",e):f.transition&&w.can.useElement("transition")&&h.transition("is supported")?(w.verbose("Displaying error with css transition",f.transition),o.transition(f.transition+" in",f.duration)):(w.verbose("Displaying error with fallback javascript animation"),o.fadeIn(f.duration)))},errors:function(e){w.debug("Adding form error messages",e),w.set.error(),t.html(f.templates.error(e))}},remove:{errors:function(){w.debug("Removing form error messages"),t.empty()},states:function(){h.removeClass(g.error).removeClass(g.success),f.inline||w.remove.errors(),w.determine.isDirty()},rule:function(n,e){var i=Array.isArray(e)?e:[e];if(l[n]!==V&&Array.isArray(l[n].rules))return e===V?(w.debug("Removed all rules"),void(l[n].rules=[])):void R.each(l[n].rules,function(e,t){t&&-1!==i.indexOf(t.type)&&(w.debug("Removed rule",t.type),l[n].rules.splice(e,1))})},field:function(e){e=Array.isArray(e)?e:[e];R.each(e,function(e,t){w.remove.rule(t)}),w.refreshEvents()},rules:function(e,n){Array.isArray(e)?R.each(e,function(e,t){w.remove.rule(t,n)}):w.remove.rule(e,n)},fields:function(e){w.remove.field(e)},prompt:function(e){var t=w.get.field(e).closest(d),n=t.children(p.prompt);t.removeClass(g.error),f.inline&&n.is(":visible")&&(w.verbose("Removing prompt for field",e),f.transition&&w.can.useElement("transition")&&h.transition("is supported")?n.transition(f.transition+" out",f.duration,function(){n.remove()}):n.fadeOut(f.duration,function(){n.remove()}))}},set:{success:function(){h.removeClass(g.error).addClass(g.success)},defaults:function(){n.each(function(e,t){var t=R(t),n=t.parent(),i=0<t.filter(p.checkbox).length,o=n.is(p.uiDropdown)&&w.can.useElement("dropdown"),a=t.closest(p.uiCalendar),r=0<a.length&&w.can.useElement("calendar"),i=i?t.is(":checked"):t.val();o?n.dropdown("save defaults"):r&&a.calendar("refresh"),t.data(m.defaultValue,i),t.data(m.isDirty,!1)})},error:function(){h.removeClass(g.success).addClass(g.error)},value:function(e,t){var n={};return n[e]=t,w.set.values.call(v,n)},values:function(e){R.isEmptyObject(e)||R.each(e,function(e,t){var n,i=w.get.field(e),o=i.parent(),e=i.closest(p.uiCalendar),a=Array.isArray(t),r=o.is(p.uiCheckbox)&&w.can.useElement("checkbox"),s=o.is(p.uiDropdown)&&w.can.useElement("dropdown"),l=i.is(p.radio)&&r,c=0<e.length&&w.can.useElement("calendar");0<i.length&&(a&&r?(w.verbose("Selecting multiple",t,i),o.checkbox("uncheck"),R.each(t,function(e,t){n=i.filter('[value="'+t+'"]'),o=n.parent(),0<n.length&&o.checkbox("check")})):l?(w.verbose("Selecting radio value",t,i),i.filter('[value="'+t+'"]').parent(p.uiCheckbox).checkbox("check")):r?(w.verbose("Setting checkbox value",t,o),!0===t||1===t||"on"===t?o.checkbox("check"):o.checkbox("uncheck"),"string"==typeof t&&i.val(t)):s?(w.verbose("Setting dropdown value",t,o),o.dropdown("set selected",t)):c?e.calendar("set date",t):(w.verbose("Setting field value",t,i),i.val(t)))})},dirty:function(){w.verbose("Setting state dirty"),x=!0,C[0]=C[1],C[1]="dirty",w.is.justClean()&&h.trigger("dirty")},clean:function(){w.verbose("Setting state clean"),x=!1,C[0]=C[1],C[1]="clean",w.is.justDirty()&&h.trigger("clean")},asClean:function(){w.set.defaults(),w.set.clean()},asDirty:function(){w.set.defaults(),w.set.dirty()},autoCheck:function(){w.debug("Enabling auto check on required fields"),n.each(function(e,t){var n=R(t),t=R(t).closest(d),i=0<n.filter(p.checkbox).length,o=n.prop("required")||t.hasClass(g.required)||t.parent().hasClass(g.required),t=n.is(":disabled")||t.hasClass(g.disabled)||t.parent().hasClass(g.disabled),a=w.get.validation(n),r=!!a&&0!==R.grep(a.rules,function(e){return"empty"==e.type}),a=a.identifier||n.attr("id")||n.attr("name")||n.data(m.validate);!o||t||r||a===V||(i?(w.verbose("Adding 'checked' rule on field",a),w.add.rule(a,"checked")):(w.verbose("Adding 'empty' rule on field",a),w.add.rule(a,"empty")))})},optional:function(n,i){i=!1!==i,R.each(l,function(e,t){n!=e&&n!=t.identifier||(t.optional=i)})}},validate:{form:function(e,t){var n,i=w.get.values();if(y)return!1;if(b=[],w.determine.isValid()){if(w.debug("Form has no validation errors, submitting"),w.set.success(),f.inline||w.remove.errors(),!0!==t)return f.onSuccess.call(v,e,i)}else if(w.debug("Form has errors"),r=!1,w.set.error(),f.inline||w.add.errors(b),e&&h.data("moduleApi")!==V&&e.stopImmediatePropagation(),f.errorFocus&&!0!==t&&(e=!0,"string"==typeof f.errorFocus?(e=(n=R(j).find(f.errorFocus)).is("[tabindex]"))||n.attr("tabindex",-1):n=d.filter("."+g.error).first().find(p.field),n.focus(),e||n.removeAttr("tabindex")),!0!==t)return f.onFailure.call(v,b,i)},field:function(i,e,o){o=o===V||o,"string"==typeof i&&(w.verbose("Validating field",i),i=l[e=i]);var a=i.identifier||e,e=w.get.field(a),t=!!i.depends&&w.get.field(i.depends),r=!0,s=[];return i.identifier||(w.debug("Using field name as identifier",a),i.identifier=a),!e.filter(":not(:disabled)").length?w.debug("Field is disabled. Skipping",a):i.optional&&w.is.blank(e)?w.debug("Field is optional and blank. Skipping",a):i.depends&&w.is.empty(t)?w.debug("Field depends on another value that is not present or empty. Skipping",t):i.rules!==V&&(o&&e.closest(d).removeClass(g.error),R.each(i.rules,function(e,t){var n;w.has.field(a)&&0<(n=w.validate.rule(i,t,!0)||[]).length&&(w.debug("Field is invalid",a,t.type),s.push(w.get.prompt(t,i)),r=!1,o&&R(n).closest(d).addClass(g.error))})),r?(o&&(w.remove.prompt(a,s),f.onValid.call(e)),!0):(o&&(b=b.concat(s),w.add.prompt(a,s,!0),f.onInvalid.call(e,s)),!1)},rule:function(e,n,t){function i(e){var t=(t=(l?R(e).filter(":checked"):R(e)).val())===V||""===t||null===t?"":f.shouldTrim&&!1!==n.shouldTrim||n.shouldTrim?String(t+"").trim():String(t+"");return r.call(e,t,o,h)}var e=w.get.field(e.identifier),o=w.get.ancillaryValue(n),a=w.get.ruleName(n),r=f.rules[a],s=[],l=e.is(p.checkbox);if(R.isFunction(r))return l?i(e)||(s=e):R.each(e,function(e,t){i(t)||s.push(t)}),t?s:!(0<s.length);w.error(c.noRule,a)}},setting:function(e,t){if(R.isPlainObject(e))R.extend(!0,f,e);else{if(t===V)return f[e];f[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,w,e);else{if(t===V)return w[e];w[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,f.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),w.verbose.apply(console,arguments)))},error:function(){f.silent||(w.error=Function.prototype.bind.call(console.error,console,f.name+":"),w.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(A||t),A=t,E.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var e=f.name+":",n=0;A=!1,clearTimeout(w.performance.timer),R.each(E,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",D&&(e+=" '"+D+"'"),1<S.length&&(e+=" ("+S.length+")"),(console.group!==V||console.table!==V)&&0<E.length&&(console.groupCollapsed(e),console.table?console.table(E):R.each(E,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),E=[]}},invoke:function(i,e,t){var o,a,n,r=u;return e=e||M,t=v||t,"string"==typeof i&&r!==V&&(i=i.split(/[\. ]/),o=i.length-1,R.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(R.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==V)return a=r[n],!1;{if(!R.isPlainObject(r[t])||e==o)return r[t]!==V&&(a=r[t]),!1;r=r[t]}}})),R.isFunction(a)?n=a.apply(t,e):a!==V&&(n=a),Array.isArray(T)?T.push(n):T!==V?T=[T,n]:n!==V&&(T=n),a}};w.initialize()}),T!==V?T:this},R.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,shouldTrim:!0,transition:"scale",duration:200,autoCheckRequired:!1,preventLeaving:!1,errorFocus:!0,dateHandling:"date",onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},onDirty:function(){},onClean:function(){},metadata:{defaultValue:"default",validate:"validate",isDirty:"isDirty"},regExp:{htmlID:/^[a-zA-Z][\w:.-]*$/g,bracket:/\[(.*)\]/i,decimal:/^\d+\.?\d*$/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|:,=@]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{and:"and",unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field",leavingMessage:"There are unsaved changes on this page which will be discarded if you continue."},prompt:{range:"{name} must be in a range from {min} to {max}",maxValue:"{name} must have a maximum value of {ruleValue}",minValue:"{name} must have a minimum value of {ruleValue}",empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} must contain "{ruleValue}"',containExactly:'{name} must contain exactly "{ruleValue}"',doesntContain:'{name} cannot contain "{ruleValue}"',doesntContainExactly:'{name} cannot contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',group:".field",input:'input:not([type="file"])',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",uiCalendar:".ui.calendar"},className:{error:"error",label:"ui basic red pointing prompt label",pressed:"down",success:"success",required:"required",disabled:"disabled"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.",noElement:"This module requires ui {element}"},templates:{error:function(e){var n='<ul class="list">';return R.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"},prompt:function(e){if(1===e.length)return e[0];var n='<ul class="ui list">';return R.each(e,function(e,t){n+="<li>"+t+"</li>"}),n+="</ul>"}},formatter:{date:function(e){return Intl.DateTimeFormat("en-GB").format(e)},datetime:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},time:function(e){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},month:function(e){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(e)},year:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(e)}},rules:{empty:function(e){return!(e===V||""===e||Array.isArray(e)&&0===e.length)},checked:function(){return 0<R(this).filter(":checked").length},email:function(e){return R.fn.form.settings.regExp.email.test(e)},url:function(e){return R.fn.form.settings.regExp.url.test(e)},regExp:function(e,t){if(t instanceof RegExp)return e.match(t);var n,i=t.match(R.fn.form.settings.regExp.flags);return i&&(t=2<=i.length?i[1]:t,n=3<=i.length?i[2]:""),e.match(new RegExp(t,n))},minValue:function(e,t){return R.fn.form.settings.rules.range(e,t+"..","number")},maxValue:function(e,t){return R.fn.form.settings.rules.range(e,".."+t,"number")},integer:function(e,t){return R.fn.form.settings.rules.range(e,t,"integer")},range:function(e,t,n){var i,o;return(n="string"==typeof n?R.fn.form.settings.regExp[n]:n)instanceof RegExp||(n=R.fn.form.settings.regExp.integer),t&&-1===["",".."].indexOf(t)&&(-1==t.indexOf("..")?n.test(t)&&(i=o=+t):(t=t.split("..",2),n.test(t[0])&&(i=+t[0]),n.test(t[1])&&(o=+t[1]))),n.test(e)&&(i===V||i<=e)&&(o===V||e<=o)},decimal:function(e,t){return R.fn.form.settings.rules.range(e,t,"decimal")},number:function(e,t){return R.fn.form.settings.rules.range(e,t,"number")},is:function(e,t){return t="string"==typeof t?t.toLowerCase():t,(e="string"==typeof e?e.toLowerCase():e)==t},isExactly:function(e,t){return e==t},not:function(e,t){return(e="string"==typeof e?e.toLowerCase():e)!=(t="string"==typeof t?t.toLowerCase():t)},notExactly:function(e,t){return e!=t},contains:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t,"i"))},containsExactly:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1!==e.search(new RegExp(t))},doesntContain:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t,"i"))},doesntContainExactly:function(e,t){return t=t.replace(R.fn.form.settings.regExp.escape,"\\$&"),-1===e.search(new RegExp(t))},minLength:function(e,t){return e!==V&&e.length>=t},exactLength:function(e,t){return e!==V&&e.length==t},maxLength:function(e,t){return e!==V&&e.length<=t},match:function(e,t,n){var i,o;return 0<(o=n.find('[data-validate="'+t+'"]')).length||0<(o=n.find("#"+t)).length||0<(o=n.find('[name="'+t+'"]')).length?i=o.val():0<(o=n.find('[name="'+t+'[]"]')).length&&(i=o),i!==V&&e.toString()==i.toString()},different:function(e,t,n){var i,o;return 0<(o=n.find('[data-validate="'+t+'"]')).length||0<(o=n.find("#"+t)).length||0<(o=n.find('[name="'+t+'"]')).length?i=o.val():0<(o=n.find('[name="'+t+'[]"]')).length&&(i=o),i!==V&&e.toString()!==i.toString()},creditCard:function(n,e){var i,o={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},a=!1,e="string"==typeof e&&e.split(",");if("string"==typeof n&&0!==n.length){if(n=n.replace(/[\s\-]/g,""),e&&(R.each(e,function(e,t){(i=o[t])&&(i={length:-1!==R.inArray(n.length,i.length),pattern:-1!==n.search(i.pattern)}).length&&i.pattern&&(a=!0)}),!a))return!1;if((e={number:-1!==R.inArray(n.length,o.unionPay.length),pattern:-1!==n.search(o.unionPay.pattern)}).number&&e.pattern)return!0;for(var t=n.length,r=0,s=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],l=0;t--;)l+=s[r][parseInt(n.charAt(t),10)],r^=1;return l%10==0&&0<l}},minCount:function(e,t){return 0==t||(1==t?""!==e:e.split(",").length>=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document),function(k,T,S){"use strict";k.isFunction=k.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},T=void 0!==T&&T.Math==Math?T:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k.fn.accordion=function(g){var h,v=k(this),b=(new Date).getTime(),y=[],x=g,C="string"==typeof x,w=[].slice.call(arguments,1);return v.each(function(){var e,a=k.isPlainObject(g)?k.extend(!0,{},k.fn.accordion.settings,g):k.extend({},k.fn.accordion.settings),r=a.className,t=a.namespace,s=a.selector,l=a.error,n="."+t,i="module-"+t,o=v.selector||"",c=k(this),u=c.find(s.title),d=c.find(s.content),f=this,m=c.data(i),p={initialize:function(){p.debug("Initializing",c),p.bind.events(),a.observeChanges&&p.observeChanges(),p.instantiate()},instantiate:function(){m=p,c.data(i,p)},destroy:function(){p.debug("Destroying previous instance",c),c.off(n).removeData(i)},refresh:function(){u=c.find(s.title),d=c.find(s.content)},observeChanges:function(){"MutationObserver"in T&&((e=new MutationObserver(function(e){p.debug("DOM tree modified, updating selector cache"),p.refresh()})).observe(f,{childList:!0,subtree:!0}),p.debug("Setting up mutation observer",e))},bind:{events:function(){p.debug("Binding delegated events"),c.on(a.on+n,s.trigger,p.event.click)}},event:{click:function(e){0===k(e.target).closest(s.ignore).length&&p.toggle.call(this)}},toggle:function(e){var e=e!==S?"number"==typeof e?u.eq(e):k(e).closest(s.title):k(this).closest(s.title),t=e.next(d),n=t.hasClass(r.animating),t=t.hasClass(r.active),i=t&&!n,t=!t&&n;p.debug("Toggling visibility of content",e),i||t?a.collapsible?p.close.call(e):p.debug("Cannot close accordion content collapsing is disabled"):p.open.call(e)},open:function(e){var e=e!==S?"number"==typeof e?u.eq(e):k(e).closest(s.title):k(this).closest(s.title),t=e.next(d),n=t.hasClass(r.animating);t.hasClass(r.active)||n?p.debug("Accordion already open, skipping",t):(p.debug("Opening accordion content",e),a.onOpening.call(t),a.onChanging.call(t),a.exclusive&&p.closeOthers.call(e),e.addClass(r.active),t.stop(!0,!0).addClass(r.animating),a.animateChildren&&(k.fn.transition!==S&&c.transition("is supported")?t.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration,skipInlineHidden:!0,onComplete:function(){t.children().removeClass(r.transition)}}):t.children().stop(!0,!0).animate({opacity:1},a.duration,p.resetOpacity)),t.slideDown(a.duration,a.easing,function(){t.removeClass(r.animating).addClass(r.active),p.reset.display.call(this),a.onOpen.call(this),a.onChange.call(this)}))},close:function(e){var e=e!==S?"number"==typeof e?u.eq(e):k(e).closest(s.title):k(this).closest(s.title),t=e.next(d),n=t.hasClass(r.animating),i=t.hasClass(r.active);!i&&!(!i&&n)||i&&n||(p.debug("Closing accordion content",t),a.onClosing.call(t),a.onChanging.call(t),e.removeClass(r.active),t.stop(!0,!0).addClass(r.animating),a.animateChildren&&(k.fn.transition!==S&&c.transition("is supported")?t.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration,skipInlineHidden:!0}):t.children().stop(!0,!0).animate({opacity:0},a.duration,p.resetOpacity)),t.slideUp(a.duration,a.easing,function(){t.removeClass(r.animating).removeClass(r.active),p.reset.display.call(this),a.onClose.call(this),a.onChange.call(this)}))},closeOthers:function(e){var t,e=e!==S?u.eq(e):k(this).closest(s.title),n=e.parents(s.content).prev(s.title),e=e.closest(s.accordion),i=s.title+"."+r.active+":visible",o=s.content+"."+r.active+":visible",o=a.closeNested?(t=e.find(i).not(n)).next(d):(t=e.find(i).not(n),e=e.find(o).find(i).not(n),(t=t.not(e)).next(d));0<t.length&&(p.debug("Exclusive enabled, closing other content",t),t.removeClass(r.active),o.removeClass(r.animating).stop(!0,!0),a.animateChildren&&(k.fn.transition!==S&&c.transition("is supported")?o.children().transition({animation:"fade out",useFailSafe:!0,debug:a.debug,verbose:a.verbose,duration:a.duration,skipInlineHidden:!0}):o.children().stop(!0,!0).animate({opacity:0},a.duration,p.resetOpacity)),o.slideUp(a.duration,a.easing,function(){k(this).removeClass(r.active),p.reset.display.call(this)}))},reset:{display:function(){p.verbose("Removing inline display from element",this),k(this).css("display",""),""===k(this).attr("style")&&k(this).attr("style","").removeAttr("style")},opacity:function(){p.verbose("Removing inline opacity from element",this),k(this).css("opacity",""),""===k(this).attr("style")&&k(this).attr("style","").removeAttr("style")}},setting:function(e,t){if(p.debug("Changing setting",e,t),k.isPlainObject(e))k.extend(!0,a,e);else{if(t===S)return a[e];k.isPlainObject(a[e])?k.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(p.debug("Changing internal",e,t),t===S)return p[e];k.isPlainObject(e)?k.extend(!0,p,e):p[e]=t},debug:function(){!a.silent&&a.debug&&(a.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,a.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),p.verbose.apply(console,arguments)))},error:function(){a.silent||(p.error=Function.prototype.bind.call(console.error,console,a.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,n;a.performance&&(n=(t=(new Date).getTime())-(b||t),b=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var e=a.name+":",n=0;b=!1,clearTimeout(p.performance.timer),k.each(y,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",o&&(e+=" '"+o+"'"),(console.group!==S||console.table!==S)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):k.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||w,t=f||t,"string"==typeof i&&r!==S&&(i=i.split(/[\. ]/),o=i.length-1,k.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(k.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==S)return a=r[n],!1;{if(!k.isPlainObject(r[t])||e==o)return r[t]!==S?a=r[t]:p.error(l.method,i),!1;r=r[t]}}})),k.isFunction(a)?n=a.apply(t,e):a!==S&&(n=a),Array.isArray(h)?h.push(n):h!==S?h=[h,n]:n!==S&&(h=n),a}};C?(m===S&&p.initialize(),p.invoke(x)):(m!==S&&m.invoke("destroy"),p.initialize())}),h!==S?h:this},k.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating",transition:"transition"},selector:{accordion:".accordion",title:".title",trigger:".title",ignore:".ui.dropdown",content:".content"}},k.extend(k.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,void document),function(oe,S,D,ae){"use strict";oe.isFunction=oe.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},S=void 0!==S&&S.Math==Math?S:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),oe.fn.calendar=function(h){var v,e=oe(this),b=e.selector||"",y=(new Date).getTime(),x=[],C=h,w="string"==typeof C,k=[].slice.call(arguments,1),T={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},ie=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var d,e,X=oe.isPlainObject(h)?oe.extend(!0,{},oe.fn.calendar.settings,h):oe.extend({},oe.fn.calendar.settings),G=X.className,t=X.namespace,n=X.selector,J=X.formatter,i=X.parser,Z=X.metadata,_=T[X.minTimeGap],s=X.error,o="."+t,a="module-"+t,r=oe(this),l=r.find(n.input),ee=r.find(n.popup),c=r.find(n.activator),u=this,f=r.data(a),m=!1,te=r.hasClass(G.inverted),p=!1,g=!1,ne={initialize:function(){ne.debug("Initializing calendar for",u,r),d=ne.get.isTouch(),ne.setup.config(),ne.setup.popup(),ne.setup.inline(),ne.setup.input(),ne.setup.date(),ne.create.calendar(),ne.bind.events(),ne.observeChanges(),ne.instantiate()},instantiate:function(){ne.verbose("Storing instance of calendar"),f=ne,r.data(a,f)},destroy:function(){ne.verbose("Destroying previous calendar for",u),r.removeData(a),ne.unbind.events(),ne.disconnect.classObserver()},setup:{config:function(){null!==ne.get.minDate()&&ne.set.minDate(r.data(Z.minDate)),null!==ne.get.maxDate()&&ne.set.maxDate(r.data(Z.maxDate)),ne.setting("type",ne.get.type()),ne.setting("on",X.on||"click")},popup:function(){var e,t;X.inline||(c.length||(c=r.children().first()).length)&&(oe.fn.popup===ae?ne.error(s.popup):(ee.length||(e=0!==(t=c.parent()).closest(n.append).length?"appendTo":"prependTo",ee=oe("<div/>").addClass(G.popup)[e](t)),ee.addClass(G.calendar),te&&ee.addClass(G.inverted),e=function(){return ne.refreshTooltips(),X.onVisible.apply(ee,arguments)},l.length||(ee.attr("tabindex","0"),e=function(){return ne.refreshTooltips(),ne.focus(),X.onVisible.apply(ee,arguments)}),t=ne.setting("on"),t=oe.extend({},X.popupOptions,{popup:ee,on:t,hoverable:"hover"===t,closable:"click"===t,onShow:function(){return ne.set.focusDate(ne.get.date()),ne.set.mode(ne.get.validatedMode(X.startMode)),X.onShow.apply(ee,arguments)},onVisible:e,onHide:X.onHide,onHidden:function(){return ne.blur(),X.onHidden.apply(ee,arguments)}}),ne.popup(t)))},inline:function(){c.length&&!X.inline||(X.inline=!0,ee=oe("<div/>").addClass(G.calendar).appendTo(r),l.length||ee.attr("tabindex","0"))},input:function(){X.touchReadonly&&l.length&&d&&l.prop("readonly",!0),ne.check.disabled()},date:function(){var e;X.initialDate?e=i.date(X.initialDate,X):r.data(Z.date)!==ae?e=i.date(r.data(Z.date),X):l.length&&(e=i.date(l.val(),X)),ne.set.date(e,X.formatInput,!1),ne.set.mode(ne.get.mode(),!1)}},trigger:{change:function(){var e,t=l[0];t&&(e=D.createEvent("HTMLEvents"),ne.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{calendar:function(){var e,t,V,n=ne.get.mode(),i=new Date,L=ne.get.date(),o=ne.get.focusDate(),a=ne.helper.dateInRange(o||L||X.initialDate||i),r=(o||ne.set.focusDate(o=a,!1,!1),"year"===n),s="month"===n,l="day"===n,c="hour"===n,u="minute"===n,q="time"===X.type,N=Math.max(X.multiMonth,1),z=l?ne.get.monthOffset():0,d=a.getMinutes(),f=a.getHours(),m=a.getDate(),H=a.getMonth()+z,p=a.getFullYear(),g=l?X.showWeekNumbers?8:7:c?4:_.column,U=l||c?6:_.row,h=l?N:1,v=(b=ee).hasClass("left")?"right center":"left center";for(b.empty(),1<h&&(V=oe("<div/>").addClass(G.grid).appendTo(b)),t=0;t<h;t++){1<h&&(b=oe("<div/>").addClass(G.column).appendTo(V));var b,y=H+t,B=(new Date(p,y,1).getDay()-X.firstDayOfWeek%7+7)%7,x=(!X.constantHeight&&l&&(x=new Date(p,y+1,0).getDate()+B,U=Math.ceil(x/7)),r?10:s?1:0),C=l?1:0,w=c||u?1:0,k=c||u?m:1,T=new Date(p-x,y-C,k-w,f),C=new Date(p+x,y+C,k+w,f),k=r?new Date(10*Math.ceil(p/10)-9,0,0):s?new Date(p,0,0):l?new Date(p,y,0):new Date(p,y,m,-1),w=r?new Date(10*Math.ceil(p/10)+1,0,1):s?new Date(p+1,0,1):l?new Date(p,y+1,1):new Date(p,y,m+1),S=n,S=(l&&X.showWeekNumbers&&(S+=" andweek"),oe("<table/>").addClass(G.table).addClass(S).addClass(ie[g]+" column").appendTo(b)),Y=(te&&S.addClass(G.inverted),g);if(!q){var W=oe("<thead/>").appendTo(S),D=oe("<tr/>").appendTo(W),A=oe("<th/>").attr("colspan",""+g).appendTo(D),E=r||s?new Date(p,0,1):l?new Date(p,y,1):new Date(p,y,m,f,d),F=oe("<span/>").addClass(G.link).appendTo(A),E=(F.text(ne.helper.dateFormat(J[n+"Header"],E)),s?X.disableYear?"day":"year":l?X.disableMonth?"year":"month":"day");if(F.data(Z.mode,E),0===t&&((F=oe("<span/>").addClass(G.prev).appendTo(A)).data(Z.focusDate,T),F.toggleClass(G.disabledCell,!ne.helper.isDateInRange(k,n)),oe("<i/>").addClass(G.prevIcon).appendTo(F)),t===h-1&&((E=oe("<span/>").addClass(G.next).appendTo(A)).data(Z.focusDate,C),E.toggleClass(G.disabledCell,!ne.helper.isDateInRange(w,n)),oe("<i/>").addClass(G.nextIcon).appendTo(E)),l)for(D=oe("<tr/>").appendTo(W),X.showWeekNumbers&&((A=oe("<th/>").appendTo(D)).text(X.text.weekNo),A.addClass(G.weekCell),Y--),O=0;O<Y;O++)(A=oe("<th/>").appendTo(D)).text(J.dayColumnHeader((O+X.firstDayOfWeek)%7,X))}for(var Q=oe("<tbody/>").appendTo(S),O=r?10*Math.ceil(p/10)-9:l?1-B:0,K=0;K<U;K++)for(D=oe("<tr/>").appendTo(Q),l&&X.showWeekNumbers&&((A=oe("<th/>").appendTo(D)).text(ne.get.weekOfYear(p,y,O+1-X.firstDayOfWeek)),A.addClass(G.weekCell)),e=0;e<Y;e++,O++){var P,M=r?new Date(O,y,1,f,d):s?new Date(p,O,1,f,d):l?new Date(p,y,O,f,d):c?new Date(p,y,m,O):new Date(p,y,m,f,O*X.minTimeGap),R=r?O:s?X.text.monthsShort[O]:l?M.getDate():ne.helper.dateFormat(J.cellTime,M),R=((A=oe("<td/>").addClass(G.cell).appendTo(D)).text(R),A.data(Z.date,M),l&&M.getMonth()!==(y+12)%12),I=!X.selectAdjacentDays&&R||!ne.helper.isDateInRange(M,n)||X.isDisabled(M,n)||ne.helper.isDisabled(M,n)||!ne.helper.isEnabled(M,n),j=(I?(null!==(j=ne.helper.findDayAsObject(M,n,X.disabledDates))&&j[Z.message]&&(A.attr("data-tooltip",j[Z.message]),A.attr("data-position",j[Z.position]||v),(j[Z.inverted]||te&&j[Z.inverted]===ae)&&A.attr("data-inverted",""),j[Z.variation]&&A.attr("data-variation",j[Z.variation])),"hour"===n&&null!==(j=ne.helper.findHourAsObject(M,n,X.disabledHours))&&j[Z.message]&&(A.attr("data-tooltip",j[Z.message]),A.attr("data-position",j[Z.position]||v),(j[Z.inverted]||te&&j[Z.inverted]===ae)&&A.attr("data-inverted",""),j[Z.variation]&&A.attr("data-variation",j[Z.variation]))):null!==(P=ne.helper.findDayAsObject(M,n,X.eventDates))&&(A.addClass(P[Z.class]||X.eventClass),P[Z.message]&&(A.attr("data-tooltip",P[Z.message]),A.attr("data-position",P[Z.position]||v),(P[Z.inverted]||te&&P[Z.inverted]===ae)&&A.attr("data-inverted",""),P[Z.variation]&&A.attr("data-variation",P[Z.variation]))),ne.helper.dateEqual(M,L,n)),$=ne.helper.dateEqual(M,i,n),R=(A.toggleClass(G.adjacentCell,R&&!P),A.toggleClass(G.disabledCell,I),A.toggleClass(G.activeCell,j&&!(R&&I)),c||u||A.toggleClass(G.todayCell,!R&&$),{mode:n,adjacent:R,disabled:I,active:j,today:$});J.cell(A,M,R),ne.helper.dateEqual(M,o,n)&&ne.set.focusDate(M,!1,!1)}X.today&&(T=oe("<tr/>").appendTo(Q),(k=oe("<td/>").attr("colspan",""+g).addClass(G.today).appendTo(T)).text(J.today(X)),k.data(Z.date,i)),ne.update.focus(!1,S),X.inline&&ne.refreshTooltips()}}},update:{focus:function(e,t){t=t||ee;var r=ne.get.mode(),n=ne.get.date(),s=ne.get.focusDate(),l=ne.get.startDate(),c=ne.get.endDate(),u=(e?s:null)||n||(d?null:s);t.find("td").each(function(){var e,t,n,i,o=oe(this),a=o.data(Z.date);a&&(e=o.hasClass(G.disabledCell),t=o.hasClass(G.activeCell),n=o.hasClass(G.adjacentCell),i=ne.helper.dateEqual(a,s,r),a=!!u&&(!!l&&ne.helper.isDateInRange(a,r,l,u)||!!c&&ne.helper.isDateInRange(a,r,u,c)),o.toggleClass(G.focusCell,i&&(!d||m)&&(!n||X.selectAdjacentDays&&n)&&!e),ne.helper.isTodayButton(o)||o.toggleClass(G.rangeCell,a&&!t&&!e))})}},refresh:function(){ne.create.calendar()},refreshTooltips:function(){var i=oe(S).width();ee.find("td[data-position]").each(function(){var e=oe(this),t=S.getComputedStyle(e[0],"::after").width.replace(/[^0-9\.]/g,""),n=e.attr("data-position"),t=i-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===n.indexOf(t)&&e.attr("data-position",n.replace(/(left|right)/,t))})},bind:{events:function(){ne.debug("Binding events"),ee.on("mousedown"+o,ne.event.mousedown),ee.on("touchstart"+o,ne.event.mousedown),ee.on("mouseup"+o,ne.event.mouseup),ee.on("touchend"+o,ne.event.mouseup),ee.on("mouseover"+o,ne.event.mouseover),l.length?(l.on("input"+o,ne.event.inputChange),l.on("focus"+o,ne.event.inputFocus),l.on("blur"+o,ne.event.inputBlur),l.on("keydown"+o,ne.event.keydown)):ee.on("keydown"+o,ne.event.keydown)}},unbind:{events:function(){ne.debug("Unbinding events"),ee.off(o),l.length&&l.off(o)}},event:{mouseover:function(e){var t=oe(e.target).data(Z.date),e=1===e.buttons;t&&ne.set.focusDate(t,!1,!0,e)},mousedown:function(e){l.length&&e.preventDefault(),m=0<=e.type.indexOf("touch");e=oe(e.target).data(Z.date);e&&ne.set.focusDate(e,!1,!0,!0)},mouseup:function(e){ne.focus(),e.preventDefault(),e.stopPropagation(),m=!1;var t,n,i,e=oe(e.target);e.hasClass("disabled")||(t=(e=(t=e.parent()).data(Z.date)||t.data(Z.focusDate)||t.data(Z.mode)?t:e).data(Z.date),n=e.data(Z.focusDate),i=e.data(Z.mode),t&&!1!==X.onSelect.call(u,t,ne.get.mode())?(e=e.hasClass(G.today),ne.selectDate(t,e)):n?ne.set.focusDate(n):i&&ne.set.mode(i))},keydown:function(e){var t,n,i,o,a,r,s,l=e.which;27!==l&&9!==l||ne.popup("hide"),ne.popup("is visible")&&(37===l||38===l||39===l||40===l?(o="day"===(r=ne.get.mode())?7:"hour"===r?4:"minute"===r?_.column:3,o=37===l?-1:38===l?-o:39==l?1:o,o*="minute"===r?X.minTimeGap:1,a=(t=ne.get.focusDate()||ne.get.date()||new Date).getFullYear()+("year"===r?o:0),s=t.getMonth()+("month"===r?o:0),n=t.getDate()+("day"===r?o:0),i=t.getHours()+("hour"===r?o:0),o=t.getMinutes()+("minute"===r?o:0),a=new Date(a,s,n,i,o),"time"===X.type&&(a=ne.helper.mergeDateTime(t,a)),ne.helper.isDateInRange(a,r)&&ne.set.focusDate(a)):13===l&&(r=ne.get.mode(),(s=ne.get.focusDate())&&!X.isDisabled(s,r)&&!ne.helper.isDisabled(s,r)&&ne.helper.isEnabled(s,r)&&!1!==X.onSelect.call(u,s,ne.get.mode())&&ne.selectDate(s),e.preventDefault(),e.stopPropagation())),38!==l&&40!==l||(e.preventDefault(),ne.popup("show"))},inputChange:function(){var e=l.val(),e=i.date(e,X);ne.set.date(e,!1)},inputFocus:function(){ee.addClass(G.active)},inputBlur:function(){var e;ee.removeClass(G.active),X.formatInput&&(e=ne.get.date(),e=ne.helper.dateFormat(J[X.type],e),l.val(e)),g&&(ne.trigger.change(),g=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ne.check.disabled()})}}},observeChanges:function(){"MutationObserver"in S&&(e=new MutationObserver(ne.event.class.mutation),ne.debug("Setting up mutation observer",e),ne.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(r[0],{attributes:!0})}},is:{disabled:function(){return r.hasClass(G.disabled)}},check:{disabled:function(){l.attr("tabindex",ne.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,n){return e=Date.UTC(e,t,n+3)/864e5,e=Math.floor(e/7),t=new Date(6048e5*e).getUTCFullYear(),e-Math.floor(Date.UTC(t,0,7)/6048e5)+1},formattedDate:function(e,t){return ne.helper.dateFormat(e||J[X.type],t||ne.get.date())},date:function(){return ne.helper.sanitiseDate(r.data(Z.date))||null},inputDate:function(){return l.val()},focusDate:function(){return r.data(Z.focusDate)||null},startDate:function(){var e=ne.get.calendarModule(X.startCalendar);return(e?e.get.date():r.data(Z.startDate))||null},endDate:function(){var e=ne.get.calendarModule(X.endCalendar);return(e?e.get.date():r.data(Z.endDate))||null},minDate:function(){return r.data(Z.minDate)||null},maxDate:function(){return r.data(Z.maxDate)||null},monthOffset:function(){return r.data(Z.monthOffset)||X.monthOffset||0},mode:function(){var e=r.data(Z.mode)||X.startMode;return ne.get.validatedMode(e)},validatedMode:function(e){var t=ne.get.validModes();return 0<=oe.inArray(e,t)?e:"time"===X.type?"hour":"month"===X.type?"month":"year"===X.type?"year":"day"},type:function(){return r.data(Z.type)||X.type},validModes:function(){var e=[];return"time"!==X.type&&(X.disableYear&&"year"!==X.type||e.push("year"),(X.disableMonth||"year"===X.type)&&"month"!==X.type||e.push("month"),0<=X.type.indexOf("date")&&e.push("day")),0<=X.type.indexOf("time")&&(e.push("hour"),X.disableMinute||e.push("minute")),e},isTouch:function(){try{return D.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e=e instanceof oe?e:oe(D).find(e).first()).data(a):null}},set:{date:function(e,t,n){t=!1!==t,n=!1!==n,e=ne.helper.sanitiseDate(e),e=ne.helper.dateInRange(e);var i=ne.get.mode(),o=ne.helper.dateFormat(J[X.type],e);if(n&&!1===X.onBeforeChange.call(u,e,o,i))return!1;if(ne.set.focusDate(e),X.isDisabled(e,i))return!1;var a=ne.get.endDate();a&&e&&a<e&&ne.set.endDate(ae),ne.set.dataKeyValue(Z.date,e),t&&l.length&&l.val(o),n&&X.onChange.call(u,e,o,i)},startDate:function(e,t){e=ne.helper.sanitiseDate(e);var n=ne.get.calendarModule(X.startCalendar);n&&n.set.date(e),ne.set.dataKeyValue(Z.startDate,e,t)},endDate:function(e,t){e=ne.helper.sanitiseDate(e);var n=ne.get.calendarModule(X.endCalendar);n&&n.set.date(e),ne.set.dataKeyValue(Z.endDate,e,t)},focusDate:function(e,t,n,i){e=ne.helper.sanitiseDate(e),e=ne.helper.dateInRange(e);var o="day"===ne.get.mode(),a=ne.get.focusDate(),o=(o&&e&&a&&((o=12*(e.getFullYear()-a.getFullYear())+e.getMonth()-a.getMonth())&&(a=ne.get.monthOffset()-o,ne.set.monthOffset(a,!1))),ne.set.dataKeyValue(Z.focusDate,e,!!e&&t));n=!1!==n&&o&&!1===t||p!=i,p=i,n&&ne.update.focus(i)},minDate:function(e){e=ne.helper.sanitiseDate(e),null!==X.maxDate&&X.maxDate<=e?ne.verbose("Unable to set minDate variable bigger that maxDate variable",e,X.maxDate):(ne.setting("minDate",e),ne.set.dataKeyValue(Z.minDate,e))},maxDate:function(e){e=ne.helper.sanitiseDate(e),null!==X.minDate&&X.minDate>=e?ne.verbose("Unable to set maxDate variable lower that minDate variable",e,X.minDate):(ne.setting("maxDate",e),ne.set.dataKeyValue(Z.maxDate,e))},monthOffset:function(e,t){var n=Math.max(X.multiMonth,1);e=Math.max(1-n,Math.min(0,e)),ne.set.dataKeyValue(Z.monthOffset,e,t)},mode:function(e,t){ne.set.dataKeyValue(Z.mode,e,t)},dataKeyValue:function(e,t,n){var i=r.data(e),i=i===t||i<=t&&t<=i;return t?r.data(e,t):r.removeData(e),(n=!1!==n&&!i)&&ne.refresh(),!i}},selectDate:function(e,t){ne.verbose("New date selection",e);var n=ne.get.mode();t||"minute"===n||X.disableMinute&&"hour"===n||"date"===X.type&&"day"===n||"month"===X.type&&"month"===n||"year"===X.type&&"year"===n?!1!==ne.set.date(e)&&(g=!0,X.closable&&(ne.popup("hide"),(t=ne.get.calendarModule(X.endCalendar))&&(t.refresh(),"focus"!==t.setting("on")&&t.popup("show"),t.focus()))):(t="year"===n?X.disableMonth?"day":"month":"month"===n?"day":"day"===n?"hour":"minute",ne.set.mode(t),"hour"===n||"day"===n&&ne.get.date()?ne.set.date(e,!0,!1):ne.set.focusDate(e))},changeDate:function(e){ne.set.date(e)},clear:function(){ne.set.date(ae)},popup:function(){return c.popup.apply(c,arguments)},focus:function(){(l.length?l:ee).focus()},blur:function(){(l.length?l:ee).blur()},helper:{dateFormat:function(e,t){if(!(t instanceof Date))return"";if("function"==typeof e)return e.call(ne,t,X);var n=t.getDate(),i=t.getMonth(),o=t.getFullYear(),a=t.getDay(),r=t.getHours(),s=t.getMinutes(),t=t.getSeconds(),l=ne.get.weekOfYear(o,i,n+1-X.firstDayOfWeek),c=r%12||12,u=(r<12?X.text.am:X.text.pm).toLowerCase(),d={D:n,DD:("0"+n).slice(-2),M:i+1,MM:("0"+(i+1)).slice(-2),MMM:X.text.monthsShort[i],MMMM:X.text.months[i],Y:o,YY:String(o).slice(2),YYYY:o,d:a,dd:X.text.dayNamesShort[a].slice(0,2),ddd:X.text.dayNamesShort[a],dddd:X.text.dayNames[a],h:c,hh:("0"+c).slice(-2),H:r,HH:("0"+r).slice(-2),m:s,mm:("0"+s).slice(-2),s:t,ss:("0"+t).slice(-2),a:u,A:u.toUpperCase(),S:["th","st","nd","rd"][3<n%10?0:(n%100-n%10!=10)*n%10],w:l,ww:("0"+l).slice(-2)};return e.replace(X.regExp.token,function(e){return e in d?d[e]:e.slice(1,e.length-1)})},isDisabled:function(n,i){return("day"===i||"month"===i||"year"===i||"hour"===i)&&("day"===i&&-1!==X.disabledDaysOfWeek.indexOf(n.getDay())||X.disabledDates.some(function(e){return(e="string"==typeof e?ne.helper.sanitiseDate(e):e)instanceof Date?ne.helper.dateEqual(n,e,i):null!==e&&"object"==typeof e?e[Z.year]?"number"==typeof e[Z.year]?n.getFullYear()==e[Z.year]:Array.isArray(e[Z.year])?-1<e[Z.year].indexOf(n.getFullYear()):void 0:e[Z.month]?"number"==typeof e[Z.month]?n.getMonth()==e[Z.month]:Array.isArray(e[Z.month])?-1<e[Z.month].indexOf(n.getMonth()):e[Z.month]instanceof Date?(t=ne.helper.sanitiseDate(e[Z.month]),n.getMonth()==t.getMonth()&&n.getFullYear()==t.getFullYear()):void 0:e[Z.date]&&"day"===i?e[Z.date]instanceof Date?ne.helper.dateEqual(n,ne.helper.sanitiseDate(e[Z.date]),i):Array.isArray(e[Z.date])?e[Z.date].some(function(e){return ne.helper.dateEqual(n,e,i)}):void 0:void 0:void 0;var t})||"hour"===i&&X.disabledHours.some(function(e){if((e="string"==typeof e?ne.helper.sanitiseDate(e):e)instanceof Date)return ne.helper.dateEqual(n,e,i);if("number"==typeof e)return n.getHours()===e;if(null!==e&&"object"==typeof e){var t=!0;if(e[Z.date])if(e[Z.date]instanceof Date)t=ne.helper.dateEqual(n,ne.helper.sanitiseDate(e[Z.date]));else if(Array.isArray(e[Z.date]))return e[Z.date].some(function(e){t=ne.helper.dateEqual(n,e,i)});if(e[Z.days]&&("number"==typeof e[Z.days]?t=n.getDay()==e[Z.days]:Array.isArray(e[Z.days])&&(t=-1<e[Z.days].indexOf(n.getDay()))),e[Z.hours])return"number"==typeof e[Z.hours]?t&&n.getHours()==e[Z.hours]:Array.isArray(e[Z.hours])?t&&-1<e[Z.hours].indexOf(n.getHours()):void 0}}))},isEnabled:function(t,n){return"day"!==n||(0===X.enabledDates.length||X.enabledDates.some(function(e){return(e="string"==typeof e?ne.helper.sanitiseDate(e):e)instanceof Date?ne.helper.dateEqual(t,e,n):null!==e&&"object"==typeof e&&e[Z.date]?ne.helper.dateEqual(t,ne.helper.sanitiseDate(e[Z.date]),n):void 0}))},findDayAsObject:function(t,n,e){if("day"===n||"month"===n||"year"===n)for(var i,o=0;o<e.length;o++){if((i="string"==typeof(i=e[o])?ne.helper.sanitiseDate(i):i)instanceof Date&&ne.helper.dateEqual(t,i,n))return(a={})[Z.date]=i,a;if(null!==i&&"object"==typeof i)if(i[Z.year]){if("number"==typeof i[Z.year]&&t.getFullYear()==i[Z.year])return i;if(Array.isArray(i[Z.year])&&-1<i[Z.year].indexOf(t.getFullYear()))return i}else if(i[Z.month]){if("number"==typeof i[Z.month]&&t.getMonth()==i[Z.month])return i;if(Array.isArray(i[Z.month])){if(-1<i[Z.month].indexOf(t.getMonth()))return i}else if(i[Z.month]instanceof Date){var a=ne.helper.sanitiseDate(i[Z.month]);if(t.getMonth()==a.getMonth()&&t.getFullYear()==a.getFullYear())return i}}else if(i[Z.date]&&"day"===n){if(i[Z.date]instanceof Date&&ne.helper.dateEqual(t,ne.helper.sanitiseDate(i[Z.date]),n))return i;if(Array.isArray(i[Z.date])&&i[Z.date].some(function(e){return ne.helper.dateEqual(t,e,n)}))return i}}return null},findHourAsObject:function(t,n,e){if("hour"===n)for(var i,o=function(e,t){if(t[Z.hours])return"number"==typeof t[Z.hours]&&e.getHours()==t[Z.hours]||Array.isArray(t[Z.hours])&&-1<t[Z.hours].indexOf(e.getHours())?t:void 0},a=0;a<e.length;a++){if("number"==typeof(i=e[a])&&t.getHours()==i)return null;if(null!==i&&"object"==typeof i)if(i[Z.days]&&o(t,i)){if("number"==typeof i[Z.days]&&t.getDay()==i[Z.days])return i;if(Array.isArray(i[Z.days])&&-1<i[Z.days].indexOf(t.getDay()))return i}else if(i[Z.date]&&o(t,i)){if(i[Z.date]instanceof Date&&ne.helper.dateEqual(t,ne.helper.sanitiseDate(i[Z.date])))return i;if(Array.isArray(i[Z.date])&&i[Z.date].some(function(e){return ne.helper.dateEqual(t,e,n)}))return i}else if(o(t,i))return i}return null},sanitiseDate:function(e){return!(e=e instanceof Date?e:i.date(""+e,X))||isNaN(e.getTime())?null:e},dateDiff:function(e,t,n){var i="time"===X.type,o="year"===(n=n||"day"),a=o||"month"===n,r="minute"===n,n=r||"hour"===n;return e=new Date(i?2e3:e.getFullYear(),i||o?0:e.getMonth(),i||a?1:e.getDate(),n?e.getHours():0,r?X.minTimeGap*Math.floor(e.getMinutes()/X.minTimeGap):0),(t=new Date(i?2e3:t.getFullYear(),i||o?0:t.getMonth(),i||a?1:t.getDate(),n?t.getHours():0,r?X.minTimeGap*Math.floor(t.getMinutes()/X.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,n){return!!e&&!!t&&0===ne.helper.dateDiff(e,t,n)},isDateInRange:function(e,t,n,i){var o;return n||i||(n=(o=ne.get.startDate())&&X.minDate?new Date(Math.max(o,X.minDate)):o||X.minDate,i=X.maxDate),n=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),X.minTimeGap*Math.ceil(n.getMinutes()/X.minTimeGap)),!(!e||n&&0<ne.helper.dateDiff(e,n,t)||i&&0<ne.helper.dateDiff(i,e,t))},dateInRange:function(e,t,n){t||n||(t=(i=ne.get.startDate())&&X.minDate?new Date(Math.max(i,X.minDate)):i||X.minDate,n=X.maxDate),t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),X.minTimeGap*Math.ceil(t.getMinutes()/X.minTimeGap));var i="time"===X.type;return e&&(t&&0<ne.helper.dateDiff(e,t,"minute")?i?ne.helper.mergeDateTime(e,t):t:n&&0<ne.helper.dateDiff(n,e,"minute")?i?ne.helper.mergeDateTime(e,n):n:e)},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t},isTodayButton:function(e){return e.text()===X.text.today}},setting:function(e,t){if(ne.debug("Changing setting",e,t),oe.isPlainObject(e))oe.extend(!0,X,e);else{if(t===ae)return X[e];oe.isPlainObject(X[e])?oe.extend(!0,X[e],t):X[e]=t}},internal:function(e,t){if(oe.isPlainObject(e))oe.extend(!0,ne,e);else{if(t===ae)return ne[e];ne[e]=t}},debug:function(){!X.silent&&X.debug&&(X.performance?ne.performance.log(arguments):(ne.debug=Function.prototype.bind.call(console.info,console,X.name+":"),ne.debug.apply(console,arguments)))},verbose:function(){!X.silent&&X.verbose&&X.debug&&(X.performance?ne.performance.log(arguments):(ne.verbose=Function.prototype.bind.call(console.info,console,X.name+":"),ne.verbose.apply(console,arguments)))},error:function(){X.silent||(ne.error=Function.prototype.bind.call(console.error,console,X.name+":"),ne.error.apply(console,arguments))},performance:{log:function(e){var t,n;X.performance&&(n=(t=(new Date).getTime())-(y||t),y=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":n})),clearTimeout(ne.performance.timer),ne.performance.timer=setTimeout(ne.performance.display,500)},display:function(){var e=X.name+":",n=0;y=!1,clearTimeout(ne.performance.timer),oe.each(x,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",b&&(e+=" '"+b+"'"),(console.group!==ae||console.table!==ae)&&0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):oe.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(i,e,t){var o,a,n,r=f;return e=e||k,t=u||t,"string"==typeof i&&r!==ae&&(i=i.split(/[\. ]/),o=i.length-1,oe.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(oe.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==ae)return a=r[n],!1;{if(!oe.isPlainObject(r[t])||e==o)return r[t]!==ae?a=r[t]:ne.error(s.method,i),!1;r=r[t]}}})),oe.isFunction(a)?n=a.apply(t,e):a!==ae&&(n=a),Array.isArray(v)?v.push(n):v!==ae?v=[v,n]:n!==ae&&(v=n),a}};w?(f===ae&&ne.initialize(),ne.invoke(C)):(f!==ae&&f.invoke("destroy"),ne.initialize())}),v!==ae?v:this},oe.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,monthOffset:0,minTimeGap:5,showWeekNumbers:!1,disabledHours:[],disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",observeChanges:!1,hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{yearHeader:function(e,t){e=10*Math.ceil(e.getFullYear()/10);return e-9+" - "+(2+e)},monthHeader:"YYYY",dayHeader:"MMMM YYYY",hourHeader:"MMMM D, YYYY",minuteHeader:"MMMM D, YYYY",dayColumnHeader:function(e,t){return t.text.days[e]},datetime:"MMMM D, YYYY h:mm A",date:"MMMM D, YYYY",time:"h:mm A",cellTime:"h:mm A",month:"MMMM YYYY",year:"YYYY",today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,n){}},parser:{date:function(e,t){if(e instanceof Date)return e;if(!e)return null;if(0===(e=String(e).trim().replace(/([.:\/\-])\s+/g,"$1").replace(/\s+([.:\/-])/g,"$1").replace(/\s+/g," ")).length)return null;e.match(/^[0-9]{4}[\/\-\.][0-9]{1,2}[\/\-\.][0-9]{1,2}$/)&&(e=e.replace(/[\/\-\.]/g,"/")+" 00:00:00"),e=t.monthFirst||!e.match(/^[0-9]{1,2}[\/\-\.]/)?e:e.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var n,i,o,a=new Date(e);if(!(null!==e.match(/^[0-9]+$/))&&!isNaN(a.getDate()))return a;e=e.toLowerCase();var r,s,l,c=-1,u=-1,d=-1,f=-1,m=-1,a=ae,p="time"===t.type,g=t.type.indexOf("time")<0,h=e.split(t.regExp.dateWords),v=e.split(t.regExp.dateNumbers);if(!g)for(a=0<=oe.inArray(t.text.am.toLowerCase(),h)||!(0<=oe.inArray(t.text.pm.toLowerCase(),h))&&ae,n=0;n<v.length;n++)if(0<=(s=v[n]).indexOf(":")){if(u<0||c<0)for(l=s.split(":"),o=0;o<Math.min(2,l.length);o++)i=parseInt(l[o]),isNaN(i)&&(i=0),0===o?u=i%24:c=i%60;v.splice(n,1)}if(!p){for(n=0;n<h.length;n++)if(!((r=h[n]).length<=0)){for(i=0;i<t.text.months.length;i++)if(t.text.months[i].substring(0,r.length).toLowerCase()===r){f=i+1;break}if(0<=f)break}for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&i>=t.centuryBreak&&n===v.length-1){i<=99&&(i+=t.currentCentury-100),m=i,v.splice(n,1);break}if(f<0)for(n=0;n<v.length;n++)if(o=1<n||t.monthFirst?n:1===n?0:1,i=parseInt(v[o]),!isNaN(i)&&1<=i&&i<=12){f=i,v.splice(o,1);break}for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&1<=i&&i<=31){d=i,v.splice(n,1);break}if(m<0)for(n=v.length-1;0<=n;n--)if(i=parseInt(v[n]),!isNaN(i)){i<=99&&(i+=t.currentCentury),m=i,v.splice(n,1);break}}if(!g){if(u<0)for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&0<=i&&i<=23){u=i,v.splice(n,1);break}if(c<0)for(n=0;n<v.length;n++)if(i=parseInt(v[n]),!isNaN(i)&&0<=i&&i<=59){c=i,v.splice(n,1);break}}if(c<0&&u<0&&d<0&&f<0&&m<0)return null;c<0&&(c=0),u<0&&(u=0),d<0&&(d=1),f<0&&(f=1),m<0&&(m=(new Date).getFullYear()),a!==ae&&(a?12===u&&(u=0):u<12&&(u+=12));e=new Date(m,f-1,d,u,c);return e.getMonth()===f-1&&e.getFullYear()===m||(e=new Date(m,f,0,u,c)),isNaN(e.getTime())?null:e}},onBeforeChange:function(e,t,n){return!0},onChange:function(e,t,n){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(e,t){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g,token:/d{1,4}|D{1,2}|M{1,4}|YY(?:YY)?|([Hhmsw])\1?|[SAaY]|"[^"]*"|'[^']*'/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",inverted:"inverted",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link",disabled:"disabled"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",inverted:"inverted",variation:"variation",position:"position",month:"month",year:"year",hours:"hours",days:"days"},eventClass:"blue"}}(jQuery,window,document),function(S,D,A,E){"use strict";S.isFunction=S.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},D=void 0!==D&&D.Math==Math?D:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),S.fn.checkbox=function(u){var d,e=S(this),f=e.selector||"",x=(new Date).getTime(),C=[],w=u,k="string"==typeof w,T=[].slice.call(arguments,1);return e.each(function(){var e,m=S.extend(!0,{},S.fn.checkbox.settings,u),t=m.className,n=m.namespace,p=m.selector,s=m.error,i="."+n,o="module-"+n,g=S(this),a=S(this).children(p.label),h=S(this).children(p.input),v=h[0],r=!1,b=!1,l=g.data(o),c=this,y={initialize:function(){y.verbose("Initializing checkbox",m),y.create.label(),y.bind.events(),y.set.tabbable(),y.hide.input(),y.observeChanges(),y.instantiate(),y.setup()},instantiate:function(){y.verbose("Storing instance of module",y),l=y,g.data(o,y)},destroy:function(){y.verbose("Destroying module"),y.unbind.events(),y.show.input(),g.removeData(o)},fix:{reference:function(){g.is(p.input)&&(y.debug("Behavior called on <input> adjusting invoked element"),g=g.closest(p.checkbox),y.refresh())}},setup:function(){y.set.initialLoad(),y.is.indeterminate()?(y.debug("Initial value is indeterminate"),y.indeterminate()):y.is.checked()?(y.debug("Initial value is checked"),y.check()):(y.debug("Initial value is unchecked"),y.uncheck()),y.remove.initialLoad()},refresh:function(){a=g.children(p.label),h=g.children(p.input),v=h[0]},hide:{input:function(){y.verbose("Modifying <input> z-index to be unselectable"),h.addClass(t.hidden)}},show:{input:function(){y.verbose("Modifying <input> z-index to be selectable"),h.removeClass(t.hidden)}},observeChanges:function(){"MutationObserver"in D&&((e=new MutationObserver(function(e){y.debug("DOM tree modified, updating selector cache"),y.refresh()})).observe(c,{childList:!0,subtree:!0}),y.debug("Setting up mutation observer",e))},attachEvents:function(e,t){var n=S(e);t=S.isFunction(y[t])?y[t]:y.toggle,0<n.length?(y.debug("Attaching checkbox events to element",e,t),n.on("click"+i,t)):y.error(s.notFound)},preventDefaultOnInputTarget:function(){"undefined"!=typeof event&&null!==event&&S(event.target).is(p.input)&&(y.verbose("Preventing default check action after manual check action"),event.preventDefault())},event:{change:function(e){y.should.ignoreCallbacks()||m.onChange.call(v)},click:function(e){var t=S(e.target);t.is(p.input)?y.verbose("Using default check action on initialized checkbox"):t.is(p.link)?y.debug("Clicking link inside checkbox, skipping toggle"):(y.toggle(),h.focus(),e.preventDefault())},keydown:function(e){var t=e.which,n=13,i=32,o=27,a=37,r=38,s=39,l=40,c=y.get.radios(),u=c.index(g),d=c.length,f=!1;if(t==a||t==r?f=(0===u?d:u)-1:t!=s&&t!=l||(f=u===d-1?0:u+1),!y.should.ignoreCallbacks()&&!1!==f){if(!1===m.beforeUnchecked.apply(v))return y.verbose("Option not allowed to be unchecked, cancelling key navigation"),!1;if(!1===m.beforeChecked.apply(S(c[f]).children(p.input)[0]))return y.verbose("Next option should not allow check, cancelling key navigation"),!1}b=!1,t==o?(y.verbose("Escape key pressed blurring field"),h.blur(),b=!0):!e.ctrlKey&&y.can.change()&&(t==i||t==n&&m.enableEnterKey?(y.verbose("Enter/space key pressed, toggling checkbox"),y.toggle(),b=!0):g.is(".toggle, .slider")&&!y.is.radio()&&(t==a&&y.is.checked()?(y.uncheck(),b=!0):t==s&&y.is.unchecked()&&(y.check(),b=!0)))},keyup:function(e){b&&e.preventDefault()}},check:function(){y.should.allowCheck()&&(y.debug("Checking checkbox",h),y.set.checked(),y.should.ignoreCallbacks()||(m.onChecked.call(v),y.trigger.change()),y.preventDefaultOnInputTarget())},uncheck:function(){y.should.allowUncheck()&&(y.debug("Unchecking checkbox"),y.set.unchecked(),y.should.ignoreCallbacks()||(m.onUnchecked.call(v),y.trigger.change()),y.preventDefaultOnInputTarget())},indeterminate:function(){y.should.allowIndeterminate()?y.debug("Checkbox is already indeterminate"):(y.debug("Making checkbox indeterminate"),y.set.indeterminate(),y.should.ignoreCallbacks()||(m.onIndeterminate.call(v),y.trigger.change()))},determinate:function(){y.should.allowDeterminate()?y.debug("Checkbox is already determinate"):(y.debug("Making checkbox determinate"),y.set.determinate(),y.should.ignoreCallbacks()||(m.onDeterminate.call(v),y.trigger.change()))},enable:function(){y.is.enabled()?y.debug("Checkbox is already enabled"):(y.debug("Enabling checkbox"),y.set.enabled(),y.should.ignoreCallbacks()||(m.onEnable.call(v),m.onEnabled.call(v)))},disable:function(){y.is.disabled()?y.debug("Checkbox is already disabled"):(y.debug("Disabling checkbox"),y.set.disabled(),y.should.ignoreCallbacks()||(m.onDisable.call(v),m.onDisabled.call(v)))},get:{radios:function(){var e=y.get.name();return S('input[name="'+e+'"]').closest(p.checkbox)},otherRadios:function(){return y.get.radios().not(g)},name:function(){return h.attr("name")}},is:{initialLoad:function(){return r},radio:function(){return h.hasClass(t.radio)||"radio"==h.attr("type")},indeterminate:function(){return h.prop("indeterminate")!==E&&h.prop("indeterminate")},checked:function(){return h.prop("checked")!==E&&h.prop("checked")},disabled:function(){return h.prop("disabled")!==E&&h.prop("disabled")},enabled:function(){return!y.is.disabled()},determinate:function(){return!y.is.indeterminate()},unchecked:function(){return!y.is.checked()}},should:{allowCheck:function(){return y.is.determinate()&&y.is.checked()&&!y.is.initialLoad()?(y.debug("Should not allow check, checkbox is already checked"),!1):!(!y.should.ignoreCallbacks()&&!1===m.beforeChecked.apply(v))||(y.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return y.is.determinate()&&y.is.unchecked()&&!y.is.initialLoad()?(y.debug("Should not allow uncheck, checkbox is already unchecked"),!1):!(!y.should.ignoreCallbacks()&&!1===m.beforeUnchecked.apply(v))||(y.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return y.is.indeterminate()&&!y.is.initialLoad()?(y.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):!(!y.should.ignoreCallbacks()&&!1===m.beforeIndeterminate.apply(v))||(y.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return y.is.determinate()&&!y.is.initialLoad()?(y.debug("Should not allow determinate, checkbox is already determinate"),!1):!(!y.should.ignoreCallbacks()&&!1===m.beforeDeterminate.apply(v))||(y.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},ignoreCallbacks:function(){return r&&!m.fireOnInit}},can:{change:function(){return!(g.hasClass(t.disabled)||g.hasClass(t.readOnly)||h.prop("disabled")||h.prop("readonly"))},uncheck:function(){return"boolean"==typeof m.uncheckable?m.uncheckable:!y.is.radio()}},set:{initialLoad:function(){r=!0},checked:function(){y.verbose("Setting class to checked"),g.removeClass(t.indeterminate).addClass(t.checked),y.is.radio()&&y.uncheckOthers(),!y.is.indeterminate()&&y.is.checked()?y.debug("Input is already checked, skipping input property change"):(y.verbose("Setting state to checked",v),h.prop("indeterminate",!1).prop("checked",!0))},unchecked:function(){y.verbose("Removing checked class"),g.removeClass(t.indeterminate).removeClass(t.checked),!y.is.indeterminate()&&y.is.unchecked()?y.debug("Input is already unchecked"):(y.debug("Setting state to unchecked"),h.prop("indeterminate",!1).prop("checked",!1))},indeterminate:function(){y.verbose("Setting class to indeterminate"),g.addClass(t.indeterminate),y.is.indeterminate()?y.debug("Input is already indeterminate, skipping input property change"):(y.debug("Setting state to indeterminate"),h.prop("indeterminate",!0))},determinate:function(){y.verbose("Removing indeterminate class"),g.removeClass(t.indeterminate),y.is.determinate()?y.debug("Input is already determinate, skipping input property change"):(y.debug("Setting state to determinate"),h.prop("indeterminate",!1))},disabled:function(){y.verbose("Setting class to disabled"),g.addClass(t.disabled),y.is.disabled()?y.debug("Input is already disabled, skipping input property change"):(y.debug("Setting state to disabled"),h.prop("disabled","disabled"))},enabled:function(){y.verbose("Removing disabled class"),g.removeClass(t.disabled),y.is.enabled()?y.debug("Input is already enabled, skipping input property change"):(y.debug("Setting state to enabled"),h.prop("disabled",!1))},tabbable:function(){y.verbose("Adding tabindex to checkbox"),h.attr("tabindex")===E&&h.attr("tabindex",0)}},remove:{initialLoad:function(){r=!1}},trigger:{change:function(){var e,t=h[0];t&&(e=A.createEvent("HTMLEvents"),y.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},create:{label:function(){0<h.prevAll(p.label).length?(h.prev(p.label).detach().insertAfter(h),y.debug("Moving existing label",a)):y.has.label()||(a=S("<label>").insertAfter(h),y.debug("Creating label",a))}},has:{label:function(){return 0<a.length}},bind:{events:function(){y.verbose("Attaching checkbox events"),g.on("click"+i,y.event.click).on("change"+i,y.event.change).on("keydown"+i,p.input,y.event.keydown).on("keyup"+i,p.input,y.event.keyup)}},unbind:{events:function(){y.debug("Removing events"),g.off(i)}},uncheckOthers:function(){var e=y.get.otherRadios();y.debug("Unchecking other radios",e),e.removeClass(t.checked)},toggle:function(){y.can.change()?y.is.indeterminate()||y.is.unchecked()?(y.debug("Currently unchecked"),y.check()):y.is.checked()&&y.can.uncheck()&&(y.debug("Currently checked"),y.uncheck()):y.is.radio()||y.debug("Checkbox is read-only or disabled, ignoring toggle")},setting:function(e,t){if(y.debug("Changing setting",e,t),S.isPlainObject(e))S.extend(!0,m,e);else{if(t===E)return m[e];S.isPlainObject(m[e])?S.extend(!0,m[e],t):m[e]=t}},internal:function(e,t){if(S.isPlainObject(e))S.extend(!0,y,e);else{if(t===E)return y[e];y[e]=t}},debug:function(){!m.silent&&m.debug&&(m.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,m.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),y.verbose.apply(console,arguments)))},error:function(){m.silent||(y.error=Function.prototype.bind.call(console.error,console,m.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-(x||t),x=t,C.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var e=m.name+":",n=0;x=!1,clearTimeout(y.performance.timer),S.each(C,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",f&&(e+=" '"+f+"'"),(console.group!==E||console.table!==E)&&0<C.length&&(console.groupCollapsed(e),console.table?console.table(C):S.each(C,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),C=[]}},invoke:function(i,e,t){var o,a,n,r=l;return e=e||T,t=c||t,"string"==typeof i&&r!==E&&(i=i.split(/[\. ]/),o=i.length-1,S.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(S.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==E)return a=r[n],!1;{if(!S.isPlainObject(r[t])||e==o)return r[t]!==E?a=r[t]:y.error(s.method,i),!1;r=r[t]}}})),S.isFunction(a)?n=a.apply(t,e):a!==E&&(n=a),Array.isArray(d)?d.push(n):d!==E?d=[d,n]:n!==E&&(d=n),a}};k?(l===E&&y.initialize(),y.invoke(w)):(l!==E&&l.invoke("destroy"),y.initialize())}),d!==E?d:this},S.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,enableEnterKey:!0,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(k,e,T,S){"use strict";k.isFunction=k.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k.fn.dimmer=function(g){var h,v=k(this),b=(new Date).getTime(),y=[],x=g,C="string"==typeof x,w=[].slice.call(arguments,1);return v.each(function(){var o,t,a=k.isPlainObject(g)?k.extend(!0,{},k.fn.dimmer.settings,g):k.extend({},k.fn.dimmer.settings),n=a.selector,e=a.namespace,i=a.className,s=a.error,r="."+e,l="module-"+e,c=v.selector||"",u="ontouchstart"in T.documentElement?"touchstart":"click",d=k(this),f=this,m=d.data(l),p={preinitialize:function(){o=p.is.dimmer()?(t=d.parent(),d):(t=d,p.has.dimmer()?a.dimmerName?t.find(n.dimmer).filter("."+a.dimmerName):t.find(n.dimmer):p.create())},initialize:function(){p.debug("Initializing dimmer",a),p.bind.events(),p.set.dimmable(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),m=p,d.data(l,m)},destroy:function(){p.verbose("Destroying previous module",o),p.unbind.events(),p.remove.variation(),t.off(r)},bind:{events:function(){"hover"==a.on?t.on("mouseenter"+r,p.show).on("mouseleave"+r,p.hide):"click"==a.on&&t.on(u+r,p.toggle),p.is.page()&&(p.debug("Setting as a page dimmer",t),p.set.pageDimmer()),p.is.closable()&&(p.verbose("Adding dimmer close event",o),t.on(u+r,n.dimmer,p.event.click))}},unbind:{events:function(){d.removeData(l),t.off(r)}},event:{click:function(e){p.verbose("Determining if event occurred on dimmer",e),0!==o.find(e.target).length&&!k(e.target).is(n.content)||(p.hide(),e.stopImmediatePropagation())}},addContent:function(e){e=k(e);p.debug("Add content to dimmer",e),e.parent()[0]!==o[0]&&e.detach().appendTo(o)},create:function(){var e=k(a.template.dimmer(a));return a.dimmerName&&(p.debug("Creating named dimmer",a.dimmerName),e.addClass(a.dimmerName)),e.appendTo(t),e},show:function(e){e=k.isFunction(e)?e:function(){},p.is.dimmed()&&!p.is.animating()||!p.is.enabled()?p.debug("Dimmer is already shown or disabled"):!1===a.onShow.call(f)?p.verbose("Show callback returned false cancelling dimmer show"):(p.debug("Showing dimmer",o,a),p.set.variation(),p.animate.show(e),a.onChange.call(f))},hide:function(e){e=k.isFunction(e)?e:function(){},p.is.dimmed()||p.is.animating()?!1===a.onHide.call(f)?p.verbose("Hide callback returned false cancelling dimmer hide"):(p.debug("Hiding dimmer",o),p.animate.hide(e),a.onChange.call(f)):p.debug("Dimmer is not visible")},toggle:function(){p.verbose("Toggling dimmer visibility",o),p.is.dimmed()?p.is.closable()&&p.hide():p.show()},animate:{show:function(e){e=k.isFunction(e)?e:function(){},a.useCSS&&k.fn.transition!==S&&o.transition("is supported")?(a.useFlex?(p.debug("Using flex dimmer"),p.remove.legacy()):(p.debug("Using legacy non-flex dimmer"),p.set.legacy()),"auto"!==a.opacity&&p.set.opacity(),o.transition({displayType:a.useFlex?"flex":"block",animation:(a.transition.showMethod||a.transition)+" in",queue:!1,duration:p.get.duration(),useFailSafe:!0,onStart:function(){p.set.dimmed()},onComplete:function(){p.set.active(),a.onVisible.call(o),e()}})):(p.verbose("Showing dimmer animation with javascript"),p.set.dimmed(),"auto"==a.opacity&&(a.opacity=.8),o.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(p.get.duration(),a.opacity,function(){o.removeAttr("style"),p.set.active(),a.onVisible.call(o),e()}))},hide:function(e){e=k.isFunction(e)?e:function(){},a.useCSS&&k.fn.transition!==S&&o.transition("is supported")?(p.verbose("Hiding dimmer with css"),o.transition({displayType:a.useFlex?"flex":"block",animation:(a.transition.hideMethod||a.transition)+" out",queue:!1,duration:p.get.duration(),useFailSafe:!0,onComplete:function(){p.remove.dimmed(),p.remove.variation(),p.remove.active(),a.onHidden.call(o),e()}})):(p.verbose("Hiding dimmer with javascript"),o.stop().fadeOut(p.get.duration(),function(){p.remove.dimmed(),p.remove.active(),o.removeAttr("style"),a.onHidden.call(o),e()}))}},get:{dimmer:function(){return o},duration:function(){return p.is.active()?a.transition.hideDuration||a.duration.hide||a.duration:a.transition.showDuration||a.duration.show||a.duration}},has:{dimmer:function(){return a.dimmerName?0<d.find(n.dimmer).filter("."+a.dimmerName).length:0<d.find(n.dimmer).length}},is:{active:function(){return o.hasClass(i.active)},animating:function(){return o.is(":animated")||o.hasClass(i.animating)},closable:function(){return"auto"==a.closable?"hover"!=a.on:a.closable},dimmer:function(){return d.hasClass(i.dimmer)},dimmable:function(){return d.hasClass(i.dimmable)},dimmed:function(){return t.hasClass(i.dimmed)},disabled:function(){return t.hasClass(i.disabled)},enabled:function(){return!p.is.disabled()},page:function(){return t.is("body")},pageDimmer:function(){return o.hasClass(i.pageDimmer)}},can:{show:function(){return!o.hasClass(i.disabled)}},set:{opacity:function(e){var t=o.css("background-color"),n=t.split(","),i=n&&3<=n.length;e=0===a.opacity?0:a.opacity||e,t=i?(n[2]=n[2].replace(")",""),n[3]=e+")",n.join(",")):"rgba(0, 0, 0, "+e+")",p.debug("Setting opacity to",e),o.css("background-color",t)},legacy:function(){o.addClass(i.legacy)},active:function(){o.addClass(i.active)},dimmable:function(){t.addClass(i.dimmable)},dimmed:function(){t.addClass(i.dimmed)},pageDimmer:function(){o.addClass(i.pageDimmer)},disabled:function(){o.addClass(i.disabled)},variation:function(e){(e=e||a.variation)&&o.addClass(e)}},remove:{active:function(){o.removeClass(i.active)},legacy:function(){o.removeClass(i.legacy)},dimmed:function(){t.removeClass(i.dimmed)},disabled:function(){o.removeClass(i.disabled)},variation:function(e){(e=e||a.variation)&&o.removeClass(e)}},setting:function(e,t){if(p.debug("Changing setting",e,t),k.isPlainObject(e))k.extend(!0,a,e);else{if(t===S)return a[e];k.isPlainObject(a[e])?k.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(k.isPlainObject(e))k.extend(!0,p,e);else{if(t===S)return p[e];p[e]=t}},debug:function(){!a.silent&&a.debug&&(a.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,a.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),p.verbose.apply(console,arguments)))},error:function(){a.silent||(p.error=Function.prototype.bind.call(console.error,console,a.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,n;a.performance&&(n=(t=(new Date).getTime())-(b||t),b=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var e=a.name+":",n=0;b=!1,clearTimeout(p.performance.timer),k.each(y,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",c&&(e+=" '"+c+"'"),1<v.length&&(e+=" ("+v.length+")"),(console.group!==S||console.table!==S)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):k.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||w,t=f||t,"string"==typeof i&&r!==S&&(i=i.split(/[\. ]/),o=i.length-1,k.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(k.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==S)return a=r[n],!1;{if(!k.isPlainObject(r[t])||e==o)return r[t]!==S?a=r[t]:p.error(s.method,i),!1;r=r[t]}}})),k.isFunction(a)?n=a.apply(t,e):a!==S&&(n=a),Array.isArray(h)?h.push(n):h!==S?h=[h,n]:n!==S&&(h=n),a}};p.preinitialize(),C?(m===S&&p.initialize(),p.invoke(x)):(m!==S&&m.invoke("destroy"),p.initialize())}),h!==S?h:this},k.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,useFlex:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},displayLoader:!1,loaderText:!1,loaderVariation:"",onChange:function(){},onShow:function(){},onHide:function(){},onVisible:function(){},onHidden:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",legacy:"legacy",pageDimmer:"page",show:"show",loader:"ui loader"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(e){var t,n=k("<div/>").addClass("ui dimmer");return e.displayLoader&&(t=k("<div/>").addClass(e.className.loader).addClass(e.loaderVariation),e.loaderText&&(t.text(e.loaderText),t.addClass("text")),n.append(t)),n}}}}(jQuery,window,document),function(_,ee,te,ne){"use strict";_.isFunction=_.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},ee=void 0!==ee&&ee.Math==Math?ee:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),_.fn.dropdown=function(B){var Y,W=_(this),Q=_(te),K=W.selector||"",$=(new Date).getTime(),X=[],G=B,J="string"==typeof G,Z=[].slice.call(arguments,1);return W.each(function(V){var f,e,t,n,i,o,a,r,s,m=_.isPlainObject(B)?_.extend(!0,{},_.fn.dropdown.settings,B):_.extend({},_.fn.dropdown.settings),p=m.className,g=m.message,l=m.fields,h=m.keys,v=m.metadata,L=m.namespace,c=m.regExp,b=m.selector,u=m.error,q=m.templates,d="."+L,y="module-"+L,x=_(this),C=[ee,te].indexOf(m.context)<0?_(te).find(m.context):_(m.context),w=x.find(b.text),k=x.find(b.search),T=x.find(b.sizer),S=x.find(b.input),N=x.find(b.icon),z=x.find(b.clearIcon),D=0<x.prev().find(b.text).length?x.prev().find(b.text):x.prev(),A=x.children(b.menu),E=A.find(b.item),F=m.hideDividers?E.parent().children(b.divider):_(),O=!1,H=!1,U=!1,P=!1,M=this,R=!1,I=x.data(y),j={initialize:function(){j.debug("Initializing dropdown",m),j.is.alreadySetup()?j.setup.reference():(m.ignoreDiacritics&&!String.prototype.normalize&&(m.ignoreDiacritics=!1,j.error(u.noNormalize,M)),j.setup.layout(),m.values&&(j.set.initialLoad(),j.change.values(m.values),j.remove.initialLoad()),j.refreshData(),j.save.defaults(),j.restore.selected(),j.create.id(),j.bind.events(),j.observeChanges(),j.instantiate())},instantiate:function(){j.verbose("Storing instance of dropdown",j),I=j,x.data(y,j)},destroy:function(){j.verbose("Destroying previous dropdown",x),j.remove.tabbable(),j.remove.active(),A.transition("stop all"),A.removeClass(p.visible).addClass(p.hidden),x.off(d).removeData(y),A.off(d),Q.off(i),j.disconnect.menuObserver(),j.disconnect.selectObserver(),j.disconnect.classObserver()},observeChanges:function(){"MutationObserver"in ee&&(a=new MutationObserver(j.event.select.mutation),r=new MutationObserver(j.event.menu.mutation),s=new MutationObserver(j.event.class.mutation),j.debug("Setting up mutation observer",a,r,s),j.observe.select(),j.observe.menu(),j.observe.class())},disconnect:{menuObserver:function(){r&&r.disconnect()},selectObserver:function(){a&&a.disconnect()},classObserver:function(){s&&s.disconnect()}},observe:{select:function(){j.has.input()&&a&&a.observe(x[0],{attributes:!0,childList:!0,subtree:!0})},menu:function(){j.has.menu()&&r&&r.observe(A[0],{childList:!0,subtree:!0})},class:function(){j.has.search()&&s&&s.observe(x[0],{attributes:!0})}},create:{id:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),i="."+o,j.verbose("Creating unique id for element",o)},userChoice:function(e){var n,i;return!!(e=e||j.get.userValues())&&(e=Array.isArray(e)?e:[e],_.each(e,function(e,t){!1===j.get.item(t)&&(i=m.templates.addition(j.add.variables(g.addResult,t)),i=_("<div />").html(i).attr("data-"+v.value,t).attr("data-"+v.text,t).addClass(p.addition).addClass(p.item),m.hideAdditions&&i.addClass(p.hidden),n=n===ne?i:n.add(i),j.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=j.get.userValues();t&&(j.debug("Adding user labels",t),_.each(t,function(e,t){j.verbose("Adding custom user value"),j.add.label(t,t)}))},menu:function(){A=_("<div />").addClass(p.menu).appendTo(x)},sizer:function(){T=_("<span />").addClass(p.sizer).insertAfter(k)}},search:function(e){e=e!==ne?e:j.get.query(),j.verbose("Searching for query",e),!1===m.fireOnInit&&j.is.initialLoad()?j.verbose("Skipping callback on initial load",m.onSearch):j.has.minCharacters(e)&&!1!==m.onSearch.call(M,e)?j.filter(e):j.hide(null,!0)},select:{firstUnfiltered:function(){j.verbose("Selecting first non-filtered element"),j.remove.selectedItem(),E.not(b.unselectable).not(b.addition+b.hidden).eq(0).addClass(p.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(b.item).not(b.unselectable).eq(0),e=e.prevAll(b.item).not(b.unselectable).eq(0);0<t.length?(j.verbose("Moving selection to",t),t.addClass(p.selected)):(j.verbose("Moving selection to",e),e.addClass(p.selected))}},setup:{api:function(){var e={debug:m.debug,urlData:{value:j.get.value(),query:j.get.query()},on:!1};j.verbose("First request, initializing API"),x.api(e)},layout:function(){x.is("select")&&(j.setup.select(),j.setup.returnedObject()),j.has.menu()||j.create.menu(),j.is.clearable()&&!j.has.clearItem()&&(j.verbose("Adding clear icon"),z=_("<i />").addClass("remove icon").insertBefore(w)),j.is.search()&&!j.has.search()&&(j.verbose("Adding search input"),k=_("<input />").addClass(p.search).prop("autocomplete",j.is.chrome()?"fomantic-search":"off").insertBefore(w)),j.is.multiple()&&j.is.searchSelection()&&!j.has.sizer()&&j.create.sizer(),m.allowTab&&j.set.tabbable()},select:function(){var e=j.get.selectValues();j.debug("Dropdown initialized on a select",e),0<(S=x.is("select")?x:S).parent(b.dropdown).length?(j.debug("UI dropdown already exists. Creating dropdown menu only"),x=S.closest(b.dropdown),j.has.menu()||j.create.menu(),A=x.children(b.menu),j.setup.menu(e)):(j.debug("Creating entire dropdown from select"),x=_("<div />").attr("class",S.attr("class")).addClass(p.selection).addClass(p.dropdown).html(q.dropdown(e,l,m.preserveHTML,m.className)).insertBefore(S),S.hasClass(p.multiple)&&!1===S.prop("multiple")&&(j.error(u.missingMultiple),S.prop("multiple",!0)),S.is("[multiple]")&&j.set.multiple(),S.prop("disabled")&&(j.debug("Disabling dropdown"),x.addClass(p.disabled)),S.is("[required]")&&(m.forceSelection=!0),S.removeAttr("required").removeAttr("class").detach().prependTo(x)),j.refresh()},menu:function(e){A.html(q.menu(e,l,m.preserveHTML,m.className)),E=A.find(b.item),F=m.hideDividers?E.parent().children(b.divider):_()},reference:function(){j.debug("Dropdown behavior was called on select, replacing with closest dropdown"),x=x.parent(b.dropdown),I=x.data(y),M=x.get(0),j.refresh(),j.setup.returnedObject()},returnedObject:function(){var e=W.slice(0,V),t=W.slice(V+1);W=e.add(x).add(t)}},refresh:function(){j.refreshSelectors(),j.refreshData()},refreshItems:function(){E=A.find(b.item),F=m.hideDividers?E.parent().children(b.divider):_()},refreshSelectors:function(){j.verbose("Refreshing selector cache"),w=x.find(b.text),k=x.find(b.search),S=x.find(b.input),N=x.find(b.icon),D=0<x.prev().find(b.text).length?x.prev().find(b.text):x.prev(),A=x.children(b.menu),E=A.find(b.item),F=m.hideDividers?E.parent().children(b.divider):_()},refreshData:function(){j.verbose("Refreshing cached metadata"),E.removeData(v.text).removeData(v.value)},clearData:function(){j.verbose("Clearing metadata"),E.removeData(v.text).removeData(v.value),x.removeData(v.defaultText).removeData(v.defaultValue).removeData(v.placeholderText)},clearItems:function(){A.empty(),j.refreshItems()},toggle:function(){j.verbose("Toggling menu visibility"),j.is.active()?j.hide():j.show()},show:function(e,t){if(e=_.isFunction(e)?e:function(){},(R||P)&&j.is.remote()&&j.is.noApiCache()&&j.clearItems(),!j.can.show()&&j.is.remote()&&(j.debug("No API results retrieved, searching before show"),j.queryRemote(j.get.query(),j.show,[e,t])),j.can.show()&&!j.is.active()){if(j.debug("Showing dropdown"),!j.has.message()||j.has.maxSelections()||j.has.allResultsFiltered()||j.remove.message(),j.is.allFiltered())return!0;!1!==m.onShow.call(M)&&j.animate.show(function(){j.bind.intent(),j.has.search()&&!t&&j.focusSearch(),j.set.visible(),e.call(M)})}},hide:function(e,t){var n;e=_.isFunction(e)?e:function(){},j.is.active()&&!j.is.animatingOutward()?(j.debug("Hiding dropdown"),!1!==m.onHide.call(M)&&(j.animate.hide(function(){j.remove.visible(),j.is.focusedOnSearch()&&!0!==t&&k.blur(),e.call(M)}),0<(n=x.find(b.menu)).length&&(j.verbose("Hiding sub-menu",n),n.each(function(){j.animate.hide(!1,_(this))})))):j.unbind.intent(),R=P=!1},hideOthers:function(){j.verbose("Finding other dropdowns to hide"),W.not(x).has(b.menu+"."+p.visible).dropdown("hide")},hideMenu:function(){j.verbose("Hiding menu instantaneously"),j.remove.active(),j.remove.visible(),A.transition("hide")},hideSubMenus:function(){var e=A.children(b.item).find(b.menu);j.verbose("Hiding sub menus",e),e.transition("hide")},bind:{events:function(){j.bind.keyboardEvents(),j.bind.inputEvents(),j.bind.mouseEvents()},keyboardEvents:function(){j.verbose("Binding keyboard events"),x.on("keydown"+d,j.event.keydown),j.has.search()&&x.on(j.get.inputEvent()+d,b.search,j.event.input),j.is.multiple()&&Q.on("keydown"+i,j.event.document.keydown)},inputEvents:function(){j.verbose("Binding input change events"),x.on("change"+d,b.input,j.event.change),j.is.multiple()&&j.is.searchSelection()&&x.on("paste"+d,b.search,j.event.paste)},mouseEvents:function(){j.verbose("Binding mouse events"),j.is.multiple()&&x.on("click"+d,b.label,j.event.label.click).on("click"+d,b.remove,j.event.remove.click),j.is.searchSelection()?(x.on("mousedown"+d,j.event.mousedown).on("mouseup"+d,j.event.mouseup).on("mousedown"+d,b.menu,j.event.menu.mousedown).on("mouseup"+d,b.menu,j.event.menu.mouseup).on("click"+d,b.icon,j.event.icon.click).on("click"+d,b.clearIcon,j.event.clearIcon.click).on("focus"+d,b.search,j.event.search.focus).on("click"+d,b.search,j.event.search.focus).on("blur"+d,b.search,j.event.search.blur).on("click"+d,b.text,j.event.text.focus),j.is.multiple()&&x.on("click"+d,j.event.click).on("click"+d,j.event.search.focus)):("click"==m.on?x.on("click"+d,b.icon,j.event.icon.click).on("click"+d,j.event.test.toggle):"hover"==m.on?x.on("mouseenter"+d,j.delay.show).on("mouseleave"+d,j.delay.hide).on("touchstart"+d,j.event.test.toggle).on("touchstart"+d,b.icon,j.event.icon.click):x.on(m.on+d,j.toggle),x.on("mousedown"+d,j.event.mousedown).on("mouseup"+d,j.event.mouseup).on("focus"+d,j.event.focus).on("click"+d,b.clearIcon,j.event.clearIcon.click),j.has.menuSearch()?x.on("blur"+d,b.search,j.event.search.blur):x.on("blur"+d,j.event.blur)),A.on("mouseenter"+d,b.item,j.event.item.mouseenter).on("touchstart"+d,b.item,j.event.item.mouseenter).on("mouseleave"+d,b.item,j.event.item.mouseleave).on("click"+d,b.item,j.event.item.click)},intent:function(){j.verbose("Binding hide intent event to document"),Q.on("click"+i,j.event.test.hide)}},unbind:{intent:function(){j.verbose("Removing hide intent event from document"),Q.off("click"+i)}},filter:function(e){function t(){j.is.multiple()&&j.filterActive(),(e||!e&&0==j.get.activeItem().length)&&j.select.firstUnfiltered(),j.has.allResultsFiltered()?m.onNoResults.call(M,n)?m.allowAdditions?m.hideAdditions&&(j.verbose("User addition with no menu, setting empty style"),j.set.empty(),j.hideMenu()):(j.verbose("All items filtered, showing message",n),j.add.message(g.noResults)):(j.verbose("All items filtered, hiding dropdown",n),j.hideMenu()):(j.remove.empty(),j.remove.message()),m.allowAdditions&&j.add.userSuggestion(j.escape.htmlEntities(e)),j.is.searchSelection()&&j.can.show()&&j.is.focusedOnSearch()&&j.show()}var n=e!==ne?e:j.get.query();m.useLabels&&j.has.maxSelections()||(m.apiSettings?j.can.useAPI()?j.queryRemote(n,function(){m.filterRemoteData&&j.filterItems(n);var e=S.val();Array.isArray(e)||(e=e&&""!==e?e.split(m.delimiter):[]),j.is.multiple()&&_.each(e,function(e,t){E.filter('[data-value="'+t+'"]').addClass(p.filtered)}),j.focusSearch(!0),t()}):j.error(u.noAPI):(j.filterItems(n),t()))},queryRemote:function(e,a,r){Array.isArray(r)||(r=[r]);var e={errorDuration:!1,cache:"local",throttle:m.throttle,urlData:{query:e}},t={onError:function(e,t,n){j.add.message(g.serverError),R=P=!1,a.apply(null,r),"function"==typeof m.apiSettings.onError&&m.apiSettings.onError.call(this,e,t,n)},onFailure:function(e,t,n){j.add.message(g.serverError),R=P=!1,a.apply(null,r),"function"==typeof m.apiSettings.onFailure&&m.apiSettings.onFailure.call(this,e,t,n)},onSuccess:function(e,t,n){var i=e[l.remoteValues],o=(Array.isArray(i)||(i=[]),j.remove.message(),{});o[l.values]=i,j.setup.menu(o),0!==i.length||m.allowAdditions?""!==(o=j.is.multiple()?j.get.values():j.get.value())&&(j.verbose("Value(s) present after click icon, select value(s) in items"),j.set.selected(o,null,!0,!0)):j.add.message(g.noResults),R=P=!1,a.apply(null,r),"function"==typeof m.apiSettings.onSuccess&&m.apiSettings.onSuccess.call(this,e,t,n)}};x.api("get request")||j.setup.api(),e=_.extend(!0,{},e,m.apiSettings,t),x.api("setting",e).api("query")},filterItems:function(e){var n=j.remove.diacritics(e!==ne?e:j.get.query()),i=null,e=j.escape.string(n),t=(m.ignoreSearchCase?"i":"")+"gm",o=new RegExp("^"+e,t);j.has.query()&&(i=[],j.verbose("Searching for matching values",n),E.each(function(){var e,t=_(this);if(t.hasClass(p.unfilterable))return i.push(this),!0;if("both"===m.match||"text"===m.match){if(-1!==(e=j.remove.diacritics(String(j.get.choiceText(t,!1)))).search(o))return i.push(this),!0;if("exact"===m.fullTextSearch&&j.exactSearch(n,e))return i.push(this),!0;if(!0===m.fullTextSearch&&j.fuzzySearch(n,e))return i.push(this),!0}return("both"===m.match||"value"===m.match)&&(-1!==(t=j.remove.diacritics(String(j.get.choiceValue(t,e)))).search(o)||"exact"===m.fullTextSearch&&j.exactSearch(n,t)||!0===m.fullTextSearch&&j.fuzzySearch(n,t))?(i.push(this),!0):void 0})),j.debug("Showing only matched items",n),j.remove.filteredItem(),i&&E.not(i).addClass(p.filtered),j.has.query()?!0===m.hideDividers?F.addClass(p.hidden):"empty"===m.hideDividers&&F.removeClass(p.hidden).filter(function(){var e=_(this).nextUntil(b.item);return 0===(e.length?e:_(this)).nextUntil(b.divider).filter(b.item+":not(."+p.filtered+")").length}).addClass(p.hidden):F.removeClass(p.hidden)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if(e=m.ignoreSearchCase?e.toLowerCase():e,t=m.ignoreSearchCase?t.toLowerCase():t,n<i)return!1;if(i===n)return e===t;e:for(var o=0,a=0;o<i;o++){for(var r=e.charCodeAt(o);a<n;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},exactSearch:function(e,t){return e=m.ignoreSearchCase?e.toLowerCase():e,-1<(t=m.ignoreSearchCase?t.toLowerCase():t).indexOf(e)},filterActive:function(){m.useLabels&&E.filter("."+p.active).addClass(p.filtered)},focusSearch:function(e){j.has.search()&&!j.is.focusedOnSearch()&&(e?(x.off("focus"+d,b.search),k.focus(),x.on("focus"+d,b.search,j.event.search.focus)):k.focus())},blurSearch:function(){j.has.search()&&k.blur()},forceSelection:function(){var e=E.not(p.filtered).filter("."+p.selected).eq(0),t=E.not(p.filtered).filter("."+p.active).eq(0),e=0<e.length?e:t,t=0<e.length;m.allowAdditions||t&&!j.is.multiple()?(j.debug("Forcing partial selection to selected item",e),j.event.item.click.call(e,{},!0)):j.remove.searchTerm()},change:{values:function(e){m.allowAdditions||j.clear(),j.debug("Creating dropdown with specified values",e);var t={};t[l.values]=e,j.setup.menu(t),_.each(e,function(e,t){if(!0===t.selected&&(j.debug("Setting initial selection to",t[l.value]),j.set.selected(t[l.value]),!j.is.multiple()))return!1}),j.has.selectInput()&&(j.disconnect.selectObserver(),S.html(""),S.append("<option disabled selected value></option>"),_.each(e,function(e,t){var n=m.templates.deQuote(t[l.value]),i=m.templates.escape(t[l.name]||"",m.preserveHTML);S.append('<option value="'+n+'"'+(!0===t.selected?" selected":"")+">"+i+"</option>")}),j.observe.select())}},event:{paste:function(e){(e.originalEvent.clipboardData||ee.clipboardData).getData("text").split(m.delimiter).forEach(function(e){j.set.selected(j.escape.htmlEntities(e.trim()),null,!0,!0)}),e.preventDefault()},change:function(){U||(j.debug("Input changed, updating selection"),j.set.selected())},focus:function(){m.showOnFocus&&!O&&j.is.hidden()&&!t&&(R=!0,j.show())},blur:function(e){t=te.activeElement===this,O||t||(j.remove.activeLabel(),j.hide())},mousedown:function(){j.is.searchSelection()?n=!0:O=!0},mouseup:function(){j.is.searchSelection()?n=!1:O=!1},click:function(e){_(e.target).is(x)&&(j.is.focusedOnSearch()?j.show():j.focusSearch())},search:{focus:function(e){O=!0,j.is.multiple()&&j.remove.activeLabel(),R||j.is.active()||!(m.showOnFocus||"focus"!==e.type&&"focusin"!==e.type)||"touchstart"===e.type||(R=!0,j.search())},blur:function(e){t=te.activeElement===this,!j.is.searchSelection()||n||H||t||(m.forceSelection?j.forceSelection():m.allowAdditions||j.remove.searchTerm(),j.hide()),n=!1}},clearIcon:{click:function(e){j.clear(),j.is.searchSelection()&&j.remove.searchTerm(),j.hide(),e.stopPropagation()}},icon:{click:function(e){P=!0,j.has.search()?j.is.active()?j.blurSearch():m.showOnFocus?j.focusSearch():j.toggle():j.toggle(),e.stopPropagation()}},text:{focus:function(e){O=!0,j.focusSearch()}},input:function(e){(j.is.multiple()||j.is.searchSelection())&&j.set.filtered(),clearTimeout(j.timer),j.timer=setTimeout(j.search,m.delay.search)},label:{click:function(e){var t=_(this),n=x.find(b.label),i=n.filter("."+p.active),o=t.nextAll("."+p.active),a=t.prevAll("."+p.active),o=(0<o.length?t.nextUntil(o):t.prevUntil(a)).add(i).add(t);e.shiftKey?(i.removeClass(p.active),o.addClass(p.active)):e.ctrlKey?t.toggleClass(p.active):(i.removeClass(p.active),t.addClass(p.active)),m.onLabelSelect.apply(this,n.filter("."+p.active)),e.stopPropagation()}},remove:{click:function(e){var t=_(this).parent();t.hasClass(p.active)?j.remove.activeLabels():j.remove.activeLabels(t),e.stopPropagation()}},test:{toggle:function(e){var t=j.is.multiple()?j.show:j.toggle;j.is.bubbledLabelClick(e)||j.is.bubbledIconClick(e)||(j.is.multiple()&&(!j.is.multiple()||j.is.active())||(R=!0),j.determine.eventOnElement(e,t)&&"touchstart"!==e.type&&e.preventDefault())},hide:function(e){j.determine.eventInModule(e,j.hide)&&M.id&&_(e.target).attr("for")===M.id&&e.preventDefault()}},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&j.check.disabled()})}},select:{mutation:function(e){j.is.selectMutation(e)&&(j.debug("<select> modified, recreating menu"),j.disconnect.selectObserver(),j.refresh(),j.setup.select(),j.set.selected(),j.observe.select())}},menu:{mutation:function(e){var e=e[0],t=e.addedNodes?_(e.addedNodes[0]):_(!1),e=e.removedNodes?_(e.removedNodes[0]):_(!1),t=t.add(e),e=t.is(b.addition)||0<t.closest(b.addition).length,t=t.is(b.message)||0<t.closest(b.message).length;e||t?(j.debug("Updating item selector cache"),j.refreshItems()):(j.debug("Menu modified, updating selector cache"),j.refresh())},mousedown:function(){H=!0},mouseup:function(){H=!1}},item:{mouseenter:function(e){var t=_(e.target),n=_(this),i=n.children(b.menu),o=n.siblings(b.item).children(b.menu),n=0<i.length;0<i.find(t).length||!n||(clearTimeout(j.itemTimer),j.itemTimer=setTimeout(function(){j.verbose("Showing sub-menu",i),_.each(o,function(){j.animate.hide(!1,_(this))}),j.animate.show(!1,i)},m.delay.show),e.preventDefault())},mouseleave:function(e){var t=_(this).find(b.menu);0<t.length&&(clearTimeout(j.itemTimer),j.itemTimer=setTimeout(function(){j.verbose("Hiding sub-menu",t),t.each(function(){j.animate.hide(!1,_(this))})},m.delay.hide))},click:function(e,t){var n=_(this),e=_(e?e.target:""),i=n.find(b.menu),o=j.get.choiceText(n),a=j.get.choiceValue(n,o),r=0<i.length,i=0<i.find(e).length;"input"!==te.activeElement.tagName.toLowerCase()&&_(te.activeElement).blur(),i||r&&!m.allowCategorySelection||(j.is.searchSelection()&&(m.allowAdditions&&j.remove.userAddition(),j.remove.searchTerm(),j.is.focusedOnSearch()||!0===t||j.focusSearch(!0)),m.useLabels||(j.remove.filteredItem(),j.set.scrollPosition(n)),j.determine.selectAction.call(this,o,a))}},document:{keydown:function(e){var t,n,i,o,a,r,s,l,c,u,d,f=e.which;j.is.inObject(f,h)&&((n=(t=x.find(b.label)).filter("."+p.active)).data(v.value),r=t.index(n),s=t.length,i=0<n.length,o=1<n.length,a=0===r,r=r+1==s,s=j.is.searchSelection(),l=j.is.focusedOnSearch(),c=j.is.focused(),d=(u=l&&0===j.get.caretPosition(!1))&&0!==j.get.caretPosition(!0),s&&!i&&!l||(f==h.leftArrow?!c&&!u||i?i&&(e.shiftKey?j.verbose("Adding previous label to selection"):(j.verbose("Selecting previous label"),t.removeClass(p.active)),a&&!o?n.addClass(p.active):n.prev(b.siblingLabel).addClass(p.active).end(),e.preventDefault()):(j.verbose("Selecting previous label"),t.last().addClass(p.active)):f==h.rightArrow?(c&&!i&&t.first().addClass(p.active),i&&(e.shiftKey?j.verbose("Adding next label to selection"):(j.verbose("Selecting next label"),t.removeClass(p.active)),r?s?l?t.removeClass(p.active):j.focusSearch():(o?n.next(b.siblingLabel):n).addClass(p.active):n.next(b.siblingLabel).addClass(p.active),e.preventDefault())):f==h.deleteKey||f==h.backspace?i?(j.verbose("Removing active labels"),r&&s&&!l&&j.focusSearch(),n.last().next(b.siblingLabel).addClass(p.active),j.remove.activeLabels(n),e.preventDefault()):!u||d||i||f!=h.backspace||(j.verbose("Removing last label on input backspace"),n=t.last().addClass(p.active),j.remove.activeLabels(n)):n.removeClass(p.active)))}},keydown:function(e){var t=e.which;if(j.is.inObject(t,h)||e.key===m.delimiter){var n,i=E.not(b.unselectable).filter("."+p.selected).eq(0),o=A.children("."+p.active).eq(0),i=0<i.length?i:o,o=0<i.length?i.siblings(":not(."+p.filtered+")").addBack():A.children(":not(."+p.filtered+")"),a=i.children(b.menu),r=i.closest(b.menu),s=r.hasClass(p.visible)||r.hasClass(p.animating)||0<r.parent(b.menu).length,l=0<a.length,c=0<i.length,u=0<i.not(b.unselectable).length,d=e.key===m.delimiter&&j.is.multiple();if(m.allowAdditions&&m.hideAdditions&&(t==h.enter||d)&&u&&(j.verbose("Selecting item from keyboard shortcut",i),j.event.item.click.call(i,e),j.is.searchSelection()&&j.remove.searchTerm(),j.is.multiple()&&e.preventDefault()),j.is.visible()){if(t!=h.enter&&!d||(t==h.enter&&c&&l&&!m.allowCategorySelection?(j.verbose("Pressed enter on unselectable category, opening sub menu"),t=h.rightArrow):u&&(j.verbose("Selecting item from keyboard shortcut",i),j.event.item.click.call(i,e),j.is.searchSelection()&&(j.remove.searchTerm(),j.is.multiple()&&k.focus())),e.preventDefault()),c&&(t==h.leftArrow&&r[0]!==A[0]&&(j.verbose("Left key pressed, closing sub-menu"),j.animate.hide(!1,r),i.removeClass(p.selected),r.closest(b.item).addClass(p.selected),e.preventDefault()),t==h.rightArrow&&l&&(j.verbose("Right key pressed, opening sub-menu"),j.animate.show(!1,a),i.removeClass(p.selected),a.find(b.item).eq(0).addClass(p.selected),e.preventDefault())),t==h.upArrow){if(n=(c&&s?i.prevAll(b.item+":not("+b.unselectable+")"):E).eq(0),o.index(n)<0)return j.verbose("Up key pressed but reached top of current menu"),void e.preventDefault();j.verbose("Up key pressed, changing active item"),i.removeClass(p.selected),n.addClass(p.selected),j.set.scrollPosition(n),m.selectOnKeydown&&j.is.single()&&!n.hasClass(p.actionable)&&j.set.selectedItem(n),e.preventDefault()}if(t==h.downArrow){if(0===(n=(c&&s?i.nextAll(b.item+":not("+b.unselectable+")"):E).eq(0)).length)return j.verbose("Down key pressed but reached bottom of current menu"),void e.preventDefault();j.verbose("Down key pressed, changing active item"),E.removeClass(p.selected),n.addClass(p.selected),j.set.scrollPosition(n),m.selectOnKeydown&&j.is.single()&&!n.hasClass(p.actionable)&&j.set.selectedItem(n),e.preventDefault()}t==h.pageUp&&(j.scrollPage("up"),e.preventDefault()),t==h.pageDown&&(j.scrollPage("down"),e.preventDefault()),t==h.escape&&(j.verbose("Escape key pressed, closing dropdown"),j.hide())}else d&&e.preventDefault(),t!=h.downArrow||j.is.visible()||(j.verbose("Down key pressed, showing dropdown"),j.show(),e.preventDefault())}else j.has.search()||j.set.selectedLetter(String.fromCharCode(t))}},trigger:{change:function(){var e,t=S[0];t&&(e=te.createEvent("HTMLEvents"),j.verbose("Triggering native change event"),e.initEvent("change",!0,!1),t.dispatchEvent(e))}},determine:{selectAction:function(e,t){f=!0,j.verbose("Determining action",m.action),_.isFunction(j.action[m.action])?(j.verbose("Triggering preset action",m.action,e,t),j.action[m.action].call(M,e,t,this)):_.isFunction(m.action)?(j.verbose("Triggering user action",m.action,e,t),m.action.call(M,e,t,this)):j.error(u.action,m.action),f=!1},eventInModule:function(e,t){var e=_(e.target),n=0<e.closest(te.documentElement).length,e=0<e.closest(x).length;return t=_.isFunction(t)?t:function(){},n&&!e?(j.verbose("Triggering event",t),t(),!0):(j.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(e,t){var n=_(e.target),i=n.closest(b.siblingLabel),e=te.body.contains(e.target),i=0===x.find(i).length||!(j.is.multiple()&&m.useLabels),n=0===n.closest(A).length;return t=_.isFunction(t)?t:function(){},e&&i&&n?(j.verbose("Triggering event",t),t(),!0):(j.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(e,t,n){t=t!==ne?t:e,j.can.activate(_(n))&&(j.set.selected(t,_(n)),j.is.multiple()||!m.collapseOnActionable&&_(n).hasClass(p.actionable)||j.hideAndClear())},select:function(e,t,n){t=t!==ne?t:e,j.can.activate(_(n))&&(j.set.value(t,e,_(n)),j.is.multiple()||!m.collapseOnActionable&&_(n).hasClass(p.actionable)||j.hideAndClear())},combo:function(e,t,n){j.set.selected(t=t!==ne?t:e,_(n)),j.hideAndClear()},hide:function(e,t,n){j.set.value(t,e,_(n)),j.hideAndClear()}},get:{id:function(){return o},defaultText:function(){return x.data(v.defaultText)},defaultValue:function(){return x.data(v.defaultValue)},placeholderText:function(){return"auto"!=m.placeholder&&"string"==typeof m.placeholder?m.placeholder:x.data(v.placeholderText)||""},text:function(){return m.preserveHTML?w.html():w.text()},query:function(){return String(k.val()).trim()},searchWidth:function(e){return e=e!==ne?e:k.val(),T.text(e),Math.ceil(T.width()+(j.is.edge()?3:1))},selectionCount:function(){var e=j.get.values();return j.is.multiple()?Array.isArray(e)?e.length:0:""!==j.get.value()?1:0},transition:function(e){return"auto"===m.transition?j.is.upward(e)?"slide up":"slide down":m.transition},userValues:function(){var e=j.get.values();return!!e&&(e=Array.isArray(e)?e:[e],_.grep(e,function(e){return!1===j.get.item(e)}))},uniqueArray:function(n){return _.grep(n,function(e,t){return _.inArray(e,n)===t})},caretPosition:function(e){var t,n,i=k.get(0);return e&&"selectionEnd"in i?i.selectionEnd:!e&&"selectionStart"in i?i.selectionStart:te.selection?(i.focus(),n=(t=te.selection.createRange()).text.length,e?n:(t.moveStart("character",-i.value.length),t.text.length-n)):void 0},value:function(){var e=0<S.length?S.val():x.data(v.value),t=Array.isArray(e)&&1===e.length&&""===e[0];return e===ne||t?"":e},values:function(e){var t=j.get.value();return""===t?"":!j.has.selectInput()&&j.is.multiple()?"string"==typeof t?(e?t:j.escape.htmlEntities(t)).split(m.delimiter):"":t},remoteValues:function(){var e=j.get.values(),i=!1;return e&&_.each(e="string"==typeof e?[e]:e,function(e,t){var n=j.read.remoteData(t);j.verbose("Restoring value from session data",n,t),n&&((i=i||{})[t]=n)}),i},choiceText:function(e,t){if(t=t!==ne?t:m.preserveHTML,e)return 0<e.find(b.menu).length&&(j.verbose("Retrieving text of element with sub-menu"),(e=e.clone()).find(b.menu).remove(),e.find(b.menuIcon).remove()),e.data(v.text)!==ne?e.data(v.text):t?e.html()&&e.html().trim():e.text()&&e.text().trim()},choiceValue:function(e,t){return t=t||j.get.choiceText(e),!!e&&(e.data(v.value)!==ne?String(e.data(v.value)):"string"==typeof t?String(m.ignoreSearchCase?t.toLowerCase():t).trim():String(t))},inputEvent:function(){var e=k[0];return!!e&&(e.oninput!==ne?"input":e.onpropertychange!==ne?"propertychange":"keyup")},selectValues:function(){var a={},r=[],s=[];return x.find("option").each(function(){var e=_(this),t=e.html(),n=e.attr("disabled"),i=e.attr("value")!==ne?e.attr("value"):t,o=e.data(v.text)!==ne?e.data(v.text):t,e=e.parent("optgroup");"auto"===m.placeholder&&""===i?a.placeholder=t:(e.length===r.length&&e[0]===r[0]||(s.push({type:"header",divider:m.headerDivider,name:e.attr("label")||""}),r=e),s.push({name:t,value:i,text:o,disabled:n}))}),m.placeholder&&"auto"!==m.placeholder&&(j.debug("Setting placeholder value to",m.placeholder),a.placeholder=m.placeholder),m.sortSelect?(!0===m.sortSelect?s.sort(function(e,t){return e.name.localeCompare(t.name)}):"natural"===m.sortSelect?s.sort(function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())}):_.isFunction(m.sortSelect)&&s.sort(m.sortSelect),a[l.values]=s,j.debug("Retrieved and sorted values from select",a)):(a[l.values]=s,j.debug("Retrieved values from select",a)),a},activeItem:function(){return E.filter("."+p.active)},selectedItem:function(){var e=E.not(b.unselectable).filter("."+p.selected);return 0<e.length?e:E.eq(0)},itemWithAdditions:function(e){var t=j.get.item(e),e=j.create.userChoice(e);return t=e&&0<e.length?0<t.length?t.add(e):e:t},item:function(n,i){var e,o,a=!1;return n=n!==ne?n:j.get.values()!==ne?j.get.values():j.get.text(),e=(o=j.is.multiple()&&Array.isArray(n))?0<n.length:n!==ne&&null!==n,i=""===n||!1===n||!0===n||(i||!1),e&&E.each(function(){var e=_(this),t=j.get.choiceText(e),t=j.get.choiceValue(e,t);if(null!==t&&t!==ne)if(o)-1!==_.inArray(j.escape.htmlEntities(String(t)),n.map(function(e){return String(e)}))&&(a=a?a.add(e):e);else if(i){if(j.verbose("Ambiguous dropdown value using strict type check",e,n),t===n)return a=e,!0}else if(m.ignoreCase&&(t=t.toLowerCase(),n=n.toLowerCase()),j.escape.htmlEntities(String(t))===j.escape.htmlEntities(String(n)))return j.verbose("Found select item by value",t,n),a=e,!0}),a},displayType:function(){return x.hasClass("column")?"flex":m.displayType}},check:{maxSelections:function(e){return!m.maxSelections||((e=e!==ne?e:j.get.selectionCount())>=m.maxSelections?(j.debug("Maximum selection count reached"),m.useLabels&&(E.addClass(p.filtered),j.add.message(g.maxSelections)),!0):(j.verbose("No longer at maximum selection count"),j.remove.message(),j.remove.filteredItem(),j.is.searchSelection()&&j.filterItems(),!1))},disabled:function(){k.attr("tabindex",j.is.disabled()?-1:0)}},restore:{defaults:function(e){j.clear(e),j.restore.defaultText(),j.restore.defaultValue()},defaultText:function(){var e=j.get.defaultText();e===j.get.placeholderText?(j.debug("Restoring default placeholder text",e),j.set.placeholderText(e)):(j.debug("Restoring default text",e),j.set.text(e))},placeholderText:function(){j.set.placeholderText()},defaultValue:function(){var e=j.get.defaultValue();e!==ne&&(j.debug("Restoring default value",e),""!==e?(j.set.value(e),j.set.selected()):(j.remove.activeItem(),j.remove.selectedItem()))},labels:function(){m.allowAdditions&&(m.useLabels||(j.error(u.labels),m.useLabels=!0),j.debug("Restoring selected values"),j.create.userLabels()),j.check.maxSelections()},selected:function(){j.restore.values(),j.is.multiple()?(j.debug("Restoring previously selected values and labels"),j.restore.labels()):j.debug("Restoring previously selected values")},values:function(){j.set.initialLoad(),m.apiSettings&&m.saveRemoteData&&j.get.remoteValues()?j.restore.remoteValues():j.set.selected();var e=j.get.value();!e||""===e||Array.isArray(e)&&0===e.length?S.addClass(p.noselection):S.removeClass(p.noselection),j.remove.initialLoad()},remoteValues:function(){var e=j.get.remoteValues();j.debug("Recreating selected from session data",e),e&&(j.is.single()?_.each(e,function(e,t){j.set.text(t)}):_.each(e,function(e,t){j.add.label(e,t)}))}},read:{remoteData:function(e){if(ee.Storage!==ne)return(e=sessionStorage.getItem(e+i))!==ne&&e;j.error(u.noStorage)}},save:{defaults:function(){j.save.defaultText(),j.save.placeholderText(),j.save.defaultValue()},defaultValue:function(){var e=j.get.value();j.verbose("Saving default value as",e),x.data(v.defaultValue,e)},defaultText:function(){var e=j.get.text();j.verbose("Saving default text as",e),x.data(v.defaultText,e)},placeholderText:function(){var e;!1!==m.placeholder&&w.hasClass(p.placeholder)&&(e=j.get.text(),j.verbose("Saving placeholder text as",e),x.data(v.placeholderText,e))},remoteData:function(e,t){ee.Storage===ne?j.error(u.noStorage):(j.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t+i,e))}},clear:function(e){j.is.multiple()&&m.useLabels?j.remove.labels(x.find(b.label),e):(j.remove.activeItem(),j.remove.selectedItem(),j.remove.filteredItem()),j.set.placeholderText(),j.clearValue(e)},clearValue:function(e){j.set.value("",null,null,e)},scrollPage:function(e,t){var t=t||j.get.selectedItem(),n=t.closest(b.menu),i=n.outerHeight(),o=n.scrollTop(),a=E.eq(0).outerHeight(),i=Math.floor(i/a),o=(n.prop("scrollHeight"),"up"==e?o-a*i:o+a*i),a=E.not(b.unselectable),i="up"==e?a.index(t)-i:a.index(t)+i,i=("up"==e?0<=i:i<a.length)?a.eq(i):"up"==e?a.first():a.last();0<i.length&&(j.debug("Scrolling page",e,i),t.removeClass(p.selected),i.addClass(p.selected),m.selectOnKeydown&&j.is.single()&&!$nextItem.hasClass(p.actionable)&&j.set.selectedItem(i),n.scrollTop(o))},set:{filtered:function(){var e=j.is.multiple(),t=j.is.searchSelection(),n=e&&t,t=t?j.get.query():"",i="string"==typeof t&&0<t.length,o=j.get.searchWidth(),t=""!==t;e&&i&&(j.verbose("Adjusting input width",o,m.glyphWidth),k.css("width",o)),i||n&&t?(j.verbose("Hiding placeholder text"),w.addClass(p.filtered)):e&&(!n||t)||(j.verbose("Showing placeholder text"),w.removeClass(p.filtered))},empty:function(){x.addClass(p.empty)},loading:function(){x.addClass(p.loading)},placeholderText:function(e){e=e||j.get.placeholderText(),j.debug("Setting placeholder text",e),j.set.text(e),w.addClass(p.placeholder)},tabbable:function(){j.is.searchSelection()?(j.debug("Added tabindex to searchable dropdown"),k.val(""),j.check.disabled(),A.attr("tabindex",-1)):(j.debug("Added tabindex to dropdown"),x.attr("tabindex")===ne&&(x.attr("tabindex",0),A.attr("tabindex",-1)))},initialLoad:function(){j.verbose("Setting initial load"),e=!0},activeItem:function(e){m.allowAdditions&&0<e.filter(b.addition).length?e.addClass(p.filtered):e.addClass(p.active)},partialSearch:function(e){var t=j.get.query().length;k.val(e.slice(0,t))},scrollPosition:function(e,t){var n,i,o=(e=e||j.get.selectedItem()).closest(b.menu),a=e&&0<e.length;t=t!==ne&&t,0===j.get.activeItem().length&&(t=!1),e&&0<o.length&&a&&(e.position().top,o.addClass(p.loading),e=(a=o.scrollTop())-o.offset().top+e.offset().top,t||(i=a+o.height()<e+5,n=e-5<a),j.debug("Scrolling to active item",e),(t||n||i)&&o.scrollTop(e),o.removeClass(p.loading))},text:function(e){"combo"===m.action?(j.debug("Changing combo button text",e,D),m.preserveHTML?D.html(e):D.text(e)):"activate"===m.action&&(e!==j.get.placeholderText()&&w.removeClass(p.placeholder),j.debug("Changing text",e,w),w.removeClass(p.filtered),m.preserveHTML?w.html(e):w.text(e))},selectedItem:function(e){var t=j.get.choiceValue(e),n=j.get.choiceText(e,!1),i=j.get.choiceText(e,!0);j.debug("Setting user selection to item",e),j.remove.activeItem(),j.set.partialSearch(n),j.set.activeItem(e),j.set.selected(t,e),j.set.text(i)},selectedLetter:function(e){var t,n=E.filter("."+p.selected),i=0<n.length&&j.has.firstLetter(n,e),o=!1;i&&(t=n.nextAll(E).eq(0),j.has.firstLetter(t,e)&&(o=t)),o||E.each(function(){if(j.has.firstLetter(_(this),e))return o=_(this),!1}),o&&(j.verbose("Scrolling to next value with letter",e),j.set.scrollPosition(o),n.removeClass(p.selected),o.addClass(p.selected),m.selectOnKeydown&&j.is.single()&&!t.hasClass(p.actionable)&&j.set.selectedItem(o))},direction:function(e){"auto"===m.direction?(e?j.is.upward(e)&&j.remove.upward(e):j.remove.upward(),(j.can.openDownward(e)?j.remove:j.set).upward(e),j.is.leftward(e)||j.can.openRightward(e)||j.set.leftward(e)):"upward"===m.direction&&j.set.upward(e)},upward:function(e){(e||x).addClass(p.upward)},leftward:function(e){(e||A).addClass(p.leftward)},value:function(e,t,n,i){"boolean"==typeof t&&(i=t,t=n=ne),e===ne||""===e||Array.isArray(e)&&0===e.length?S.addClass(p.noselection):S.removeClass(p.noselection);var o=j.escape.value(e),a=0<S.length,r=j.get.values(),s=e!==ne?String(e):e;if(a){if(!m.allowReselection&&s==r&&(j.verbose("Skipping value update already same value",e,r),!j.is.initialLoad()))return;j.is.single()&&j.has.selectInput()&&j.can.extendSelect()&&(j.debug("Adding user option",e),j.add.optionValue(e)),j.debug("Updating input value",o,r),U=!0,S.val(o),!1===m.fireOnInit&&j.is.initialLoad()?j.debug("Input native change event ignored on initial load"):!0!==i&&j.trigger.change(),U=!1}else j.verbose("Storing value in metadata",o,S),o!==r&&x.data(v.value,s);!1===m.fireOnInit&&j.is.initialLoad()?j.verbose("No callback on initial load",m.onChange):!0!==i&&m.onChange.call(M,e,t,n)},active:function(){x.addClass(p.active)},multiple:function(){x.addClass(p.multiple)},visible:function(){x.addClass(p.visible)},exactly:function(e,t,n){"boolean"==typeof t&&(n=t,t=ne),j.debug("Setting selected to exact values"),j.clear(),j.set.selected(e,t,n)},selected:function(e,l,c,u){"boolean"==typeof l&&(u=c,c=l,l=ne);var d=j.is.multiple();(l=m.allowAdditions?l||j.get.itemWithAdditions(e):l||j.get.item(e))&&(j.debug("Setting selected menu item to",l),j.is.multiple()&&j.remove.searchWidth(),j.is.single()?(j.remove.activeItem(),j.remove.selectedItem()):m.useLabels&&j.remove.selectedItem(),l.each(function(){var e=_(this),t=j.get.choiceText(e),n=j.get.choiceValue(e,t),i=e.hasClass(p.filtered),o=e.hasClass(p.active),a=e.hasClass(p.actionable),r=e.hasClass(p.addition),s=d&&l&&1===l.length;a?(d&&o&&!r||!m.apiSettings||!m.saveRemoteData||j.save.remoteData(t,n),m.onActionable.call(M,n,t,e)):d?!o||r?(m.apiSettings&&m.saveRemoteData&&j.save.remoteData(t,n),m.useLabels?(j.add.value(n,t,e,c),j.add.label(n,t,s),j.set.activeItem(e),j.filterActive(),j.select.nextAvailable(l)):(j.add.value(n,t,e,c),j.set.text(j.add.variables(g.count)),j.set.activeItem(e))):i||!m.useLabels&&!f||(j.debug("Selected active value, removing label"),j.remove.selected(n)):(m.apiSettings&&m.saveRemoteData&&j.save.remoteData(t,n),u||e.hasClass(p.actionable)||j.set.text(t),j.set.value(n,t,e,c),e.addClass(p.active).addClass(p.selected))}),u||j.remove.searchTerm())}},add:{label:function(e,t,n){var i,o=j.is.searchSelection()?k:w,a=j.escape.value(e);m.ignoreCase&&(a=a.toLowerCase()),i=_("<a />").addClass(p.label).attr("data-"+v.value,a).html(q.label(a,t,m.preserveHTML,m.className)),i=m.onLabelCreate.call(i,a,t),j.has.label(e)?j.debug("User selection already exists, skipping",a):(m.label.variation&&i.addClass(m.label.variation),!0===n?(j.debug("Animating in label",i),i.addClass(p.hidden).insertBefore(o).transition({animation:m.label.transition,debug:m.debug,verbose:m.verbose,duration:m.label.duration})):(j.debug("Adding selection label",i),i.insertBefore(o)))},message:function(e){var t=A.children(b.message),e=m.templates.message(j.add.variables(e));0<t.length?t.html(e):_("<div/>").html(e).addClass(p.message).appendTo(A)},optionValue:function(e){var t=j.escape.value(e);0<S.find('option[value="'+j.escape.string(t)+'"]').length||(j.disconnect.selectObserver(),j.is.single()&&(j.verbose("Removing previous user addition"),S.find("option."+p.addition).remove()),_("<option/>").prop("value",t).addClass(p.addition).text(e).appendTo(S),j.verbose("Adding user addition as an <option>",e),j.observe.select())},userSuggestion:function(e){var t=A.children(b.addition),n=j.get.item(e),n=n&&n.not(b.addition).length,i=0<t.length;m.useLabels&&j.has.maxSelections()||(""===e||n?t.remove():(i?(t.data(v.value,e).data(v.text,e).attr("data-"+v.value,e).attr("data-"+v.text,e).removeClass(p.filtered),m.hideAdditions||(n=m.templates.addition(j.add.variables(g.addResult,e)),t.html(n)),j.verbose("Replacing user suggestion with new value",t)):((t=j.create.userChoice(e)).prependTo(A),j.verbose("Adding item choice to menu corresponding with user choice addition",t)),m.hideAdditions&&!j.is.allFiltered()||t.addClass(p.selected).siblings().removeClass(p.selected),j.refreshItems()))},variables:function(e,t){var n,i=-1!==e.search("{count}"),o=-1!==e.search("{maxCount}"),a=-1!==e.search("{term}");return j.verbose("Adding templated variables to message",e),i&&(n=j.get.selectionCount(),e=e.replace("{count}",n)),o&&(n=j.get.selectionCount(),e=e.replace("{maxCount}",m.maxSelections)),a&&(i=t||j.get.query(),e=e.replace("{term}",i)),e},value:function(e,t,n,i){"boolean"==typeof t&&(i=t,t=n=ne);var o,a=j.get.values(!0);j.has.value(e)?j.debug("Value already selected"):""===e?j.debug("Cannot select blank values from multiselect"):(o=Array.isArray(a)?(o=n&&n.hasClass(p.actionable)?a:a.concat([e]),j.get.uniqueArray(o)):[e],j.has.selectInput()?j.can.extendSelect()&&(j.debug("Adding value to select",e,o,S),j.add.optionValue(e)):(o=o.join(m.delimiter),j.debug("Setting hidden input to delimited value",o,S)),!1===m.fireOnInit&&j.is.initialLoad()?j.verbose("Skipping onadd callback on initial load",m.onAdd):m.onAdd.call(M,e,t,n),j.set.value(o,t,n,i),j.check.maxSelections())}},remove:{active:function(){x.removeClass(p.active)},activeLabel:function(){x.find(b.label).removeClass(p.active)},empty:function(){x.removeClass(p.empty)},loading:function(){x.removeClass(p.loading)},initialLoad:function(){e=!1},upward:function(e){(e||x).removeClass(p.upward)},leftward:function(e){(e||A).removeClass(p.leftward)},visible:function(){x.removeClass(p.visible)},activeItem:function(){E.removeClass(p.active)},filteredItem:function(){m.useLabels&&j.has.maxSelections()||((m.useLabels&&j.is.multiple()?E.not("."+p.active):E).removeClass(p.filtered),m.hideDividers&&F.removeClass(p.hidden),j.remove.empty())},optionValue:function(e){var e=j.escape.value(e),t=S.find('option[value="'+j.escape.string(e)+'"]');0<t.length&&t.hasClass(p.addition)&&(j.disconnect.selectObserver(),t.remove(),j.verbose("Removing user addition as an <option>",e),j.observe.select())},message:function(){A.children(b.message).remove()},searchWidth:function(){k.css("width","")},searchTerm:function(){j.verbose("Cleared search term"),k.val(""),j.set.filtered()},userAddition:function(){E.filter(b.addition).remove()},selected:function(e,t,i){if(!(t=m.allowAdditions?t||j.get.itemWithAdditions(e):t||j.get.item(e)))return!1;t.each(function(){var e=_(this),t=j.get.choiceText(e),n=j.get.choiceValue(e,t);j.is.multiple()?m.useLabels?(j.remove.value(n,t,e,i),j.remove.label(n)):(j.remove.value(n,t,e,i),0===j.get.selectionCount()?j.set.placeholderText():j.set.text(j.add.variables(g.count))):j.remove.value(n,t,e,i),e.removeClass(p.filtered).removeClass(p.active),m.useLabels&&e.removeClass(p.selected)})},selectedItem:function(){E.removeClass(p.selected)},value:function(e,t,n,i){var o,a=j.get.values();e=j.escape.htmlEntities(e),j.has.selectInput()?(j.verbose("Input is <select> removing selected option",e),o=j.remove.arrayValue(e,a),j.remove.optionValue(e)):(j.verbose("Removing from delimited values",e),o=(o=j.remove.arrayValue(e,a)).join(m.delimiter)),!1===m.fireOnInit&&j.is.initialLoad()?j.verbose("No callback on initial load",m.onRemove):m.onRemove.call(M,e,t,n),j.set.value(o,t,n,i),j.check.maxSelections()},arrayValue:function(t,e){return Array.isArray(e)||(e=[e]),e=_.grep(e,function(e){return t!=e}),j.verbose("Removed value from delimited string",t,e),e},label:function(e,t){e=j.escape.value(e),e=x.find(b.label).filter("[data-"+v.value+'="'+j.escape.string(m.ignoreCase?e.toLowerCase():e)+'"]');j.verbose("Removing label",e),e.remove()},activeLabels:function(e){e=e||x.find(b.label).filter("."+p.active),j.verbose("Removing active label selections",e),j.remove.labels(e)},labels:function(e,o){e=e||x.find(b.label),j.verbose("Removing labels",e),e.each(function(){var e=_(this),t=e.data(v.value),n=t!==ne?String(t):t,i=j.is.userValue(n);!1===m.onLabelRemove.call(e,t)?j.debug("Label remove callback cancelled removal"):(j.remove.message(),i?(j.remove.value(n,n,j.get.item(n),o),j.remove.label(n)):j.remove.selected(n,!1,o))})},tabbable:function(){j.is.searchSelection()?(j.debug("Searchable dropdown initialized"),k.removeAttr("tabindex")):(j.debug("Simple selection dropdown initialized"),x.removeAttr("tabindex")),A.removeAttr("tabindex")},diacritics:function(e){return m.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}},has:{menuSearch:function(){return j.has.search()&&0<k.closest(A).length},clearItem:function(){return 0<z.length},search:function(){return 0<k.length},sizer:function(){return 0<T.length},selectInput:function(){return S.is("select")},minCharacters:function(e){return m.minCharacters&&!P?(e=e!==ne?String(e):String(j.get.query())).length>=m.minCharacters:!(P=!1)},firstLetter:function(e,t){return!(!e||0===e.length||"string"!=typeof t)&&(e=j.get.choiceText(e,!1),(t=t.toLowerCase())==String(e).charAt(0).toLowerCase())},input:function(){return 0<S.length},items:function(){return 0<E.length},menu:function(){return 0<A.length},subMenu:function(e){return 0<(e||A).find(b.menu).length},message:function(){return 0!==A.children(b.message).length},label:function(e){var e=j.escape.value(e),t=x.find(b.label);return m.ignoreCase&&(e=e.toLowerCase()),0<t.filter("[data-"+v.value+'="'+j.escape.string(e)+'"]').length},maxSelections:function(){return m.maxSelections&&j.get.selectionCount()>=m.maxSelections},allResultsFiltered:function(){var e=E.not(b.addition);return e.filter(b.unselectable).length===e.length},userSuggestion:function(){return 0<A.children(b.addition).length},query:function(){return""!==j.get.query()},value:function(e){return m.ignoreCase?j.has.valueIgnoringCase(e):j.has.valueMatchingCase(e)},valueMatchingCase:function(e){var t=j.get.values(!0);return!!(Array.isArray(t)?t&&-1!==_.inArray(e,t):t==e)},valueIgnoringCase:function(n){var e=j.get.values(!0),i=!1;return Array.isArray(e)||(e=[e]),_.each(e,function(e,t){if(String(n).toLowerCase()==String(t).toLowerCase())return!(i=!0)}),i}},is:{active:function(){return x.hasClass(p.active)},animatingInward:function(){return A.transition("is inward")},animatingOutward:function(){return A.transition("is outward")},bubbledLabelClick:function(e){return _(e.target).is("select, input")&&0<x.closest("label").length},bubbledIconClick:function(e){return 0<_(e.target).closest(N).length},edge:function(){return!!ee.chrome&&!!ee.StyleMedia},chrome:function(){return!!ee.chrome&&!ee.StyleMedia},alreadySetup:function(){return x.is("select")&&x.parent(b.dropdown).data(y)!==ne&&0===x.prev().length},animating:function(e){return e?e.transition&&e.transition("is animating"):A.transition&&A.transition("is animating")},leftward:function(e){return(e||A).hasClass(p.leftward)},clearable:function(){return x.hasClass(p.clearable)||m.clearable},disabled:function(){return x.hasClass(p.disabled)},focused:function(){return te.activeElement===x[0]},focusedOnSearch:function(){return te.activeElement===k[0]},allFiltered:function(){return(j.is.multiple()||j.has.search())&&!(0==m.hideAdditions&&j.has.userSuggestion())&&!j.has.message()&&j.has.allResultsFiltered()},hidden:function(e){return!j.is.visible(e)},initialLoad:function(){return e},inObject:function(n,e){var i=!1;return _.each(e,function(e,t){if(t==n)return i=!0}),i},multiple:function(){return x.hasClass(p.multiple)},remote:function(){return m.apiSettings&&j.can.useAPI()},noApiCache:function(){return m.apiSettings&&!m.apiSettings.cache},single:function(){return!j.is.multiple()},selectMutation:function(e){var n=!1;return _.each(e,function(e,t){if(_(t.target).is("select, option, optgroup")||_(t.addedNodes).is("select"))return!(n=!0)}),n},search:function(){return x.hasClass(p.search)},searchSelection:function(){return j.has.search()&&1===k.parent(b.dropdown).length},selection:function(){return x.hasClass(p.selection)},userValue:function(e){return-1!==_.inArray(e,j.get.userValues())},upward:function(e){return(e||x).hasClass(p.upward)},visible:function(e){return(e||A).hasClass(p.visible)},verticallyScrollableContext:function(){var e=C.get(0)!==ee&&C.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=C.get(0)!==ee&&C.css("overflow-X");return"auto"==e||"scroll"==e}},can:{activate:function(e){return!!m.useLabels||(!j.has.maxSelections()||!(!j.has.maxSelections()||!e.hasClass(p.active)))},openDownward:function(e){var t,e=e||A,n=!0;return e.addClass(p.loading),t={context:{offset:C.get(0)===ee?{top:0,left:0}:C.offset(),scrollTop:C.scrollTop(),height:C.outerHeight()},menu:{offset:e.offset(),height:e.outerHeight()}},j.is.verticallyScrollableContext()&&(t.menu.offset.top+=t.context.scrollTop),j.has.subMenu(e)&&(t.menu.height+=e.find(b.menu).first().outerHeight()),n=(t={above:t.context.scrollTop<=t.menu.offset.top-t.context.offset.top-t.menu.height,below:t.context.scrollTop+t.context.height>=t.menu.offset.top-t.context.offset.top+t.menu.height}).below?(j.verbose("Dropdown can fit in context downward",t),!0):t.above?(j.verbose("Dropdown cannot fit below, opening upward",t),!1):(j.verbose("Dropdown cannot fit in either direction, favoring downward",t),!0),e.removeClass(p.loading),n},openRightward:function(e){var t,e=e||A,n=!0;return e.addClass(p.loading),t={context:{offset:C.get(0)===ee?{top:0,left:0}:C.offset(),scrollLeft:C.scrollLeft(),width:C.outerWidth()},menu:{offset:e.offset(),width:e.outerWidth()}},j.is.horizontallyScrollableContext()&&(t.menu.offset.left+=t.context.scrollLeft),(t=t.menu.offset.left-t.context.offset.left+t.menu.width>=t.context.scrollLeft+t.context.width)&&(j.verbose("Dropdown cannot fit in context rightward",t),n=!1),e.removeClass(p.loading),n},extendSelect:function(){return m.allowAdditions||m.apiSettings},show:function(){return!j.is.disabled()&&(j.has.items()||j.has.message())},useAPI:function(){return _.fn.api!==ne}},animate:{show:function(e,t){var n=t||A,i=t?function(){}:function(){j.hideSubMenus(),j.hideOthers(),j.set.active()};e=_.isFunction(e)?e:function(){},j.verbose("Doing menu show animation",n),j.set.direction(t),t=m.transition.showMethod||j.get.transition(t),j.is.selection()&&j.set.scrollPosition(j.get.selectedItem(),!0),(j.is.hidden(n)||j.is.animating(n))&&("none"===t?(i(),n.transition({displayType:j.get.displayType()}).transition("show"),e.call(M)):_.fn.transition!==ne&&x.transition("is supported")?n.transition({animation:t+" in",debug:m.debug,verbose:m.verbose,duration:m.transition.showDuration||m.duration,queue:!0,onStart:i,displayType:j.get.displayType(),onComplete:function(){e.call(M)}}):j.error(u.noTransition,t))},hide:function(e,t){var n=t||A,i=t?function(){}:function(){j.unbind.intent(),j.remove.active()},t=m.transition.hideMethod||j.get.transition(t);e=_.isFunction(e)?e:function(){},(j.is.visible(n)||j.is.animating(n))&&(j.verbose("Doing menu hide animation",n),"none"===t?(i(),n.transition({displayType:j.get.displayType()}).transition("hide"),e.call(M)):_.fn.transition!==ne&&x.transition("is supported")?n.transition({animation:t+" out",duration:m.transition.hideDuration||m.duration,debug:m.debug,verbose:m.verbose,queue:!1,onStart:i,displayType:j.get.displayType(),onComplete:function(){e.call(M)}}):j.error(u.transition))}},hideAndClear:function(){j.remove.searchTerm(),j.has.maxSelections()||(j.has.search()?j.hide(function(){j.remove.filteredItem()}):j.hide())},delay:{show:function(){j.verbose("Delaying show event to ensure user intent"),clearTimeout(j.timer),j.timer=setTimeout(j.show,m.delay.show)},hide:function(){j.verbose("Delaying hide event to ensure user intent"),clearTimeout(j.timer),j.timer=setTimeout(j.hide,m.delay.hide)}},escape:{value:function(e){var t=Array.isArray(e),n="string"==typeof e,i=!n&&!t,n=n&&-1!==e.search(c.quote),o=[];return i||!n?e:(j.debug("Encoding quote values for use in select",e),t?(_.each(e,function(e,t){o.push(t.replace(c.quote,"""))}),o):e.replace(c.quote,"""))},string:function(e){return(e=String(e)).replace(c.escape,"\\$&")},htmlEntities:function(e){var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return t[e]}):e}},setting:function(e,t){if(j.debug("Changing setting",e,t),_.isPlainObject(e))_.extend(!0,m,e);else{if(t===ne)return m[e];_.isPlainObject(m[e])?_.extend(!0,m[e],t):m[e]=t}},internal:function(e,t){if(_.isPlainObject(e))_.extend(!0,j,e);else{if(t===ne)return j[e];j[e]=t}},debug:function(){!m.silent&&m.debug&&(m.performance?j.performance.log(arguments):(j.debug=Function.prototype.bind.call(console.info,console,m.name+":"),j.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?j.performance.log(arguments):(j.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),j.verbose.apply(console,arguments)))},error:function(){m.silent||(j.error=Function.prototype.bind.call(console.error,console,m.name+":"),j.error.apply(console,arguments))},performance:{log:function(e){var t,n;m.performance&&(n=(t=(new Date).getTime())-($||t),$=t,X.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:M,"Execution Time":n})),clearTimeout(j.performance.timer),j.performance.timer=setTimeout(j.performance.display,500)},display:function(){var e=m.name+":",n=0;$=!1,clearTimeout(j.performance.timer),_.each(X,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",K&&(e+=" '"+K+"'"),(console.group!==ne||console.table!==ne)&&0<X.length&&(console.groupCollapsed(e),console.table?console.table(X):_.each(X,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),X=[]}},invoke:function(i,e,t){var o,a,n,r=I;return e=e||Z,t=M||t,"string"==typeof i&&r!==ne&&(i=i.split(/[\. ]/),o=i.length-1,_.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(_.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==ne)return a=r[n],!1;{if(!_.isPlainObject(r[t])||e==o)return r[t]!==ne?a=r[t]:j.error(u.method,i),!1;r=r[t]}}})),_.isFunction(a)?n=a.apply(t,e):a!==ne&&(n=a),Array.isArray(Y)?Y.push(n):Y!==ne?Y=[Y,n]:n!==ne&&(Y=n),a}};J?(I===ne&&j.initialize(),j.invoke(G)):(I!==ne&&I.invoke("destroy"),j.initialize())}),Y!==ne?Y:W},_.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",values:!1,clearable:!1,apiSettings:!1,selectOnKeydown:!0,minCharacters:0,filterRemoteData:!1,saveRemoteData:!0,throttle:200,context:ee,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:"exact",ignoreDiacritics:!1,hideDividers:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!1,allowAdditions:!1,ignoreCase:!1,ignoreSearchCase:!0,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!1,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,displayType:!1,glyphWidth:1.037,headerDivider:!0,collapseOnActionable:!0,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20},onChange:function(e,t,n){},onAdd:function(e,t,n){},onRemove:function(e,t,n){},onActionable:function(e,t,n){},onSearch:function(e){},onLabelSelect:function(e){},onLabelCreate:function(e,t){return _(this)},onLabelRemove:function(e){return!0},onNoResults:function(e){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add <b>{term}</b>",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:"<select> requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",description:"description",descriptionVertical:"descriptionVertical",value:"value",text:"text",type:"type",image:"image",imageClass:"imageClass",icon:"icon",iconClass:"iconClass",class:"class",divider:"divider",actionable:"actionable"},keys:{backspace:8,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",divider:".divider, .header",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> span.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered",clearIcon:"> .remove.icon"},className:{active:"active",addition:"addition",animating:"animating",description:"description",descriptionVertical:"vertical",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",icon:"icon",image:"image",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",text:"text",upward:"upward",leftward:"left",visible:"visible",clearable:"clearable",noselection:"noselection",delete:"delete",header:"header",divider:"divider",groupIcon:"",unfilterable:"unfilterable",actionable:"actionable"}},_.fn.dropdown.settings.templates={deQuote:function(e,t){return String(e).replace(/"/g,t?""":"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e},dropdown:function(e,t,n,i){var o=e.placeholder||!1,a="",r=_.fn.dropdown.settings.templates.escape;return a=(a=(a=(a+='<i class="dropdown icon"></i>')+(o?'<div class="default text">'+r(o,n)+"</div>":'<div class="text"></div>'))+('<div class="'+i.menu+'">'))+_.fn.dropdown.settings.templates.menu(e,t,n,i)+"</div>"},menu:function(e,c,u,d){var e=e[c.values]||[],f="",m=_.fn.dropdown.settings.templates.escape,p=_.fn.dropdown.settings.templates.deQuote;return _.each(e,function(e,t){var n,i,o,a,r,s=t[c.type]||"item",l=-1!==s.indexOf("menu");"item"===s||l?(n=t[c.text]?' data-text="'+p(t[c.text],!0)+'"':"",a=t[c.actionable]?d.actionable+" ":"",r=t[c.disabled]?d.disabled+" ":"",i=t[c.descriptionVertical]?d.descriptionVertical+" ":"",o=""!=m(t[c.description]||"",u),f+='<div class="'+a+r+i+(t[c.class]?p(t[c.class]):d.item)+'" data-value="'+p(t[c.value],!0)+'"'+n+">",l&&(f+='<i class="'+(-1!==s.indexOf("left")?"left":"")+' dropdown icon"></i>'),t[c.image]&&(f+='<img class="'+(t[c.imageClass]?p(t[c.imageClass]):d.image)+'" src="'+p(t[c.image])+'">'),t[c.icon]&&(f+='<i class="'+p(t[c.icon])+" "+(t[c.iconClass]?p(t[c.iconClass]):d.icon)+'"></i>'),o&&(f=(f+='<span class="'+d.description+'">'+m(t[c.description]||"",u)+"</span>")+(l?"":'<span class="'+d.text+'">')),l&&(f+='<span class="'+d.text+'">'),f+=m(t[c.name]||"",u),l?f=(f=f+'</span><div class="'+s+'">')+_.fn.dropdown.settings.templates.menu(t,c,u,d)+"</div>":o&&(f+="</span>"),f+="</div>"):"header"===s&&(a=m(t[c.name]||"",u),r=t[c.icon]?p(t[c.icon]):d.groupIcon,""===a&&""===r||(f+='<div class="'+(t[c.class]?p(t[c.class]):d.header)+'">',""!==r&&(f+='<i class="'+r+" "+(t[c.iconClass]?p(t[c.iconClass]):d.icon)+'"></i>'),f=f+a+"</div>"),t[c.divider]&&(f+='<div class="'+d.divider+'"></div>'))}),f},label:function(e,t,n,i){return(0,_.fn.dropdown.settings.templates.escape)(t,n)+'<i class="'+i.delete+' icon"></i>'},message:function(e){return e},addition:function(e){return e}}}(jQuery,window,document),function(T,e,S){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),T.fn.embed=function(g){var h,v=T(this),b=v.selector||"",y=(new Date).getTime(),x=[],C=g,w="string"==typeof C,k=[].slice.call(arguments,1);return v.each(function(){var i=T.isPlainObject(g)?T.extend(!0,{},T.fn.embed.settings,g):T.extend({},T.fn.embed.settings),e=i.selector,t=i.className,o=i.sources,s=i.error,a=i.metadata,n=i.namespace,r=i.templates,l="."+n,c="module-"+n,u=T(this),d=(u.find(e.placeholder),u.find(e.icon),u.find(e.embed)),f=this,m=u.data(c),p={initialize:function(){p.debug("Initializing embed"),p.determine.autoplay(),p.create(),p.bind.events(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),m=p,u.data(c,p)},destroy:function(){p.verbose("Destroying previous instance of embed"),p.reset(),u.removeData(c).off(l)},refresh:function(){p.verbose("Refreshing selector cache"),u.find(e.placeholder),u.find(e.icon),d=u.find(e.embed)},bind:{events:function(){p.has.placeholder()&&(p.debug("Adding placeholder events"),u.on("click"+l,e.placeholder,p.createAndShow).on("click"+l,e.icon,p.createAndShow))}},create:function(){p.get.placeholder()?p.createPlaceholder():p.createAndShow()},createPlaceholder:function(e){var t=p.get.icon(),n=p.get.url();p.generate.embed(n);e=e||p.get.placeholder(),u.html(r.placeholder(e,t)),p.debug("Creating placeholder for embed",e,t)},createEmbed:function(e){p.refresh(),e=e||p.get.url(),d=T("<div/>").addClass(t.embed).html(p.generate.embed(e)).appendTo(u),i.onCreate.call(f,e),p.debug("Creating embed object",d)},changeEmbed:function(e){d.html(p.generate.embed(e))},createAndShow:function(){p.createEmbed(),p.show()},change:function(e,t,n){p.debug("Changing video to ",e,t,n),u.data(a.source,e).data(a.id,t),n?u.data(a.url,n):u.removeData(a.url),p.has.embed()?p.changeEmbed():p.create()},reset:function(){p.debug("Clearing embed and showing placeholder"),p.remove.data(),p.remove.active(),p.remove.embed(),p.showPlaceholder(),i.onReset.call(f)},show:function(){p.debug("Showing embed"),p.set.active(),i.onDisplay.call(f)},hide:function(){p.debug("Hiding embed"),p.showPlaceholder()},showPlaceholder:function(){p.debug("Showing placeholder image"),p.remove.active(),i.onPlaceholderDisplay.call(f)},get:{id:function(){return i.id||u.data(a.id)},placeholder:function(){return i.placeholder||u.data(a.placeholder)},icon:function(){return i.icon||(u.data(a.icon)!==S?u.data(a.icon):p.determine.icon())},source:function(e){return i.source||(u.data(a.source)!==S?u.data(a.source):p.determine.source())},type:function(){var e=p.get.source();return o[e]!==S&&o[e].type},url:function(){return i.url||(u.data(a.url)!==S?u.data(a.url):p.determine.url())}},determine:{autoplay:function(){p.should.autoplay()&&(i.autoplay=!0)},source:function(n){var i=!1;return(n=n||p.get.url())&&T.each(o,function(e,t){if(-1!==n.search(t.domain))return i=e,!1}),i},icon:function(){var e=p.get.source();return o[e]!==S&&o[e].icon},url:function(){var e=i.id||u.data(a.id),t=i.source||u.data(a.source),t=o[t]!==S&&o[t].url.replace("{id}",e);return t&&u.data(a.url,t),t}},set:{active:function(){u.addClass(t.active)}},remove:{data:function(){u.removeData(a.id).removeData(a.icon).removeData(a.placeholder).removeData(a.source).removeData(a.url)},active:function(){u.removeClass(t.active)},embed:function(){d.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){p.debug("Generating embed html");var t,n=p.get.source();return(e=p.get.url(e))?(n=p.generate.parameters(n),t=r.iframe(e,n)):p.error(s.noURL,u),t},parameters:function(e,t){e=o[e]&&o[e].parameters!==S?o[e].parameters(i):{};return(t=t||i.parameters)&&(e=T.extend({},e,t)),e=i.onEmbed(e),p.encode.parameters(e)}},has:{embed:function(){return 0<d.length},placeholder:function(){return i.placeholder||u.data(a.placeholder)}},should:{autoplay:function(){return"auto"===i.autoplay?i.placeholder||u.data(a.placeholder)!==S:i.autoplay}},is:{video:function(){return"video"==p.get.type()}},setting:function(e,t){if(p.debug("Changing setting",e,t),T.isPlainObject(e))T.extend(!0,i,e);else{if(t===S)return i[e];T.isPlainObject(i[e])?T.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(T.isPlainObject(e))T.extend(!0,p,e);else{if(t===S)return p[e];p[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,i.name+":"),p.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),p.verbose.apply(console,arguments)))},error:function(){i.silent||(p.error=Function.prototype.bind.call(console.error,console,i.name+":"),p.error.apply(console,arguments))},performance:{log:function(e){var t,n;i.performance&&(n=(t=(new Date).getTime())-(y||t),y=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":n})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,500)},display:function(){var e=i.name+":",n=0;y=!1,clearTimeout(p.performance.timer),T.each(x,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",b&&(e+=" '"+b+"'"),1<v.length&&(e+=" ("+v.length+")"),(console.group!==S||console.table!==S)&&0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):T.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||k,t=f||t,"string"==typeof i&&r!==S&&(i=i.split(/[\. ]/),o=i.length-1,T.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(T.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==S)return a=r[n],!1;{if(!T.isPlainObject(r[t])||e==o)return r[t]!==S?a=r[t]:p.error(s.method,i),!1;r=r[t]}}})),T.isFunction(a)?n=a.apply(t,e):a!==S&&(n=a),Array.isArray(h)?h.push(n):h!==S?h=[h,n]:n!==S&&(h=n),a}};w?(m===S&&p.initialize(),p.invoke(C)):(m!==S&&m.invoke("destroy"),p.initialize())}),h!==S?h:this},T.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(e){},onEmbed:function(e){return e},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{autohide:!e.brandedUI,autoplay:e.autoplay,color:e.color||S,hq:e.hd,jsapi:e.api,modestbranding:!e.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(e){return{api:e.api,autoplay:e.autoplay,byline:e.brandedUI,color:e.color||S,portrait:e.brandedUI,title:e.brandedUI}}}},templates:{iframe:function(e,t){return t&&(e+="?"+t),'<iframe src="'+e+'" width="100%" height="100%" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'},placeholder:function(e,t){var n="";return t&&(n+='<i class="'+t+' icon"></i>'),e&&(n+='<img class="placeholder" src="'+e+'">'),n}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,void document),function(z,H,U,B){"use strict";z.isFunction=z.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},H=void 0!==H&&H.Math==Math?H:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),z.fn.modal=function(E){var F,e=z(this),O=z(H),P=z(U),M=z("body"),R=e.selector||"",I=(new Date).getTime(),j=[],V=E,L="string"==typeof V,q=[].slice.call(arguments,1),N=H.requestAnimationFrame||H.mozRequestAnimationFrame||H.webkitRequestAnimationFrame||H.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,o,a,e,i,n,r,s,l,c,u,d=z.isPlainObject(E)?z.extend(!0,{},z.fn.modal.settings,E):z.extend({},z.fn.modal.settings),f=d.selector,m=d.className,p=d.namespace,g=d.fields,h=d.error,v="."+p,b="module-"+p,y=z(this),x=[H,U].indexOf(d.context)<0?z(U).find(d.context):z(d.context),C=y.find(f.closeIcon),w=this,k=y.hasClass("modal")?y.data(b):B,T=!1,S="",D="",A={initialize:function(){var a;A.create.id(),y.hasClass("modal")||(A.create.modal(),z.isFunction(d.onHidden)||(d.onHidden=function(){A.destroy(),y.remove()})),y.addClass(d.class),""!==d.title&&y.find(f.title).html(A.helpers.escape(d.title,d.preserveHTML)).addClass(d.classTitle),""!==d.content&&y.find(f.content).html(A.helpers.escape(d.content,d.preserveHTML)).addClass(d.classContent),A.has.configActions()&&(0===(a=y.find(f.actions).addClass(d.classActions)).length?a=z("<div/>",{class:m.actions+" "+(d.classActions||"")}).appendTo(y):a.empty(),d.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+A.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=A.helpers.escape(e[g.text]||"",d.preserveHTML),i=A.helpers.deQuote(e[g.class]||""),o=e[g.click]&&z.isFunction(e[g.click])?e[g.click]:function(){};a.append(z("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,click:function(){var e=z(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(w,y)||A.hide()}}))})),A.cache={},A.verbose("Initializing dimmer",x),A.create.dimmer(),d.allowMultiple&&A.create.innerDimmer(),d.centered||y.addClass("top aligned"),A.refreshModals(),A.refreshInputs(),A.bind.events(),A.observeChanges(),A.instantiate(),d.autoShow&&A.show()},instantiate:function(){A.verbose("Storing instance of modal"),k=A,y.data(b,k)},create:{modal:function(){var e;y=z("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),d.closeIcon&&(C=z("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":d.text.close}),y.append(C)),""!==d.title&&(e="_"+A.get.id()+"title",y.attr("aria-labelledby",e),z("<div/>",{class:m.title,id:e}).appendTo(y)),""!==d.content&&(e="_"+A.get.id()+"desc",y.attr("aria-describedby",e),z("<div/>",{class:m.content,id:e}).appendTo(y)),A.has.configActions()&&z("<div/>",{class:m.actions}).appendTo(y),x.append(y)},dimmer:function(){var e={debug:d.debug,dimmerName:"modals"},e=z.extend(!0,e,d.dimmerSettings);z.fn.dimmer===B?A.error(h.dimmer):(A.debug("Creating dimmer"),i=x.dimmer(e),d.detachable?(A.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):A.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){c=(Math.random().toString(16)+"000000000").slice(2,10),l="."+c,A.verbose("Creating unique id for element",c)},innerDimmer:function(){0===y.find(f.dimmer).length&&z("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){u&&u.disconnect(),A.verbose("Destroying previous modal"),y.removeData(b).off(v),O.off(l),n.off(l),C.off(l),t&&t.off(l),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in H&&((u=new MutationObserver(function(e){d.observeChanges&&(A.debug("DOM tree modified, refreshing"),A.refresh()),A.refreshInputs()})).observe(w,{childList:!0,subtree:!0}),A.debug("Setting up mutation observer",u))},refresh:function(){A.remove.scrolling(),A.cacheSizes(),A.can.useFlex()||A.set.modalOffset(),A.set.screenHeight(),A.set.type()},refreshModals:function(){a=y.siblings(f.modal),o=a.add(y)},refreshInputs:function(){t&&t.off("keydown"+l),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===z(this).closest(".disabled").length})).first().on("keydown"+l,A.event.inputKeyDown.first),t.last().on("keydown"+l,A.event.inputKeyDown.last)},attachEvents:function(e,t){var n=z(e);t=z.isFunction(A[t])?A[t]:A.toggle,0<n.length?(A.debug("Attaching modal events to element",e,t),n.off(v).on("click"+v,t)):A.error(h.notFound,e)},bind:{events:function(){A.verbose("Attaching events"),y.on("click"+v,f.close,A.event.close).on("click"+v,f.approve,A.event.approve).on("click"+v,f.deny,A.event.deny),C.on("keyup"+l,A.event.closeKeyUp),O.on("resize"+l,A.event.resize)},scrollLock:function(){i.get(0).addEventListener("touchmove",A.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i.get(0).removeEventListener("touchmove",A.event.preventScroll,{passive:!1})}},get:{id:function(){return c},element:function(){return y},settings:function(){return d}},event:{approve:function(){T||!1===d.onApprove.call(w,z(this))?A.verbose("Approve callback returned false cancelling hide"):(T=!0,A.hide(function(){T=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){T||!1===d.onDeny.call(w,z(this))?A.verbose("Deny callback returned false cancelling hide"):(T=!0,A.hide(function(){T=!1}))},close:function(){A.hide()},closeKeyUp:function(e){e=e.which;e!==d.keys.enter&&e!==d.keys.space||!y.hasClass(m.front)||A.hide()},inputKeyDown:{first:function(e){e.which===d.keys.tab&&e.shiftKey&&(t.last().focus(),e.preventDefault())},last:function(e){e.which!==d.keys.tab||e.shiftKey||(t.first().focus(),e.preventDefault())}},mousedown:function(e){var t=z(e.target),n=A.is.rtl();(r=0<t.closest(f.modal).length)&&A.verbose("Mouse down event registered inside the modal"),(s=A.is.scrolling()&&(!n&&z(H).outerWidth()-d.scrollbarWidth<=e.clientX||n&&d.scrollbarWidth>=e.clientX))&&A.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(d.closable)if(r)A.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(s)A.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<z(e.target).closest(f.modal).length,e=z.contains(U.documentElement,e.target);if(!t&&e&&A.is.active()&&y.hasClass(m.front)){if(A.debug("Dimmer clicked, hiding all modals"),d.allowMultiple){if(!A.hideAll())return}else if(!A.hide())return;A.remove.clickaway()}}else A.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(A.timer),A.timer=setTimeout(e,t)},keyboard:function(e){e.which===d.keys.escape&&(d.closable?(A.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&A.hide()):A.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(A.is.animating()||A.is.active())&&N(A.refresh)}},toggle:function(){A.is.active()||A.is.animating()?A.hide():A.show()},show:function(e){e=z.isFunction(e)?e:function(){},A.refreshModals(),A.set.dimmerSettings(),A.set.dimmerStyles(),A.showModal(e)},hide:function(e){return e=z.isFunction(e)?e:function(){},A.refreshModals(),A.hideModal(e)},showModal:function(e){e=z.isFunction(e)?e:function(){},A.is.animating()||!A.is.active()?!1===d.onShow.call(w)?A.verbose("Show callback returned false cancelling show"):(A.showDimmer(),A.cacheSizes(),A.set.bodyMargin(),A.can.useFlex()?A.remove.legacy():(A.set.legacy(),A.set.modalOffset(),A.debug("Using non-flex legacy modal positioning.")),A.set.screenHeight(),A.set.type(),A.set.clickaway(),!d.allowMultiple&&A.others.active()?A.hideOthers(A.showModal):(T=!1,d.allowMultiple&&(A.others.active()&&a.filter("."+m.active).find(f.dimmer).addClass("active"),d.detachable&&y.detach().appendTo(n)),d.transition&&z.fn.transition!==B&&y.transition("is supported")?(A.debug("Showing modal with css animations"),y.transition({debug:d.debug,animation:(d.transition.showMethod||d.transition)+" in",queue:d.queue,duration:d.transition.showDuration||d.duration,useFailSafe:!0,onComplete:function(){d.onVisible.apply(w),d.keyboardShortcuts&&A.add.keyboardShortcuts(),A.save.focus(),A.set.active(),d.autofocus&&A.set.autofocus(),e()}})):A.error(h.noTransition))):A.debug("Modal is already visible")},hideModal:function(e,t,n){var i=a.filter("."+m.active).last();if(e=z.isFunction(e)?e:function(){},!1===d.onHide.call(w,z(this)))return A.verbose("Hide callback returned false cancelling hide"),T=!1;(A.is.animating()||A.is.active())&&(A.debug("Hiding modal"),d.transition&&z.fn.transition!==B&&y.transition("is supported")?(A.remove.active(),y.transition({debug:d.debug,animation:(d.transition.hideMethod||d.transition)+" out",queue:d.queue,duration:d.transition.hideDuration||d.duration,useFailSafe:!0,onStart:function(){A.others.active()||A.others.animating()||t||A.hideDimmer(),d.keyboardShortcuts&&!A.others.active()&&A.remove.keyboardShortcuts()},onComplete:function(){A.unbind.scrollLock(),d.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),z.isFunction(d.onHidden)&&d.onHidden.call(w),A.remove.dimmerStyles(),A.restore.focus(),e()}})):A.error(h.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(A.save.bodyMargin(),A.debug("Showing dimmer"),i.dimmer("show")):A.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(A.unbind.scrollLock(),i.dimmer("hide",function(){A.restore.bodyMargin(),A.remove.clickaway(),A.remove.screenHeight()})):A.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=z.isFunction(n)?n:function(){},0<e.length)return A.debug("Hiding all visible modals"),i=!0,z(e.get().reverse()).each(function(e,t){i=i&&z(t).modal("hide modal",n,!1,!0)}),i&&A.hideDimmer(),i},hideOthers:function(e){var t=a.filter("."+m.active+", ."+m.animating);e=z.isFunction(e)?e:function(){},0<t.length&&(A.debug("Hiding other modals",a),t.modal("hide modal",e,!0))},others:{active:function(){return 0<a.filter("."+m.active).length},animating:function(){return 0<a.filter("."+m.animating).length}},add:{keyboardShortcuts:function(){A.verbose("Adding keyboard shortcuts"),P.on("keyup"+v,A.event.keyboard)}},save:{focus:function(){0<z(U.activeElement).closest(y).length||(e=z(U.activeElement).blur())},bodyMargin:function(){S=M.css("margin-"+(A.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(S.replace(/[^\d.]/g,"")),t=H.innerWidth-U.documentElement.clientWidth;D=e+t}},restore:{focus:function(){e&&0<e.length&&d.restoreFocus&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";M.css("margin-"+n,S),M.find(f.bodyFixed.replace("right",n)).each(function(){var e=z(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){d.detachable||y.off("mousedown"+l),n.off("mousedown"+l),n.off("mouseup"+l)},dimmerStyles:function(){n.removeClass(m.inverted),i.removeClass(m.blurring)},bodyStyle:function(){""===M.attr("style")&&(A.verbose("Removing style attribute"),M.removeAttr("style"))},screenHeight:function(){A.debug("Removing page height"),M.css("height","")},keyboardShortcuts:function(){A.verbose("Removing keyboard shortcuts"),P.off("keyup"+v)},scrolling:function(){i.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),n=y.outerHeight();A.cache.pageHeight!==B&&0===n||(z.extend(A.cache,{pageHeight:z(U).outerHeight(),width:t,height:n+d.offset,scrollHeight:e+d.offset,contextHeight:("body"==d.context?z(H):i).height()}),A.cache.topOffset=-A.cache.height/2),y.removeClass(m.loading),A.debug("Caching modal and container sizes",A.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return A.cache.leftBodyScrollbar===B&&(A.cache.leftBodyScrollbar=A.is.rtl()&&(A.is.iframe&&!A.is.firefox()||A.is.safari()||A.is.edge()||A.is.ie())),A.cache.leftBodyScrollbar},useFlex:function(){return"auto"===d.useFlex?d.detachable&&!A.is.ie():(d.useFlex&&A.is.ie()?A.debug("useFlex true is not supported in IE"):d.useFlex&&!d.detachable&&A.debug("useFlex true in combination with detachable false is not supported"),d.useFlex)},fit:function(){var e=A.cache.contextHeight,t=A.cache.contextHeight/2,n=A.cache.topOffset,i=A.cache.scrollHeight,o=A.cache.height,a=d.padding;return o<i?t+n+i+a<e:o+2*a<e}},has:{configActions:function(){return Array.isArray(d.actions)&&0<d.actions.length}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return A.cache.isIE===B&&(e=!H.ActiveXObject&&"ActiveXObject"in H,t="ActiveXObject"in H,A.cache.isIE=e||t),A.cache.isIE},animating:function(){return y.transition("is supported")?y.transition("is animating"):y.is(":visible")},scrolling:function(){return i.hasClass(m.scrolling)},modernBrowser:function(){return!(H.ActiveXObject||"ActiveXObject"in H)},rtl:function(){return A.cache.isRTL===B&&(A.cache.isRTL="rtl"===M.attr("dir")||"rtl"===M.css("direction")),A.cache.isRTL},safari:function(){return A.cache.isSafari===B&&(A.cache.isSafari=/constructor/i.test(H.HTMLElement)||!!H.ApplePaySession),A.cache.isSafari},edge:function(){return A.cache.isEdge===B&&(A.cache.isEdge=!!H.setImmediate&&!A.is.ie()),A.cache.isEdge},firefox:function(){return A.cache.isFirefox===B&&(A.cache.isFirefox=!!H.InstallTrigger),A.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var e=t.filter("[autofocus]"),e=(0<e.length?e:1<t.length?t.filter(":not(i.close)"):t).first();0<e.length&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";(d.detachable||A.can.fit())&&M.css("margin-"+n,D+"px"),M.find(f.bodyFixed.replace("right",n)).each(function(){var e=z(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+D+"px)")})},clickaway:function(){d.detachable||y.on("mousedown"+l,A.event.mousedown),n.on("mousedown"+l,A.event.mousedown),n.on("mouseup"+l,A.event.mouseup)},dimmerSettings:function(){var e;z.fn.dimmer===B?A.error(h.dimmer):(e={debug:d.debug,dimmerName:"modals",closable:"auto",useFlex:A.can.useFlex(),duration:{show:d.transition.showDuration||d.duration,hide:d.transition.hideDuration||d.duration}},e=z.extend(!0,e,d.dimmerSettings),d.inverted&&(e.variation=e.variation!==B?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){d.inverted?n.addClass(m.inverted):n.removeClass(m.inverted),d.blurring?i.addClass(m.blurring):i.removeClass(m.blurring)},modalOffset:function(){var e;d.detachable?y.css({marginTop:!y.hasClass("aligned")&&A.can.fit()?-A.cache.height/2:d.padding/2,marginLeft:-A.cache.width/2}):(e=A.can.fit(),y.css({top:!y.hasClass("aligned")&&e?z(U).scrollTop()+(A.cache.contextHeight-A.cache.height)/2:!e||y.hasClass("top")?z(U).scrollTop()+d.padding:z(U).scrollTop()+(A.cache.contextHeight-A.cache.height-d.padding),marginLeft:-A.cache.width/2})),A.verbose("Setting modal offset for legacy mode")},screenHeight:function(){A.can.fit()?M.css("height",""):y.hasClass("bottom")||(A.debug("Modal is taller than page content, resizing page height"),M.css("height",A.cache.height+2*d.padding))},active:function(){y.addClass(m.active+" "+m.front),a.filter("."+m.active).removeClass(m.front)},scrolling:function(){i.addClass(m.scrolling),y.addClass(m.scrolling),A.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){A.can.fit()?(A.verbose("Modal fits on screen"),A.others.active()||A.others.animating()||(A.remove.scrolling(),A.bind.scrollLock())):y.hasClass("bottom")?A.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(A.verbose("Modal cannot fit on screen setting to scrolling"),A.set.scrolling())},undetached:function(){i.addClass(m.undetached)}},setting:function(e,t){if(A.debug("Changing setting",e,t),z.isPlainObject(e))z.extend(!0,d,e);else{if(t===B)return d[e];z.isPlainObject(d[e])?z.extend(!0,d[e],t):d[e]=t}},internal:function(e,t){if(z.isPlainObject(e))z.extend(!0,A,e);else{if(t===B)return A[e];A[e]=t}},debug:function(){!d.silent&&d.debug&&(d.performance?A.performance.log(arguments):(A.debug=Function.prototype.bind.call(console.info,console,d.name+":"),A.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?A.performance.log(arguments):(A.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),A.verbose.apply(console,arguments)))},error:function(){d.silent||(A.error=Function.prototype.bind.call(console.error,console,d.name+":"),A.error.apply(console,arguments))},performance:{log:function(e){var t,n;d.performance&&(n=(t=(new Date).getTime())-(I||t),I=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":n})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(A.performance.display,500)},display:function(){var e=d.name+":",n=0;I=!1,clearTimeout(A.performance.timer),z.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",R&&(e+=" '"+R+"'"),(console.group!==B||console.table!==B)&&0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):z.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){var o,a,n,r=k;return e=e||q,t=w||t,"string"==typeof i&&r!==B&&(i=i.split(/[\. ]/),o=i.length-1,z.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(z.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==B)return a=r[n],!1;{if(!z.isPlainObject(r[t])||e==o)return r[t]!==B&&(a=r[t]),!1;r=r[t]}}})),z.isFunction(a)?n=a.apply(t,e):a!==B&&(n=a),Array.isArray(F)?F.push(n):F!==B?F=[F,n]:n!==B&&(F=n),a}};L?(k===B&&(z.isFunction(d.templates[V])&&(d.autoShow=!0,d.className.modal=d.className.template,d=z.extend(!0,{},d,d.templates[V].apply(A,q)),m=d.className,d.namespace,g=d.fields,h=d.error),A.initialize()),z.isFunction(d.templates[V])||A.invoke(V)):(k!==B&&k.invoke("destroy"),A.initialize(),F=y)}),F!==B?F:this},z.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},z.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return z.isPlainObject(e[0])?z.extend({handler:function(){},content:"",title:""},e[0]):(z.isFunction(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];o.handler(z(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===z(z.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+i.className.prompt+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document),function(x,C,w,k){"use strict";x.isFunction=x.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},C=void 0!==C&&C.Math==Math?C:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),x.fn.nag=function(f){var m,e=x(this),p=e.selector||"",g=(new Date).getTime(),h=[],v=f,b="string"==typeof v,y=[].slice.call(arguments,1);return e.each(function(){var i,o=x.isPlainObject(f)?x.extend(!0,{},x.fn.nag.settings,f):x.extend({},x.fn.nag.settings),e=o.selector,s=o.error,t=o.namespace,n="."+t,a=t+"-module",r=x(this),l=o.context?[C,w].indexOf(o.context)<0?x(w).find(o.context):x(o.context):x("body"),c=this,u=r.data(a),d={initialize:function(){d.verbose("Initializing element"),i=d.get.storage(),r.on("click"+n,e.close,d.dismiss).data(a,d),o.detachable&&r.parent()[0]!==l[0]&&r.detach().prependTo(l),0<o.displayTime&&setTimeout(d.hide,o.displayTime),d.show()},destroy:function(){d.verbose("Destroying instance"),r.removeData(a).off(n)},show:function(){if(d.should.show()&&!r.is(":visible")){if(!1===o.onShow.call(c))return d.debug("onShow callback returned false, cancelling nag animation"),!1;d.debug("Showing nag",o.animation.show),"fade"===o.animation.show?r.fadeIn(o.duration,o.easing,o.onVisible):r.slideDown(o.duration,o.easing,o.onVisible)}},hide:function(){if(!1===o.onHide.call(c))return d.debug("onHide callback returned false, cancelling nag animation"),!1;d.debug("Hiding nag",o.animation.hide),"fade"===o.animation.hide?r.fadeOut(o.duration,o.easing,o.onHidden):r.slideUp(o.duration,o.easing,o.onHidden)},dismiss:function(e){!1!==d.hide()&&o.storageMethod&&(d.debug("Dismissing nag",o.storageMethod,o.key,o.value,o.expires),d.storage.set(o.key,o.value)),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return o.persist?(d.debug("Persistent nag is set, can show nag"),!0):d.storage.get(o.key)!=o.value.toString()?(d.debug("Stored value is not set, can show nag",d.storage.get(o.key)),!0):(d.debug("Stored value is set, cannot show nag",d.storage.get(o.key)),!1)}},get:{expirationDate:function(e){if((e="number"==typeof e?new Date(Date.now()+864e5*e):e)instanceof Date&&e.getTime())return e.toUTCString();d.error(s.expiresFormat)},storage:function(){return"localstorage"===o.storageMethod&&C.localStorage!==k?(d.debug("Using local storage"),C.localStorage):"sessionstorage"===o.storageMethod&&C.sessionStorage!==k?(d.debug("Using session storage"),C.sessionStorage):"cookie"in w?(d.debug("Using cookie"),{setItem:function(e,t,n){e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),t=encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent);var i,o="";for(i in n)n.hasOwnProperty(i)&&(o+="; "+i,"string"==typeof n[i]&&(o+="="+n[i].split(";")[0]));w.cookie=e+"="+t+o},getItem:function(e){for(var t=w.cookie.split("; "),n=0,i=t.length;n<i;n++){var o=t[n].split("=");if(e===o[0].replace(/(%[\dA-F]{2})+/gi,decodeURIComponent))return o[1]||""}},removeItem:function(e,t){i.setItem(e,"",t)}}):void d.error(s.noStorage)},storageOptions:function(){var e={};return o.expires&&(e.expires=d.get.expirationDate(o.expires)),o.domain&&(e.domain=o.domain),o.path&&(e.path=o.path),o.secure&&(e.secure=o.secure),o.samesite&&(e.samesite=o.samesite),e}},clear:function(){d.storage.remove(o.key)},storage:{set:function(e,t){var n=d.get.storageOptions();i===C.localStorage&&n.expires&&(d.debug("Storing expiration value in localStorage",e,n.expires),i.setItem(e+o.expirationKey,n.expires)),d.debug("Value stored",e,t);try{i.setItem(e,t,n)}catch(e){d.error(s.setItem,e)}},get:function(e){var t,n=i.getItem(e);return i===C.localStorage&&null!==(t=i.getItem(e+o.expirationKey))&&t!==k&&new Date(t)<new Date&&(d.debug("Value in localStorage has expired. Deleting key",e),d.storage.remove(e),n=null),n="undefined"!=n&&"null"!=n&&n!==k&&null!==n?n:k},remove:function(e){var t=d.get.storageOptions();t.expires=d.get.expirationDate(-1),i===C.localStorage&&i.removeItem(e+o.expirationKey),i.removeItem(e,t)}},setting:function(e,t){if(d.debug("Changing setting",e,t),x.isPlainObject(e))x.extend(!0,o,e);else{if(t===k)return o[e];x.isPlainObject(o[e])?x.extend(!0,o[e],t):o[e]=t}},internal:function(e,t){if(x.isPlainObject(e))x.extend(!0,d,e);else{if(t===k)return d[e];d[e]=t}},debug:function(){!o.silent&&o.debug&&(o.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,o.name+":"),d.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),d.verbose.apply(console,arguments)))},error:function(){o.silent||(d.error=Function.prototype.bind.call(console.error,console,o.name+":"),d.error.apply(console,arguments))},performance:{log:function(e){var t,n;o.performance&&(n=(t=(new Date).getTime())-(g||t),g=t,h.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":n})),clearTimeout(d.performance.timer),d.performance.timer=setTimeout(d.performance.display,500)},display:function(){var e=o.name+":",n=0;g=!1,clearTimeout(d.performance.timer),x.each(h,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",p&&(e+=" '"+p+"'"),(console.group!==k||console.table!==k)&&0<h.length&&(console.groupCollapsed(e),console.table?console.table(h):x.each(h,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(i,e,t){var o,a,n,r=u;return e=e||y,t=c||t,"string"==typeof i&&r!==k&&(i=i.split(/[\. ]/),o=i.length-1,x.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(x.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==k)return a=r[n],!1;{if(!x.isPlainObject(r[t])||e==o)return r[t]!==k?a=r[t]:d.error(s.method,i),!1;r=r[t]}}})),x.isFunction(a)?n=a.apply(t,e):a!==k&&(n=a),Array.isArray(m)?m.push(n):m!==k?m=[m,n]:n!==k&&(m=n),a}};b?(u===k&&d.initialize(),d.invoke(v)):(u!==k&&u.invoke("destroy"),d.initialize())}),m!==k?m:this},x.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",secure:!1,samesite:!1,storageMethod:"cookie",key:"nag",value:"dismiss",expirationKey:"ExpirationDate",error:{noStorage:"Unsupported storage method",method:"The method you called is not defined.",setItem:"Unexpected error while setting value",expiresFormat:'"expires" must be a number of days or a Date Object'},className:{bottom:"bottom",fixed:"fixed"},selector:{close:"> .close.icon"},duration:500,easing:"easeOutQuad",onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){}},x.extend(x.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document),function(V,L,q,N){"use strict";V.isFunction=V.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},L=void 0!==L&&L.Math==Math?L:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),V.fn.popup=function(T){var S,e=V(this),D=V(q),A=V(L),E=V("body"),F=e.selector||"",O="ontouchstart"in q.documentElement?"touchstart":"click",P=(new Date).getTime(),M=[],R=T,I="string"==typeof R,j=[].slice.call(arguments,1);return e.each(function(){var c,s,e,t,n,u=V.isPlainObject(T)?V.extend(!0,{},V.fn.popup.settings,T):V.extend({},V.fn.popup.settings),i=u.selector,d=u.className,f=u.error,m=u.metadata,o=u.namespace,a="."+u.namespace,r="module-"+o,p=V(this),l=[L,q].indexOf(u.context)<0?V(q).find(u.context):V(u.context),g=[L,q].indexOf(u.scrollContext)<0?V(q).find(u.scrollContext):V(u.scrollContext),h=[L,q].indexOf(u.boundary)<0?V(q).find(u.boundary):V(u.boundary),v=u.target?[L,q].indexOf(u.target)<0?V(q).find(u.target):V(u.target):p,b=0,y=!1,x=!1,C=this,w=p.data(r),k={initialize:function(){k.debug("Initializing",p),k.createID(),k.bind.events(),!k.exists()&&u.preserve&&k.create(),u.observeChanges&&k.observeChanges(),k.instantiate()},instantiate:function(){k.verbose("Storing instance",k),w=k,p.data(r,w)},observeChanges:function(){"MutationObserver"in L&&((e=new MutationObserver(k.event.documentChanged)).observe(q,{childList:!0,subtree:!0}),k.debug("Setting up mutation observer",e))},refresh:function(){u.popup&&"string"==typeof u.popup?c=V(q).find(u.popup).eq(0):u.inline&&(c=v.nextAll(i.popup).eq(0),u.popup=c),u.popup?(c.addClass(d.loading),s=k.get.offsetParent(),c.removeClass(d.loading),u.movePopup&&k.has.popup()&&k.get.offsetParent(c)[0]!==s[0]&&(k.debug("Moving popup to the same offset parent as target"),c.detach().appendTo(s))):s=u.inline?k.get.offsetParent(v):k.has.popup()?k.get.offsetParent(c):E,s.is("html")&&s[0]!==E[0]&&(k.debug("Setting page as offset parent"),s=E),k.get.variation()&&k.set.variation()},reposition:function(){k.refresh(),k.set.position()},destroy:function(){k.debug("Destroying previous module"),e&&e.disconnect(),c&&!u.preserve&&k.removePopup(),clearTimeout(k.hideTimer),clearTimeout(k.showTimer),k.unbind.close(),k.unbind.events(),p.removeData(r)},event:{start:function(e){var t=V.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(k.hideTimer),x&&!u.addTouchEvents||(k.showTimer=setTimeout(k.show,t))},end:function(){var e=V.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(k.showTimer),k.hideTimer=setTimeout(k.hide,e)},touchstart:function(e){x=!0,u.addTouchEvents&&k.show()},resize:function(){k.is.visible()&&k.set.position()},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==C||0<V(e).find(C).length)&&(k.debug("Element removed from DOM, tearing down events"),k.destroy())})})},hideGracefully:function(e){var t=V(e.target),n=V.contains(q.documentElement,e.target),t=0<t.closest(i.popup).length;e&&!t&&n?(k.debug("Click occurred outside popup hiding popup"),k.hide()):k.debug("Click was inside popup, keeping popup open")}},create:function(){var e=k.get.html(),t=k.get.title(),n=k.get.content();e||n||t?(k.debug("Creating pop-up html"),e=e||u.templates.popup({title:t,content:n}),c=V("<div/>").addClass(d.popup).data(m.activator,p).html(e),u.inline?(k.verbose("Inserting popup element inline",c),c.insertAfter(p)):(k.verbose("Appending popup element to body",c),c.appendTo(l)),k.refresh(),k.set.variation(),u.hoverable&&k.bind.popup(),u.onCreate.call(c,C)):u.popup&&"string"==typeof u.popup?(V(q).find(u.popup).data(m.activator,p),k.verbose("Used popup specified in settings"),k.refresh(),u.hoverable&&k.bind.popup()):0!==v.next(i.popup).length?(k.verbose("Pre-existing popup found"),u.inline=!0,u.popup=v.next(i.popup).data(m.activator,p),k.refresh(),u.hoverable&&k.bind.popup()):k.debug("No content specified skipping display",C)},createID:function(){n=(Math.random().toString(16)+"000000000").slice(2,10),t="."+n,k.verbose("Creating unique id for element",n)},toggle:function(){k.debug("Toggling pop-up"),k.is.hidden()?(k.debug("Popup is hidden, showing pop-up"),k.unbind.close(),k.show()):(k.debug("Popup is visible, hiding pop-up"),k.hide())},show:function(e){e=e||function(){},k.debug("Showing pop-up",u.transition),!k.is.hidden()||k.is.active()&&k.is.dropdown()||(k.exists()||k.create(),!1===u.onShow.call(c,C)?k.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||k.refresh(),c&&k.set.position()&&(k.save.conditions(),u.exclusive&&k.hideAll(),k.animate.show(e))))},hide:function(e){e=e||function(){},(k.is.visible()||k.is.animating())&&(!1===u.onHide.call(c,C)?k.debug("onHide callback returned false, cancelling popup animation"):(k.remove.visible(),k.unbind.close(),k.restore.conditions(),k.animate.hide(e)))},hideAll:function(){V(q).find(i.popup).filter("."+d.popupVisible).each(function(){V(this).data(m.activator).popup("hide")})},exists:function(){return!!c&&(u.inline||u.popup?k.has.popup():1<=c.closest(l).length)},removePopup:function(){k.has.popup()&&!u.popup&&(k.debug("Removing popup",c),c.remove(),c=N,u.onRemove.call(c,C))},save:{conditions:function(){k.cache={title:p.attr("title")},k.cache.title&&p.removeAttr("title"),k.verbose("Saving original attributes",k.cache.title)}},restore:{conditions:function(){return k.cache&&k.cache.title&&(p.attr("title",k.cache.title),k.verbose("Restoring original attributes",k.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(e){e=V.isFunction(e)?e:function(){},u.transition&&V.fn.transition!==N&&p.transition("is supported")?(k.set.visible(),c.transition({animation:(u.transition.showMethod||u.transition)+" in",queue:!1,debug:u.debug,verbose:u.verbose,duration:u.transition.showDuration||u.duration,onComplete:function(){k.bind.close(),e.call(c,C),u.onVisible.call(c,C)}})):k.error(f.noTransition)},hide:function(e){e=V.isFunction(e)?e:function(){},k.debug("Hiding pop-up"),u.transition&&V.fn.transition!==N&&p.transition("is supported")?c.transition({animation:(u.transition.hideMethod||u.transition)+" out",queue:!1,duration:u.transition.hideDuration||u.duration,debug:u.debug,verbose:u.verbose,onComplete:function(){k.reset(),e.call(c,C),u.onHidden.call(c,C)}}):k.error(f.noTransition)}},change:{content:function(e){c.html(e)}},get:{html:function(){return p.removeData(m.html),p.data(m.html)||u.html},title:function(){return p.removeData(m.title),p.data(m.title)||u.title},content:function(){return p.removeData(m.content),p.data(m.content)||u.content||p.attr("title")},variation:function(){return p.removeData(m.variation),p.data(m.variation)||u.variation},popup:function(){return c},popupOffset:function(){return c.offset()},calculations:function(){var e=k.get.offsetParent(c),t=v[0],n=h[0]==L,i=v.offset(),o=u.inline||u.popup&&u.movePopup?v.offsetParent().offset():{top:0,left:0},a=n?{top:0,left:0}:h.offset(),r={},n=n?{top:A.scrollTop(),left:A.scrollLeft()}:{top:0,left:0},r={target:{element:v[0],width:v.outerWidth(),height:v.outerHeight(),top:i.top-o.top,left:i.left-o.left,margin:{}},popup:{width:c.outerWidth(),height:c.outerHeight()},parent:{width:s.outerWidth(),height:s.outerHeight()},screen:{top:a.top,left:a.left,scroll:{top:n.top,left:n.left},width:h.width(),height:h.height()}};return e.get(0)!==s.get(0)&&(i=e.offset(),r.target.top-=i.top,r.target.left-=i.left,r.parent.width=e.outerWidth(),r.parent.height=e.outerHeight()),u.setFluidWidth&&k.is.fluid()&&(r.container={width:c.parent().outerWidth()},r.popup.width=r.container.width),r.target.margin.top=u.inline?parseInt(L.getComputedStyle(t).getPropertyValue("margin-top"),10):0,r.target.margin.left=u.inline?k.is.rtl()?parseInt(L.getComputedStyle(t).getPropertyValue("margin-right"),10):parseInt(L.getComputedStyle(t).getPropertyValue("margin-left"),10):0,o=r.screen,r.boundary={top:o.top+o.scroll.top,bottom:o.top+o.scroll.top+o.height,left:o.left+o.scroll.left,right:o.left+o.scroll.left+o.width},r},id:function(){return n},startEvent:function(){return"hover"==u.on?"mouseenter":"focus"==u.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==u.on?"mouseleave":"focus"==u.on&&"blur"},distanceFromBoundary:function(e,t){var n={},i=(t=t||k.get.calculations()).popup,t=t.boundary;return e&&(n={top:e.top-t.top,left:e.left-t.left,right:t.right-(e.left+i.width),bottom:t.bottom-(e.top+i.height)},k.verbose("Distance from boundaries determined",e,n)),n},offsetParent:function(e){var t=(e!==N?e:v)[0].parentNode,n=V(t);if(t)for(var i="none"===n.css("transform"),o="static"===n.css("position"),a=n.is("body");t&&!a&&o&&i;)t=t.parentNode,i="none"===(n=V(t)).css("transform"),o="static"===n.css("position"),a=n.is("body");return n&&0<n.length?n:V()},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],t=t[1],i="top"==n||"bottom"==n,o=!1,a=!1,r=!1;return y||(k.verbose("All available positions available"),y=k.get.positions()),k.debug("Recording last position tried",e),y[e]=!0,"opposite"===u.prefer&&(r=(r=[{top:"bottom",bottom:"top",left:"right",right:"left"}[n],t]).join(" "),o=!0===y[r],k.debug("Trying opposite strategy",r)),"adjacent"===u.prefer&&i&&(r=(r=[n,{left:"center",center:"right",right:"left"}[t]]).join(" "),a=!0===y[r],k.debug("Trying adjacent strategy",r)),(a||o)&&(k.debug("Using backup position",r),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"}[e]),r}},set:{position:function(e,t){if(0!==v.length&&0!==c.length){var n,i,o,a,r,s,l;if(t=t||k.get.calculations(),e=e||p.data(m.position)||u.position,n=p.data(m.offset)||u.offset,i=u.distanceAway,o=t.target,a=t.popup,r=t.parent,k.should.centerArrow(t)&&(k.verbose("Adjusting offset to center arrow on small target element"),"top left"!=e&&"bottom left"!=e||(n=(n+=o.width/2)-u.arrowPixelsFromEdge),"top right"!=e&&"bottom right"!=e||(n=(n-=o.width/2)+u.arrowPixelsFromEdge)),0===o.width&&0===o.height&&!k.is.svg(o.element))return k.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(k.debug("Adding margin to calculation",o.margin),"left center"==e||"right center"==e?(n+=o.margin.top,i+=-o.margin.left):"top left"==e||"top center"==e||"top right"==e?(n+=o.margin.left,i-=o.margin.top):(n+=o.margin.left,i+=o.margin.top)),k.debug("Determining popup position from calculations",e,t),k.is.rtl()&&(e=e.replace(/left|right/g,function(e){return"left"==e?"right":"left"}),k.debug("RTL: Popup position updated",e)),e=b==u.maxSearchDepth&&"string"==typeof u.lastResort?u.lastResort:e){case"top left":s={top:"auto",bottom:r.height-o.top+i,left:o.left+n,right:"auto"};break;case"top center":s={bottom:r.height-o.top+i,left:o.left+o.width/2-a.width/2+n,top:"auto",right:"auto"};break;case"top right":s={bottom:r.height-o.top+i,right:r.width-o.left-o.width-n,top:"auto",left:"auto"};break;case"left center":s={top:o.top+o.height/2-a.height/2+n,right:r.width-o.left+i,left:"auto",bottom:"auto"};break;case"right center":s={top:o.top+o.height/2-a.height/2+n,left:o.left+o.width+i,bottom:"auto",right:"auto"};break;case"bottom left":s={top:o.top+o.height+i,left:o.left+n,bottom:"auto",right:"auto"};break;case"bottom center":s={top:o.top+o.height+i,left:o.left+o.width/2-a.width/2+n,bottom:"auto",right:"auto"};break;case"bottom right":s={top:o.top+o.height+i,right:r.width-o.left-o.width-n,left:"auto",bottom:"auto"}}if(s===N&&k.error(f.invalidPosition,e),k.debug("Calculated popup positioning values",s),c.css(s).removeClass(d.position).addClass(e).addClass(d.loading),l=k.get.popupOffset(),l=k.get.distanceFromBoundary(l,t),!u.forcePosition&&k.is.offstage(l,e)){if(k.debug("Position is outside viewport",e),b<u.maxSearchDepth)return b++,e=k.get.nextPosition(e),k.debug("Trying new position",e),!!c&&k.set.position(e,t);if(!u.lastResort)return k.debug("Popup could not find a position to display",c),k.error(f.cannotPlace,C),k.remove.attempts(),k.remove.loading(),k.reset(),u.onUnplaceable.call(c,C),!1;k.debug("No position found, showing with last position")}return k.debug("Position is on stage",e),k.remove.attempts(),k.remove.loading(),u.setFluidWidth&&k.is.fluid()&&k.set.fluidWidth(t),!0}k.error(f.notFound)},fluidWidth:function(e){e=e||k.get.calculations(),k.debug("Automatically setting element width to parent width",e.parent.width),c.css("width",e.container.width)},variation:function(e){(e=e||k.get.variation())&&k.has.popup()&&(k.verbose("Adding variation to popup",e),c.addClass(e))},visible:function(){p.addClass(d.visible)}},remove:{loading:function(){c.removeClass(d.loading)},variation:function(e){(e=e||k.get.variation())&&(k.verbose("Removing variation",e),c.removeClass(e))},visible:function(){p.removeClass(d.visible)},attempts:function(){k.verbose("Resetting all searched positions"),b=0,y=!1}},bind:{events:function(){k.debug("Binding popup events to module"),"click"==u.on&&p.on(O+a,k.toggle),"hover"==u.on&&p.on("touchstart"+a,k.event.touchstart),k.get.startEvent()&&p.on(k.get.startEvent()+a,k.event.start).on(k.get.endEvent()+a,k.event.end),u.target&&k.debug("Target set to element",v),A.on("resize"+t,k.event.resize)},popup:function(){k.verbose("Allowing hover events on popup to prevent closing"),c&&k.has.popup()&&c.on("mouseenter"+a,k.event.start).on("mouseleave"+a,k.event.end)},close:function(){(!0===u.hideOnScroll||"auto"==u.hideOnScroll&&"click"!=u.on)&&k.bind.closeOnScroll(),k.is.closable()?k.bind.clickaway():"hover"==u.on&&x&&k.bind.touchClose()},closeOnScroll:function(){k.verbose("Binding scroll close event to document"),g.one(k.get.scrollEvent()+t,k.event.hideGracefully)},touchClose:function(){k.verbose("Binding popup touchclose event to document"),D.on("touchstart"+t,function(e){k.verbose("Touched away from popup"),k.event.hideGracefully.call(C,e)})},clickaway:function(){k.verbose("Binding popup close event to document"),D.on(O+t,function(e){k.verbose("Clicked away from popup"),k.event.hideGracefully.call(C,e)})}},unbind:{events:function(){A.off(t),p.off(a)},close:function(){D.off(t),g.off(t)}},has:{popup:function(){return c&&0<c.length}},should:{centerArrow:function(e){return!k.is.basic()&&e.target.width<=2*u.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==u.closable?"hover"!=u.on:u.closable},offstage:function(e,n){var i=[];return V.each(e,function(e,t){t<-u.jitter&&(k.debug("Position exceeds allowable distance from edge",e,t,n),i.push(e))}),0<i.length},svg:function(e){return k.supports.svg()&&e instanceof SVGGraphicsElement},basic:function(){return p.hasClass(d.basic)},active:function(){return p.hasClass(d.active)},animating:function(){return c!==N&&c.hasClass(d.animating)},fluid:function(){return c!==N&&c.hasClass(d.fluid)},visible:function(){return c!==N&&c.hasClass(d.popupVisible)},dropdown:function(){return p.hasClass(d.dropdown)},hidden:function(){return!k.is.visible()},rtl:function(){return"rtl"===p.attr("dir")||"rtl"===p.css("direction")}},reset:function(){k.remove.visible(),u.preserve?V.fn.transition!==N&&c.transition("remove transition"):k.removePopup()},setting:function(e,t){if(V.isPlainObject(e))V.extend(!0,u,e);else{if(t===N)return u[e];u[e]=t}},internal:function(e,t){if(V.isPlainObject(e))V.extend(!0,k,e);else{if(t===N)return k[e];k[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?k.performance.log(arguments):(k.debug=Function.prototype.bind.call(console.info,console,u.name+":"),k.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?k.performance.log(arguments):(k.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),k.verbose.apply(console,arguments)))},error:function(){u.silent||(k.error=Function.prototype.bind.call(console.error,console,u.name+":"),k.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=(new Date).getTime())-(P||t),P=t,M.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:C,"Execution Time":n})),clearTimeout(k.performance.timer),k.performance.timer=setTimeout(k.performance.display,500)},display:function(){var e=u.name+":",n=0;P=!1,clearTimeout(k.performance.timer),V.each(M,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",F&&(e+=" '"+F+"'"),(console.group!==N||console.table!==N)&&0<M.length&&(console.groupCollapsed(e),console.table?console.table(M):V.each(M,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),M=[]}},invoke:function(i,e,t){var o,a,n,r=w;return e=e||j,t=C||t,"string"==typeof i&&r!==N&&(i=i.split(/[\. ]/),o=i.length-1,V.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(V.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==N)return a=r[n],!1;{if(!V.isPlainObject(r[t])||e==o)return r[t]!==N&&(a=r[t]),!1;r=r[t]}}})),V.isFunction(a)?n=a.apply(t,e):a!==N&&(n=a),Array.isArray(S)?S.push(n):S!==N?S=[S,n]:n!==N&&(S=n),a}};I?(w===N&&k.initialize(),k.invoke(R)):(w!==N&&w.invoke("destroy"),k.initialize())}),S!==N?S:this},V.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:L,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:L,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(e){var t={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return t[e]}):e},popup:function(e){var t="",n=V.fn.popup.settings.templates.escape;return typeof e!==N&&(typeof e.title!==N&&e.title&&(e.title=n(e.title),t+='<div class="header">'+e.title+"</div>"),typeof e.content!==N&&e.content&&(e.content=n(e.content),t+='<div class="content">'+e.content+"</div>")),t}}}}(jQuery,window,document),function(T,e,S,D){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),T.fn.progress=function(h){var v,e=T(this),b=e.selector||"",y=(new Date).getTime(),x=[],C=h,w="string"==typeof C,k=[].slice.call(arguments,1);return e.each(function(){var r=T.isPlainObject(h)?T.extend(!0,{},T.fn.progress.settings,h):T.extend({},T.fn.progress.settings),n=r.className,t=r.metadata,e=r.namespace,i=r.selector,s=r.error,o="."+e,a="module-"+e,c=T(this),u=T(this).find(i.bar),l=T(this).find(i.progress),d=T(this).find(i.label),f=this,m=c.data(a),p=!1,g={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var n=0,i=1,o=e/t;n<10&&!(1<(o*=i));)i=Math.pow(10,n++);return i},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){g.set.duration(),g.set.transitionEvent(),g.debug(f),g.read.metadata(),g.read.settings(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of progress",g),m=g,c.data(a,g)},destroy:function(){g.verbose("Destroying previous progress for",c),clearInterval(m.interval),g.remove.state(),c.removeData(a),m=D},reset:function(){g.remove.nextValue(),g.update.progress(0)},complete:function(e){(g.percent===D||g.percent<100)&&(g.remove.progressPoll(),!0!==e&&g.set.percent(100))},read:{metadata:function(){var e={percent:g.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:g.helper.forceArray(c.data(t.value))};e.total!==D&&(g.debug("Total value set from metadata",e.total),g.set.total(e.total)),0<e.value.length&&(g.debug("Current value set from metadata",e.value),g.set.value(e.value),g.set.progress(e.value)),0<e.percent.length&&(g.debug("Current percent value set from metadata",e.percent),g.set.percent(e.percent))},settings:function(){!1!==r.total&&(g.debug("Current total set in settings",r.total),g.set.total(r.total)),!1!==r.value&&(g.debug("Current value set in settings",r.value),g.set.value(r.value),g.set.progress(g.value)),!1!==r.percent&&(g.debug("Current percent set in settings",r.percent),g.set.percent(r.percent))}},bind:{transitionEnd:function(t){var e=g.get.transitionEnd();u.one(e+o,function(e){clearTimeout(g.failSafeTimer),t.call(this,e)}),g.failSafeTimer=setTimeout(function(){u.triggerHandler(e)},r.duration+r.failSafeDelay),g.verbose("Adding fail safe timer",g.timer)}},increment:function(e){var t;e=g.has.total()?(t=g.get.value(),e||1):(t=g.get.percent(),e||g.get.randomValue()),g.debug("Incrementing percentage by",t,t=t+e,e),t=g.get.normalizedValue(t),g.set.progress(t)},decrement:function(e){var t,n;g.get.total()?(n=(t=g.get.value())-(e=e||1),g.debug("Decrementing value by",e,t)):(n=(t=g.get.percent())-(e=e||g.get.randomValue()),g.debug("Decrementing percentage by",e,t)),n=g.get.normalizedValue(n),g.set.progress(n)},has:{progressPoll:function(){return g.progressPoll},total:function(){return!1!==g.get.total()}},get:{text:function(e,t){var t=t||0,n=g.get.value(t),i=g.get.total(),o=p?g.get.displayPercent(t):g.get.percent(t),a=!1!==i?Math.max(0,i-n):100-o;return e=(e=e||"").replace("{value}",n).replace("{total}",i||0).replace("{left}",a).replace("{percent}",o).replace("{bar}",r.text.bars[t]||""),g.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return g.debug("Value cannot decrement below 0"),0;if(g.has.total()){if(e>g.total)return g.debug("Value cannot increment above total",g.total),g.total}else if(100<e)return g.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"==r.updateInterval?r.duration:r.updateInterval},randomValue:function(){return g.debug("Generating random increment percentage"),Math.floor(Math.random()*r.random.max+r.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},transitionEnd:function(){var e,t=S.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(t.style[e]!==D)return n[e]},displayPercent:function(e){var e=T(u[e]),t=e.width(),n=c.width(),e=parseInt(e.css("min-width"),10)<t?t/n*100:g.percent;return 0<r.precision?Math.round(e*(10*r.precision))/(10*r.precision):Math.round(e)},percent:function(e){return g.percent&&g.percent[e||0]||0},value:function(e){return g.nextValue||g.value&&g.value[e||0]||0},total:function(){return g.total!==D&&g.total}},create:{progressPoll:function(){g.progressPoll=setTimeout(function(){g.update.toNextValue(),g.remove.progressPoll()},g.get.updateInterval())}},is:{complete:function(){return g.is.success()||g.is.warning()||g.is.error()},success:function(){return c.hasClass(n.success)},warning:function(){return c.hasClass(n.warning)},error:function(){return c.hasClass(n.error)},active:function(){return c.hasClass(n.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){g.verbose("Removing progress poll timer"),g.progressPoll&&(clearTimeout(g.progressPoll),delete g.progressPoll)},nextValue:function(){g.verbose("Removing progress value stored for next update"),delete g.nextValue},state:function(){g.verbose("Removing stored state"),delete g.total,delete g.percent,delete g.value},active:function(){g.verbose("Removing active state"),c.removeClass(n.active)},success:function(){g.verbose("Removing success state"),c.removeClass(n.success)},warning:function(){g.verbose("Removing warning state"),c.removeClass(n.warning)},error:function(){g.verbose("Removing error state"),c.removeClass(n.error)}},set:{barWidth:function(e){g.debug("set bar width with ",e),e=g.helper.forceArray(e);var o=-1,a=-1,r=g.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var n=t===s-1&&0===r,i=T(u[t]);return 0===e&&l&&!n?i.css("display","none"):(l&&n&&i.css("background","transparent"),-1==o&&(o=t),a=t,i.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){T(u[t]).css({borderTopLeftRadius:t==o?"":0,borderBottomLeftRadius:t==o?"":0,borderTopRightRadius:t==a?"":0,borderBottomRightRadius:t==a?"":0})}),c.attr("data-percent",t)},duration:function(e){e=e||r.duration,g.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=g.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,r.limitValues?Math.max(0,Math.min(100,e)):e});var t,n=g.has.total(),i=g.helper.sum(e),o=1<e.length&&n,a=g.helper.sum(g.helper.forceArray(g.value));o&&a>g.total?g.error(s.sumExceedsTotal,a,g.total):!o&&100<i?g.error(s.tooHigh,i):i<0?g.error(s.tooLow,i):(t=0<r.precision?r.precision:o?g.helper.derivePrecision(Math.min.apply(null,g.value),g.total):0,a=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),g.percent=a,n&&(g.value=e.map(function(e){return 0<t?Math.round(e/100*g.total*(10*t))/(10*t):Math.round(e/100*g.total*10)/10})),g.set.barWidth(e),g.set.labelInterval()),r.onChange.call(f,e,g.value,g.total)},labelInterval:function(){clearInterval(g.interval),g.bind.transitionEnd(function(){g.verbose("Bar finished animating, removing continuous label updates"),clearInterval(g.interval),p=!1,g.set.labels()}),p=!0,g.interval=setInterval(function(){T.contains(S.documentElement,f)||(clearInterval(g.interval),p=!1),g.set.labels()},r.framerate)},labels:function(){g.verbose("Setting both bar progress and outer label text"),g.set.barLabel(),g.set.state()},label:function(e){(e=e||"")&&(e=g.get.text(e),g.verbose("Setting label to text",e),d.text(e))},state:function(e){100===(e=e!==D?e:g.helper.sum(g.percent))?r.autoSuccess&&1===u.length&&!(g.is.warning()||g.is.error()||g.is.success())?(g.set.success(),g.debug("Automatically triggering success at 100%")):(g.verbose("Reached 100% removing active state"),g.remove.active(),g.remove.progressPoll()):0<e?(g.verbose("Adjusting active progress bar label",e),g.set.active()):(g.remove.active(),g.remove.warning(),g.remove.error(),g.remove.success(),g.set.label(r.text.active))},barLabel:function(n){l.map(function(e,t){t=T(t);n!==D?t.text(g.get.text(n,e)):"ratio"==r.label&&g.has.total()?(g.verbose("Adding ratio to bar label"),t.text(g.get.text(r.text.ratio,e))):"percent"==r.label&&(g.verbose("Adding percentage to bar label"),t.text(g.get.text(r.text.percent,e)))})},active:function(e){e=e||r.text.active,g.debug("Setting active state"),r.showActivity&&!g.is.active()&&c.addClass(n.active),g.remove.warning(),g.remove.error(),g.remove.success(),(e=r.onLabelUpdate("active",e,g.value,g.total))&&g.set.label(e),g.bind.transitionEnd(function(){r.onActive.call(f,g.value,g.total)})},success:function(e,t){e=e||r.text.success||r.text.active,g.debug("Setting success state"),c.addClass(n.success),g.remove.active(),g.remove.warning(),g.remove.error(),g.complete(t),e=r.text.success?r.onLabelUpdate("success",e,g.value,g.total):r.onLabelUpdate("active",e,g.value,g.total),g.set.label(e),g.bind.transitionEnd(function(){r.onSuccess.call(f,g.total)})},warning:function(e,t){e=e||r.text.warning,g.debug("Setting warning state"),c.addClass(n.warning),g.remove.active(),g.remove.success(),g.remove.error(),g.complete(t),(e=r.onLabelUpdate("warning",e,g.value,g.total))&&g.set.label(e),g.bind.transitionEnd(function(){r.onWarning.call(f,g.value,g.total)})},error:function(e,t){e=e||r.text.error,g.debug("Setting error state"),c.addClass(n.error),g.remove.active(),g.remove.success(),g.remove.warning(),g.complete(t),(e=r.onLabelUpdate("error",e,g.value,g.total))&&g.set.label(e),g.bind.transitionEnd(function(){r.onError.call(f,g.value,g.total)})},transitionEvent:function(){g.get.transitionEnd()},total:function(e){g.total=e},value:function(e){g.value=g.helper.forceArray(e)},progress:function(e){g.has.progressPoll()?(g.debug("Updated within interval, setting next update to use new value",e),g.set.nextValue(e)):(g.debug("First update in progress update interval, immediately updating",e),g.update.progress(e),g.create.progressPoll())},nextValue:function(e){g.nextValue=e}},update:{toNextValue:function(){var e=g.nextValue;e&&(g.debug("Update interval complete using last updated value",e),g.update.progress(e),g.remove.nextValue())},progress:function(e){var n=g.has.total(),e=(n&&g.set.value(e),g.helper.forceArray(e).map(function(e){var t;return!1===(e=g.get.numericValue(e))&&g.error(s.nonNumeric,e),e=g.get.normalizedValue(e),n?(t=0<g.total?e/g.total*100:100,g.debug("Calculating percent complete from total",t)):(t=e,g.debug("Setting value to exact percentage value",t)),t}));g.set.percent(e)}},setting:function(e,t){if(g.debug("Changing setting",e,t),T.isPlainObject(e))T.extend(!0,r,e);else{if(t===D)return r[e];T.isPlainObject(r[e])?T.extend(!0,r[e],t):r[e]=t}},internal:function(e,t){if(T.isPlainObject(e))T.extend(!0,g,e);else{if(t===D)return g[e];g[e]=t}},debug:function(){!r.silent&&r.debug&&(r.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,r.name+":"),g.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),g.verbose.apply(console,arguments)))},error:function(){r.silent||(g.error=Function.prototype.bind.call(console.error,console,r.name+":"),g.error.apply(console,arguments))},performance:{log:function(e){var t,n;r.performance&&(n=(t=(new Date).getTime())-(y||t),y=t,x.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:f,"Execution Time":n})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,500)},display:function(){var e=r.name+":",n=0;y=!1,clearTimeout(g.performance.timer),T.each(x,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",b&&(e+=" '"+b+"'"),(console.group!==D||console.table!==D)&&0<x.length&&(console.groupCollapsed(e),console.table?console.table(x):T.each(x,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),x=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||k,t=f||t,"string"==typeof i&&r!==D&&(i=i.split(/[\. ]/),o=i.length-1,T.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(T.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==D)return a=r[n],!1;{if(!T.isPlainObject(r[t])||e==o)return r[t]!==D?a=r[t]:g.error(s.method,i),!1;r=r[t]}}})),T.isFunction(a)?n=a.apply(t,e):a!==D&&(n=a),Array.isArray(v)?v.push(n):v!==D?v=[v,n]:n!==D&&(v=n),a}};w?(m===D&&g.initialize(),g.invoke(C)):(m!==D&&m.invoke("destroy"),g.initialize())}),v!==D?v:this},T.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,n,i){return t},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%",sumExceedsTotal:"Sum of multiple values exceed total"},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}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(U,t,B,Y){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),U.fn.slider=function(P){var M,e=U(this),R=U(t),I=e.selector||"",j=(new Date).getTime(),V=[],L=P,q="string"==typeof L,N=[].slice.call(arguments,1),z=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],H=0;return e.each(function(){var c,r,s,l,e,u,d,t,f,m,p,g,o,h,a,v,b=U.isPlainObject(P)?U.extend(!0,{},U.fn.slider.settings,P):U.extend({},U.fn.slider.settings),n=b.className,i=b.metadata,y=b.namespace,x=b.error,C=b.keys,w=b.interpretLabel,k=!1,T="."+y,S="module-"+y,D=U(this),A=this,E=D.data(S),F=1,O={initialize:function(){O.debug("Initializing slider",b),v=!0,t=H+=1,O.setup.layout(),O.setup.labels(),O.is.disabled()||O.bind.events(),O.read.metadata(),O.read.settings(),v=!1,O.instantiate()},instantiate:function(){O.verbose("Storing instance of slider",O),E=O,D.data(S,O)},destroy:function(){O.verbose("Destroying previous slider for",D),clearInterval(E.interval),O.unbind.events(),O.unbind.slidingEvents(),D.removeData(S),E=Y},setup:{layout:function(){D.attr("tabindex")===Y&&D.attr("tabindex",0),0==D.find(".inner").length&&D.append("<div class='inner'><div class='track'></div><div class='track-fill'></div><div class='thumb'></div></div>"),o=O.get.precision(),s=D.find(".thumb:not(.second)"),c=s,O.is.range()&&(0==D.find(".thumb.second").length&&D.find(".inner").append("<div class='thumb second'></div>"),l=D.find(".thumb.second")),e=D.find(".track"),u=D.find(".track-fill"),g=s.width()/2},labels:function(){O.is.labeled()&&(0!=(d=D.find(".labels:not(.auto)")).length?O.setup.customLabel():O.setup.autoLabel(),b.showLabelTicks&&D.addClass(n.ticked))},customLabel:function(){var n,e=d.find(".label"),i=e.length,o=O.get.min(),a=O.get.max();e.each(function(e){var t=U(this).attr("data-value");n=t?((t=a<t?a:t<o?o:t)-o)/(a-o):(e+1)/(i+1),O.update.labelPosition(n,U(this))})},autoLabel:function(){0!=(d=D.find(".labels")).length?d.empty():d=D.append('<ul class="auto labels"></ul>').find(".labels");for(var e=0,t=O.get.numLabels();e<=t;e++){var n=O.get.label(e),n=""!==n?e%O.get.gapRatio()?U('<li class="halftick label"></li>'):U('<li class="label">'+n+"</li>"):null;n&&(O.update.labelPosition(e/t,n),d.append(n))}}},bind:{events:function(){O.bind.globalKeyboardEvents(),O.bind.keyboardEvents(),O.bind.mouseEvents(),b.autoAdjustLabels&&O.bind.windowEvents()},keyboardEvents:function(){O.verbose("Binding keyboard events"),D.on("keydown"+T,O.event.keydown)},globalKeyboardEvents:function(){U(B).on("keydown"+T+t,O.event.activateFocus)},mouseEvents:function(){O.verbose("Binding mouse and touch events"),D.find(".track, .thumb, .inner").on("mousedown"+T,function(e){e.stopImmediatePropagation(),e.preventDefault(),O.event.down(e)}),D.on("mousedown"+T,O.event.down),D.on("mouseenter"+T,function(e){k=!0}),D.on("mouseleave"+T,function(e){k=!1}),D.find(".thumb").on("touchstart"+T,O.event.touchDown).on("touchmove"+T,O.event.move).on("touchend"+T,O.event.up).on("touchcancel"+T,O.event.touchCancel)},slidingEvents:function(){O.verbose("Binding page wide events while handle is being draged"),U(B).on("mousemove"+T,O.event.move),U(B).on("mouseup"+T,O.event.up)},windowEvents:function(){R.on("resize"+T,O.event.resize)}},unbind:{events:function(){D.find(".track, .thumb, .inner").off("mousedown"+T),D.off("mousedown"+T),D.off("mouseenter"+T),D.off("mouseleave"+T),D.find(".thumb").off("touchstart"+T).off("touchmove"+T).off("touchend"+T).off("touchcancel"+T),D.off("keydown"+T),D.off("focusout"+T),U(B).off("keydown"+T+t,O.event.activateFocus),R.off("resize"+T)},slidingEvents:function(){U(B).off("mousemove"+T),U(B).off("mouseup"+T)}},event:{down:function(e){e.preventDefault(),O.is.range()?(e=O.determine.eventPos(e),e=O.determine.pos(e),c=b.preventCrossover&&O.is.range()&&O.thumbVal===O.secondThumbVal?(a=e,Y):O.determine.closestThumb(e),h===Y&&(h=O.get.currentThumbValue())):h===Y&&(h=O.get.value()),O.is.disabled()||O.bind.slidingEvents()},touchDown:function(e){e.preventDefault(),e.stopImmediatePropagation(),r===Y&&(c=U(e.target),e=e.touches?e:e.originalEvent,r=e.targetTouches[0].identifier,h===Y&&(h=O.get.currentThumbValue()))},move:function(e){var t,n,i;"mousemove"==e.type&&e.preventDefault(),O.is.disabled()||(t=O.determine.valueFromEvent(e),"mousemove"==e.type&&c===Y&&(n=O.determine.eventPos(e),n=O.determine.pos(n),c=n<a?s:l),0==O.get.step()||O.is.smooth()?(n=O.thumbVal,i=O.secondThumbVal,e=O.determine.smoothValueFromEvent(e),c.hasClass("second")?(b.preventCrossover&&O.is.range()&&(t=Math.max(n,t),e=Math.max(n,e)),i=t):(b.preventCrossover&&O.is.range()&&(t=Math.min(i,t),e=Math.min(i,e)),n=t),t=Math.abs(n-(i||0)),O.update.position(e),b.onMove.call(A,t,n,i)):O.update.value(t,function(e,t,n){b.onMove.call(A,e,t,n)}))},up:function(e){e.preventDefault(),O.is.disabled()||(e=O.determine.valueFromEvent(e),O.set.value(e),O.unbind.slidingEvents(),h!==(r=Y)&&(h=Y))},touchCancel:function(e){e.preventDefault(),h!==(r=Y)&&(O.update.value(h),h=Y)},keydown:function(e,t){if(b.preventCrossover&&O.is.range()&&O.thumbVal===O.secondThumbVal&&(c=Y),O.is.focused()&&U(B).trigger(e),t||O.is.focused()){t=O.determine.keyMovement(e);if(0!=t)switch(e.preventDefault(),t){case 1:O.takeStep();break;case 2:O.takeStep(O.get.multiplier());break;case-1:O.backStep();break;case-2:O.backStep(O.get.multiplier())}}},activateFocus:function(e){!O.is.focused()&&O.is.hover()&&0!=O.determine.keyMovement(e)&&(e.preventDefault(),O.event.keydown(e,!0),D.focus())},resize:function(e){F!=O.get.gapRatio()&&(O.setup.labels(),F=O.get.gapRatio())}},resync:function(){O.verbose("Resyncing thumb position based on value"),O.is.range()&&O.update.position(O.secondThumbVal,l),O.update.position(O.thumbVal,s),O.setup.labels()},takeStep:function(e){var e=e!=Y?e:1,t=O.get.step(),n=O.get.currentThumbValue();O.verbose("Taking a step"),0<t?O.set.value(n+t*e):0==t&&(t=O.get.precision(),O.set.value(Math.round((n+e/t)*t)/t))},backStep:function(e){var e=e!=Y?e:1,t=O.get.step(),n=O.get.currentThumbValue();O.verbose("Going back a step"),0<t?O.set.value(n-t*e):0==t&&(t=O.get.precision(),O.set.value(Math.round((n-e/t)*t)/t))},is:{range:function(){return D.hasClass(b.className.range)},hover:function(){return k},focused:function(){return D.is(":focus")},disabled:function(){return D.hasClass(b.className.disabled)},labeled:function(){return D.hasClass(b.className.labeled)},reversed:function(){return D.hasClass(b.className.reversed)},vertical:function(){return D.hasClass(b.className.vertical)},smooth:function(){return b.smooth||D.hasClass(b.className.smooth)}},get:{trackOffset:function(){return O.is.vertical()?e.offset().top:e.offset().left},trackLength:function(){return O.is.vertical()?e.height():e.width()},trackLeft:function(){return O.is.vertical()?e.position().top:e.position().left},trackStartPos:function(){return O.is.reversed()?O.get.trackLeft()+O.get.trackLength():O.get.trackLeft()},trackEndPos:function(){return O.is.reversed()?O.get.trackLeft():O.get.trackLeft()+O.get.trackLength()},trackStartMargin:function(){var e=O.is.vertical()?O.is.reversed()?D.css("padding-bottom"):D.css("padding-top"):O.is.reversed()?D.css("padding-right"):D.css("padding-left");return e||"0px"},trackEndMargin:function(){var e=O.is.vertical()?O.is.reversed()?D.css("padding-top"):D.css("padding-bottom"):O.is.reversed()?D.css("padding-left"):D.css("padding-right");return e||"0px"},precision:function(){var e=O.get.step(),e=(e=0!=e?2==(e=String(e).split(".")).length?e[1].length:0:b.decimalPlaces,Math.pow(10,e));return O.debug("Precision determined",e),e},min:function(){return b.min},max:function(){var e=O.get.step(),t=O.get.min(),n=0===e?0:Math.floor((b.max-t)/e);return 0==(0===e?0:(b.max-t)%e)?b.max:t+n*e},step:function(){return b.step},numLabels:function(){var e=Math.round((O.get.max()-O.get.min())/(0===O.get.step()?1:O.get.step()));return O.debug("Determined that there should be "+e+" labels"),e},labelType:function(){return b.labelType},label:function(e){if(w)return w(e);switch(b.labelType){case b.labelTypes.number:return Math.round((e*(0===O.get.step()?1:O.get.step())+O.get.min())*o)/o;case b.labelTypes.letter:return z[e%26];default:return e}},value:function(){return f},currentThumbValue:function(){return c!==Y&&c.hasClass("second")?O.secondThumbVal:O.thumbVal},thumbValue:function(e){return"second"!==e?O.thumbVal:O.is.range()?O.secondThumbVal:void O.error(x.notrange)},multiplier:function(){return b.pageMultiplier},thumbPosition:function(e){return"second"!==e?m:O.is.range()?p:void O.error(x.notrange)},gapRatio:function(){var e=1;if(b.autoAdjustLabels){var t=O.get.numLabels(),n=O.get.trackLength(),i=1;if(0<n)for(;n/t*i<b.labelDistance;)t%i||(e=i),i+=1}return e}},determine:{pos:function(e){return O.is.reversed()?O.get.trackStartPos()-e+O.get.trackOffset():e-O.get.trackOffset()-O.get.trackStartPos()},closestThumb:function(e){var t=parseFloat(O.determine.thumbPos(s)),t=Math.abs(e-t),n=parseFloat(O.determine.thumbPos(l)),e=Math.abs(e-n);return(t!==e||O.get.thumbValue()!==O.get.min())&&t<=e?s:l},closestThumbPos:function(e){var t=parseFloat(O.determine.thumbPos(s)),n=Math.abs(e-t),i=parseFloat(O.determine.thumbPos(l));return n<=Math.abs(e-i)?t:i},thumbPos:function(e){return O.is.vertical()?O.is.reversed()?e.css("bottom"):e.css("top"):O.is.reversed()?e.css("right"):e.css("left")},positionFromValue:function(e){var t=O.get.min(),n=O.get.max(),e=n<e?n:e<t?t:e,i=O.get.trackLength(),n=Math.round((e-t)/(n-t)*i);return O.verbose("Determined position: "+n+" from value: "+e),n},positionFromRatio:function(e){var t=O.get.trackLength(),n=O.get.step(),e=Math.round(e*t);return 0==n?e:Math.round(e/n)*n},valueFromEvent:function(e){var e=O.determine.eventPos(e),t=O.determine.pos(e),e=e<O.get.trackOffset()?O.is.reversed()?O.get.max():O.get.min():e>O.get.trackOffset()+O.get.trackLength()?O.is.reversed()?O.get.min():O.get.max():O.determine.value(t);return e},smoothValueFromEvent:function(e){var t=O.get.min(),n=O.get.max(),i=O.get.trackLength(),e=O.determine.eventPos(e)-O.get.trackOffset(),e=(e=e<0?0:i<e?i:e)/i;return(e=O.is.reversed()?1-e:e)*(n-t)+t},eventPos:function(e){if("touchmove"===e.type||"touchend"===e.type){for(var t=e.touches?e:e.originalEvent,n=t.changedTouches[0],i=0;i<t.touches.length;i++)if(t.touches[i].identifier===r){n=t.touches[i];break}var o=n.pageY,a=n.pageX;return O.is.vertical()?o:a}o=e.pageY||e.originalEvent.pageY,a=e.pageX||e.originalEvent.pageX;return O.is.vertical()?o:a},value:function(e){var t=O.is.reversed()?O.get.trackEndPos():O.get.trackStartPos(),t=(e-t)/((O.is.reversed()?O.get.trackStartPos():O.get.trackEndPos())-t),n=O.get.max()-O.get.min(),i=O.get.step(),t=t*n,n=0==i?t:Math.round(t/i)*i;return O.verbose("Determined value based upon position: "+e+" as: "+t),t!=n&&O.verbose("Rounding value to closest step: "+n),O.verbose("Cutting off additional decimal places"),Math.round((n+O.get.min())*o)/o},keyMovement:function(e){var e=e.which,t=!O.is.vertical()||O.is.reversed()?C.downArrow:C.upArrow,n=!O.is.vertical()||O.is.reversed()?C.upArrow:C.downArrow,i=!O.is.vertical()&&O.is.reversed()?C.rightArrow:C.leftArrow,o=!O.is.vertical()&&O.is.reversed()?C.leftArrow:C.rightArrow;return e==t||e==i?-1:e==n||e==o?1:e==C.pageDown?-2:e==C.pageUp?2:0}},handleNewValuePosition:function(e){var t=O.get.min(),n=O.get.max();return e<=t?e=t:n<=e&&(e=n),O.determine.positionFromValue(e)},set:{value:function(i,o){o=!1!==o;var a=h===Y;h=h===Y?O.get.value():h,O.update.value(i,function(e,t,n){v&&!b.fireOnInit||!o||(i!==h&&b.onChange.call(A,e,t,n),b.onMove.call(A,e,t,n)),a&&(h=Y)})},rangeValue:function(e,t,n){var i,o,a;n=!1!==n,O.is.range()?(i=O.get.min(),o=O.get.max(),h=(a=h===Y)?O.get.value():h,e<=i?e=i:o<=e&&(e=o),t<=i?t=i:o<=t&&(t=o),O.thumbVal=e,O.secondThumbVal=t,f=Math.abs(O.thumbVal-O.secondThumbVal),O.update.position(O.thumbVal,s),O.update.position(O.secondThumbVal,l),v&&!b.fireOnInit||!n||(f!==h&&b.onChange.call(A,f,O.thumbVal,O.secondThumbVal),b.onMove.call(A,f,O.thumbVal,O.secondThumbVal)),a&&(h=Y)):O.error(x.notrange)},position:function(e,t){e=O.determine.value(e);"second"===t?(O.secondThumbVal=e,O.update.position(e,l)):(O.thumbVal=e,O.update.position(e,s)),f=Math.abs(O.thumbVal-(O.secondThumbVal||0)),O.set.value(f)}},update:{value:function(e,t){var n=O.get.min(),i=O.get.max();e<=n?e=n:i<=e&&(e=i),O.is.range()?((c=c===Y?e<=O.get.currentThumbValue()?s:l:c).hasClass("second")?(b.preventCrossover&&O.is.range()&&(e=Math.max(O.thumbVal,e)),O.secondThumbVal=e):(b.preventCrossover&&O.is.range()&&(e=Math.min(O.secondThumbVal,e)),O.thumbVal=e),f=Math.abs(O.thumbVal-O.secondThumbVal)):(f=e,O.thumbVal=f),O.update.position(e),O.debug("Setting slider value to "+f),"function"==typeof t&&t(f,O.thumbVal,O.secondThumbVal)},position:function(e,t){var n=O.handleNewValuePosition(e),t=t!=Y?t:c,i=O.thumbVal||O.get.min(),o=O.secondThumbVal||O.get.min();O.is.range()&&t.hasClass("second")?(p=n,o=e):(m=n,i=e);var a,r=O.get.min(),s=O.get.max(),e=100*(e-r)/(s-r),l=100*(Math.min(i,o)-r)/(s-r),i=100*(1-(Math.max(i,o)-r)/(s-r)),o=O.is.vertical()?O.is.reversed()?(a={bottom:"calc("+e+"% - "+g+"px)",top:"auto"},{bottom:l+"%",top:i+"%"}):(a={top:"calc("+e+"% - "+g+"px)",bottom:"auto"},{top:l+"%",bottom:i+"%"}):O.is.reversed()?(a={right:"calc("+e+"% - "+g+"px)",left:"auto"},{right:l+"%",left:i+"%"}):(a={left:"calc("+e+"% - "+g+"px)",right:"auto"},{left:l+"%",right:i+"%"});t.css(a),u.css(o),O.debug("Setting slider position to "+n)},labelPosition:function(e,t){var n=O.get.trackStartMargin(),i=O.get.trackEndMargin(),o=O.is.vertical()?O.is.reversed()?"bottom":"top":O.is.reversed()?"right":"left",a=O.is.reversed()&&!O.is.vertical()?" - ":" + ";t.css(o,"calc("+("(100% - "+n+" - "+i+") * "+e)+a+n+")")}},goto:{max:function(){O.set.value(O.get.max())},min:function(){O.set.value(O.get.min())}},read:{metadata:function(){var e={thumbVal:D.data(i.thumbVal),secondThumbVal:D.data(i.secondThumbVal)};e.thumbVal&&(O.is.range()&&e.secondThumbVal?(O.debug("Current value set from metadata",e.thumbVal,e.secondThumbVal),O.set.rangeValue(e.thumbVal,e.secondThumbVal)):(O.debug("Current value set from metadata",e.thumbVal),O.set.value(e.thumbVal)))},settings:function(){!1!==b.start&&(O.is.range()?(O.debug("Start position set from settings",b.start,b.end),O.set.rangeValue(b.start,b.end)):(O.debug("Start position set from settings",b.start),O.set.value(b.start)))}},setting:function(e,t){if(O.debug("Changing setting",e,t),U.isPlainObject(e))U.extend(!0,b,e);else{if(t===Y)return b[e];U.isPlainObject(b[e])?U.extend(!0,b[e],t):b[e]=t}},internal:function(e,t){if(U.isPlainObject(e))U.extend(!0,O,e);else{if(t===Y)return O[e];O[e]=t}},debug:function(){!b.silent&&b.debug&&(b.performance?O.performance.log(arguments):(O.debug=Function.prototype.bind.call(console.info,console,b.name+":"),O.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?O.performance.log(arguments):(O.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),O.verbose.apply(console,arguments)))},error:function(){b.silent||(O.error=Function.prototype.bind.call(console.error,console,b.name+":"),O.error.apply(console,arguments))},performance:{log:function(e){var t,n;b.performance&&(n=(t=(new Date).getTime())-(j||t),j=t,V.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:A,"Execution Time":n})),clearTimeout(O.performance.timer),O.performance.timer=setTimeout(O.performance.display,500)},display:function(){var e=b.name+":",n=0;j=!1,clearTimeout(O.performance.timer),U.each(V,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",I&&(e+=" '"+I+"'"),(console.group!==Y||console.table!==Y)&&0<V.length&&(console.groupCollapsed(e),console.table?console.table(V):U.each(V,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),V=[]}},invoke:function(i,e,t){var o,a,n,r=E;return e=e||N,t=A||t,"string"==typeof i&&r!==Y&&(i=i.split(/[\. ]/),o=i.length-1,U.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(U.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==Y)return a=r[n],!1;{if(!U.isPlainObject(r[t])||e==o)return r[t]!==Y?a=r[t]:O.error(x.method,i),!1;r=r[t]}}})),U.isFunction(a)?n=a.apply(t,e):a!==Y&&(n=a),U.isArray(M)?M.push(n):M!==Y?M=[M,n]:n!==Y&&(M=n),a}};q?(E===Y&&O.initialize(),O.invoke(L)):(E!==Y&&E.invoke("destroy"),O.initialize())}),M!==Y?M:this},U.fn.slider.settings={silent:!1,debug:!1,verbose:!1,performance:!0,name:"Slider",namespace:"slider",error:{method:"The method you called is not defined.",notrange:"This slider is not a range slider"},metadata:{thumbVal:"thumbVal",secondThumbVal:"secondThumbVal"},min:0,max:20,step:1,start:0,end:20,labelType:"number",showLabelTicks:!1,smooth:!1,autoAdjustLabels:!0,labelDistance:100,preventCrossover:!0,fireOnInit:!1,interpretLabel:!1,decimalPlaces:2,pageMultiplier:2,selector:{},className:{reversed:"reversed",disabled:"disabled",labeled:"labeled",ticked:"ticked",vertical:"vertical",range:"range",smooth:"smooth"},keys:{pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},labelTypes:{number:"number",letter:"letter"},onChange:function(e,t,n){},onMove:function(e,t,n){}}}(jQuery,window,document),function(k,e,T){"use strict";k.isFunction=k.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k.fn.rating=function(p){var g,h=k(this),v=h.selector||"",b=(new Date).getTime(),y=[],x=p,C="string"==typeof x,w=[].slice.call(arguments,1);return h.each(function(){var e,o=k.isPlainObject(p)?k.extend(!0,{},k.fn.rating.settings,p):k.extend({},k.fn.rating.settings),t=o.namespace,a=o.className,n=o.metadata,i=o.selector,r=o.cssVars,s="."+t,l="module-"+t,c=this,u=k(this).data(l),d=k(this),f=d.find(i.icon),m={initialize:function(){m.verbose("Initializing rating module",o),0===f.length&&m.setup.layout(),o.interactive&&!m.is.disabled()?m.enable():m.disable(),m.set.initialLoad(),m.set.rating(m.get.initialRating()),m.remove.initialLoad(),m.instantiate()},instantiate:function(){m.verbose("Instantiating module",o),u=m,d.data(l,m)},destroy:function(){m.verbose("Destroying previous instance",u),m.remove.events(),d.removeData(l)},refresh:function(){f=d.find(i.icon)},setup:{layout:function(){var e=m.get.maxRating(),t=m.get.icon(),e=k.fn.rating.settings.templates.icon(e,t);m.debug("Generating icon html dynamically"),d.html(e),m.refresh()}},event:{mouseenter:function(){var e=k(this);e.nextAll().removeClass(a.selected),d.addClass(a.selected),e.addClass(a.selected).prevAll().addClass(a.selected)},mouseleave:function(){d.removeClass(a.selected),f.removeClass(a.selected)},click:function(){var e=k(this),t=m.get.rating(),e=f.index(e)+1;("auto"==o.clearable?1===f.length:o.clearable)&&t==e?m.clearRating():m.set.rating(e)}},clearRating:function(){m.debug("Clearing current rating"),m.set.rating(0)},bind:{events:function(){m.verbose("Binding events"),d.on("mouseenter"+s,i.icon,m.event.mouseenter).on("mouseleave"+s,i.icon,m.event.mouseleave).on("click"+s,i.icon,m.event.click)}},remove:{events:function(){m.verbose("Removing events"),d.off(s)},initialLoad:function(){e=!1}},enable:function(){m.debug("Setting rating to interactive mode"),m.bind.events(),d.removeClass(a.disabled)},disable:function(){m.debug("Setting rating to read-only mode"),m.remove.events(),d.addClass(a.disabled)},is:{initialLoad:function(){return e},disabled:function(){return d.hasClass(a.disabled)}},get:{icon:function(){var e=d.data(n.icon);return e&&d.removeData(n.icon),e||o.icon},initialRating:function(){return d.data(n.rating)!==T?(d.removeData(n.rating),d.data(n.rating)):o.initialRating},maxRating:function(){return d.data(n.maxRating)!==T?(d.removeData(n.maxRating),d.data(n.maxRating)):o.maxRating},rating:function(){var e=f.filter("."+a.active).length;return m.verbose("Current rating retrieved",e),e}},set:{rating:function(e){var t=Math.floor(0<=e-1?e-1:0),t=f.eq(t),n=e<=1?t:t.next(),i=e%1*100;d.removeClass(a.selected),f.removeClass(a.selected).removeClass(a.active).removeClass(a.partiallyActive),0<e&&(m.verbose("Setting current rating to",e),t.prevAll().addBack().addClass(a.active),t.next()&&e%1!=0&&(n.addClass(a.partiallyActive).addClass(a.active),n.css(r.filledCustomPropName,i+"%"),"transparent"===n.css("backgroundColor")&&n.removeClass(a.partiallyActive).removeClass(a.active))),m.is.initialLoad()||o.onRate.call(c,e)},initialLoad:function(){e=!0}},setting:function(e,t){if(m.debug("Changing setting",e,t),k.isPlainObject(e))k.extend(!0,o,e);else{if(t===T)return o[e];k.isPlainObject(o[e])?k.extend(!0,o[e],t):o[e]=t}},internal:function(e,t){if(k.isPlainObject(e))k.extend(!0,m,e);else{if(t===T)return m[e];m[e]=t}},debug:function(){!o.silent&&o.debug&&(o.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,o.name+":"),m.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),m.verbose.apply(console,arguments)))},error:function(){o.silent||(m.error=Function.prototype.bind.call(console.error,console,o.name+":"),m.error.apply(console,arguments))},performance:{log:function(e){var t,n;o.performance&&(n=(t=(new Date).getTime())-(b||t),b=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var e=o.name+":",n=0;b=!1,clearTimeout(m.performance.timer),k.each(y,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",v&&(e+=" '"+v+"'"),1<h.length&&(e+=" ("+h.length+")"),(console.group!==T||console.table!==T)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):k.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,t){var o,a,n,r=u;return e=e||w,t=c||t,"string"==typeof i&&r!==T&&(i=i.split(/[\. ]/),o=i.length-1,k.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(k.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==T)return a=r[n],!1;{if(!k.isPlainObject(r[t])||e==o)return r[t]!==T&&(a=r[t]),!1;r=r[t]}}})),k.isFunction(a)?n=a.apply(t,e):a!==T&&(n=a),Array.isArray(g)?g.push(n):g!==T?g=[g,n]:n!==T&&(g=n),a}};C?(u===T&&m.initialize(),m.invoke(x)):(u!==T&&u.invoke("destroy"),m.initialize())}),g!==T?g:this},k.fn.rating.settings={name:"Rating",namespace:"rating",icon:"star",silent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,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",icon:"icon"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading",partiallyActive:"partial"},cssVars:{filledCustomPropName:"--full"},selector:{icon:".icon"},templates:{icon:function(e,t){for(var n=1,i="";n<=e;)i+='<i class="'+t+' icon"></i>',n++;return i}}}}(jQuery,window,void document),function(F,O,P,M){"use strict";F.isFunction=F.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),F.fn.search=function(x){var C,w=F(this),k=w.selector||"",T=(new Date).getTime(),S=[],D=x,A="string"==typeof D,E=[].slice.call(arguments,1);return F(this).each(function(){var u=F.isPlainObject(x)?F.extend(!0,{},F.fn.search.settings,x):F.extend({},F.fn.search.settings),d=u.className,l=u.metadata,i=u.regExp,a=u.fields,f=u.selector,m=u.error,e=u.namespace,o="."+e,t=e+"-module",p=F(this),g=p.find(f.prompt),n=p.find(f.searchButton),r=p.find(f.results),s=p.find(f.result),c=(p.find(f.category),this),h=p.data(t),v=!1,b=!1,y={initialize:function(){y.verbose("Initializing module"),y.get.settings(),y.determine.searchFields(),y.bind.events(),y.set.type(),y.create.results(),y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y),h=y,p.data(t,y)},destroy:function(){y.verbose("Destroying instance"),p.off(o).removeData(t)},refresh:function(){y.debug("Refreshing selector cache"),g=p.find(f.prompt),n=p.find(f.searchButton),p.find(f.category),r=p.find(f.results),s=p.find(f.result)},refreshResults:function(){r=p.find(f.results),s=p.find(f.result)},bind:{events:function(){y.verbose("Binding events to search"),u.automatic&&(p.on(y.get.inputEvent()+o,f.prompt,y.event.input),g.attr("autocomplete",y.is.chrome()?"fomantic-search":"off")),p.on("focus"+o,f.prompt,y.event.focus).on("blur"+o,f.prompt,y.event.blur).on("keydown"+o,f.prompt,y.handleKeyboard).on("click"+o,f.searchButton,y.query).on("mousedown"+o,f.results,y.event.result.mousedown).on("mouseup"+o,f.results,y.event.result.mouseup).on("click"+o,f.result,y.event.result.click)}},determine:{searchFields:function(){x&&x.searchFields!==M&&(u.searchFields=x.searchFields)}},event:{input:function(){u.searchDelay?(clearTimeout(y.timer),y.timer=setTimeout(function(){y.is.focused()&&y.query()},u.searchDelay)):y.query()},focus:function(){y.set.focus(),u.searchOnFocus&&y.has.minimumCharacters()&&y.query(function(){y.can.show()&&y.showResults()})},blur:function(e){function t(){y.cancel.query(),y.remove.focus(),y.timer=setTimeout(y.hideResults,u.hideDelay)}var n=P.activeElement===this;n||(b=!1,y.resultsClicked?(y.debug("Determining if user action caused search to close"),p.one("click.close"+o,f.results,function(e){y.is.inMessage(e)||v?g.focus():(v=!1,y.is.animating()||y.is.hidden()||t())})):(y.debug("Input blurred without user action, closing results"),t()))},result:{mousedown:function(){y.resultsClicked=!0},mouseup:function(){y.resultsClicked=!1},click:function(e){y.debug("Search result selected");var t=F(this),n=t.find(f.title).eq(0),i=t.is("a[href]")?t:t.find("a[href]").eq(0),o=i.attr("href")||!1,a=i.attr("target")||!1,n=0<n.length&&n.text(),r=y.get.results(),t=t.data(l.result)||y.get.result(n,r),s=y.get.value();if(F.isFunction(u.onSelect)&&!1===u.onSelect.call(c,t,r))return y.debug("Custom onSelect callback cancelled default select action"),void(v=!0);y.hideResults(),n&&y.get.value()===s&&y.set.value(n),o&&(e.preventDefault(),y.verbose("Opening search link found in result",i),"_blank"==a||e.ctrlKey?O.open(o):O.location.href=o)}}},ensureVisible:function(e){var t,n,i;0!==e.length&&(e=(t=e.position().top)+e.outerHeight(!0),n=r.scrollTop(),i=r.height(),t<0?r.scrollTop(n+t):i<e&&r.scrollTop(n+(e-i)))},handleKeyboard:function(e){var t,n=p.find(f.result),i=p.find(f.category),o=n.filter("."+d.active),a=n.index(o),r=n.length,o=0<o.length,s=e.which,l=13,c=38,u=40;if(s==27&&(y.verbose("Escape key pressed, blurring search field"),y.hideResults(),b=!0),y.is.visible())if(s==l){if(y.verbose("Enter key pressed, selecting active result"),0<n.filter("."+d.active).length)return y.event.result.click.call(n.filter("."+d.active),e),e.preventDefault(),!1}else s==c&&o?(y.verbose("Up key pressed, changing active result"),t=a-1<0?a:a-1,i.removeClass(d.active),n.removeClass(d.active).eq(t).addClass(d.active).closest(i).addClass(d.active),y.ensureVisible(n.eq(t)),e.preventDefault()):s==u&&(y.verbose("Down key pressed, changing active result"),t=r<=a+1?a:a+1,i.removeClass(d.active),n.removeClass(d.active).eq(t).addClass(d.active).closest(i).addClass(d.active),y.ensureVisible(n.eq(t)),e.preventDefault());else s==l&&(y.verbose("Enter key pressed, executing query"),y.query(),y.set.buttonPressed(),g.one("keyup",y.remove.buttonFocus))},setup:{api:function(i,o){var e={debug:u.debug,on:!1,cache:u.cache,action:"search",urlData:{query:i}};F.extend(!0,e,u.apiSettings,{onSuccess:function(e,t,n){y.parse.response.call(c,e,i),o(),u.apiSettings&&"function"==typeof u.apiSettings.onSuccess&&u.apiSettings.onSuccess.call(this,e,t,n)},onFailure:function(e,t,n){y.displayMessage(m.serverError),o(),u.apiSettings&&"function"==typeof u.apiSettings.onFailure&&u.apiSettings.onFailure.call(this,e,t,n)},onAbort:function(e,t,n){u.apiSettings&&"function"==typeof u.apiSettings.onAbort&&u.apiSettings.onAbort.call(this,e,t,n)},onError:function(e,t,n){y.error(),u.apiSettings&&"function"==typeof u.apiSettings.onError&&u.apiSettings.onError.call(this,e,t,n)}}),y.verbose("Setting up API request",e),p.api(e)}},can:{useAPI:function(){return F.fn.api!==M},show:function(){return y.is.focused()&&!y.is.visible()&&!y.is.empty()},transition:function(){return u.transition&&F.fn.transition!==M&&p.transition("is supported")}},is:{animating:function(){return r.hasClass(d.animating)},chrome:function(){return!!O.chrome&&!O.StyleMedia},hidden:function(){return r.hasClass(d.hidden)},inMessage:function(e){var t;if(e.target)return t=F(e.target),F.contains(P.documentElement,e.target)&&0<t.closest(f.message).length},empty:function(){return""===r.html()},visible:function(){return 0<r.filter(":visible").length},focused:function(){return 0<g.filter(":focus").length}},get:{settings:function(){F.isPlainObject(x)&&x.searchFullText&&(u.fullTextSearch=x.searchFullText,y.error(u.error.oldSearchSyntax,c)),u.ignoreDiacritics&&!String.prototype.normalize&&(u.ignoreDiacritics=!1,y.error(m.noNormalize,c))},inputEvent:function(){var e=g[0];return e!==M&&e.oninput!==M?"input":e!==M&&e.onpropertychange!==M?"propertychange":"keyup"},value:function(){return g.val()},results:function(){return p.data(l.results)},result:function(n,e){var i=!1;return n=n!==M?n:y.get.value(),e=e!==M?e:y.get.results(),"category"===u.type?(y.debug("Finding result that matches",n),F.each(e,function(e,t){if(Array.isArray(t.results)&&(i=y.search.object(n,t.results)[0]))return!1})):(y.debug("Finding result in results object",n),i=y.search.object(n,e)[0]),i||!1}},select:{firstResult:function(){y.verbose("Selecting first result"),s.first().addClass(d.active)}},set:{focus:function(){p.addClass(d.focus)},loading:function(){p.addClass(d.loading)},value:function(e){y.verbose("Setting search input value",e),g.val(e)},type:function(e){e=e||u.type,"category"==u.type&&p.addClass(u.type)},buttonPressed:function(){n.addClass(d.pressed)}},remove:{loading:function(){p.removeClass(d.loading)},focus:function(){p.removeClass(d.focus)},buttonPressed:function(){n.removeClass(d.pressed)},diacritics:function(e){return u.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}},query:function(e){e=F.isFunction(e)?e:function(){};var t=y.get.value(),n=y.read.cache(t);e=e||function(){},y.has.minimumCharacters()?(n?(y.debug("Reading result from cache",t),y.save.results(n.results),y.addResults(n.html),y.inject.id(n.results),e()):(y.debug("Querying for",t),F.isPlainObject(u.source)||Array.isArray(u.source)?(y.search.local(t),e()):y.can.useAPI()?y.search.remote(t,e):(y.error(m.source),e())),u.onSearchQuery.call(c,t)):y.hideResults()},search:{local:function(e){var t,n=y.search.object(e,u.source);y.set.loading(),y.save.results(n),y.debug("Returned full local search results",n),0<u.maxResults&&(y.debug("Using specified max results",n),n=n.slice(0,u.maxResults)),"category"==u.type&&(n=y.create.categoryResults(n)),t=y.generateResults({results:n}),y.remove.loading(),y.addResults(t),y.inject.id(n),y.write.cache(e,{html:t,results:n})},remote:function(e,t){t=F.isFunction(t)?t:function(){},p.api("is loading")&&p.api("abort"),y.setup.api(e,t),p.api("query")},object:function(o,t,e){o=y.remove.diacritics(String(o));function a(e,t){var n=-1==F.inArray(t,r),i=-1==F.inArray(t,l),o=-1==F.inArray(t,s);n&&i&&o&&e.push(t)}var r=[],s=[],l=[],n=o.replace(i.escape,"\\$&"),c=new RegExp(i.beginsWith+n,"i");return t=t||u.source,e=e!==M?e:u.searchFields,Array.isArray(e)||(e=[e]),t===M||!1===t?(y.error(m.source),[]):(F.each(e,function(e,i){F.each(t,function(e,t){var n;"string"!=typeof t[i]&&"number"!=typeof t[i]||(-1!==(n="string"==typeof t[i]?y.remove.diacritics(t[i]):t[i].toString()).search(c)?a(r,t):"exact"===u.fullTextSearch&&y.exactSearch(o,n)?a(s,t):1==u.fullTextSearch&&y.fuzzySearch(o,n)&&a(l,t))})}),F.merge(s,l),F.merge(r,s),r)}},exactSearch:function(e,t){return e=e.toLowerCase(),-1<(t=t.toLowerCase()).indexOf(e)},fuzzySearch:function(e,t){var n=t.length,i=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),n<i)return!1;if(i===n)return e===t;e:for(var o=0,a=0;o<i;o++){for(var r=e.charCodeAt(o);a<n;)if(t.charCodeAt(a++)===r)continue e;return!1}return!0},parse:{response:function(e,t){Array.isArray(e)&&((n={})[a.results]=e,e=n);var n=y.generateResults(e);y.verbose("Parsing server response",e),e!==M&&t!==M&&e[a.results]!==M&&(y.addResults(n),y.inject.id(e[a.results]),y.write.cache(t,{html:n,results:e[a.results]}),y.save.results(e[a.results]))}},cancel:{query:function(){y.can.useAPI()&&p.api("abort")}},has:{minimumCharacters:function(){return y.get.value().length>=u.minCharacters},results:function(){return 0!==r.length&&""!=r.html()}},clear:{cache:function(e){var t=p.data(l.cache);e?t&&t[e]&&(y.debug("Removing value from cache",e),delete t[e],p.data(l.cache,t)):(y.debug("Clearing cache",e),p.removeData(l.cache))}},read:{cache:function(e){var t=p.data(l.cache);return!!u.cache&&(y.verbose("Checking cache for generated html for query",e),"object"==typeof t&&t[e]!==M&&t[e])}},create:{categoryResults:function(e){var n={};return F.each(e,function(e,t){t.category&&(n[t.category]===M?(y.verbose("Creating new category of results",t.category),n[t.category]={name:t.category,results:[t]}):n[t.category].results.push(t))}),n},id:function(e,t){var n,e=e+1;return t!==M?(t=String.fromCharCode(97+t),y.verbose("Creating category result id",n=t+e)):y.verbose("Creating result id",n=e),n},results:function(){0===r.length&&(r=F("<div />").addClass(d.results).appendTo(p))}},inject:{result:function(e,t,n){y.verbose("Injecting result into results");n=(n!==M?r.children().eq(n).children(f.results).first():r).children(f.result).eq(t);y.verbose("Injecting results metadata",n),n.data(l.result,e)},id:function(e){y.debug("Injecting unique ids into results");var n=0,i=0;return"category"===u.type?F.each(e,function(e,t){0<t.results.length&&(i=0,F.each(t.results,function(e,t){t.id===M&&(t.id=y.create.id(i,n)),y.inject.result(t,i,n),i++}),n++)}):F.each(e,function(e,t){t.id===M&&(t.id=y.create.id(i)),y.inject.result(t,i),i++}),e}},save:{results:function(e){y.verbose("Saving current search results to metadata",e),p.data(l.results,e)}},write:{cache:function(e,t){var n=p.data(l.cache)!==M?p.data(l.cache):{};u.cache&&(y.verbose("Writing generated html to cache",e,t),n[e]=t,p.data(l.cache,n))}},addResults:function(e){if(F.isFunction(u.onResultsAdd)&&!1===u.onResultsAdd.call(r,e))return y.debug("onResultsAdd callback cancelled default action"),!1;e?(r.html(e),y.refreshResults(),u.selectFirstResult&&y.select.firstResult(),y.showResults()):y.hideResults(function(){r.empty()})},showResults:function(e){e=F.isFunction(e)?e:function(){},b||!y.is.visible()&&y.has.results()&&(y.can.transition()?(y.debug("Showing results with css animations"),r.transition({animation:u.transition+" in",debug:u.debug,verbose:u.verbose,duration:u.duration,onShow:function(){var e=p.find(f.result).eq(0);y.ensureVisible(e)},onComplete:function(){e()},queue:!0})):(y.debug("Showing results with javascript"),r.stop().fadeIn(u.duration,u.easing)),u.onResultsOpen.call(r))},hideResults:function(e){e=F.isFunction(e)?e:function(){},y.is.visible()&&(y.can.transition()?(y.debug("Hiding results with css animations"),r.transition({animation:u.transition+" out",debug:u.debug,verbose:u.verbose,duration:u.duration,onComplete:function(){e()},queue:!0})):(y.debug("Hiding results with javascript"),r.stop().fadeOut(u.duration,u.easing)),u.onResultsClose.call(r))},generateResults:function(e){y.debug("Generating html from response",e);var t=u.templates[u.type],n=F.isPlainObject(e[a.results])&&!F.isEmptyObject(e[a.results]),i=Array.isArray(e[a.results])&&0<e[a.results].length,o="";return n||i?(0<u.maxResults&&(n?"standard"==u.type&&y.error(m.maxResults):e[a.results]=e[a.results].slice(0,u.maxResults)),F.isFunction(t)?o=t(e,a,u.preserveHTML):y.error(m.noTemplate,!1)):u.showNoResults&&(o=y.displayMessage(m.noResults,"empty",m.noResultsHeader)),u.onResults.call(c,e),o},displayMessage:function(e,t,n){return y.debug("Displaying message",e,t=t||"standard",n),y.addResults(u.templates.message(e,t,n)),u.templates.message(e,t,n)},setting:function(e,t){if(F.isPlainObject(e))F.extend(!0,u,e);else{if(t===M)return u[e];u[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,y,e);else{if(t===M)return y[e];y[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,u.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),y.verbose.apply(console,arguments)))},error:function(){u.silent||(y.error=Function.prototype.bind.call(console.error,console,u.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=(new Date).getTime())-(T||t),T=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:c,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var e=u.name+":",n=0;T=!1,clearTimeout(y.performance.timer),F.each(S,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",k&&(e+=" '"+k+"'"),1<w.length&&(e+=" ("+w.length+")"),(console.group!==M||console.table!==M)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):F.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(i,e,t){var o,a,n,r=h;return e=e||E,t=c||t,"string"==typeof i&&r!==M&&(i=i.split(/[\. ]/),o=i.length-1,F.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(F.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==M)return a=r[n],!1;{if(!F.isPlainObject(r[t])||e==o)return r[t]!==M&&(a=r[t]),!1;r=r[t]}}})),F.isFunction(a)?n=a.apply(t,e):a!==M&&(n=a),Array.isArray(C)?C.push(n):C!==M?C=[C,n]:n!==M&&(C=n),a}};A?(h===M&&y.initialize(),y.invoke(D)):(h!==M&&h.invoke("destroy"),y.initialize())}),C!==M?C:this},F.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["id","title","description"],displayField:"",fullTextSearch:"exact",ignoreDiacritics:!1,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,preserveHTML:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(e){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResultsHeader:"No Results",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined.",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e},message:function(e,t,n){var i="";return e!==M&&t!==M&&(i+='<div class="message '+t+'">',n&&(i+='<div class="header">'+n+"</div>"),i=i+' <div class="description">'+e+"</div></div>"),i},category:function(e,n,i){var o="",a=F.fn.search.settings.templates.escape;return e[n.categoryResults]!==M&&(F.each(e[n.categoryResults],function(e,t){t[n.results]!==M&&0<t.results.length&&(o+='<div class="category">',t[n.categoryName]!==M&&(o+='<div class="name">'+a(t[n.categoryName],i)+"</div>"),o+='<div class="results">',F.each(t.results,function(e,t){t[n.url]?o+='<a class="result" href="'+t[n.url].replace(/"/g,"")+'">':o+='<a class="result">',t[n.image]!==M&&(o+='<div class="image"> <img src="'+t[n.image].replace(/"/g,"")+'"></div>'),o+='<div class="content">',t[n.price]!==M&&(o+='<div class="price">'+a(t[n.price],i)+"</div>"),t[n.title]!==M&&(o+='<div class="title">'+a(t[n.title],i)+"</div>"),t[n.description]!==M&&(o+='<div class="description">'+a(t[n.description],i)+"</div>"),o+="</div></a>"}),o+="</div></div>")}),e[n.action]&&(!1===n.actionURL?o+='<div class="action">'+a(e[n.action][n.actionText],i)+"</div>":o+='<a href="'+e[n.action][n.actionURL].replace(/"/g,"")+'" class="action">'+a(e[n.action][n.actionText],i)+"</a>"),o)},standard:function(e,n,i){var o="",a=F.fn.search.settings.templates.escape;return e[n.results]!==M&&(F.each(e[n.results],function(e,t){t[n.url]?o+='<a class="result" href="'+t[n.url].replace(/"/g,"")+'">':o+='<a class="result">',t[n.image]!==M&&(o+='<div class="image"> <img src="'+t[n.image].replace(/"/g,"")+'"></div>'),o+='<div class="content">',t[n.price]!==M&&(o+='<div class="price">'+a(t[n.price],i)+"</div>"),t[n.title]!==M&&(o+='<div class="title">'+a(t[n.title],i)+"</div>"),t[n.description]!==M&&(o+='<div class="description">'+a(t[n.description],i)+"</div>"),o+="</div></a>"}),e[n.action]&&(!1===n.actionURL?o+='<div class="action">'+a(e[n.action][n.actionText],i)+"</div>":o+='<a href="'+e[n.action][n.actionURL].replace(/"/g,"")+'" class="action">'+a(e[n.action][n.actionText],i)+"</a>"),o)}}}}(jQuery,window,document),function(D,e,A,E){"use strict";D.isFunction=D.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),D.fn.shape=function(v){var b,y=D(this),x=(new Date).getTime(),C=[],w=v,k="string"==typeof w,T=[].slice.call(arguments,1),S=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,0)};return y.each(function(){var n,i,t=y.selector||"",a=D.isPlainObject(v)?D.extend(!0,{},D.fn.shape.settings,v):D.extend({},D.fn.shape.settings),e=a.namespace,r=a.selector,o=a.error,s=a.className,l="."+e,c="module-"+e,u=D(this),d=u.find(">"+r.sides),f=d.find(">"+r.side),m=!1,p=this,g=u.data(c),h={initialize:function(){h.verbose("Initializing module for",p),h.set.defaultSide(),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),g=h,u.data(c,g)},destroy:function(){h.verbose("Destroying previous module for",p),u.removeData(c).off(l)},refresh:function(){h.verbose("Refreshing selector cache for",p),u=D(p),d=D(this).find(r.sides),f=D(this).find(r.side)},repaint:function(){h.verbose("Forcing repaint event");(d[0]||A.createElement("div")).offsetWidth},animate:function(e,t){h.verbose("Animating box with properties",e),t=t||function(e){h.verbose("Executing animation callback"),e!==E&&e.stopPropagation(),h.reset(),h.set.active()},a.onBeforeChange.call(i[0]),h.get.transitionEvent()?(h.verbose("Starting CSS animation"),u.addClass(s.animating),d.css(e).one(h.get.transitionEvent(),t),h.set.duration(a.duration),S(function(){u.addClass(s.animating),n.addClass(s.hidden)})):t()},queue:function(e){h.debug("Queueing animation of",e),d.one(h.get.transitionEvent(),function(){h.debug("Executing queued animation"),setTimeout(function(){u.shape(e)},0)})},reset:function(){h.verbose("Animating states reset"),u.removeClass(s.animating).attr("style","").removeAttr("style"),d.attr("style","").removeAttr("style"),f.attr("style","").removeAttr("style").removeClass(s.hidden),i.removeClass(s.animating).attr("style","").removeAttr("style")},is:{complete:function(){return f.filter("."+s.active)[0]==i[0]},animating:function(){return u.hasClass(s.animating)},hidden:function(){return 0<u.closest(":hidden").length}},set:{defaultSide:function(){n=f.filter("."+a.className.active),i=0<n.next(r.side).length?n.next(r.side):f.first(),m=!1,h.verbose("Active side set to",n),h.verbose("Next side set to",i)},duration:function(e){e=e||a.duration,h.verbose("Setting animation duration",e="number"==typeof e?e+"ms":e),!a.duration&&0!==a.duration||d.add(f).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},currentStageSize:function(){var e=f.filter("."+a.className.active),t=e.outerWidth(!0),e=e.outerHeight(!0);u.css({width:t,height:e})},stageSize:function(){var e=u.clone().addClass(s.loading),t=e.find(">"+r.sides+">"+r.side),n=t.filter("."+a.className.active),t=m?t.eq(m):0<n.next(r.side).length?n.next(r.side):t.first(),i="next"===a.width?t.outerWidth(!0):"initial"===a.width?u.width():a.width,o="next"===a.height?t.outerHeight(!0):"initial"===a.height?u.height():a.height;n.removeClass(s.active),t.addClass(s.active),e.insertAfter(u),e.remove(),"auto"!==a.width&&(u.css("width",i+a.jitter),h.verbose("Specifying width during animation",i)),"auto"!==a.height&&(u.css("height",o+a.jitter),h.verbose("Specifying height during animation",o))},nextSide:function(e){m=e,i=f.filter(e),m=f.index(i),0===i.length&&(h.set.defaultSide(),h.error(o.side)),h.verbose("Next side manually set to",i)},active:function(){h.verbose("Setting new side to active",i),f.removeClass(s.active),i.addClass(s.active),a.onChange.call(i[0]),h.set.defaultSide()}},flip:{to:function(e,t){var n;h.is.hidden()?h.debug("Module not visible",i):!h.is.complete()||h.is.animating()||a.allowRepeats?(n=h.get.transform[e](),h.is.animating()?h.queue("flip "+e):(h.debug("Flipping "+e,i),h.set.stageSize(),h.stage[t](),h.animate(n))):h.debug("Side already visible",i)},up:function(){h.flip.to("up","above")},down:function(){h.flip.to("down","below")},left:function(){h.flip.to("left","left")},right:function(){h.flip.to("right","right")},over:function(){h.flip.to("over","behind")},back:function(){h.flip.to("back","behind")}},get:{transform:{up:function(){var e=n.outerHeight(!0)/2;return{transform:"translateY("+(i.outerHeight(!0)-e)+"px) translateZ(-"+e+"px) rotateX(-90deg)"}},down:function(){var e=n.outerHeight(!0)/2;return{transform:"translateY(-"+e+"px) translateZ(-"+e+"px) rotateX(90deg)"}},left:function(){var e=n.outerWidth(!0)/2;return{transform:"translateX("+(i.outerWidth(!0)-e)+"px) translateZ(-"+e+"px) rotateY(90deg)"}},right:function(){var e=n.outerWidth(!0)/2;return{transform:"translateX(-"+e+"px) translateZ(-"+e+"px) rotateY(-90deg)"}},over:function(){return{transform:"translateX("+-(n.outerWidth(!0)-i.outerWidth(!0))/2+"px) rotateY(180deg)"}},back:function(){return{transform:"translateX("+-(n.outerWidth(!0)-i.outerWidth(!0))/2+"px) rotateY(-180deg)"}}},transitionEvent:function(){var e,t=A.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(t.style[e]!==E)return n[e]},nextSide:function(){return 0<n.next(r.side).length?n.next(r.side):f.first()}},stage:{above:function(){var e={origin:(n.outerHeight(!0)-i.outerHeight(!0))/2,depth:{active:i.outerHeight(!0)/2,next:n.outerHeight(!0)/2}};h.verbose("Setting the initial animation position as above",i,e),n.css({transform:"rotateX(0deg)"}),i.addClass(s.animating).css({top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px) translateY(-"+e.depth.active+"px)"})},below:function(){var e={origin:(n.outerHeight(!0)-i.outerHeight(!0))/2,depth:{active:i.outerHeight(!0)/2,next:n.outerHeight(!0)/2}};h.verbose("Setting the initial animation position as below",i,e),n.css({transform:"rotateX(0deg)"}),i.addClass(s.animating).css({top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px) translateY("+e.depth.active+"px)"})},left:function(){var e=n.outerWidth(!0),t=i.outerWidth(!0),t={origin:(e-t)/2,depth:{active:t/2,next:e/2}};h.verbose("Setting the initial animation position as left",i,t),n.css({transform:"rotateY(0deg)"}),i.addClass(s.animating).css({left:t.origin+"px",transform:"rotateY(-90deg) translateZ("+t.depth.next+"px) translateX(-"+t.depth.active+"px)"})},right:function(){var e=n.outerWidth(!0),t=i.outerWidth(!0),t={origin:(e-t)/2,depth:{active:t/2,next:e/2}};h.verbose("Setting the initial animation position as right",i,t),n.css({transform:"rotateY(0deg)"}),i.addClass(s.animating).css({left:t.origin+"px",transform:"rotateY(90deg) translateZ("+t.depth.next+"px) translateX("+t.depth.active+"px)"})},behind:function(){var e=n.outerWidth(!0),t=i.outerWidth(!0),t={origin:(e-t)/2,depth:{active:t/2,next:e/2}};h.verbose("Setting the initial animation position as behind",i,t),n.css({transform:"rotateY(0deg)"}),i.addClass(s.animating).css({left:t.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(e,t){if(h.debug("Changing setting",e,t),D.isPlainObject(e))D.extend(!0,a,e);else{if(t===E)return a[e];D.isPlainObject(a[e])?D.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(D.isPlainObject(e))D.extend(!0,h,e);else{if(t===E)return h[e];h[e]=t}},debug:function(){!a.silent&&a.debug&&(a.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,a.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),h.verbose.apply(console,arguments)))},error:function(){a.silent||(h.error=Function.prototype.bind.call(console.error,console,a.name+":"),h.error.apply(console,arguments))},performance:{log:function(e){var t,n;a.performance&&(n=(t=(new Date).getTime())-(x||t),x=t,C.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,500)},display:function(){var e=a.name+":",n=0;x=!1,clearTimeout(h.performance.timer),D.each(C,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",t&&(e+=" '"+t+"'"),1<y.length&&(e+=" ("+y.length+")"),(console.group!==E||console.table!==E)&&0<C.length&&(console.groupCollapsed(e),console.table?console.table(C):D.each(C,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),C=[]}},invoke:function(i,e,t){var o,a,n,r=g;return e=e||T,t=p||t,"string"==typeof i&&r!==E&&(i=i.split(/[\. ]/),o=i.length-1,D.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(D.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==E)return a=r[n],!1;{if(!D.isPlainObject(r[t])||e==o)return r[t]!==E&&(a=r[t]),!1;r=r[t]}}})),D.isFunction(a)?n=a.apply(t,e):a!==E&&(n=a),Array.isArray(b)?b.push(n):b!==E?b=[b,n]:n!==E&&(b=n),a}};k?(g===E&&h.initialize(),0<(e=u.find("input")).length?(e.blur(),setTimeout(function(){h.invoke(w)},150)):h.invoke(w)):(g!==E&&g.invoke("destroy"),h.initialize())}),b!==E?b:this},D.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",onBeforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(R,I,j,V){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},I=void 0!==I&&I.Math==Math?I:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),R.fn.sidebar=function(x){var C,e=R(this),w=R(I),k=R(j),T=R("html"),S=R("head"),D=e.selector||"",A=(new Date).getTime(),E=[],F=x,O="string"==typeof F,P=[].slice.call(arguments,1),M=I.requestAnimationFrame||I.mozRequestAnimationFrame||I.webkitRequestAnimationFrame||I.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var o,a,e,t,r,s=R.isPlainObject(x)?R.extend(!0,{},R.fn.sidebar.settings,x):R.extend({},R.fn.sidebar.settings),n=s.selector,l=s.className,i=s.namespace,c=s.regExp,u=s.error,d="."+i,f="module-"+i,m=R(this),p=[I,j].indexOf(s.context)<0?R(j).find(s.context):R(s.context),g=m.children(n.sidebar),h=(p.children(n.fixed),p.children(n.pusher)),v=this,b=m.data(f),y={initialize:function(){y.debug("Initializing sidebar",x),y.create.id(),r=y.get.transitionEvent(),s.delaySetup?M(y.setup.layout):y.setup.layout(),M(function(){y.setup.cache()}),y.instantiate()},instantiate:function(){y.verbose("Storing instance of module",y),b=y,m.data(f,y)},create:{id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),a="."+e,y.verbose("Creating unique id for element",e)}},destroy:function(){y.verbose("Destroying previous module for",m),m.off(d).removeData(f),y.is.ios()&&y.remove.ios(),p.off(a),w.off(a),k.off(a)},event:{clickaway:function(e){var t;s.closable&&(t=0<h.find(e.target).length||h.is(e.target),e=p.is(e.target),t&&(y.verbose("User clicked on dimmed page"),y.hide()),e&&(y.verbose("User clicked on dimmable context (scaled out page)"),y.hide()))},touch:function(e){},containScroll:function(e){v.scrollTop<=0&&(v.scrollTop=1),v.scrollTop+v.offsetHeight>=v.scrollHeight&&(v.scrollTop=v.scrollHeight-v.offsetHeight-1)},scroll:function(e){0===R(e.target).closest(n.sidebar).length&&e.preventDefault()}},bind:{clickaway:function(){y.verbose("Adding clickaway events to context",p),p.on("click"+a,y.event.clickaway).on("touchend"+a,y.event.clickaway)},scrollLock:function(){s.scrollLock&&(y.debug("Disabling page scroll"),w.on("DOMMouseScroll"+a,y.event.scroll)),y.verbose("Adding events to contain sidebar scroll"),k.on("touchmove"+a,y.event.touch),m.on("scroll"+d,y.event.containScroll)}},unbind:{clickaway:function(){y.verbose("Removing clickaway events from context",p),p.off(a)},scrollLock:function(){y.verbose("Removing scroll lock from page"),k.off(a),w.off(a),m.off("scroll"+d)}},add:{inlineCSS:function(){var e=y.cache.width||m.outerWidth(),t=y.cache.height||m.outerHeight(),n=y.is.rtl(),i=y.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(y.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="<style>","left"===i||"right"===i?(y.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+i+".sidebar ~ .fixed, .ui.visible."+i+".sidebar ~ .pusher { -webkit-transform: translate3d("+t[i]+"px, 0, 0); transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!=i||(n+=" .ui.visible."+i+".sidebar ~ .fixed, .ui.visible."+i+".sidebar ~ .pusher { -webkit-transform: translate3d(0, "+t[i]+"px, 0); transform: translate3d(0, "+t[i]+"px, 0); }"),y.is.ie()&&("left"===i||"right"===i?(y.debug("Adding CSS rules for animation distance",e),n+=" body.pushable > .ui.visible."+i+".sidebar ~ .pusher::after { -webkit-transform: translate3d("+t[i]+"px, 0, 0); transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!=i||(n+=" body.pushable > .ui.visible."+i+".sidebar ~ .pusher::after { -webkit-transform: translate3d(0, "+t[i]+"px, 0); transform: translate3d(0, "+t[i]+"px, 0); }"),n+=" body.pushable > .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher::after, body.pushable > .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher::after { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }"),o=R(n+="</style>").appendTo(S),y.debug("Adding sizing css to head",o)}},refresh:function(){y.verbose("Refreshing selector cache"),p=[I,j].indexOf(s.context)<0?R(j).find(s.context):R(s.context),g=p.children(n.sidebar),h=p.children(n.pusher),p.children(n.fixed),y.clear.cache()},refreshSidebars:function(){y.verbose("Refreshing other sidebars"),g=p.children(n.sidebar)},repaint:function(){y.verbose("Forcing repaint event"),v.style.display="none";v.offsetHeight;v.scrollTop=v.scrollTop,v.style.display=""},setup:{cache:function(){y.cache={width:m.outerWidth(),height:m.outerHeight()}},layout:function(){0===p.children(n.pusher).length&&(y.debug("Adding wrapper element for sidebar"),y.error(u.pusher),h=R('<div class="pusher" />'),p.children().not(n.omitted).not(g).wrapAll(h),y.refresh()),0!==m.nextAll(n.pusher).length&&m.nextAll(n.pusher)[0]===h[0]||(y.debug("Moved sidebar to correct parent element"),y.error(u.movedSidebar,v),m.detach().prependTo(p),y.refresh()),y.clear.cache(),y.set.pushable(),y.set.direction()}},attachEvents:function(e,t){var n=R(e);t=R.isFunction(y[t])?y[t]:y.toggle,0<n.length?(y.debug("Attaching sidebar events to element",e,t),n.on("click"+d,t)):y.error(u.notFound,e)},show:function(e){if(e=R.isFunction(e)?e:function(){},y.is.hidden())if(!1===s.onShow.call(v))y.verbose("Show callback returned false cancelling show");else{if(y.refreshSidebars(),s.overlay&&(y.error(u.overlay),s.transition="overlay"),y.refresh(),y.othersActive())if(y.debug("Other sidebars currently visible"),s.exclusive){if("overlay"!=s.transition)return void y.hideOthers(y.show);y.hideOthers()}else s.transition="overlay";y.pushPage(function(){e.call(v),s.onVisible.call(v)}),s.onChange.call(v)}else y.debug("Sidebar is already visible")},hide:function(e){e=R.isFunction(e)?e:function(){},(y.is.visible()||y.is.animating())&&!1!==s.onHide.call(v)&&(y.debug("Hiding sidebar",e),y.refreshSidebars(),y.pullPage(function(){e.call(v),s.onHidden.call(v)}),s.onChange.call(v))},othersAnimating:function(){return 0<g.not(m).filter("."+l.animating).length},othersVisible:function(){return 0<g.not(m).filter("."+l.visible).length},othersActive:function(){return y.othersVisible()||y.othersAnimating()},hideOthers:function(e){var t=g.not(m).filter("."+l.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){++i==n&&e()})},toggle:function(){y.verbose("Determining toggled direction"),y.is.hidden()?y.show():y.hide()},pushPage:function(t){var e,n,i=y.get.transition(),o="overlay"===i||y.othersActive()?m:h;t=R.isFunction(t)?t:function(){},"scale down"==s.transition&&y.scrollToTop(),y.set.transition(i),y.repaint(),i=function(){y.bind.clickaway(),y.add.inlineCSS(),y.set.animating(),y.set.visible()},e=function(){y.set.dimmed()},n=function(e){e.target==o[0]&&(o.off(r+a,n),y.remove.animating(),y.bind.scrollLock(),t.call(v))},o.off(r+a),o.on(r+a,n),M(i),s.dimPage&&!y.othersVisible()&&M(e)},pullPage:function(t){var e,n,i=y.get.transition(),o="overlay"==i||y.othersActive()?m:h;t=R.isFunction(t)?t:function(){},y.verbose("Removing context push state",y.get.direction()),y.unbind.clickaway(),y.unbind.scrollLock(),e=function(){y.set.transition(i),y.set.animating(),y.remove.visible(),s.dimPage&&!y.othersVisible()&&h.removeClass(l.dimmed)},n=function(e){e.target==o[0]&&(o.off(r+a,n),y.remove.animating(),y.remove.transition(),y.remove.inlineCSS(),("scale down"==i||s.returnScroll&&y.is.mobile())&&y.scrollBack(),t.call(v))},o.off(r+a),o.on(r+a,n),M(e)},scrollToTop:function(){y.verbose("Scrolling to top of page to avoid animation issues"),t=R(I).scrollTop(),m.scrollTop(0),I.scrollTo(0,0)},scrollBack:function(){y.verbose("Scrolling back to original page position"),I.scrollTo(0,t)},clear:{cache:function(){y.verbose("Clearing cached dimensions"),y.cache={}}},set:{ios:function(){T.addClass(l.ios)},pushed:function(){p.addClass(l.pushed)},pushable:function(){p.addClass(l.pushable)},dimmed:function(){h.addClass(l.dimmed)},active:function(){m.addClass(l.active)},animating:function(){m.addClass(l.animating)},transition:function(e){e=e||y.get.transition(),m.addClass(e)},direction:function(e){e=e||y.get.direction(),m.addClass(l[e])},visible:function(){m.addClass(l.visible)},overlay:function(){m.addClass(l.overlay)}},remove:{inlineCSS:function(){y.debug("Removing inline css styles",o),o&&0<o.length&&o.remove()},ios:function(){T.removeClass(l.ios)},pushed:function(){p.removeClass(l.pushed)},pushable:function(){p.removeClass(l.pushable)},active:function(){m.removeClass(l.active)},animating:function(){m.removeClass(l.animating)},transition:function(e){e=e||y.get.transition(),m.removeClass(e)},direction:function(e){e=e||y.get.direction(),m.removeClass(l[e])},visible:function(){m.removeClass(l.visible)},overlay:function(){m.removeClass(l.overlay)}},get:{direction:function(){return m.hasClass(l.top)?l.top:m.hasClass(l.right)?l.right:m.hasClass(l.bottom)?l.bottom:l.left},transition:function(){var e=y.get.direction(),e=y.is.mobile()?"auto"==s.mobileTransition?s.defaultTransition.mobile[e]:s.mobileTransition:"auto"==s.transition?s.defaultTransition.computer[e]:s.transition;return y.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=j.createElement("element"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(t.style[e]!==V)return n[e]}},is:{ie:function(){var e=!I.ActiveXObject&&"ActiveXObject"in I,t="ActiveXObject"in I;return e||t},ios:function(){var e=navigator.userAgent,t=e.match(c.ios),n=e.match(c.mobileChrome);return!(!t||n)&&(y.verbose("Browser was found to be iOS",e),!0)},mobile:function(){var e=navigator.userAgent;return e.match(c.mobile)?(y.verbose("Browser was found to be mobile",e),!0):(y.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!y.is.visible()},visible:function(){return m.hasClass(l.visible)},open:function(){return y.is.visible()},closed:function(){return y.is.hidden()},vertical:function(){return m.hasClass(l.top)},animating:function(){return p.hasClass(l.animating)},rtl:function(){return y.cache.rtl===V&&(y.cache.rtl="rtl"===m.attr("dir")||"rtl"===m.css("direction")),y.cache.rtl}},setting:function(e,t){if(y.debug("Changing setting",e,t),R.isPlainObject(e))R.extend(!0,s,e);else{if(t===V)return s[e];R.isPlainObject(s[e])?R.extend(!0,s[e],t):s[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,y,e);else{if(t===V)return y[e];y[e]=t}},debug:function(){!s.silent&&s.debug&&(s.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,s.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!s.silent&&s.verbose&&s.debug&&(s.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,s.name+":"),y.verbose.apply(console,arguments)))},error:function(){s.silent||(y.error=Function.prototype.bind.call(console.error,console,s.name+":"),y.error.apply(console,arguments))},performance:{log:function(e){var t,n;s.performance&&(n=(t=(new Date).getTime())-(A||t),A=t,E.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":n})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var e=s.name+":",n=0;A=!1,clearTimeout(y.performance.timer),R.each(E,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",D&&(e+=" '"+D+"'"),(console.group!==V||console.table!==V)&&0<E.length&&(console.groupCollapsed(e),console.table?console.table(E):R.each(E,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),E=[]}},invoke:function(i,e,t){var o,a,n,r=b;return e=e||P,t=v||t,"string"==typeof i&&r!==V&&(i=i.split(/[\. ]/),o=i.length-1,R.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(R.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==V)return a=r[n],!1;{if(!R.isPlainObject(r[t])||e==o)return r[t]!==V?a=r[t]:y.error(u.method,i),!1;r=r[t]}}})),R.isFunction(a)?n=a.apply(t,e):a!==V&&(n=a),Array.isArray(C)?C.push(n):C!==V?C=[C,n]:n!==V&&(C=n),a}};O?(b===V&&y.initialize(),y.invoke(F)):(b!==V&&y.invoke("destroy"),y.initialize())}),C!==V?C:this},R.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(S,D,A,E){"use strict";S.isFunction=S.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},D=void 0!==D&&D.Math==Math?D:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),S.fn.sticky=function(v){var b,e=S(this),y=e.selector||"",x=(new Date).getTime(),C=[],w=v,k="string"==typeof w,T=[].slice.call(arguments,1);return e.each(function(){var t,i,e,n,l=S.isPlainObject(v)?S.extend(!0,{},S.fn.sticky.settings,v):S.extend({},S.fn.sticky.settings),o=l.className,a=l.namespace,r=l.error,s="."+a,c="module-"+a,u=S(this),d=S(D),f=[D,A].indexOf(l.scrollContext)<0?S(A).find(l.scrollContext):S(l.scrollContext),m=u.data(c),p=D.requestAnimationFrame||D.mozRequestAnimationFrame||D.webkitRequestAnimationFrame||D.msRequestAnimationFrame||function(e){setTimeout(e,0)},g=this,h={initialize:function(){h.determineContainer(),h.determineContext(),h.verbose("Initializing sticky",l,t),h.save.positions(),h.checkErrors(),h.bind.events(),l.observeChanges&&h.observeChanges(),h.instantiate()},instantiate:function(){h.verbose("Storing instance of module",h),m=h,u.data(c,h)},destroy:function(){h.verbose("Destroying previous instance"),h.reset(),e&&e.disconnect(),n&&n.disconnect(),d.off("load"+s,h.event.load).off("resize"+s,h.event.resize),f.off("scrollchange"+s,h.event.scrollchange),u.removeData(c)},observeChanges:function(){"MutationObserver"in D&&(e=new MutationObserver(h.event.documentChanged),n=new MutationObserver(h.event.changed),e.observe(A,{childList:!0,subtree:!0}),n.observe(g,{childList:!0,subtree:!0}),n.observe(i[0],{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",n))},determineContainer:function(){t=l.container?[D,A].indexOf(l.container)<0?S(A).find(l.container):S(l.container):u.offsetParent()},determineContext:function(){0===(i=l.context?[D,A].indexOf(l.context)<0?S(A).find(l.context):S(l.context):t).length&&h.error(r.invalidContext,l.context,u)},checkErrors:function(){h.is.hidden()&&h.error(r.visible,u),h.cache.element.height>h.cache.context.height&&(h.reset(),h.error(r.elementSize,u))},bind:{events:function(){d.on("load"+s,h.event.load).on("resize"+s,h.event.resize),f.off("scroll"+s).on("scroll"+s,h.event.scroll).on("scrollchange"+s,h.event.scrollchange)}},event:{changed:function(e){clearTimeout(h.timer),h.timer=setTimeout(function(){h.verbose("DOM tree modified, updating sticky menu",e),h.refresh()},100)},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==g||0<S(e).find(g).length)&&(h.debug("Element removed from DOM, tearing down events"),h.destroy())})})},load:function(){h.verbose("Page contents finished loading"),p(h.refresh)},resize:function(){h.verbose("Window resized"),p(h.refresh)},scroll:function(){p(function(){f.triggerHandler("scrollchange"+s,f.scrollTop())})},scrollchange:function(e,t){h.stick(t),l.onScroll.call(g)}},refresh:function(e){h.reset(),l.context||h.determineContext(),e&&h.determineContainer(),h.save.positions(),h.stick(),l.onReposition.call(g)},supports:{sticky:function(){var e=S("<div/>");return e.addClass(o.supported),e.css("position").match("sticky")}},save:{lastScroll:function(e){h.lastScroll=e},elementScroll:function(e){h.elementScroll=e},positions:function(){var e={height:f.height()},t={margin:{top:parseInt(u.css("margin-top"),10),bottom:parseInt(u.css("margin-bottom"),10)},offset:u.offset(),width:u.outerWidth(),height:u.outerHeight()},n={offset:i.offset(),height:i.outerHeight()};h.is.standardScroll()||(h.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=f.scrollTop(),e.left=f.scrollLeft(),t.offset.top+=e.top,n.offset.top+=e.top,t.offset.left+=e.left,n.offset.left+=e.left),h.cache={fits:t.height+l.offset<=e.height,sameHeight:t.height==n.height,scrollContext:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:n.offset.top,height:n.height,bottom:n.offset.top+n.height}},h.set.containerSize(),h.stick(),h.debug("Caching element positions",h.cache)}},get:{direction:function(e){var t="down";return e=e||f.scrollTop(),h.lastScroll!==E&&(h.lastScroll<e?t="down":h.lastScroll>e&&(t="up")),t},scrollChange:function(e){return e=e||f.scrollTop(),h.lastScroll?e-h.lastScroll:0},currentElementScroll:function(){return h.elementScroll||(h.is.top()?Math.abs(parseInt(u.css("top"),10))||0:Math.abs(parseInt(u.css("bottom"),10))||0)},elementScroll:function(e){e=e||f.scrollTop();var t=h.cache.element,n=h.cache.scrollContext,e=h.get.scrollChange(e),t=t.height-n.height+l.offset,n=h.get.currentElementScroll(),e=n+e;return n=h.cache.fits||e<0?0:t<e?t:e}},remove:{lastScroll:function(){delete h.lastScroll},elementScroll:function(e){delete h.elementScroll},minimumSize:function(){t.css("min-height","")},offset:function(){u.css("margin-top","")}},set:{offset:function(){h.verbose("Setting offset on element",l.offset),u.css("margin-top",l.offset)},containerSize:function(){var e=t.get(0).tagName;"HTML"===e||"body"==e?h.determineContainer():Math.abs(t.outerHeight()-h.cache.context.height)>l.jitter&&(h.debug("Context has padding, specifying exact height for container",h.cache.context.height),t.css({height:h.cache.context.height}))},minimumSize:function(){var e=h.cache.element;t.css("min-height",e.height)},scroll:function(e){h.debug("Setting scroll on element",e),h.elementScroll!=e&&(h.is.top()&&u.css("bottom","").css("top",-e),h.is.bottom()&&u.css("top","").css("bottom",e))},size:function(){0!==h.cache.element.height&&0!==h.cache.element.width&&(g.style.setProperty("width",h.cache.element.width+"px","important"),g.style.setProperty("height",h.cache.element.height+"px","important"))}},is:{standardScroll:function(){return f[0]==D},top:function(){return u.hasClass(o.top)},bottom:function(){return u.hasClass(o.bottom)},initialPosition:function(){return!h.is.fixed()&&!h.is.bound()},hidden:function(){return!u.is(":visible")},bound:function(){return u.hasClass(o.bound)},fixed:function(){return u.hasClass(o.fixed)}},stick:function(e){var t=e||f.scrollTop(),n=h.cache,i=n.fits,o=n.sameHeight,a=n.element,r=n.scrollContext,n=n.context,s=h.is.bottom()&&l.pushing?l.bottomOffset:l.offset,e={top:t+s,bottom:t+s+r.height},t=i?0:h.get.elementScroll(e.top),s=!i;0===a.height||o||(h.is.initialPosition()?e.top>=n.bottom?(h.debug("Initial element position is bottom of container"),h.bindBottom()):e.top>a.top&&(a.height+e.top-t>=n.bottom?(h.debug("Initial element position is bottom of container"),h.bindBottom()):(h.debug("Initial element position is fixed"),h.fixTop())):h.is.fixed()?h.is.top()?e.top<=a.top?(h.debug("Fixed element reached top of container"),h.setInitialPosition()):a.height+e.top-t>=n.bottom?(h.debug("Fixed element reached bottom of container"),h.bindBottom()):s&&(h.set.scroll(t),h.save.lastScroll(e.top),h.save.elementScroll(t)):h.is.bottom()&&(e.bottom-a.height<=a.top?(h.debug("Bottom fixed rail has reached top of container"),h.setInitialPosition()):e.bottom>=n.bottom?(h.debug("Bottom fixed rail has reached bottom of container"),h.bindBottom()):s&&(h.set.scroll(t),h.save.lastScroll(e.top),h.save.elementScroll(t))):h.is.bottom()&&(e.top<=a.top?(h.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),h.setInitialPosition()):l.pushing?h.is.bound()&&e.bottom<=n.bottom&&(h.debug("Fixing bottom attached element to bottom of browser."),h.fixBottom()):h.is.bound()&&e.top<=n.bottom-a.height&&(h.debug("Fixing bottom attached element to top of browser."),h.fixTop())))},bindTop:function(){h.debug("Binding element to top of parent container"),h.remove.offset(),u.css({left:"",top:"",marginBottom:""}).removeClass(o.fixed).removeClass(o.bottom).addClass(o.bound).addClass(o.top),l.onTop.call(g),l.onUnstick.call(g)},bindBottom:function(){h.debug("Binding element to bottom of parent container"),h.remove.offset(),u.css({left:"",top:""}).removeClass(o.fixed).removeClass(o.top).addClass(o.bound).addClass(o.bottom),l.onBottom.call(g),l.onUnstick.call(g)},setInitialPosition:function(){h.debug("Returning to initial position"),h.unfix(),h.unbind()},fixTop:function(){h.debug("Fixing element to top of page"),l.setSize&&h.set.size(),h.set.minimumSize(),h.set.offset(),u.css({left:h.cache.element.left,bottom:"",marginBottom:""}).removeClass(o.bound).removeClass(o.bottom).addClass(o.fixed).addClass(o.top),l.onStick.call(g)},fixBottom:function(){h.debug("Sticking element to bottom of page"),l.setSize&&h.set.size(),h.set.minimumSize(),h.set.offset(),u.css({left:h.cache.element.left,bottom:"",marginBottom:""}).removeClass(o.bound).removeClass(o.top).addClass(o.fixed).addClass(o.bottom),l.onStick.call(g)},unbind:function(){h.is.bound()&&(h.debug("Removing container bound position on element"),h.remove.offset(),u.removeClass(o.bound).removeClass(o.top).removeClass(o.bottom))},unfix:function(){h.is.fixed()&&(h.debug("Removing fixed position on element"),h.remove.minimumSize(),h.remove.offset(),u.removeClass(o.fixed).removeClass(o.top).removeClass(o.bottom),l.onUnstick.call(g))},reset:function(){h.debug("Resetting elements position"),h.unbind(),h.unfix(),h.resetCSS(),h.remove.offset(),h.remove.lastScroll()},resetCSS:function(){u.css({width:"",height:""}),t.css({height:""})},setting:function(e,t){if(S.isPlainObject(e))S.extend(!0,l,e);else{if(t===E)return l[e];l[e]=t}},internal:function(e,t){if(S.isPlainObject(e))S.extend(!0,h,e);else{if(t===E)return h[e];h[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?h.performance.log(arguments):(h.debug=Function.prototype.bind.call(console.info,console,l.name+":"),h.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?h.performance.log(arguments):(h.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),h.verbose.apply(console,arguments)))},error:function(){l.silent||(h.error=Function.prototype.bind.call(console.error,console,l.name+":"),h.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=(new Date).getTime())-(x||t),x=t,C.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:g,"Execution Time":n})),clearTimeout(h.performance.timer),h.performance.timer=setTimeout(h.performance.display,0)},display:function(){var e=l.name+":",n=0;x=!1,clearTimeout(h.performance.timer),S.each(C,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",y&&(e+=" '"+y+"'"),(console.group!==E||console.table!==E)&&0<C.length&&(console.groupCollapsed(e),console.table?console.table(C):S.each(C,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),C=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||T,t=g||t,"string"==typeof i&&r!==E&&(i=i.split(/[\. ]/),o=i.length-1,S.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(S.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==E)return a=r[n],!1;{if(!S.isPlainObject(r[t])||e==o)return r[t]!==E&&(a=r[t]),!1;r=r[t]}}})),S.isFunction(a)?n=a.apply(t,e):a!==E&&(n=a),Array.isArray(b)?b.push(n):b!==E?b=[b,n]:n!==E&&(b=n),a}};k?(m===E&&h.initialize(),h.invoke(w)):(m!==E&&m.invoke("destroy"),h.initialize())}),b!==E?b:this},S.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,container:!1,scrollContext:D,offset:0,bottomOffset:0,jitter:5,setSize:!0,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to suppress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(O,P,M,R){"use strict";O.isWindow=O.isWindow||function(e){return null!=e&&e===e.window},O.isFunction=O.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},P=void 0!==P&&P.Math==Math?P:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.tab=function(l){var c,u=O.isFunction(this)?O(P):O(this),d=u.selector||"",f=(new Date).getTime(),S=[],D=l,A="string"==typeof D,E=[].slice.call(arguments,1),F=!1;return u.each(function(){var m,o,p,g,h,v=O.isPlainObject(l)?O.extend(!0,{},O.fn.tab.settings,l):O.extend({},O.fn.tab.settings),b=v.className,y=v.metadata,t=v.selector,x=v.error,n=v.regExp,e="."+v.namespace,i="module-"+v.namespace,C=O(this),a={},w=!0,r=0,k=this,s=C.data(i),T={initialize:function(){T.debug("Initializing tab menu item",C),T.fix.callbacks(),T.determineTabs(),T.debug("Determining tabs",v.context,o),v.auto&&T.set.auto(),T.bind.events(),v.history&&!F&&(T.initializeHistory(),F=!0);var e,t=T.determine.activeTab();v.autoTabActivation&&s===R&&null==t&&(t=!0===v.autoTabActivation?T.get.initialPath():v.autoTabActivation,T.debug("No active tab detected, setting tab active",t),T.changeTab(t)),null!=t&&v.history&&(e=O.address.autoUpdate(),O.address.autoUpdate(!1),O.address.value(t),O.address.autoUpdate(e)),T.instantiate()},instantiate:function(){T.verbose("Storing instance of module",T),s=T,C.data(i,T)},destroy:function(){T.debug("Destroying tabs",C),C.removeData(i).off(e)},bind:{events:function(){O.isWindow(k)||(T.debug("Attaching tab activation events to element",C),C.on("click"+e,T.event.click))}},determineTabs:function(){var e;"parent"===v.context?(0<C.closest(t.ui).length?(e=C.closest(t.ui),T.verbose("Using closest UI element as parent",e)):e=C,m=e.parent(),T.verbose("Determined parent element for creating context",m)):v.context?(m=[P,M].indexOf(v.context)<0?O(M).find(v.context):O(v.context),T.verbose("Using selector for tab context",v.context,m)):m=O("body"),v.childrenOnly?(o=m.children(t.tabs),T.debug("Searching tab context children for tabs",m,o)):(o=m.find(t.tabs),T.debug("Searching tab context for tabs",m,o))},fix:{callbacks:function(){O.isPlainObject(l)&&(l.onTabLoad||l.onTabInit)&&(l.onTabLoad&&(l.onLoad=l.onTabLoad,delete l.onTabLoad,T.error(x.legacyLoad,l.onLoad)),l.onTabInit&&(l.onFirstLoad=l.onTabInit,delete l.onTabInit,T.error(x.legacyInit,l.onFirstLoad)),v=O.extend(!0,{},O.fn.tab.settings,l))}},initializeHistory:function(){if(T.debug("Initializing page state"),O.address===R)return T.error(x.state),!1;if("state"==v.historyType){if(T.debug("Using HTML5 to manage state"),!1===v.path)return T.error(x.path),!1;O.address.history(!0).state(v.path),O(P).trigger("popstate")}O.address.bind("change",T.event.history.change)},event:{click:function(e){var t=O(this).data(y.tab);t!==R?(v.history?(T.verbose("Updating page state",e),O.address.value(t)):(T.verbose("Changing tab",e),T.changeTab(t)),e.preventDefault()):T.debug("No tab specified")},history:{change:function(e){var t=e.pathNames.join("/")||T.get.initialPath(),n=v.templates.determineTitle(t)||!1;T.performance.display(),T.debug("History change event",t,e),h=e,t!==R&&T.changeTab(t),n&&O.address.title(n)}}},refresh:function(){p&&(T.debug("Refreshing tab",p),T.changeTab(p))},cache:{read:function(e){return e!==R&&a[e]},add:function(e,t){e=e||p,T.debug("Adding cached content for",e),a[e]=t},remove:function(e){e=e||p,T.debug("Removing cached content for",e),delete a[e]}},escape:{string:function(e){return(e=String(e)).replace(n.escape,"\\$&")}},set:{auto:function(){var e="string"==typeof v.path?v.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";T.verbose("Setting up automatic tab retrieval from server",e),O.isPlainObject(v.apiSettings)?v.apiSettings.url=e:v.apiSettings={url:e}},loading:function(e){var t=T.get.tabElement(e);t.hasClass(b.loading)||(T.verbose("Setting loading state for",t),t.addClass(b.loading).siblings(o).removeClass(b.active+" "+b.loading),0<t.length&&v.onRequest.call(t[0],e))},state:function(e){O.address.value(e)}},changeTab:function(c){var u=P.history&&P.history.pushState&&v.ignoreFirstLoad&&w,d=v.auto||O.isPlainObject(v.apiSettings),f=d&&!u?T.utilities.pathToArray(c):T.get.defaultPathArray(c);c=T.utilities.arrayToPath(f),O.each(f,function(e,t){var n,i,o=f.slice(0,e+1),a=T.utilities.arrayToPath(o),r=T.is.tab(a),s=e+1==f.length,l=T.get.tabElement(a);return T.verbose("Looking for tab",t),r?(T.verbose("Tab was found",t),p=a,g=T.utilities.filterArray(f,o),s?i=!0:(r=f.slice(0,e+2),t=T.utilities.arrayToPath(r),(i=!T.is.tab(t))&&T.verbose("Tab parameters found",r)),!1===v.onBeforeChange.call(k,a)?(T.debug("onBeforeChange returned false, cancelling tab change",l),!1):i&&d?(u?(T.debug("Ignoring remote content on first tab load",a),w=!1,T.cache.add(c,l.html()),T.activate.all(a),v.onFirstLoad.call(l[0],a,g,h),v.onLoad.call(l[0],a,g,h)):(T.activate.navigation(a),T.fetch.content(a,c)),!1):(T.debug("Opened local tab",a),T.activate.all(a),T.cache.read(a)||(T.cache.add(a,!0),T.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(l[0],a,g,h)),void v.onLoad.call(l[0],a,g,h))):-1!=c.search("/")||""===c?(T.error(x.missingTab,C,m,a),!1):(c=T.escape.string(c),a=(n=O("#"+c+', a[name="'+c+'"]')).closest("[data-tab]").data(y.tab),l=T.get.tabElement(a),n&&0<n.length&&a?(T.debug("Anchor link used, opening parent tab",l,n),!1===v.onBeforeChange.call(k,a)?T.debug("onBeforeChange returned false, cancelling tab change",l):(l.hasClass(b.active)||setTimeout(function(){T.scrollTo(n)},0),T.activate.all(a),T.cache.read(a)||(T.cache.add(a,!0),T.debug("First time tab loaded calling tab init"),v.onFirstLoad.call(l[0],a,g,h)),v.onLoad.call(l[0],a,g,h)),!1):void 0)})},scrollTo:function(e){var t=!!(e&&0<e.length)&&e.offset().top;!1!==t&&(T.debug("Forcing scroll to an in-page link in a hidden tab",t,e),O(M).scrollTop(t))},update:{content:function(e,t,n){var i=T.get.tabElement(e),o=i[0];n=n!==R?n:v.evaluateScripts,"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&"string"!=typeof t?i.empty().append(O(t).clone(!0)):n?(T.debug("Updating HTML and evaluating inline scripts",e,t),i.html(t)):(T.debug("Updating HTML",e,t),o.innerHTML=t)}},fetch:{content:function(t,n){var e,i=T.get.tabElement(t),o={dataType:"html",encodeParameters:!1,on:"now",cache:v.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(e){"response"==v.cacheType&&T.cache.add(n,e),T.update.content(t,e),t==p?(T.debug("Content loaded",t),T.activate.tab(t)):T.debug("Content loaded in background",t),v.onFirstLoad.call(i[0],t,g,h),v.onLoad.call(i[0],t,g,h),v.loadOnce?T.cache.add(n,!0):"string"==typeof v.cacheType&&"dom"==v.cacheType.toLowerCase()&&0<i.children().length?setTimeout(function(){var e=(e=i.children().clone(!0)).not("script");T.cache.add(n,e)},0):T.cache.add(n,i.html())},urlData:{tab:n}},a=i.api("get request")||!1,a=a&&"pending"===a.state();n=n||t,e=T.cache.read(n),v.cache&&e?(T.activate.tab(t),T.debug("Adding cached content",n),v.loadOnce||("once"==v.evaluateScripts?T.update.content(t,e,!1):T.update.content(t,e)),v.onLoad.call(i[0],t,g,h)):a?(T.set.loading(t),T.debug("Content is already loading",n)):O.api!==R?(e=O.extend(!0,{},v.apiSettings,o),T.debug("Retrieving remote content",n,e),T.set.loading(t),i.api(e)):T.error(x.api)}},activate:{all:function(e){T.activate.tab(e),T.activate.navigation(e)},tab:function(e){var t=T.get.tabElement(e),n="siblings"==v.deactivate?t.siblings(o):o.not(t),i=t.hasClass(b.active);T.verbose("Showing tab content for",t),i||(t.addClass(b.active),n.removeClass(b.active+" "+b.loading),0<t.length&&v.onVisible.call(t[0],e))},navigation:function(e){var t=T.get.navElement(e),n="siblings"==v.deactivate?t.siblings(u):u.not(t),i=t.hasClass(b.active);T.verbose("Activating tab navigation for",t,e),i||(t.addClass(b.active),n.removeClass(b.active+" "+b.loading))}},deactivate:{all:function(){T.deactivate.navigation(),T.deactivate.tabs()},navigation:function(){u.removeClass(b.active)},tabs:function(){o.removeClass(b.active+" "+b.loading)}},is:{tab:function(e){return e!==R&&0<T.get.tabElement(e).length}},get:{initialPath:function(){return u.eq(0).data(y.tab)||o.eq(0).data(y.tab)},path:function(){return O.address.value()},defaultPathArray:function(e){return T.utilities.pathToArray(T.get.defaultPath(e))},defaultPath:function(e){var t=u.filter("[data-"+y.tab+'^="'+T.escape.string(e)+'/"]').eq(0).data(y.tab)||!1;if(t){if(T.debug("Found default tab",t),r<v.maxDepth)return r++,T.get.defaultPath(t);T.error(x.recursion)}else T.debug("No default tabs found for",e,o);return r=0,e},navElement:function(e){return e=e||p,u.filter("[data-"+y.tab+'="'+T.escape.string(e)+'"]')},tabElement:function(e){var t;return e=e||p,t=T.utilities.pathToArray(e),t=T.utilities.last(t),e=o.filter("[data-"+y.tab+'="'+T.escape.string(e)+'"]'),t=o.filter("[data-"+y.tab+'="'+T.escape.string(t)+'"]'),0<e.length?e:t},tab:function(){return p}},determine:{activeTab:function(){var n=null;return o.each(function(e,t){O(t).hasClass(b.active)&&(t=O(this).data(y.tab),u.filter("[data-"+y.tab+'="'+T.escape.string(t)+'"]').hasClass(b.active)&&(n=t))}),n}},utilities:{filterArray:function(e,t){return O.grep(e,function(e){return-1==O.inArray(e,t)})},last:function(e){return!!Array.isArray(e)&&e[e.length-1]},pathToArray:function(e){return"string"==typeof(e=e===R?p:e)?e.split("/"):[e]},arrayToPath:function(e){return!!Array.isArray(e)&&e.join("/")}},setting:function(e,t){if(T.debug("Changing setting",e,t),O.isPlainObject(e))O.extend(!0,v,e);else{if(t===R)return v[e];O.isPlainObject(v[e])?O.extend(!0,v[e],t):v[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,T,e);else{if(t===R)return T[e];T[e]=t}},debug:function(){!v.silent&&v.debug&&(v.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,v.name+":"),T.debug.apply(console,arguments)))},verbose:function(){!v.silent&&v.verbose&&v.debug&&(v.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),T.verbose.apply(console,arguments)))},error:function(){v.silent||(T.error=Function.prototype.bind.call(console.error,console,v.name+":"),T.error.apply(console,arguments))},performance:{log:function(e){var t,n;v.performance&&(n=(t=(new Date).getTime())-(f||t),f=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:k,"Execution Time":n})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var e=v.name+":",n=0;f=!1,clearTimeout(T.performance.timer),O.each(S,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",d&&(e+=" '"+d+"'"),(console.group!==R||console.table!==R)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):O.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(i,e,t){var o,a,n,r=s;return e=e||E,t=k||t,"string"==typeof i&&r!==R&&(i=i.split(/[\. ]/),o=i.length-1,O.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(O.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==R)return a=r[n],!1;{if(!O.isPlainObject(r[t])||e==o)return r[t]!==R?a=r[t]:T.error(x.method,i),!1;r=r[t]}}})),O.isFunction(a)?n=a.apply(t,e):a!==R&&(n=a),Array.isArray(c)?c.push(n):c!==R?c=[c,n]:n!==R&&(c=n),a}};A?(s===R&&T.initialize(),T.invoke(D)):(s!==R&&s.invoke("destroy"),T.initialize())}),c!==R?c:this},O.tab=function(){O(P).tab.apply(this,arguments)},O.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,loadOnce:!1,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",autoTabActivation:!0,onFirstLoad:function(e,t,n){},onLoad:function(e,t,n){},onVisible:function(e,t,n){},onRequest:function(e,t,n){},onBeforeChange:function(e){},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. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library <https://github.com/asual/jquery-address>"},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s:=@]/g},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(O,P,M,R){"use strict";O.isFunction=O.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},P=void 0!==P&&P.Math==Math?P:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.toast=function(w){var k,e=O(this),T=e.selector||"",S=(new Date).getTime(),D=[],A=w,E="string"==typeof A,F=[].slice.call(arguments,1);return e.each(function(){var n,i,a,o,r,s,l,e,c=O.isPlainObject(w)?O.extend(!0,{},O.fn.toast.settings,w):O.extend({},O.fn.toast.settings),u=c.className,d=c.selector,f=c.error,t=c.namespace,m=c.fields,p="."+t,g=t+"-module",h=O(this),v=c.context?[P,M].indexOf(c.context)<0?O(M).find(c.context):O(c.context):O("body"),b=h.hasClass("toast")||h.hasClass("message")||h.hasClass("card"),y=this,x=b?h.data(g):R,C={initialize:function(){C.verbose("Initializing element"),C.create.id(),C.has.container()||C.create.container(),(b||""!==c.message||""!==c.title||""!==C.get.iconClass()||c.showImage||C.has.configActions())&&("string"==typeof c.showProgress&&-1!==[u.top,u.bottom].indexOf(c.showProgress)||(c.showProgress=!1),C.create.toast(),c.closeOnClick&&(c.closeIcon||0<O(i).find(d.input).length||C.has.configActions())&&(c.closeOnClick=!1),c.closeOnClick||n.addClass(u.unclickable),C.bind.events()),C.instantiate(),n&&C.show()},instantiate:function(){C.verbose("Storing instance of toast"),x=C,h.data(g,x)},destroy:function(){n&&(C.debug("Removing toast",n),C.unbind.events(),n.remove(),s=i=n=R,c.onRemove.call(n,y),l=r=o=R),h.removeData(g)},show:function(e){!1===c.onShow.call(n,y)?C.debug("onShow callback returned false, cancelling toast animation"):(e=e||function(){},C.debug("Showing toast"),C.animate.show(e))},close:function(e){!1===c.onHide.call(n,y)?C.debug("onHide callback returned false, cancelling toast animation"):(e=e||function(){},C.debug("Closing toast"),C.remove.visible(),C.unbind.events(),C.animate.close(e))},create:{container:function(){C.verbose("Creating container"),v.append(O("<div/>",{class:c.position+" "+u.container+" "+(c.horizontal?u.horizontal:"")+" "+(c.context&&"body"!==c.context?u.absolute:"")}))},id:function(){e=(Math.random().toString(16)+"000000000").slice(2,10),C.verbose("Creating unique id for element",e)},toast:function(){n=O("<div/>",{class:u.box});var e,t=C.get.iconClass();b?(i=c.cloneModule?h.clone().removeAttr("id"):h,l=i.find("> i"+C.helpers.toClass(u.close)),c.closeIcon=0<l.length,""!==t&&i.find(d.icon).attr("class",t+" "+u.icon),c.showImage&&i.find(d.image).attr("src",c.showImage),""!==c.title&&i.find(d.title).html(C.helpers.escape(c.title,c.preserveHTML)),""!==c.message&&i.find(d.message).html(C.helpers.escape(c.message,c.preserveHTML))):(C.verbose("Creating toast"),i=O("<div/>",{role:"alert"}),e=O("<div/>",{class:u.content}),""!==t&&i.append(O("<i/>",{class:t+" "+u.icon})),c.showImage&&i.append(O("<img>",{class:u.image+" "+c.classImage,src:c.showImage})),""!==c.title&&(t="_"+C.get.id()+"title",i.attr("aria-labelledby",t),e.append(O("<div/>",{class:u.title,id:t,html:C.helpers.escape(c.title,c.preserveHTML)}))),t="_"+C.get.id()+"desc",i.attr("aria-describedby",t),e.append(O("<div/>",{class:u.message,id:t,html:C.helpers.escape(c.message,c.preserveHTML)})),i.addClass(c.class+" "+u.toast).append(e),i.css("opacity",c.opacity),c.closeIcon&&((l=O("<i/>",{class:u.close+" "+("string"==typeof c.closeIcon?c.closeIcon:""),role:"button",tabindex:0,"aria-label":c.text.close})).hasClass(u.left)?i.prepend(l):i.append(l))),i.hasClass(u.compact)&&(c.compact=!0),i.hasClass("card")&&(c.compact=!1),a=i.find(".actions"),C.has.configActions()&&(0===a.length&&(a=O("<div/>",{class:u.actions+" "+(c.classActions||"")}).appendTo(i)),i.hasClass("card")&&!a.hasClass(u.attached)&&(a.addClass(u.extraContent),a.hasClass(u.vertical)&&(a.removeClass(u.vertical),C.error(f.verticalCard))),c.actions.forEach(function(e){var t=e[m.icon]?"<i "+(e[m.text]?'aria-hidden="true"':"")+' class="'+C.helpers.deQuote(e[m.icon])+' icon"></i>':"",n=C.helpers.escape(e[m.text]||"",c.preserveHTML),i=C.helpers.deQuote(e[m.class]||""),o=e[m.click]&&O.isFunction(e[m.click])?e[m.click]:function(){};a.append(O("<button/>",{html:t+n,"aria-label":(e[m.text]||e[m.icon]||"").replace(/<[^>]+(>|$)/g,""),class:u.button+" "+i,click:function(){var e=O(this);e.is(d.approve)||e.is(d.deny)||!1===o.call(y,h)||C.close()}}))})),a&&a.hasClass(u.vertical)&&i.addClass(u.vertical),0<a.length&&!a.hasClass(u.attached)&&(!a||a.hasClass(u.basic)&&!a.hasClass(u.left)||i.addClass(u.actions)),"auto"===c.displayTime&&(c.displayTime=Math.max(c.minDisplayTime,i.text().split(" ").length/c.wordsPerMinute*6e4)),n.append(i),0<a.length&&a.hasClass(u.attached)&&(a.addClass(u.buttons),a.detach(),i.addClass(u.attached),a.hasClass(u.vertical)?(i.wrap(O("<div/>",{class:u.vertical+" "+u.attached+" "+(c.compact?u.compact:"")})),a.hasClass(u.left)?i.addClass(u.left).parent().addClass(u.left).prepend(a):i.parent().append(a)):a.hasClass(u.top)?(n.prepend(a),i.addClass(u.bottom)):(n.append(a),i.addClass(u.top))),h!==i&&(y=(h=i)[0]),0<c.displayTime&&(t=u.progressing+" "+(c.pauseOnHover?u.pausable:""),c.showProgress&&(o=O("<div/>",{class:u.progress+" "+(c.classProgress||c.class),"data-percent":""}),c.classProgress||(i.hasClass("toast")&&!i.hasClass(u.inverted)?o.addClass(u.inverted):o.removeClass(u.inverted)),r=O("<div/>",{class:"bar "+(c.progressUp?"up ":"down ")+t}),o.addClass(c.showProgress).append(r),o.hasClass(u.top)?n.prepend(o):n.append(o),r.css("animation-duration",c.displayTime/1e3+"s")),(s=O("<span/>",{class:"wait "+t})).css("animation-duration",c.displayTime/1e3+"s"),s.appendTo(i)),c.compact&&(n.addClass(u.compact),i.addClass(u.compact),o&&o.addClass(u.compact)),c.newestOnTop?n.prependTo(C.get.container()):n.appendTo(C.get.container())}},bind:{events:function(){C.debug("Binding events to toast"),c.closeIcon&&l.on("click"+p,C.event.close),i.on("click"+p,C.event.click),s&&s.on("animationend"+p,C.event.close),n.on("click"+p,d.approve,C.event.approve).on("click"+p,d.deny,C.event.deny)}},unbind:{events:function(){C.debug("Unbinding events to toast"),c.closeIcon&&l.off("click"+p),i.off("click"+p),s&&s.off("animationend"+p),n.off("click"+p)}},animate:{show:function(e){e=O.isFunction(e)?e:function(){},c.transition&&C.can.useElement("transition")&&h.transition("is supported")&&(C.set.visible(),n.transition({animation:c.transition.showMethod+" in",queue:!1,debug:c.debug,verbose:c.verbose,duration:c.transition.showDuration,onComplete:function(){e.call(n,y),c.onVisible.call(n,y)}}))},close:function(e){e=O.isFunction(e)?e:function(){},c.transition&&O.fn.transition!==R&&h.transition("is supported")?n.transition({animation:c.transition.hideMethod+" out",queue:!1,duration:c.transition.hideDuration,debug:c.debug,verbose:c.verbose,interval:50,onBeforeHide:function(e){e=O.isFunction(e)?e:function(){},""!==c.transition.closeEasing?n&&(n.css("opacity",0),n.wrap("<div/>").parent().hide(c.transition.closeDuration,c.transition.closeEasing,function(){n&&(n.parent().remove(),e.call(n))})):e.call(n)},onComplete:function(){e.call(n,y),c.onHidden.call(n,y),C.destroy()}}):C.error(f.noTransition)},pause:function(){s.css("animationPlayState","paused"),r&&r.css("animationPlayState","paused")},continue:function(){s.css("animationPlayState","running"),r&&r.css("animationPlayState","running")}},has:{container:function(){return C.verbose("Determining if there is already a container"),0<C.get.containers().length},toast:function(){return!!C.get.toast()},toasts:function(){return 0<C.get.toasts().length},configActions:function(){return Array.isArray(c.actions)&&0<c.actions.length}},get:{id:function(){return e},containers:function(){return v.children(C.helpers.toClass(c.position)+d.container+(c.horizontal?C.helpers.toClass(u.horizontal):":not("+C.helpers.toClass(u.horizontal)+")")+(c.context&&"body"!==c.context?C.helpers.toClass(u.absolute):":not("+C.helpers.toClass(u.absolute)+")"))},container:function(){return C.get.containers()[0]},toastBox:function(){return n||null},toast:function(){return i||null},toasts:function(){return O(C.get.container()).find(d.box)},iconClass:function(){return"string"==typeof c.showIcon?c.showIcon:c.showIcon&&c.icons[c.class]?c.icons[c.class]:""},remainingTime:function(){return s?s.css("opacity")*c.displayTime:0}},set:{visible:function(){i.addClass(u.visible)}},remove:{visible:function(){i.removeClass(u.visible)}},event:{close:function(){C.close()},click:function(e){0===O(e.target).closest(d.clickable).length&&(!1!==c.onClick.call(n,y)&&c.closeOnClick?C.close():C.verbose("Click callback returned false or close denied by setting cancelling close"))},approve:function(){!1===c.onApprove.call(y,h)?C.verbose("Approve callback returned false cancelling close"):C.close()},deny:function(){!1===c.onDeny.call(y,h)?C.verbose("Deny callback returned false cancelling close"):C.close()}},helpers:{toClass:function(e){var e=e.trim().split(/\s+/),t="";return e.forEach(function(e){t+="."+e}),t},deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{useElement:function(e){return O.fn[e]!==R||(C.error(f.noElement.replace("{element}",e)),!1)}},setting:function(e,t){if(C.debug("Changing setting",e,t),O.isPlainObject(e))O.extend(!0,c,e);else{if(t===R)return c[e];O.isPlainObject(c[e])?O.extend(!0,c[e],t):c[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,C,e);else{if(t===R)return C[e];C[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?C.performance.log(arguments):(C.debug=Function.prototype.bind.call(console.info,console,c.name+":"),C.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?C.performance.log(arguments):(C.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),C.verbose.apply(console,arguments)))},error:function(){c.silent||(C.error=Function.prototype.bind.call(console.error,console,c.name+":"),C.error.apply(console,arguments))},performance:{log:function(e){var t,n;c.performance&&(n=(t=(new Date).getTime())-(S||t),S=t,D.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTimeout(C.performance.timer),C.performance.timer=setTimeout(C.performance.display,500)},display:function(){var e=c.name+":",n=0;S=!1,clearTimeout(C.performance.timer),O.each(D,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",T&&(e+=" '"+T+"'"),(console.group!==R||console.table!==R)&&0<D.length&&(console.groupCollapsed(e),console.table?console.table(D):O.each(D,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),D=[]}},invoke:function(i,e,t){var o,a,n,r=x;return e=e||F,t=y||t,"string"==typeof i&&r!==R&&(i=i.split(/[\. ]/),o=i.length-1,O.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(O.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==R)return a=r[n],!1;{if(!O.isPlainObject(r[t])||e==o)return r[t]!==R?a=r[t]:C.error(f.method,i),!1;r=r[t]}}})),O.isFunction(a)?n=a.apply(t,e):a!==R&&(n=a),Array.isArray(k)?k.push(n):k!==R?k=[k,n]:n!==R&&(k=n),a}};E?(x===R&&C.initialize(),C.invoke(A)):(x!==R&&x.invoke("destroy"),C.initialize(),k=h)}),k!==R?k:this},O.fn.toast.settings={name:"Toast",namespace:"toast",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",position:"top right",horizontal:!1,class:"neutral",classProgress:!1,classActions:!1,classImage:"mini",title:"",message:"",displayTime:3e3,minDisplayTime:1e3,wordsPerMinute:120,showIcon:!1,newestOnTop:!1,showProgress:!1,pauseOnHover:!0,progressUp:!1,opacity:1,compact:!0,closeIcon:!1,closeOnClick:!0,cloneModule:!0,actions:!1,preserveHTML:!0,showImage:!1,transition:{showMethod:"scale",showDuration:500,hideMethod:"scale",hideDuration:500,closeEasing:"easeOutCubic",closeDuration:500},error:{method:"The method you called is not defined.",noElement:"This module requires ui {element}",verticalCard:"Vertical but not attached actions are not supported for card layout"},className:{container:"ui toast-container",absolute:"absolute",box:"floating toast-box",progress:"ui attached active progress",toast:"ui toast",icon:"centered icon",visible:"visible",content:"content",title:"ui header",message:"message",actions:"actions",extraContent:"extra content",button:"ui button",buttons:"ui buttons",close:"close icon",image:"ui image",vertical:"vertical",horizontal:"horizontal",attached:"attached",inverted:"inverted",compact:"compact",pausable:"pausable",progressing:"progressing",top:"top",bottom:"bottom",left:"left",basic:"basic",unclickable:"unclickable"},text:{close:"Close"},icons:{info:"info",success:"checkmark",warning:"warning",error:"times"},selector:{container:".ui.toast-container",box:".toast-box",toast:".ui.toast",title:".header",message:".message:not(.ui)",image:"> img.image, > .image > img",icon:"> i.icon",input:'input:not([type="hidden"]), textarea, select, button, .ui.button, ui.dropdown',clickable:"a, details, .ui.accordion",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onClick:function(){},onHide:function(){},onHidden:function(){},onRemove:function(){},onApprove:function(){},onDeny:function(){}},O.extend(O.easing,{easeOutBounce:function(e,t,n,i,o){return(t/=o)<1/2.75?i*(7.5625*t*t)+n:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+n:i*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeOutCubic:function(e){return--e*e*e+1}})}(jQuery,window,document),function(C,e,w,k){"use strict";C.isFunction=C.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),C.fn.transition=function(){var m,r=C(this),p=r.selector||"",g=(new Date).getTime(),h=[],v=arguments,b=v[0],y=[].slice.call(arguments,1),x="string"==typeof b;return r.each(function(n){var l,s,t,c,i,o,e,a,u=C(this),d=this,f={initialize:function(){l=f.get.settings.apply(d,v),c=l.className,t=l.error,i=l.metadata,a="."+l.namespace,e="module-"+l.namespace,s=u.data(e)||f,o=f.get.animationEndEvent(),!1===(x=x&&f.invoke(b))&&(f.verbose("Converted arguments into settings object",l),l.interval?f.delay(l.animate):f.animate(),f.instantiate())},instantiate:function(){f.verbose("Storing instance of module",f),s=f,u.data(e,s)},destroy:function(){f.verbose("Destroying previous module for",d),u.removeData(e)},refresh:function(){f.verbose("Refreshing display type on next animation"),delete f.displayType},forceRepaint:function(){f.verbose("Forcing element repaint");var e=u.parent(),t=u.next();0===t.length?u.detach().appendTo(e):u.detach().insertBefore(t)},repaint:function(){f.verbose("Repainting element");d.offsetWidth},delay:function(e){var t=(t=f.get.animationDirection())||(f.can.transition()?f.get.direction():"static");e=e!==k?e:l.interval,e="auto"==l.reverse&&t==c.outward||1==l.reverse?(r.length-n)*l.interval:n*l.interval,f.debug("Delaying animation by",e),setTimeout(f.animate,e)},animate:function(e){if(l=e||l,!f.is.supported())return f.error(t.support),!1;if(f.debug("Preparing animation",l.animation),f.is.animating()){if(l.queue)return!l.allowRepeats&&f.has.direction()&&f.is.occurring()&&!0!==f.queuing?f.debug("Animation is currently occurring, preventing queueing same animation",l.animation):f.queue(l.animation),!1;if(!l.allowRepeats&&f.is.occurring())return f.debug("Animation is already occurring, will not execute repeated animation",l.animation),!1;f.debug("New animation started, completing previous early",l.animation),s.complete()}f.can.animate()?f.set.animating(l.animation):f.error(t.noAnimation,l.animation,d)},reset:function(){f.debug("Resetting animation to beginning conditions"),f.remove.animationCallbacks(),f.restore.conditions(),f.remove.animating()},queue:function(e){f.debug("Queueing animation of",e),f.queuing=!0,u.one(o+".queue"+a,function(){f.queuing=!1,f.repaint(),f.animate.apply(this,l)})},complete:function(e){e&&e.target===d&&e.stopPropagation(),f.debug("Animation complete",l.animation),f.remove.completeCallback(),f.remove.failSafe(),f.is.looping()||(f.is.outward()?(f.verbose("Animation is outward, hiding element"),f.restore.conditions(),f.hide()):f.is.inward()?(f.verbose("Animation is outward, showing element"),f.restore.conditions(),f.show()):(f.verbose("Static animation completed"),f.restore.conditions(),l.onComplete.call(d)))},force:{visible:function(){var e=u.attr("style"),e=f.get.userStyle(e),t=f.get.displayType(),e=e+"display: "+t+" !important;",n=u[0].style.display;return!t||"none"===n&&l.skipInlineHidden||u[0].tagName.match(/(script|link|style)/i)?(f.remove.transition(),!1):(f.verbose("Overriding default display to show element",t),u.attr("style",e),!0)},hidden:function(){var e=u.attr("style"),t=u.css("display"),e=e===k||""===e;"none"===t||f.is.hidden()?e&&u.removeAttr("style"):(f.verbose("Overriding default display to hide element"),u.css("display","none"))}},has:{direction:function(e){var n=!1;return"string"==typeof(e=e||l.animation)&&(e=e.split(" "),C.each(e,function(e,t){t!==c.inward&&t!==c.outward||(n=!0)})),n},inlineDisplay:function(){var e=u.attr("style")||"";return Array.isArray(e.match(/display.*?;/,""))}},set:{animating:function(e){f.remove.completeCallback(),e=e||l.animation;e=f.get.animationClass(e);f.save.animation(e),f.force.visible()&&(f.remove.hidden(),f.remove.direction(),f.start.animation(e))},duration:function(e,t){!(t="number"==typeof(t=t||l.duration)?t+"ms":t)&&0!==t||(f.verbose("Setting animation duration",t),u.css({"animation-duration":t}))},direction:function(e){(e=e||f.get.direction())==c.inward?f.set.inward():f.set.outward()},looping:function(){f.debug("Transition set to loop"),u.addClass(c.looping)},hidden:function(){u.addClass(c.transition).addClass(c.hidden)},inward:function(){f.debug("Setting direction to inward"),u.removeClass(c.outward).addClass(c.inward)},outward:function(){f.debug("Setting direction to outward"),u.removeClass(c.inward).addClass(c.outward)},visible:function(){u.addClass(c.transition).addClass(c.visible)}},start:{animation:function(e){e=e||f.get.animationClass(),f.debug("Starting tween",e),u.addClass(e).one(o+".complete"+a,f.complete),l.useFailSafe&&f.add.failSafe(),f.set.duration(l.duration),l.onStart.call(d)}},save:{animation:function(e){f.cache||(f.cache={}),f.cache.animation=e},displayType:function(e){"none"!==e&&u.data(i.displayType,e)},transitionExists:function(e,t){C.fn.transition.exists[e]=t,f.verbose("Saving existence of transition",e,t)}},restore:{conditions:function(){var e=f.get.currentAnimation();e&&(u.removeClass(e),f.verbose("Removing animation class",f.cache)),f.remove.duration()}},add:{failSafe:function(){var e=f.get.duration();f.timer=setTimeout(function(){u.triggerHandler(o)},e+l.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},remove:{animating:function(){u.removeClass(c.animating)},animationCallbacks:function(){f.remove.queueCallback(),f.remove.completeCallback()},queueCallback:function(){u.off(".queue"+a)},completeCallback:function(){u.off(".complete"+a)},display:function(){u.css("display","")},direction:function(){u.removeClass(c.inward).removeClass(c.outward)},duration:function(){u.css("animation-duration","")},failSafe:function(){f.verbose("Removing fail safe timer",f.timer),f.timer&&clearTimeout(f.timer)},hidden:function(){u.removeClass(c.hidden)},visible:function(){u.removeClass(c.visible)},looping:function(){f.debug("Transitions are no longer looping"),f.is.looping()&&(f.reset(),u.removeClass(c.looping))},transition:function(){u.removeClass(c.transition).removeClass(c.visible).removeClass(c.hidden)}},get:{settings:function(e,t,n){return"object"==typeof e?C.extend(!0,{},C.fn.transition.settings,e):"function"==typeof n?C.extend({},C.fn.transition.settings,{animation:e,onComplete:n,duration:t}):"string"==typeof t||"number"==typeof t?C.extend({},C.fn.transition.settings,{animation:e,duration:t}):"object"==typeof t?C.extend({},C.fn.transition.settings,t,{animation:e}):"function"==typeof t?C.extend({},C.fn.transition.settings,{animation:e,onComplete:t}):C.extend({},C.fn.transition.settings,{animation:e})},animationClass:function(e){var e=e||l.animation,t=f.can.transition()&&!f.has.direction()?f.get.direction()+" ":"";return c.animating+" "+c.transition+" "+t+e},currentAnimation:function(){return!(!f.cache||f.cache.animation===k)&&f.cache.animation},currentDirection:function(){return f.is.inward()?c.inward:c.outward},direction:function(){return f.is.hidden()||!f.is.visible()?c.inward:c.outward},animationDirection:function(e){var n;return"string"==typeof(e=e||l.animation)&&(e=e.split(" "),C.each(e,function(e,t){t===c.inward?n=c.inward:t===c.outward&&(n=c.outward)})),n||!1},duration:function(e){return"string"==typeof(e=!1===(e=e||l.duration)?u.css("animation-duration")||0:e)?-1<e.indexOf("ms")?parseFloat(e):1e3*parseFloat(e):e},displayType:function(e){return l.displayType||((e=e===k||e)&&u.data(i.displayType)===k&&(""===(e=u.css("display"))||"none"===e?f.can.transition(!0):f.save.displayType(e)),u.data(i.displayType))},userStyle:function(e){return(e=e||u.attr("style")||"").replace(/display.*?;/,"")},transitionExists:function(e){return C.fn.transition.exists[e]},animationStartEvent:function(){var e,t=w.createElement("div"),n={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(e in n)if(t.style[e]!==k)return n[e];return!1},animationEndEvent:function(){var e,t=w.createElement("div"),n={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(e in n)if(t.style[e]!==k)return n[e];return!1}},can:{transition:function(e){var t,n,i,o,a=l.animation,r=f.get.transitionExists(a),s=f.get.displayType(!1);if(r===k||e){if(f.verbose("Determining whether animation exists"),e=u.attr("class"),t=u.prop("tagName"),n=(t=C("<"+t+" />").addClass(e).insertAfter(u)).addClass(a).removeClass(c.inward).removeClass(c.outward).addClass(c.animating).addClass(c.transition).css("animationName"),i=t.addClass(c.inward).css("animationName"),s||(s=t.attr("class",e).removeAttr("style").removeClass(c.hidden).removeClass(c.visible).show().css("display"),f.verbose("Determining final display state",s),f.save.displayType(s)),t.remove(),n!=i)f.debug("Direction exists for animation",a),o=!0;else{if("none"==n||!n)return void f.debug("No animation defined in css",a);f.debug("Static animation found",a,s),o=!1}f.save.transitionExists(a,o)}return r!==k?r:o},animate:function(){return f.can.transition()!==k}},is:{animating:function(){return u.hasClass(c.animating)},inward:function(){return u.hasClass(c.inward)},outward:function(){return u.hasClass(c.outward)},looping:function(){return u.hasClass(c.looping)},occurring:function(e){return e="."+(e=e||l.animation).replace(" ","."),0<u.filter(e).length},visible:function(){return u.is(":visible")},hidden:function(){return"hidden"===u.css("visibility")},supported:function(){return!1!==o}},hide:function(){if(!1===l.onHide.call(d))return f.verbose("Hide callback returned false cancelling hide"),!1;f.verbose("Hiding element"),f.is.animating()&&f.reset(),d.blur(),f.remove.display(),f.remove.visible(),l.onBeforeHide.call(d,f.hideNow)},hideNow:function(){f.set.hidden(),f.force.hidden(),l.onHidden.call(d),l.onComplete.call(d)},show:function(e){f.force.visible()&&!1!==l.onShow.call(d)&&(f.verbose("Showing element",e),f.remove.hidden(),l.onBeforeShow.call(d,f.showNow))},showNow:function(){f.set.visible(),l.onVisible.call(d),l.onComplete.call(d)},toggle:function(){f.is.visible()?f.hide():f.show()},stop:function(){f.debug("Stopping current animation"),u.triggerHandler(o)},stopAll:function(){f.debug("Stopping all animation"),f.remove.queueCallback(),u.triggerHandler(o)},clear:{queue:function(){f.debug("Clearing animation queue"),f.remove.queueCallback()}},enable:function(){f.verbose("Starting animation"),u.removeClass(c.disabled)},disable:function(){f.debug("Stopping animation"),u.addClass(c.disabled)},setting:function(e,t){if(f.debug("Changing setting",e,t),C.isPlainObject(e))C.extend(!0,l,e);else{if(t===k)return l[e];C.isPlainObject(l[e])?C.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(C.isPlainObject(e))C.extend(!0,f,e);else{if(t===k)return f[e];f[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,l.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),f.verbose.apply(console,arguments)))},error:function(){l.silent||(f.error=Function.prototype.bind.call(console.error,console,l.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=(new Date).getTime())-(g||t),g=t,h.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 e=l.name+":",n=0;g=!1,clearTimeout(f.performance.timer),C.each(h,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",p&&(e+=" '"+p+"'"),1<r.length&&(e+=" ("+r.length+")"),(console.group!==k||console.table!==k)&&0<h.length&&(console.groupCollapsed(e),console.table?console.table(h):C.each(h,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(i,e,t){var o,a,n,r=s;return e=e||y,t=d||t,"string"==typeof i&&r!==k&&(i=i.split(/[\. ]/),o=i.length-1,C.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(C.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==k)return a=r[n],!1;{if(!C.isPlainObject(r[t])||e==o)return r[t]!==k&&(a=r[t]),!1;r=r[t]}}})),C.isFunction(a)?n=a.apply(t,e):a!==k&&(n=a),Array.isArray(m)?m.push(n):m!==k?m=[m,n]:n!==k&&(m=n),a!==k&&a}};f.initialize()}),m!==k?m:this},C.fn.transition.exists={},C.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onBeforeShow:function(e){e.call(this)},onVisible:function(){},onHide:function(){},onHidden:function(){},onBeforeHide:function(e){e.call(this)},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,skipInlineHidden:!1,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to suppress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(F,O,P,M){"use strict";F.isWindow=F.isWindow||function(e){return null!=e&&e===e.window},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),F.api=F.fn.api=function(C){var w,e=F.isFunction(this)?F(O):F(this),k=e.selector||"",T=(new Date).getTime(),S=[],D=C,A="string"==typeof D,E=[].slice.call(arguments,1);return e.each(function(){var a,i,n,e,r,o,f=F.isPlainObject(C)?F.extend(!0,{},F.fn.api.settings,C):F.extend({},F.fn.api.settings),t=f.namespace,s=f.metadata,l=f.selector,c=f.error,u=f.className,d="."+t,m="module-"+t,p=F(this),g=p.closest(l.form),h=f.stateContext?[O,P].indexOf(f.stateContext)<0?F(P).find(f.stateContext):F(f.stateContext):p,v=this,b=h[0],y=p.data(m),x={initialize:function(){A||(o=f.data,x.bind.events()),x.instantiate()},instantiate:function(){x.verbose("Storing instance of module",x),y=x,p.data(m,y)},destroy:function(){x.verbose("Destroying previous module for",v),p.removeData(m).off(d)},bind:{events:function(){var e=x.get.event();e?(x.verbose("Attaching API events to element",e),p.on(e+d,x.event.trigger)):"now"==f.on&&(x.debug("Querying API endpoint immediately"),x.query())}},decode:{json:function(e){if(e!==M&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(O.Storage!==M)return t=sessionStorage.getItem(e+x.get.normalizedData()),x.debug("Using cached response",e,f.data,t),x.decode.json(t);x.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?x.debug("Response empty, not caching",t):O.Storage===M?x.error(c.noStorage):(F.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+x.get.normalizedData(),t),x.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(x.is.disabled())x.debug("Element is disabled API request aborted");else{if(x.is.loading()){if(!f.interruptRequests)return void x.debug("Cancelling request, previous request is still pending");x.debug("Interrupting previous request"),x.abort()}if(f.defaultData&&F.extend(!0,f.urlData,x.get.defaultData()),f.serializeForm&&(f.data=x.add.formData(o||f.data)),!1===(i=x.get.settings()))return x.cancelled=!0,void x.error(c.beforeSend);if(x.cancelled=!1,(n=x.get.templatedURL())||x.is.mocked()){if((n=x.add.urlData(n))||x.is.mocked()){if(i.url=f.base+n,a=F.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+n,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),x.debug("Querying URL",a.url),x.verbose("Using AJAX settings",a),"local"===f.cache&&x.read.cachedResponse(n))return x.debug("Response returned from local cache"),x.request=x.create.request(),void x.request.resolveWith(b,[x.read.cachedResponse(n)]);f.throttle?f.throttleFirstRequest||x.timer?(x.debug("Throttling request",f.throttle),clearTimeout(x.timer),x.timer=setTimeout(function(){x.timer&&delete x.timer,x.debug("Sending throttled request",e,a.method),x.send.request()},f.throttle)):(x.debug("Sending request",e,a.method),x.send.request(),x.timer=setTimeout(function(){},f.throttle)):(x.debug("Sending request",e,a.method),x.send.request())}}else x.error(c.missingURL)}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!x.is.form()}},is:{disabled:function(){return 0<p.filter(l.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){return p.is("form")||h.is("form")},mocked:function(){return f.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){return p.is("input")},loading:function(){return!!x.request&&"pending"==x.request.state()},abortedRequest:function(e){return e&&e.readyState!==M&&0===e.readyState?(x.verbose("XHR request determined to be aborted"),!0):(x.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return x.is.expectingJSON()&&F.isFunction(f.successTest)?(x.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(x.debug("Response passed success test",e),!0):(x.debug("Response failed success test",e),!1)):(x.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled:function(){return x.cancelled||!1},successful:function(){return x.request&&"resolved"==x.request.state()},failure:function(){return x.request&&"rejected"==x.request.state()},complete:function(){return x.request&&("resolved"==x.request.state()||"rejected"==x.request.state())}},add:{urlData:function(o,a){var e,t;return o&&(e=o.match(f.regExp.required),t=o.match(f.regExp.optional),a=a||f.urlData,e&&(x.debug("Looking for required URL variables",e),F.each(e,function(e,t){var n=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),i=F.isPlainObject(a)&&a[n]!==M?a[n]:p.data(n)!==M?p.data(n):h.data(n)!==M?h.data(n):a[n];if(i===M)return x.error(c.requiredParameter,n,o),o=!1;x.verbose("Found required variable",n,i),i=f.encodeParameters?x.get.urlEncodedValue(i):i,o=o.replace(t,i)})),t&&(x.debug("Looking for optional URL variables",e),F.each(t,function(e,t){var n=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),i=F.isPlainObject(a)&&a[n]!==M?a[n]:p.data(n)!==M?p.data(n):h.data(n)!==M?h.data(n):a[n];o=i!==M?(x.verbose("Optional variable Found",n,i),o.replace(t,i)):(x.verbose("Optional variable not found",n),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(n){var e,i,l,c,u,d={},t="formdata"===f.serializeForm;return n=n||o||f.data,e=F.isPlainObject(n),t?(d=new FormData(g[0]),f.processData=void 0!==f.processData&&f.processData,f.contentType=void 0!==f.contentType&&f.contentType):(i=g.serializeArray(),l={},c={},u=function(e,t,n){return e[t]=n,e},F.each(F('input[type="file"]',g),function(e,n){F.each(F(n)[0].files,function(e,t){i.push({name:n.name,value:t})})}),F.each(i,function(e,t){if(f.regExp.validate.test(t.name)){var n,i="checkbox"===F('[name="'+t.name+'"]',g).attr("type"),o=parseFloat(t.value),a=i&&"on"===t.value||"true"===t.value||(String(o)===t.value?o:"false"!==t.value&&t.value),r=t.name.match(f.regExp.key)||[],s=t.name.replace(/\[\]$/,"");s in l?Array.isArray(c[s])?c[s].push(a):c[s]=[c[s],a]:(l[s]=0,c[s]=a),a=c[s];for(;(n=r.pop())!==M;)""!=n||Array.isArray(a)?f.regExp.fixed.test(n)?a=u([],n,a):f.regExp.named.test(n)&&(a=u({},n,a)):a=u([],l[s]++,a);d=F.extend(!0,d,a)}})),n=e?(x.debug("Extending existing data with form data",n,d),t?(F.each(Object.keys(n),function(e,t){d.append(t,n[t])}),d):F.extend(!0,{},n,d)):(x.debug("Adding form data",d),d)}},send:{request:function(){x.set.loading(),x.request=x.create.request(),x.is.mocked()?x.mockedXHR=x.create.mockedXHR():x.xhr=x.create.xhr(),f.onRequest.call(b,x.request,x.xhr)}},event:{trigger:function(e){x.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,n){var i=this,o=(new Date).getTime()-r,o=f.loadingDuration-o,a=!!F.isFunction(f.onResponse)&&(x.is.expectingJSON()&&!f.rawResponse?f.onResponse.call(i,F.extend(!0,{},e)):f.onResponse.call(i,e)),o=0<o?o:0;a&&(x.debug("Modified API response in onResponse callback",f.onResponse,a,e),e=a),0<o&&x.debug("Response completed early delaying state change by",o),setTimeout(function(){x.is.validResponse(e)?x.request.resolveWith(i,[e,n]):x.request.rejectWith(i,[n,"invalid"])},o)},fail:function(e,t,n){var i=this,o=(new Date).getTime()-r,o=f.loadingDuration-o;0<(o=0<o?o:0)&&x.debug("Response completed early delaying state change by",o),setTimeout(function(){x.is.abortedRequest(e)?x.request.rejectWith(i,[e,"aborted",n]):x.request.rejectWith(i,[e,"error",t,n])},o)}},request:{done:function(e,t){x.debug("Successful API Response",e),"local"===f.cache&&n&&(x.write.cachedResponse(n,e),x.debug("Saving server response locally",x.cache)),f.onSuccess.call(b,e,p,t)},complete:function(e,t){var n,i;x.was.successful()?(i=e,n=t):i=x.get.responseFromXHR(n=e),x.remove.loading(),f.onComplete.call(b,i,p,n)},fail:function(e,t,n){var i=x.get.responseFromXHR(e),o=x.get.errorFromRequest(i,t,n);if("aborted"==t)return x.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,n),f.onAbort.call(b,t,p,e),!0;"invalid"==t?x.debug("JSON did not pass success test. A server-side error has most likely occurred",i):"error"==t&&e!==M&&(x.debug("XHR produced a server error",t,n),(e.status<200||300<=e.status)&&n!==M&&""!==n&&x.error(c.statusMessage+n,a.url),f.onError.call(b,o,p,e)),f.errorDuration&&"aborted"!==t&&(x.debug("Adding error state"),x.set.error(),x.should.removeError()&&setTimeout(x.remove.error,f.errorDuration)),x.debug("API Request failed",o,e),f.onFailure.call(b,i,p,e)}}},create:{request:function(){return F.Deferred().always(x.event.request.complete).done(x.event.request.done).fail(x.event.request.fail)},mockedXHR:function(){var e=f.mockResponse||f.response,t=f.mockResponseAsync||f.responseAsync,n=F.Deferred().always(x.event.xhr.complete).done(x.event.xhr.done).fail(x.event.xhr.fail);return e?(e=F.isFunction(e)?(x.debug("Using specified synchronous callback",e),e.call(b,i)):(x.debug("Using settings specified response",e),e),n.resolveWith(b,[e,!1,{responseText:e}])):F.isFunction(t)&&(e=function(e){x.debug("Async callback returned response",e),e?n.resolveWith(b,[e,!1,{responseText:e}]):n.rejectWith(b,[{responseText:e},!1,!1])},x.debug("Using specified async response callback",t),t.call(b,i,e)),n},xhr:function(){var e=F.ajax(a).always(x.event.xhr.always).done(x.event.xhr.done).fail(x.event.xhr.fail);return x.verbose("Created server request",e,a),e}},set:{error:function(){x.verbose("Adding error state to element",h),h.addClass(u.error)},loading:function(){x.verbose("Adding loading state to element",h),h.addClass(u.loading),r=(new Date).getTime()}},remove:{error:function(){x.verbose("Removing error state from element",h),h.removeClass(u.error)},loading:function(){x.verbose("Removing loading state from element",h),h.removeClass(u.loading)}},get:{normalizedData:function(){return"string"==typeof f.data?f.data:JSON.stringify(f.data,Object.keys(f.data).sort())},responseFromXHR:function(e){return!!F.isPlainObject(e)&&(x.is.expectingJSON()?x.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,n){return F.isPlainObject(e)&&e.error!==M?e.error:f.error[t]!==M?f.error[t]:n},request:function(){return x.request||!1},xhr:function(){return x.xhr||!1},settings:function(){var e=f.beforeSend.call(p,f);return e&&(e.success!==M&&(x.debug("Legacy success callback detected",e),x.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==M&&(x.debug("Legacy failure callback detected",e),x.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==M&&(x.debug("Legacy complete callback detected",e),x.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===M&&x.error(c.noReturnedValue),!1===e?e:e!==M?F.extend(!0,{},e):F.extend(!0,{},f)},urlEncodedValue:function(e){var t=O.decodeURIComponent(e),n=O.encodeURIComponent(e);return t!==e?(x.debug("URL value is already encoded, avoiding double encoding",e),e):(x.verbose("Encoding value using encodeURIComponent",e,n),n)},defaultData:function(){var e={};return F.isWindow(v)||(x.is.input()?e.value=p.val():x.is.form()||(e.text=p.text())),e},event:function(){return F.isWindow(v)||"now"==f.on?(x.debug("API called without element, no events attached"),!1):"auto"==f.on?p.is("input")?v.oninput!==M?"input":v.onpropertychange!==M?"propertychange":"keyup":p.is("form")?"submit":"click":f.on},templatedURL:function(e){if(e=e||p.data(s.action)||f.action||!1,n=p.data(s.url)||f.url||!1)return x.debug("Using specified url",n),n;if(e){if(x.debug("Looking up url for action",e,f.api),f.api[e]===M&&!x.is.mocked())return void x.error(c.missingAction,f.action,f.api);n=f.api[e]}else x.is.form()&&(n=p.attr("action")||h.attr("action")||!1,x.debug("No url or action specified, defaulting to form action",n));return n}},abort:function(){var e=x.get.xhr();e&&"resolved"!==e.state()&&(x.debug("Cancelling API request"),e.abort())},reset:function(){x.remove.error(),x.remove.loading()},setting:function(e,t){if(x.debug("Changing setting",e,t),F.isPlainObject(e))F.extend(!0,f,e);else{if(t===M)return f[e];F.isPlainObject(f[e])?F.extend(!0,f[e],t):f[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,x,e);else{if(t===M)return x[e];x[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,f.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),x.verbose.apply(console,arguments)))},error:function(){f.silent||(x.error=Function.prototype.bind.call(console.error,console,f.name+":"),x.error.apply(console,arguments))},performance:{log:function(e){var t,n;f.performance&&(n=(t=(new Date).getTime())-(T||t),T=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":n})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var e=f.name+":",n=0;T=!1,clearTimeout(x.performance.timer),F.each(S,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",k&&(e+=" '"+k+"'"),(console.group!==M||console.table!==M)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):F.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(i,e,t){var o,a,n,r=y;return e=e||E,t=v||t,"string"==typeof i&&r!==M&&(i=i.split(/[\. ]/),o=i.length-1,F.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(F.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==M)return a=r[n],!1;{if(!F.isPlainObject(r[t])||e==o)return r[t]!==M?a=r[t]:x.error(c.method,i),!1;r=r[t]}}})),F.isFunction(a)?n=a.apply(t,e):a!==M&&(n=a),Array.isArray(w)?w.push(n):w!==M?w=[w,n]:n!==M&&(w=n),a}};A?(y===M&&x.initialize(),x.invoke(D)):(y!==M&&y.invoke("destroy"),x.initialize())}),w!==M?w:this},F.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!0,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",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g,validate:/^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_-]+$/i},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(w,k,T,S){"use strict";w.isFunction=w.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},k=void 0!==k&&k.Math==Math?k:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),w.fn.state=function(m){var p,g=w(this),h=g.selector||"",v=(new Date).getTime(),b=[],y=m,x="string"==typeof y,C=[].slice.call(arguments,1);return g.each(function(){var o=w.isPlainObject(m)?w.extend(!0,{},w.fn.state.settings,m):w.extend({},w.fn.state.settings),s=o.error,n=o.metadata,t=o.className,e=o.namespace,i=o.states,a=o.text,r="."+e,l=e+"-module",c=w(this),u=this,d=c.data(l),f={initialize:function(){f.verbose("Initializing module"),o.automatic&&f.add.defaults(),o.context&&""!==h?([k,T].indexOf(o.context)<0?w(T).find(o.context):w(o.context)).on(h,"mouseenter"+r,f.change.text).on(h,"mouseleave"+r,f.reset.text).on(h,"click"+r,f.toggle.state):c.on("mouseenter"+r,f.change.text).on("mouseleave"+r,f.reset.text).on("click"+r,f.toggle.state),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),d=f,c.data(l,f)},destroy:function(){f.verbose("Destroying previous module",d),c.off(r).removeData(l)},refresh:function(){f.verbose("Refreshing selector cache"),c=w(u)},add:{defaults:function(){var n=m&&w.isPlainObject(m.states)?m.states:{};w.each(o.defaults,function(e,t){f.is[e]!==S&&f.is[e]()&&(f.verbose("Adding default states",e,u),w.extend(o.states,t,n))})}},is:{active:function(){return c.hasClass(t.active)},loading:function(){return c.hasClass(t.loading)},inactive:function(){return!c.hasClass(t.active)},state:function(e){return t[e]!==S&&c.hasClass(t[e])},enabled:function(){return!c.is(o.filter.active)},disabled:function(){return c.is(o.filter.active)},textEnabled:function(){return!c.is(o.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){f.debug("Now allowing state",e),i[e]=!0},disallow:function(e){f.debug("No longer allowing",e),i[e]=!1},allows:function(e){return i[e]||!1},enable:function(){c.removeClass(t.disabled)},disable:function(){c.addClass(t.disabled)},setState:function(e){f.allows(e)&&c.addClass(t[e])},removeState:function(e){f.allows(e)&&c.removeClass(t[e])},toggle:{state:function(){var e;if(f.allows("active")&&f.is.enabled()){if(f.refresh(),w.fn.api!==S)if(e=c.api("get request"),c.api("was cancelled"))f.debug("API Request cancelled by beforesend"),o.activateTest=function(){return!1},o.deactivateTest=function(){return!1};else if(e)return void f.listenTo(e);f.change.state()}}},listenTo:function(e){f.debug("API request detected, waiting for state signal",e),e&&(a.loading&&f.update.text(a.loading),w.when(e).then(function(){"resolved"==e.state()?(f.debug("API request succeeded"),o.activateTest=function(){return!0},o.deactivateTest=function(){return!0}):(f.debug("API request failed"),o.activateTest=function(){return!1},o.deactivateTest=function(){return!1}),f.change.state()}))},change:{state:function(){f.debug("Determining state change direction"),f.is.inactive()?f.activate():f.deactivate(),o.sync&&f.sync(),o.onChange.call(u)},text:function(){f.is.textEnabled()&&(f.is.disabled()?(f.verbose("Changing text to disabled text",a.hover),f.update.text(a.disabled)):f.is.active()?a.hover?(f.verbose("Changing text to hover text",a.hover),f.update.text(a.hover)):a.deactivate&&(f.verbose("Changing text to deactivating text",a.deactivate),f.update.text(a.deactivate)):a.hover?(f.verbose("Changing text to hover text",a.hover),f.update.text(a.hover)):a.activate&&(f.verbose("Changing text to activating text",a.activate),f.update.text(a.activate)))}},activate:function(){o.activateTest.call(u)&&(f.debug("Setting state to active"),c.addClass(t.active),f.update.text(a.active),o.onActivate.call(u))},deactivate:function(){o.deactivateTest.call(u)&&(f.debug("Setting state to inactive"),c.removeClass(t.active),f.update.text(a.inactive),o.onDeactivate.call(u))},sync:function(){f.verbose("Syncing other buttons to current state"),f.is.active()?g.not(c).state("activate"):g.not(c).state("deactivate")},get:{text:function(){return o.selector.text?c.find(o.selector.text).text():c.html()},textFor:function(e){return a[e]||!1}},flash:{text:function(e,t,n){var i=f.get.text();f.debug("Flashing text message",e,t),e=e||o.text.flash,t=t||o.flashDuration,n=n||function(){},f.update.text(e),setTimeout(function(){f.update.text(i),n.call(u)},t)}},reset:{text:function(){var e=a.active||c.data(n.storedText),t=a.inactive||c.data(n.storedText);f.is.textEnabled()&&(f.is.active()&&e?(f.verbose("Resetting active text",e),f.update.text(e)):t&&(f.verbose("Resetting inactive text",e),f.update.text(t)))}},update:{text:function(e){var t=f.get.text();e&&e!==t?(f.debug("Updating text",e),o.selector.text?c.data(n.storedText,e).find(o.selector.text).text(e):c.data(n.storedText,e).html(e)):f.debug("Text is already set, ignoring update",e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),w.isPlainObject(e))w.extend(!0,o,e);else{if(t===S)return o[e];w.isPlainObject(o[e])?w.extend(!0,o[e],t):o[e]=t}},internal:function(e,t){if(w.isPlainObject(e))w.extend(!0,f,e);else{if(t===S)return f[e];f[e]=t}},debug:function(){!o.silent&&o.debug&&(o.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,o.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),f.verbose.apply(console,arguments)))},error:function(){o.silent||(f.error=Function.prototype.bind.call(console.error,console,o.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,n;o.performance&&(n=(t=(new Date).getTime())-(v||t),v=t,b.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=o.name+":",n=0;v=!1,clearTimeout(f.performance.timer),w.each(b,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",h&&(e+=" '"+h+"'"),(console.group!==S||console.table!==S)&&0<b.length&&(console.groupCollapsed(e),console.table?console.table(b):w.each(b,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),b=[]}},invoke:function(i,e,t){var o,a,n,r=d;return e=e||C,t=u||t,"string"==typeof i&&r!==S&&(i=i.split(/[\. ]/),o=i.length-1,w.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(w.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==S)return a=r[n],!1;{if(!w.isPlainObject(r[t])||e==o)return r[t]!==S?a=r[t]:f.error(s.method,i),!1;r=r[t]}}})),w.isFunction(a)?n=a.apply(t,e):a!==S&&(n=a),Array.isArray(p)?p.push(n):p!==S?p=[p,n]:n!==S&&(p=n),a}};x?(d===S&&f.initialize(),f.invoke(y)):(d!==S&&d.invoke("destroy"),f.initialize())}),p!==S?p:this},w.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,F,O,P){"use strict";E.isFunction=E.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},F=void 0!==F&&F.Math==Math?F:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),E.fn.visibility=function(b){var y,e=E(this),x=e.selector||"",C=(new Date).getTime(),w=[],k=b,T="string"==typeof k,S=[].slice.call(arguments,1),D=e.length,A=0;return e.each(function(){var e,t,n,o=E.isPlainObject(b)?E.extend(!0,{},E.fn.visibility.settings,b):E.extend({},E.fn.visibility.settings),i=o.className,a=o.namespace,s=o.error,r=o.metadata,l="."+a,c="module-"+a,u=E(F),d=E(this),f=[F,O].indexOf(o.context)<0?E(O).find(o.context):E(o.context),m=d.data(c),p=F.requestAnimationFrame||F.mozRequestAnimationFrame||F.webkitRequestAnimationFrame||F.msRequestAnimationFrame||function(e){setTimeout(e,0)},g=this,h=!1,v={initialize:function(){v.debug("Initializing",o),v.setup.cache(),v.should.trackChanges()&&("image"==o.type&&v.setup.image(),"fixed"==o.type&&v.setup.fixed(),o.observeChanges&&v.observeChanges(),v.bind.events()),v.save.position(),v.is.visible()||v.error(s.visible,d),o.initialCheck&&v.checkVisibility(),v.instantiate()},instantiate:function(){v.debug("Storing instance",v),d.data(c,v),m=v},destroy:function(){v.verbose("Destroying previous module"),n&&n.disconnect(),t&&t.disconnect(),u.off("load"+l,v.event.load).off("resize"+l,v.event.resize),f.off("scroll"+l,v.event.scroll).off("scrollchange"+l,v.event.scrollchange),"fixed"==o.type&&(v.resetFixed(),v.remove.placeholder()),d.off(l).removeData(c)},observeChanges:function(){"MutationObserver"in F&&(t=new MutationObserver(v.event.contextChanged),n=new MutationObserver(v.event.changed),t.observe(O,{childList:!0,subtree:!0}),n.observe(g,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",n))},bind:{events:function(){v.verbose("Binding visibility events to scroll and resize"),o.refreshOnLoad&&u.on("load"+l,v.event.load),u.on("resize"+l,v.event.resize),f.off("scroll"+l).on("scroll"+l,v.event.scroll).on("scrollchange"+l,v.event.scrollchange)}},event:{changed:function(e){v.verbose("DOM tree modified, updating visibility calculations"),v.timer=setTimeout(function(){v.verbose("DOM tree modified, updating sticky menu"),v.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==g||0<E(e).find(g).length)&&(v.debug("Element removed from DOM, tearing down events"),v.destroy())})})},resize:function(){v.debug("Window resized"),o.refreshOnResize&&p(v.refresh)},load:function(){v.debug("Page finished loading"),p(v.refresh)},scroll:function(){o.throttle?(clearTimeout(v.timer),v.timer=setTimeout(function(){f.triggerHandler("scrollchange"+l,[f.scrollTop()])},o.throttle)):p(function(){f.triggerHandler("scrollchange"+l,[f.scrollTop()])})},scrollchange:function(e,t){v.checkVisibility(t)}},precache:function(e,t){for(var n=(e=e instanceof Array?e:[e]).length,i=0,o=[],a=O.createElement("img"),r=function(){++i>=e.length&&E.isFunction(t)&&t()};n--;)(a=O.createElement("img")).onload=r,a.onerror=r,a.src=e[n],o.push(a)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),h=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),h=!0},should:{trackChanges:function(){return T?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=d.data(r.src);e&&(v.verbose("Lazy loading image",e),o.once=!0,o.observeChanges=!1,o.onOnScreen=function(){v.debug("Image on screen",g),v.precache(e,function(){v.set.image(e,function(){++A==D&&o.onAllLoaded.call(this),o.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),o.once=!1,o.observeChanges=!1,o.initialCheck=!0,o.refreshOnLoad=!0,b.transition||(o.transition=!1),v.create.placeholder(),v.debug("Added placeholder",e),o.onTopPassed=function(){v.debug("Element passed, adding fixed position",d),v.show.placeholder(),v.set.fixed(),o.transition&&E.fn.transition!==P&&d.transition(o.transition,o.duration)},o.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",d),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),e=d.clone(!1).css("display","none").addClass(i.placeholder).insertAfter(d)}},show:{placeholder:function(){v.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),d.addClass(i.fixed).css({position:"fixed",top:o.offset+"px",left:"auto",zIndex:o.zIndex}),o.onFixed.call(g)},image:function(e,t){d.attr("src",e),o.transition?E.fn.transition!==P?d.hasClass(i.visible)?v.debug("Transition already occurred on this image, skipping animation"):d.transition(o.transition,o.duration,t):d.fadeIn(o.duration,t):d.show()}},is:{onScreen:function(){return v.get.elementCalculations().onScreen},offScreen:function(){return v.get.elementCalculations().offScreen},visible:function(){return!(!v.cache||!v.cache.element)&&!(0===v.cache.element.width&&0===v.cache.element.offset.top)},verticallyScrollableContext:function(){var e=f.get(0)!==F&&f.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=f.get(0)!==F&&f.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==o.type&&v.resetFixed(),v.reset(),v.save.position(),o.checkOnRefresh&&v.checkVisibility(),o.onRefresh.call(g)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),E.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!h&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),o.onUpdate&&o.onUpdate.call(g,v.get.elementCalculations()))},passed:function(e,t){var n=v.get.elementCalculations();if(e&&t)o.onPassed[e]=t;else{if(e!==P)return v.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&E.each(o.onPassed,function(e,t){n.bottomVisible||n.pixelsPassed>v.get.pixelsPassed(e)?v.execute(t,e):o.once||v.remove.occurred(t)})}},onScreen:function(e){var t=v.get.elementCalculations(),n=e||o.onOnScreen;if(e&&(v.debug("Adding callback for onScreen",e),o.onOnScreen=e),t.onScreen?v.execute(n,"onScreen"):o.once||v.remove.occurred("onScreen"),e!==P)return t.onOnScreen},offScreen:function(e){var t=v.get.elementCalculations(),n=e||o.onOffScreen;if(e&&(v.debug("Adding callback for offScreen",e),o.onOffScreen=e),t.offScreen?v.execute(n,"offScreen"):o.once||v.remove.occurred("offScreen"),e!==P)return t.onOffScreen},passing:function(e){var t=v.get.elementCalculations(),n=e||o.onPassing;if(e&&(v.debug("Adding callback for passing",e),o.onPassing=e),t.passing?v.execute(n,"passing"):o.once||v.remove.occurred("passing"),e!==P)return t.passing},topVisible:function(e){var t=v.get.elementCalculations(),n=e||o.onTopVisible,i="topVisible";if(e&&(v.debug("Adding callback for top visible",e),o.onTopVisible=e),t.topVisible?v.execute(n,i):o.once||v.remove.occurred(i),e===P)return t.topVisible},bottomVisible:function(e){var t=v.get.elementCalculations(),n=e||o.onBottomVisible,i="bottomVisible";if(e&&(v.debug("Adding callback for bottom visible",e),o.onBottomVisible=e),t.bottomVisible?v.execute(n,i):o.once||v.remove.occurred(i),e===P)return t.bottomVisible},topPassed:function(e){var t=v.get.elementCalculations(),n=e||o.onTopPassed;if(e&&(v.debug("Adding callback for top passed",e),o.onTopPassed=e),t.topPassed?v.execute(n,"topPassed"):o.once||v.remove.occurred("topPassed"),e===P)return t.topPassed},bottomPassed:function(e){var t=v.get.elementCalculations(),n=e||o.onBottomPassed,i="bottomPassed";if(e&&(v.debug("Adding callback for bottom passed",e),o.onBottomPassed=e),t.bottomPassed?v.execute(n,i):o.once||v.remove.occurred(i),e===P)return t.bottomPassed},passingReverse:function(e){var t=v.get.elementCalculations(),n=e||o.onPassingReverse,i="passingReverse";if(e&&(v.debug("Adding callback for passing reverse",e),o.onPassingReverse=e),t.passing?o.once||v.remove.occurred(i):v.get.occurred("passing")&&v.execute(n,i),e!==P)return!t.passing},topVisibleReverse:function(e){var t=v.get.elementCalculations(),n=e||o.onTopVisibleReverse,i="topVisibleReverse";if(e&&(v.debug("Adding callback for top visible reverse",e),o.onTopVisibleReverse=e),t.topVisible?o.once||v.remove.occurred(i):v.get.occurred("topVisible")&&v.execute(n,i),e===P)return!t.topVisible},bottomVisibleReverse:function(e){var t=v.get.elementCalculations(),n=e||o.onBottomVisibleReverse,i="bottomVisibleReverse";if(e&&(v.debug("Adding callback for bottom visible reverse",e),o.onBottomVisibleReverse=e),t.bottomVisible?o.once||v.remove.occurred(i):v.get.occurred("bottomVisible")&&v.execute(n,i),e===P)return!t.bottomVisible},topPassedReverse:function(e){var t=v.get.elementCalculations(),n=e||o.onTopPassedReverse,i="topPassedReverse";if(e&&(v.debug("Adding callback for top passed reverse",e),o.onTopPassedReverse=e),t.topPassed?o.once||v.remove.occurred(i):v.get.occurred("topPassed")&&v.execute(n,i),e===P)return!t.onTopPassed},bottomPassedReverse:function(e){var t=v.get.elementCalculations(),n=e||o.onBottomPassedReverse,i="bottomPassedReverse";if(e&&(v.debug("Adding callback for bottom passed reverse",e),o.onBottomPassedReverse=e),t.bottomPassed?o.once||v.remove.occurred(i):v.get.occurred("bottomPassed")&&v.execute(n,i),e===P)return!t.bottomPassed},execute:function(e,t){var n=v.get.elementCalculations(),i=v.get.screenCalculations();(e=e||!1)&&(o.continuous?(v.debug("Callback being called continuously",t,n),e.call(g,n,i)):v.get.occurred(t)||(v.debug("Conditions met",t,n),e.call(g,n,i))),v.save.occurred(t)},remove:{fixed:function(){v.debug("Removing fixed position"),d.removeClass(i.fixed).css({position:"",top:"",left:"",zIndex:""}),o.onUnfixed.call(g)},placeholder:function(){v.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){var t;e?(t=v.cache.occurred)[e]!==P&&!0===t[e]&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1):v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){!e||v.cache.occurred[e]!==P&&!0===v.cache.occurred[e]||(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0)},scroll:function(e){e=e+o.offset||f.scrollTop()+o.offset,v.cache.scroll=e},direction:function(){var e=v.get.scroll(),t=v.get.lastScroll(),e=t<e&&t?"down":e<t&&t?"up":"static";return v.cache.direction=e,v.cache.direction},elementPosition:function(){var e=v.cache.element,t=v.get.screenSize();return v.verbose("Saving element position"),e.fits=e.height<t.height,e.offset=d.offset(),e.width=d.outerWidth(),e.height=d.outerHeight(),v.is.verticallyScrollableContext()&&(e.offset.top+=f.scrollTop()-f.offset().top),v.is.horizontallyScrollableContext()&&(e.offset.left+=f.scrollLeft()-f.offset().left),v.cache.element=e},elementCalculations:function(){var e=v.get.screenCalculations(),t=v.get.elementPosition();return o.includeMargin?(t.margin={},t.margin.top=parseInt(d.css("margin-top"),10),t.margin.bottom=parseInt(d.css("margin-bottom"),10),t.top=t.offset.top-t.margin.top,t.bottom=t.offset.top+t.height+t.margin.bottom):(t.top=t.offset.top,t.bottom=t.offset.top+t.height),t.topPassed=e.top>=t.top,t.bottomPassed=e.top>=t.bottom,t.topVisible=e.bottom>=t.top&&!t.topPassed,t.bottomVisible=e.bottom>=t.bottom&&!t.bottomPassed,t.pixelsPassed=0,t.percentagePassed=0,t.onScreen=(t.topVisible||t.passing)&&!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),v.cache.element=t,v.verbose("Updated element calculations",t),t},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:f.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var t=v.get.elementCalculations();return-1<e.search("%")?t.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return v.cache.occurred!==P&&v.cache.occurred[e]||!1},direction:function(){return v.cache.direction===P&&v.save.direction(),v.cache.direction},elementPosition:function(){return v.cache.element===P&&v.save.elementPosition(),v.cache.element},elementCalculations:function(){return v.cache.element===P&&v.save.elementCalculations(),v.cache.element},screenCalculations:function(){return v.cache.screen===P&&v.save.screenCalculations(),v.cache.screen},screenSize:function(){return v.cache.screen===P&&v.save.screenSize(),v.cache.screen},scroll:function(){return v.cache.scroll===P&&v.save.scroll(),v.cache.scroll},lastScroll:function(){return v.cache.screen===P?(v.debug("First scroll event, no last scroll could be found"),!1):v.cache.screen.top}},setting:function(e,t){if(E.isPlainObject(e))E.extend(!0,o,e);else{if(t===P)return o[e];o[e]=t}},internal:function(e,t){if(E.isPlainObject(e))E.extend(!0,v,e);else{if(t===P)return v[e];v[e]=t}},debug:function(){!o.silent&&o.debug&&(o.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,o.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!o.silent&&o.verbose&&o.debug&&(o.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),v.verbose.apply(console,arguments)))},error:function(){o.silent||(v.error=Function.prototype.bind.call(console.error,console,o.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var t,n;o.performance&&(n=(t=(new Date).getTime())-(C||t),C=t,w.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:g,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var e=o.name+":",n=0;C=!1,clearTimeout(v.performance.timer),E.each(w,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",x&&(e+=" '"+x+"'"),(console.group!==P||console.table!==P)&&0<w.length&&(console.groupCollapsed(e),console.table?console.table(w):E.each(w,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),w=[]}},invoke:function(i,e,t){var o,a,n,r=m;return e=e||S,t=g||t,"string"==typeof i&&r!==P&&(i=i.split(/[\. ]/),o=i.length-1,E.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(E.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==P)return a=r[n],!1;{if(!E.isPlainObject(r[t])||e==o)return r[t]!==P?a=r[t]:v.error(s.method,i),!1;r=r[t]}}})),E.isFunction(a)?n=a.apply(t,e):a!==P&&(n=a),Array.isArray(y)?y.push(n):y!==P?y=[y,n]:n!==P&&(y=n),a}};T?(m===P&&v.initialize(),m.save.scroll(),m.save.calculations(),v.invoke(k)):(m!==P&&m.invoke("destroy"),v.initialize())}),y!==P?y:this},E.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:F,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"constraint",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document); |