You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
173 KiB

/** # Semantic UI
* Version: 0.16.1
* http://github.com/jlukic/semantic-ui
*
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Release Date: 09/05/2014
*/
!function(a,b,c,d){a.api=a.fn.api=function(c){var e,f=a(a.isFunction(this)?b:this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return f.each(function(){var b,f,m,n,o,p=a.extend(!0,{},a.fn.api.settings,c),q=p.namespace,r=(p.metadata,p.selector),s=p.error,t=p.className,u="."+q,v="module-"+q,w=a(this),x=w.closest(r.form),y=p.stateContext?a(p.stateContext):w,z=this,A=w.data(v);o={initialize:function(){var a=o.get.event();k||(a?(o.debug("Attaching API events to element",a),w.on(a+u,o.event.trigger)):o.query()),o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o),A=o,w.data(v,A)},destroy:function(){o.verbose("Destroying previous module for",z),w.removeData(v).off(u)},query:function(){if(o.is.disabled())return void o.debug("Element is disabled API request aborted");if(o.is.loading()&&!p.allowMultiple)return void o.debug("Request cancelled previous request is still pending");if(p.defaultData&&a.extend(!0,p.urlData,o.get.defaultData()),(p.serializeForm!==!1||w.is("form"))&&("json"==p.serializeForm?a.extend(!0,p.data,o.get.formData()):p.data=o.get.formData()),f=o.get.settings(),f===!1)return void o.error(s.beforeSend);if(p.url?(o.debug("Using specified url",m),m=o.add.urlData(p.url)):(m=o.add.urlData(o.get.templateURL()),o.debug("API url resolved to",m)),!m){if(!w.is("form"))return void o.error(s.missingURL);o.debug("No url or action specified, defaulting to form action"),m=w.attr("action")}o.set.loading(),b=a.extend(!0,{},p,{type:p.method||p.type,data:n,url:m,beforeSend:p.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),o.verbose("Creating AJAX request with settings",b),o.request=o.create.request(),o.xhr=o.create.xhr()},is:{disabled:function(){return w.filter(p.filter).size()>0},loading:function(){return o.request&&"pending"==o.request.state()}},was:{succesful:function(){return o.request&&"resolved"==o.request.state()},failure:function(){return o.request&&"rejected"==o.request.state()},complete:function(){return o.request&&("resolved"==o.request.state()||"rejected"==o.request.state())}},add:{urlData:function(b,c){var e,f;return b&&(e=b.match(p.regExp.required),f=b.match(p.regExp.optional),c=c||p.urlData,e&&(o.debug("Looking for required URL variables",e),a.each(e,function(e,f){var g=-1!==f.indexOf("$")?f.substr(2,f.length-3):f.substr(1,f.length-2),h=a.isPlainObject(c)&&c[g]!==d?c[g]:w.data(g)!==d?w.data(g):y.data(g)!==d?y.data(g):c[g];return h===d?(o.error(s.requiredParameter,g,b),b=!1,!1):(o.verbose("Found required variable",g,h),void(b=b.replace(f,h)))})),f&&(o.debug("Looking for optional URL variables",e),a.each(f,function(e,f){var g=-1!==f.indexOf("$")?f.substr(3,f.length-4):f.substr(2,f.length-3),h=a.isPlainObject(c)&&c[g]!==d?c[g]:w.data(g)!==d?w.data(g):y.data(g)!==d?y.data(g):c[g];h!==d?(o.verbose("Optional variable Found",g,h),b=b.replace(f,h)):(o.verbose("Optional variable not found",g),b=-1!==b.indexOf("/"+f)?b.replace("/"+f,""):b.replace(f,""))}))),b}},event:{trigger:function(a){o.query(),("submit"==a.type||"click"==a.type)&&a.preventDefault()},xhr:{always:function(){},done:function(a){var b=this,c=(new Date).getTime()-h,d=p.loadingDuration-c;d=d>0?d:0,setTimeout(function(){o.request.resolveWith(b,[a])},d)},fail:function(a,b,c){var d=this,e=(new Date).getTime()-h,f=p.loadingDuration-e;f=f>0?f:0,setTimeout(function(){"abort"!==b?o.request.rejectWith(d,[a,b,c]):o.reset()},f)}},request:{complete:function(b){o.remove.loading(),a.proxy(p.onComplete,y)(b,w)},done:function(b){o.debug("API request received",b),"json"==p.dataType&&a.isFunction(p.successTest)?(o.debug("Checking JSON",p.successTest,b),p.onSuccess(b)?a.proxy(p.onSuccess,y)(b,w):(o.debug("JSON test specified by user and response failed",b),a.proxy(p.onFailure,y)(b,w))):a.proxy(p.onSuccess,y)(b,w)},error:function(b,c,e){var f,g=p.error[c]!==d?p.error[c]:e;if(b!==d)if(b.readyState!==d&&4==b.readyState){if(200!=b.status&&e!==d&&""!==e)o.error(s.statusMessage+e);else if("error"==c&&"json"==p.dataType)try{f=a.parseJSON(b.responseText),f&&f.error!==d&&(g=f.error)}catch(h){o.error(s.JSONParse)}o.remove.loading(),o.set.error(),p.errorDuration&&setTimeout(o.remove.error,p.errorDuration),o.debug("API Request error:",g),a.proxy(p.onFailure,y)(g,w)}else a.proxy(p.onAbort,y)(g,w),o.debug("Request Aborted (Most likely caused by page change or CORS Policy)",c,e)}}},create:{request:function(){return a.Deferred().always(o.event.request.complete).done(o.event.request.done).fail(o.event.request.error)},xhr:function(){a.ajax(b).always(o.event.xhr.always).done(o.event.xhr.done).fail(o.event.xhr.fail)}},set:{error:function(){o.verbose("Adding error state to element",y),y.addClass(t.error)},loading:function(){o.verbose("Adding loading state to element",y),y.addClass(t.loading)}},remove:{error:function(){o.verbose("Removing error state from element",y),y.removeClass(t.error)},loading:function(){o.verbose("Removing loading state from element",y),y.removeClass(t.loading)}},get:{request:function(){return o.request||!1},xhr:function(){return o.xhr||!1},settings:function(){var b;return b=a.proxy(p.beforeSend,w)(p),b.success!==d&&(o.debug("Legacy success callback detected",b),o.error(s.legacyParameters),b.onSuccess=b.success),b.failure!==d&&(o.debug("Legacy failure callback detected",b),o.error(s.legacyParameters),b.onFailure=b.failure),b.complete!==d&&(o.debug("Legacy complete callback detected",b),o.error(s.legacyParameters),b.onComplete=b.complete),b},defaultData:function(){var b={};return a.isWindow(z)||(w.is("input")?b.value=w.val():w.is("form")||(b.text=w.text())),b},event:function(){return a.isWindow(z)||"now"==p.on?(o.debug("API called without element, no events attached"),!1):"auto"==p.on?w.is("input")?z.oninput!==d?"input":z.onpropertychange!==d?"propertychange":"keyup":w.is("form")?"submit":"click":p.on},formData:function(){var b;if("json"==p.serializeForm){if(a(this).toJSON===d)return void o.error(s.missingSerialize);b=x.toJSON()}else b=x.serialize();return o.debug("Retrieving form data",b),b},templateURL:function(a){var b;return a=a||w.data(p.metadata.action)||p.action||!1,a&&(o.debug("Looking up url for action",a),p.api[a]!==d?(b=p.api[a],o.debug("Found template url",b)):o.error(s.missingAction,p.action)),b}},reset:function(){o.remove.error(),o.remove.loading()},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,p,b);else{if(c===d)return p[b];p[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,o,b);else{if(c===d)return o[b];o[b]=c}},debug:function(){p.debug&&(p.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,p.name+":"),o.debug.apply(console,arguments)))},verbose:function(){p.verbose&&p.debug&&(p.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,p.name+":"),o.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;p.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,100)},display:function(){var b=p.name+":",c=0;h=(new Date).getTime(),clearTimeout(o.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i;return c=c||l,f=z||f,"string"==typeof b&&A!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(A[e])&&c!=g)A=A[e];else{if(!a.isPlainObject(A[f])||c==g)return A[e]!==d?(h=A[e],!1):A[f]!==d?(h=A[f],!1):(o.error(s.method,b),!1);A=A[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(A===d&&o.initialize(),o.invoke(j)):(A!==d&&o.destroy(),o.initialize())}),e!==d?e:this},a.api.settings={name:"API",namespace:"api",debug:!0,verbose:!0,performance:!0,on:"auto",filter:".disabled, .loading",context:!1,stateContext:!1,action:!1,regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},url:!1,urlData:!1,serializeForm:!1,defaultData:!0,throttle:100,allowMultiple:!1,loadingDuration:0,errorDuration:2e3,method:"get",data:{},dataType:"json",cache:!0,beforeSend:function(a){return a},beforeXHR:function(){},onSuccess:function(){},onComplete:function(){},onFailure:function(){},onAbort:function(){},successText:function(){return!0},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",missingAction:"API action used but no url was defined",missingSerialize:"Serializing a Form requires toJSON to be included",missingURL:"No URL specified for api event",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},className:{loading:"loading",error:"error"},selector:{form:"form"},metadata:{action:"action",request:"request",xhr:"xhr"}},a.api.settings.api={}}(jQuery,window,document),function(a,b,c,d){a.fn.colorize=function(b){var c=a.extend(!0,{},a.fn.colorize.settings,b),e=arguments||!1;return a(this).each(function(b){var f,g,h,i,j,k,l,m,n=a(this),o=a("<canvas />")[0],p=a("<canvas />")[0],q=a("<canvas />")[0],r=new Image,s=c.colors,t=(c.paths,c.namespace),u=c.error,v=n.data("module-"+t);return m={checkPreconditions:function(){return m.debug("Checking pre-conditions"),!a.isPlainObject(s)||a.isEmptyObject(s)?(m.error(u.undefinedColors),!1):!0},async:function(a){c.async?setTimeout(a,0):a()},getMetadata:function(){m.debug("Grabbing metadata"),i=n.data("image")||c.image||d,j=n.data("name")||c.name||b,k=c.width||n.width(),l=c.height||n.height(),(0===k||0===l)&&m.error(u.undefinedSize)},initialize:function(){m.debug("Initializing with colors",s),m.checkPreconditions()&&m.async(function(){m.getMetadata(),m.canvas.create(),m.draw.image(function(){m.draw.colors(),m.canvas.merge()}),n.data("module-"+t,m)})},redraw:function(){m.debug("Redrawing image"),m.async(function(){m.canvas.clear(),m.draw.colors(),m.canvas.merge()})},change:{color:function(a,b){return m.debug("Changing color",a),s[a]===d?(m.error(u.missingColor),!1):(s[a]=b,void m.redraw())}},canvas:{create:function(){m.debug("Creating canvases"),o.width=k,o.height=l,p.width=k,p.height=l,q.width=k,q.height=l,f=o.getContext("2d"),g=p.getContext("2d"),h=q.getContext("2d"),n.append(o),f=n.children("canvas")[0].getContext("2d")},clear:function(){m.debug("Clearing canvas"),h.fillStyle="#FFFFFF",h.fillRect(0,0,k,l)},merge:function(){return a.isFunction(f.blendOnto)?(f.putImageData(g.getImageData(0,0,k,l),0,0),void h.blendOnto(f,"multiply")):void m.error(u.missingPlugin)}},draw:{image:function(a){m.debug("Drawing image"),a=a||function(){},i?(r.src=i,r.onload=function(){g.drawImage(r,0,0),a()}):(m.error(u.noImage),a())},colors:function(){m.debug("Drawing color overlays",s),a.each(s,function(a,b){c.onDraw(h,j,a,b)})}},debug:function(a,b){c.debug&&(b!==d?console.info(c.name+": "+a,b):console.info(c.name+": "+a))},error:function(a){console.warn(c.name+": "+a)},invoke:function(b,e,f){var g;return f=f||Array.prototype.slice.call(arguments,2),"string"==typeof b&&v!==d&&(b=b.split("."),a.each(b,function(b,d){return a.isPlainObject(v[d])?(v=v[d],!0):a.isFunction(v[d])?(g=v[d],!0):(m.error(c.error.method),!1)})),a.isFunction(g)?g.apply(e,f):!1}},v!==d&&e?("invoke"==e[0]&&(e=Array.prototype.slice.call(e,1)),m.invoke(e[0],this,Array.prototype.slice.call(e,1))):void m.initialize()}),this},a.fn.colorize.settings={name:"Image Colorizer",debug:!0,namespace:"colorize",onDraw:function(){},async:!0,colors:{},metadata:{image:"image",name:"name"},error:{noImage:"No tracing image specified",undefinedColors:"No default colors specified.",missingColor:"Attempted to change color that does not exist",missingPlugin:"Blend onto plug-in must be included",undefinedHeight:"The width or height of image canvas could not be automatically determined. Please specify a height."}}}(jQuery,window,document),function(a,b,c,d){a.fn.form=function(b,e){var f,g=a(this),h=a.extend(!0,{},a.fn.form.settings,e),i=a.extend({},a.fn.form.settings.defaults,b),j=h.namespace,k=h.metadata,l=h.selector,m=h.className,n=(h.error,"."+j),o="module-"+j,p=g.selector||"",q=(new Date).getTime(),r=[],s=arguments[0],t="string"==typeof s,u=[].slice.call(arguments,1);return g.each(function(){var b,e=a(this),j=a(this).find(l.field),v=a(this).find(l.group),w=a(this).find(l.message),x=(a(this).find(l.prompt),a(this).find(l.submit)),y=[],z=this,A=e.data(o);b={initialize:function(){b.verbose("Initializing form validation",e,i,h),b.bindEvents(),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),A=b,e.data(o,b)},destroy:function(){b.verbose("Destroying previous module",A),b.removeEvents(),e.removeData(o)},refresh:function(){b.verbose("Refreshing selector cache"),j=e.find(l.field)},submit:function(){b.verbose("Submitting form",e),e.submit()},attachEvents:function(c,d){d=d||"submit",a(c).on("click",function(a){b[d](),a.preventDefault()})},bindEvents:function(){h.keyboardShortcuts&&j.on("keydown"+n,b.event.field.keydown),e.on("submit"+n,b.validate.form),j.on("blur"+n,b.event.field.blur),b.attachEvents(x,"submit"),j.each(function(){var c=a(this).prop("type"),d=b.get.changeEvent(c);a(this).on(d+n,b.event.field.change)})},removeEvents:function(){e.off(n),j.off(n),x.off(n),j.off(n)},event:{field:{keydown:function(c){var d=a(this),e=c.which,f={enter:13,escape:27};e==f.escape&&(b.verbose("Escape key pressed blurring field"),d.blur()),!c.ctrlKey&&e==f.enter&&d.is(l.input)&&d.not(l.checkbox).size()>0&&(b.debug("Enter key pressed, submitting form"),x.addClass(m.down),d.one("keyup"+n,b.event.field.keyup))},keyup:function(){b.verbose("Doing keyboard shortcut form submit"),x.removeClass(m.down),b.submit()},blur:function(){var c=a(this),d=c.closest(v);d.hasClass(m.error)?(b.debug("Revalidating field",c,b.get.validation(c)),b.validate.field(b.get.validation(c))):("blur"==h.on||"change"==h.on)&&b.validate.field(b.get.validation(c))},change:function(){var c=a(this),d=c.closest(v);("change"==h.on||d.hasClass(m.error)&&h.revalidate)&&(clearTimeout(b.timer),b.timer=setTimeout(function(){b.debug("Revalidating field",c,b.get.validation(c)),b.validate.field(b.get.validation(c))},h.delay))}}},get:{changeEvent:function(a){return"checkbox"==a||"radio"==a?"change":c.createElement("input").oninput!==d?"input":c.createElement("input").onpropertychange!==d?"propertychange":"keyup"},field:function(c){return b.verbose("Finding field with identifier",c),j.filter("#"+c).size()>0?j.filter("#"+c):j.filter('[name="'+c+'"]').size()>0?j.filter('[name="'+c+'"]'):j.filter("[data-"+k.validate+'="'+c+'"]').size()>0?j.filter("[data-"+k.validate+'="'+c+'"]'):a("<input/>")},validation:function(c){var d;return a.each(i,function(a,e){b.get.field(e.identifier).get(0)==c.get(0)&&(d=e)}),d||!1}},has:{field:function(a){return b.verbose("Checking for existence of a field with identifier",a),j.filter("#"+a).size()>0?!0:j.filter('[name="'+a+'"]').size()>0?!0:j.filter("[data-"+k.validate+'="'+a+'"]').size()>0?!0:!1}},add:{prompt:function(c,f){var g=b.get.field(c),i=g.closest(v),j=i.find(l.prompt),k=0!==j.size();f="string"==typeof f?[f]:f,b.verbose("Adding field error state",c),i.addClass(m.error),h.inline&&(k||(j=h.templates.prompt(f),j.appendTo(i)),j.html(f[0]),k?b.verbose("Inline errors are disabled, no inline error added",c):h.transition&&a.fn.transition!==d&&e.transition("is supported")?(b.verbose("Displaying error with css transition",h.transition),j.transition(h.transition+" in",h.duration)):(b.verbose("Displaying error with fallback javascript animation"),j.fadeIn(h.duration)))},errors:function(a){b.debug("Adding form error messages",a),w.html(h.templates.error(a))}},remove:{prompt:function(c){var f=b.get.field(c.identifier),g=f.closest(v),i=g.find(l.prompt);g.removeClass(m.error),h.inline&&i.is(":visible")&&(b.verbose("Removing prompt for field",c),h.transition&&a.fn.transition!==d&&e.transition("is supported")?i.transition(h.transition+" out",h.duration,function(){i.remove()}):i.fadeOut(h.duration,function(){i.remove()}))}},set:{success:function(){e.removeClass(m.error).addClass(m.success)},error:function(){e.removeClass(m.success).addClass(m.error)}},validate:{form:function(c){var f=!0;return y=[],a.each(i,function(a,c){b.validate.field(c)||(f=!1)}),f?(b.debug("Form has no validation errors, submitting"),b.set.success(),a.proxy(h.onSuccess,this)(c)):(b.debug("Form has errors"),b.set.error(),h.inline||b.add.errors(y),e.data("moduleApi")!==d&&c.stopImmediatePropagation(),a.proxy(h.onFailure,this)(y))},field:function(c){var e=b.get.field(c.identifier),f=!0,g=[];return c.rules!==d&&a.each(c.rules,function(a,d){b.has.field(c.identifier)&&!b.validate.rule(c,d)&&(b.debug("Field is invalid",c.identifier,d.type),g.push(d.prompt),f=!1)}),f?(b.remove.prompt(c,g),a.proxy(h.onValid,e)(),!0):(y=y.concat(g),b.add.prompt(c.identifier,g),a.proxy(h.onInvalid,e)(g),!1)},rule:function(c,f){var g,i,j=b.get.field(c.identifier),k=f.type,l=a.trim(j.val()+""),m=/\[(.*)\]/i,n=m.exec(k),o=!0;return n!==d&&null!==n?(g=""+n[1],i=k.replace(n[0],""),o=a.proxy(h.rules[i],e)(l,g)):o=a.proxy(h.rules[k],j)(l),o}},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,h,b);else{if(c===d)return h[b];h[b]=c}},internal:function(c,e){if(a.isPlainObject(c))a.extend(!0,b,c);else{if(e===d)return b[c];b[c]=e}},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=q||c,d=c-e,q=c,r.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;q=!1,clearTimeout(b.performance.timer),a.each(r,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",p&&(c+=" '"+p+"'"),g.size()>1&&(c+=" ("+g.size()+")"),(console.group!==d||console.table!==d)&&r.length>0&&(console.groupCollapsed(c),console.table?console.table(r):a.each(r,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(b,c,e){var g,h,i,j=A;return c=c||u,e=z||e,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},t?(A===d&&b.initialize(),b.invoke(s)):(A!==d&&b.destroy(),b.initialize())}),f!==d?f:this},a.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!0,performance:!0,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:150,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},selector:{message:".error.message",field:"input, textarea, select",group:".field",checkbox:'input[type="checkbox"], input[type="radio"]',input:"input",prompt:".prompt",submit:".submit"},className:{error:"error",success:"success",down:"down",label:"ui label prompt"},error:{method:"The method you called is not defined."},templates:{error:function(b){var c='<ul class="list">';return a.each(b,function(a,b){c+="<li>"+b+"</li>"}),c+="</ul>",a(c)},prompt:function(b){return a("<div/>").addClass("ui red pointing prompt label").html(b[0])}},rules:{checked:function(){return a(this).filter(":checked").size()>0},empty:function(a){return!(a===d||""===a)},email:function(a){var b=new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?","i");return b.test(a)},length:function(a,b){return a!==d?a.length>=b:!1},not:function(a,b){return a!=b},contains:function(a,b){return b=b.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),-1!==a.search(b)},is:function(a,b){return a==b},maxLength:function(a,b){return a!==d?a.length<=b:!1},match:function(b,c){var e,f=a(this);return f.find("#"+c).size()>0?e=f.find("#"+c).val():f.find("[name="+c+"]").size()>0?e=f.find("[name="+c+"]").val():f.find('[data-validate="'+c+'"]').size()>0&&(e=f.find('[data-validate="'+c+'"]').val()),e!==d?b.toString()==e.toString():!1},url:function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)}}}}(jQuery,window,document),function(a,b,c,d){a.fn.state=function(b){var e,f=a(this),g=a.extend(!0,{},a.fn.state.settings,b),h=f.selector||"",i=("ontouchstart"in c.documentElement,(new Date).getTime()),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1),n=(g.error,g.metadata),o=g.className,p=g.namespace,q=g.states,r=g.text,s="."+p,t=p+"-module";return f.each(function(){var c,p=a(this),u=this,v=p.data(t);c={initialize:function(){c.verbose("Initializing module"),g.automatic&&c.add.defaults(),g.context&&""!==h?a(g.context).on(h,"mouseenter"+s,c.change.text).on(h,"mouseleave"+s,c.reset.text).on(h,"click"+s,c.toggle.state):p.on("mouseenter"+s,c.change.text).on("mouseleave"+s,c.reset.text).on("click"+s,c.toggle.state),c.instantiate()},instantiate:function(){c.verbose("Storing instance of module",c),v=c,p.data(t,c)},destroy:function(){c.verbose("Destroying previous module",v),p.off(s).removeData(t)},refresh:function(){c.verbose("Refreshing selector cache"),p=a(u)},add:{defaults:function(){var e=b&&a.isPlainObject(b.states)?b.states:{};a.each(g.defaults,function(b,f){c.is[b]!==d&&c.is[b]()&&(c.verbose("Adding default states",b,u),a.extend(g.states,f,e))})}},is:{active:function(){return p.hasClass(o.active)},loading:function(){return p.hasClass(o.loading)},inactive:function(){return!p.hasClass(o.active)},enabled:function(){return!p.is(g.filter.active)},disabled:function(){return p.is(g.filter.active)},textEnabled:function(){return!p.is(g.filter.text)},button:function(){return p.is(".button:not(a, .submit)")},input:function(){return p.is("input")}},allow:function(a){c.debug("Now allowing state",a),q[a]=!0},disallow:function(a){c.debug("No longer allowing",a),q[a]=!1},allows:function(a){return q[a]||!1},enable:function(){p.removeClass(o.disabled)},disable:function(){p.addClass(o.disabled)},setState:function(a){c.allows(a)&&p.addClass(o[a])},removeState:function(a){c.allows(a)&&p.removeClass(o[a])},toggle:{state:function(){var b;if(c.allows("active")&&c.is.enabled()){if(c.refresh(),a.fn.api!==d&&(b=p.api("get request")))return void c.listenTo(b);c.change.state()}}},listenTo:function(b){c.debug("API request detected, waiting for state signal",b),b?(r.loading&&c.update.text(r.loading),a.when(b).then(function(){"resolved"==b.state()?(c.debug("API request succeeded"),g.activateTest=function(){return!0},g.deactivateTest=function(){return!0}):(c.debug("API request failed"),g.activateTest=function(){return!1},g.deactivateTest=function(){return!1}),c.change.state()})):(g.activateTest=function(){return!1},g.deactivateTest=function(){return!1})},change:{state:function(){c.debug("Determining state change direction"),c.is.inactive()?c.activate():c.deactivate(),g.sync&&c.sync(),a.proxy(g.onChange,u)()},text:function(){c.is.textEnabled()&&(c.is.disabled()?(c.verbose("Changing text to disabled text",r.hover),c.update.text(r.disabled)):c.is.active()?r.hover?(c.verbose("Changing text to hover text",r.hover),c.update.text(r.hover)):r.disable&&(c.verbose("Changing text to disable text",r.disable),c.update.text(r.disable)):r.hover?(c.verbose("Changing text to hover text",r.disable),c.update.text(r.hover)):r.enable&&(c.verbose("Changing text to enable text",r.enable),c.update.text(r.enable)))}},activate:function(){a.proxy(g.activateTest,u)()&&(c.debug("Setting state to active"),p.addClass(o.active),c.update.text(r.active)),a.proxy(g.onActivate,u)()},deactivate:function(){a.proxy(g.deactivateTest,u)()&&(c.debug("Setting state to inactive"),p.removeClass(o.active),c.update.text(r.inactive)),a.proxy(g.onDeactivate,u)()},sync:function(){c.verbose("Syncing other buttons to current state"),f.not(p).state(c.is.active()?"activate":"deactivate")},get:{text:function(){return g.selector.text?p.find(g.selector.text).text():p.html()},textFor:function(a){return r[a]||!1}},flash:{text:function(b,d,e){var f=c.get.text();c.debug("Flashing text message",b,d),b=b||g.text.flash,d=d||g.flashDuration,e=e||function(){},c.update.text(b),setTimeout(function(){c.update.text(f),a.proxy(e,u)()},d)}},reset:{text:function(){var a=r.active||p.data(n.storedText),b=r.inactive||p.data(n.storedText);c.is.textEnabled()&&(c.is.active()&&a?(c.verbose("Resetting active text",a),c.update.text(a)):b&&(c.verbose("Resetting inactive text",a),c.update.text(b)))}},update:{text:function(a){var b=c.get.text();a&&a!==b?(c.debug("Updating text",a),g.selector.text?p.data(n.storedText,a).find(g.selector.text).text(a):p.data(n.storedText,a).html(a)):c.debug("Text is already sane, ignoring update",a)}},setting:function(b,e){return c.debug("Changing setting",b,e),e===d?g[b]:void(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=e)},internal:function(b,e){return c.debug("Changing internal",b,e),e===d?c[b]:void(a.isPlainObject(b)?a.extend(!0,c,b):c[b]=e)},debug:function(){g.debug&&(g.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,g.name+":"),c.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),c.verbose.apply(console,arguments)))},error:function(){c.error=Function.prototype.bind.call(console.error,console,g.name+":"),c.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;g.performance&&(b=(new Date).getTime(),e=i||b,d=b-e,i=b,j.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,100)},display:function(){var b=g.name+":",e=0;i=!1,clearTimeout(c.performance.timer),a.each(j,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",h&&(b+=" '"+h+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&j.length>0&&(console.groupCollapsed(b),console.table?console.table(j):a.each(j,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(b,c,f){var g,h,i,j=v;return c=c||m,f=u||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},l?(v===d&&c.initialize(),c.invoke(k)):(v!==d&&c.destroy(),c.initialize())}),e!==d?e:this},a.fn.state.settings={name:"State",debug:!1,verbose:!0,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:3e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",loading:"loading"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0}},states:{disabled:!0,loading:!0,active:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,enable:!1,disable:!1}}}(jQuery,window,document),function(a,b,c,d){a.fn.visibility=function(e){var f,g=a(this),h=g.selector||"",i=(new Date).getTime(),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1);return g.each(function(){var g,n=a.extend(!0,{},a.fn.visibility.settings,e),o=(n.className,n.namespace),p=(n.error,"."+o),q="module-"+o,r=a(b),s=a(this),t=a(n.context),u=(s.offsetParent(),s.selector||"",s.data(q)),v=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},w=this;g={initialize:function(){g.verbose("Initializing visibility",n),g.reset(),g.save.position(),g.bindEvents(),g.instantiate(),"image"==n.type&&g.setup.image(),v(g.checkVisibility)},instantiate:function(){g.verbose("Storing instance of module",g),u=g,s.data(q,g)},destroy:function(){g.verbose("Destroying previous module"),r.off(p),t.off(p),s.off(p).removeData(q)},bindEvents:function(){g.verbose("Binding visibility events to scroll and resize"),r.on("resize"+p,g.event.refresh),t.on("scroll"+p,g.event.scroll)},event:{refresh:function(){v(g.refresh)},scroll:function(){g.verbose("Scroll position changed"),n.throttle?(clearTimeout(g.timer),g.timer=setTimeout(g.checkVisibility,200)):v(g.checkVisibility)}},precache:function(b,d){b instanceof Array||(b=[b]);for(var e=b.length,f=0,g=[],h=c.createElement("img"),i=function(){f++,f>=b.length&&a.isFunction(d)&&d()};e--;)h=c.createElement("img"),h.onload=i,h.onerror=i,h.src=b[e],g.push(h)},setup:{image:function(){var a=s.data("src");a&&(g.verbose("Lazy loading image",a),g.topVisible(function(){g.precache(a,function(){g.set.image(a),n.onTopVisible=!1})}))}},set:{image:function(b){var c=g.cache.screen.bottom+n.offset<g.cache.element.top;s.attr("src",b),c?s.show():a.fn.transition!==d?s.transition(n.transition,n.duration):s.fadeIn(n.duration)}},refresh:function(){g.debug("Refreshing constants (element width/height)"),g.reset(),g.save.position(),g.checkVisibility(),a.proxy(n.onRefresh,w)()},reset:function(){g.verbose("Reseting all cached values"),g.cache={occurred:{},screen:{},element:{}}},checkVisibility:function(){g.verbose("Checking visibility of element",g.cache.element),g.save.scroll(),g.save.direction(),g.save.screenCalculations(),g.save.elementCalculations(),g.passed(),g.passing(),g.topVisible(),g.bottomVisible(),g.topPassed(),g.bottomPassed()},passed:function(b,c){var e=g.get.elementCalculations();if(b!==d&&c!==d)n.onPassed[b]=c;else{if(b!==d)return g.get.pixelsPassed(b)>e.pixelsPassed;e.passing&&a.each(n.onPassed,function(a,b){e.bottomVisible||e.pixelsPassed>g.get.pixelsPassed(a)?g.execute(b,a):n.once||g.remove.occurred(b)})}},passing:function(a){var b=g.get.elementCalculations(),c=a||n.onPassing,e="passing";return a&&(g.debug("Adding callback for passing",a),n.onPassing=a),c&&b.passing?g.execute(c,e):n.once||g.remove.occurred(e),a!==d?b.passing:void 0},topVisible:function(a){var b=g.get.elementCalculations(),c=a||n.onTopVisible,e="topVisible";return a&&(g.debug("Adding callback for top visible",a),n.onTopVisible=a),c&&b.topVisible?g.execute(c,e):n.once||g.remove.occurred(e),a===d?b.topVisible:void 0},bottomVisible:function(a){var b=g.get.elementCalculations(),c=a||n.onBottomVisible,e="bottomVisible";
return a&&(g.debug("Adding callback for bottom visible",a),n.onBottomVisible=a),c&&b.bottomVisible?g.execute(c,e):n.once||g.remove.occurred(e),a===d?b.bottomVisible:void 0},topPassed:function(a){var b=g.get.elementCalculations(),c=a||n.onTopPassed,e="topPassed";return a&&(g.debug("Adding callback for top passed",a),n.onTopPassed=a),c&&b.topPassed?g.execute(c,e):n.once||g.remove.occurred(e),a===d?b.topPassed:void 0},bottomPassed:function(a){var b=g.get.elementCalculations(),c=a||n.onBottomPassed,e="bottomPassed";return a&&(g.debug("Adding callback for bottom passed",a),n.onBottomPassed=a),c&&b.bottomPassed?g.execute(c,e):n.once||g.remove.occurred(e),a===d?b.bottomPassed:void 0},execute:function(b,c){var d=g.get.elementCalculations(),e=g.get.screenCalculations();n.continuous?(g.debug("Callback called continuously on valid",c,d),a.proxy(b,w)(d,e)):g.get.occurred(c)||(g.debug("Callback conditions met",c,d),a.proxy(b,w)(d,e)),g.save.occurred(c)},remove:{occurred:function(a){a?g.cache.occurred[a]=!1:g.cache.occurred={}}},save:{occurred:function(a){a&&(g.cache.occurred[a]=!0)},scroll:function(){g.cache.scroll=t.scrollTop()+n.offset},direction:function(){var a,b=g.get.scroll(),c=g.get.lastScroll();return a=b>c&&c?"down":c>b&&c?"up":"static",g.cache.direction=a,g.cache.direction},elementPosition:function(){var b=g.get.screenSize();return g.verbose("Saving element position"),a.extend(g.cache.element,{margin:{top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)},fits:w.height<b.height,offset:s.offset(),width:s.outerWidth(),height:s.outerHeight()}),g.cache.element},elementCalculations:function(){var b=g.get.screenCalculations(),c=g.get.elementPosition();n.includeMargin?a.extend(g.cache.element,{top:c.offset.top-c.margin.top,bottom:c.offset.top+c.height+c.margin.bottom}):a.extend(g.cache.element,{top:c.offset.top,bottom:c.offset.top+c.height}),a.extend(g.cache.element,{topVisible:b.bottom>c.top,topPassed:b.top>c.top,bottomVisible:b.bottom>c.bottom,bottomPassed:b.top>c.bottom,pixelsPassed:0,percentagePassed:0}),a.extend(g.cache.element,{visible:g.cache.element.topVisible||g.cache.element.bottomVisible,passing:g.cache.element.topPassed&&!g.cache.element.bottomPassed,hidden:!g.cache.element.topVisible&&!g.cache.element.bottomVisible}),g.cache.element.passing&&(g.cache.element.pixelsPassed=b.top-c.top,g.cache.element.percentagePassed=(b.top-c.top)/c.height),g.verbose("Updated element calculations",g.cache.element)},screenCalculations:function(){var b=t.scrollTop();return g.cache.scroll===d&&(g.cache.scroll=t.scrollTop()),g.save.direction(),a.extend(g.cache.screen,{top:b-n.offset,bottom:b-n.offset+g.cache.screen.height}),g.cache.screen},screenSize:function(){g.verbose("Saving window position"),g.cache.screen={height:t.height()}},position:function(){g.save.screenSize(),g.save.elementPosition()}},get:{pixelsPassed:function(a){var b=g.get.elementCalculations();return a.search("%")>-1?b.height*(parseInt(a,10)/100):parseInt(a,10)},occurred:function(a){return g.cache.occurred!==d?g.cache.occurred[a]||!1:!1},direction:function(){return g.cache.direction===d&&g.save.direction(),g.cache.direction},elementPosition:function(){return g.cache.element===d&&g.save.elementPosition(),g.cache.element},elementCalculations:function(){return g.cache.element===d&&g.save.elementCalculations(),g.cache.element},screenCalculations:function(){return g.cache.screen===d&&g.save.screenCalculations(),g.cache.screen},screenSize:function(){return g.cache.screen===d&&g.save.screenSize(),g.cache.screen},scroll:function(){return g.cache.scroll===d&&g.save.scroll(),g.cache.scroll},lastScroll:function(){return g.cache.screen===d?(g.debug("First scroll event, no last scroll could be found"),!1):g.cache.screen.top}},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];n[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,g,b);else{if(c===d)return g[b];g[b]=c}},debug:function(){n.debug&&(n.performance?g.performance.log(arguments):(g.debug=Function.prototype.bind.call(console.info,console,n.name+":"),g.debug.apply(console,arguments)))},verbose:function(){n.verbose&&n.debug&&(n.performance?g.performance.log(arguments):(g.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),g.verbose.apply(console,arguments)))},error:function(){g.error=Function.prototype.bind.call(console.error,console,n.name+":"),g.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;n.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Element:w,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(g.performance.timer),g.performance.timer=setTimeout(g.performance.display,100)},display:function(){var b=n.name+":",c=0;i=!1,clearTimeout(g.performance.timer),a.each(j,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",h&&(b+=" '"+h+"'"),(console.group!==d||console.table!==d)&&j.length>0&&(console.groupCollapsed(b),console.table?console.table(j):a.each(j,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(b,c,e){var g,h,i,j=u;return c=c||m,e=w||e,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},l?(u===d&&g.initialize(),g.invoke(k)):(u!==d&&g.destroy(),g.initialize())}),f!==d?f:this},a.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,offset:0,includeMargin:!1,context:b,throttle:!1,type:!1,transition:"fade in",duration:500,onPassed:{},onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,once:!0,continuous:!1,onRefresh:function(){},onScroll:function(){},watch:!0,watchedProperties:["offsetWidth","offsetHeight","top","left"],error:{method:"The method you called is not defined."}}}(jQuery,window,document),function(a,b,c,d){a.visit=a.fn.visit=function(c){var e,f=a(a.isFunction(this)?b:this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return f.each(function(){var m,n=a.extend(!0,{},a.fn.visit.settings,c),o=n.error,p=n.namespace,q=p+"-module",r=a(this),s=a(),t=this,u=r.data(q);m={initialize:function(){n.count?m.store(n.key.count,n.count):n.id?m.add.id(n.id):n.increment&&"increment"!==k&&m.increment(),m.add.display(r),m.instantiate()},instantiate:function(){m.verbose("Storing instance of visit module",m),u=m,r.data(q,m)},destroy:function(){m.verbose("Destroying instance"),r.removeData(q)},increment:function(a){var b=m.get.count(),c=+b+1;a?m.add.id(a):(c>n.limit&&!n.surpass&&(c=n.limit),m.debug("Incrementing visits",c),m.store(n.key.count,c))},decrement:function(a){var b=m.get.count(),c=+b-1;a?m.remove.id(a):(m.debug("Removing visit"),m.store(n.key.count,c))},get:{count:function(){return+m.retrieve(n.key.count)||0},idCount:function(a){return a=a||m.get.ids(),a.length},ids:function(a){var b=[];return a=a||m.retrieve(n.key.ids),"string"==typeof a&&(b=a.split(n.delimiter)),m.verbose("Found visited ID list",b),b},storageOptions:function(){var a={};return n.expires&&(a.expires=n.expires),n.domain&&(a.domain=n.domain),n.path&&(a.path=n.path),a}},has:{visited:function(b,c){var e=!1;return c=c||m.get.ids(),b!==d&&c&&a.each(c,function(a,c){c==b&&(e=!0)}),e}},set:{count:function(a){m.store(n.key.count,a)},ids:function(a){m.store(n.key.ids,a)}},reset:function(){m.store(n.key.count,0),m.store(n.key.ids,null)},add:{id:function(a){var b=m.retrieve(n.key.ids),c=b===d||""===b?a:b+n.delimiter+a;m.has.visited(a)?m.debug("Unique content already visited, not adding visit",a,b):a===d?m.debug("ID is not defined"):(m.debug("Adding visit to unique content",a),m.store(n.key.ids,c)),m.set.count(m.get.idCount())},display:function(b){var c=a(b);c.size()>0&&!a.isWindow(c[0])&&(m.debug("Updating visit count for element",c),s=s.size()>0?s.add(c):c)}},remove:{id:function(b){var c=m.get.ids(),e=[];b!==d&&c!==d&&(m.debug("Removing visit to unique content",b,c),a.each(c,function(a,c){c!==b&&e.push(c)}),e=e.join(n.delimiter),m.store(n.key.ids,e)),m.set.count(m.get.idCount())}},check:{limit:function(b){b=b||m.get.count(),n.limit&&(b>=n.limit&&(m.debug("Pages viewed exceeded limit, firing callback",b,n.limit),a.proxy(n.onLimit,this)(b)),m.debug("Limit not reached",b,n.limit),a.proxy(n.onChange,this)(b)),m.update.display(b)}},update:{display:function(a){a=a||m.get.count(),s.size()>0&&(m.debug("Updating displayed view count",s),s.html(a))}},store:function(c,e){var f=m.get.storageOptions(e);if("localstorage"==n.storageMethod&&b.localStorage!==d)b.localStorage.setItem(c,e),m.debug("Value stored using local storage",c,e);else{if(a.cookie===d)return void m.error(o.noCookieStorage);a.cookie(c,e,f),m.debug("Value stored using cookie",c,e,f)}c==n.key.count&&m.check.limit(e)},retrieve:function(c){var e;return"localstorage"==n.storageMethod&&b.localStorage!==d?e=b.localStorage.getItem(c):a.cookie!==d?e=a.cookie(c):m.error(o.noCookieStorage),("undefined"==e||"null"==e||e===d||null===e)&&(e=d),e},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];n[b]=c}},internal:function(b,c){return m.debug("Changing internal",b,c),c===d?m[b]:void(a.isPlainObject(b)?a.extend(!0,m,b):m[b]=c)},debug:function(){n.debug&&(n.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,n.name+":"),m.debug.apply(console,arguments)))},verbose:function(){n.verbose&&n.debug&&(n.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,n.name+":"),m.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;n.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:t,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,100)},display:function(){var b=n.name+":",c=0;h=!1,clearTimeout(m.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=u;return c=c||l,f=t||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(u===d&&m.initialize(),m.invoke(j)):(u!==d&&m.destroy(),m.initialize())}),e!==d?e:this},a.fn.visit.settings={name:"Visit",debug:!1,verbose:!0,performance:!0,namespace:"visit",increment:!1,surpass:!1,count:!1,limit:!1,delimiter:"&",storageMethod:"localstorage",key:{count:"visit-count",ids:"visit-ids"},expires:30,domain:!1,path:!1,onLimit:function(){},onChange:function(){},error:{method:"The method you called is not defined",missingPersist:"Using the persist setting requires the inclusion of PersistJS",noCookieStorage:"The default storage cookie requires $.cookie to be included."}}}(jQuery,window,document),function(a,b,c,d){a.site=a.fn.site=function(e){var f,g,h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1),m=a.isPlainObject(e)?a.extend(!0,{},a.site.settings,e):a.extend({},a.site.settings),n=m.namespace,o=m.error,p="module-"+n,q=a(c),r=q,s=this,t=r.data(p);return f={initialize:function(){f.instantiate()},instantiate:function(){f.verbose("Storing instance of site",f),t=f,r.data(p,f)},normalize:function(){f.fix.console(),f.fix.requestAnimationFrame()},fix:{console:function(){f.debug("Normalizing window.console"),(console===d||console.log===d)&&(f.verbose("Console not available, normalizing events"),f.disable.console()),("undefined"==typeof console.group||"undefined"==typeof console.groupEnd||"undefined"==typeof console.groupCollapsed)&&(f.verbose("Console group not available, normalizing events"),b.console.group=function(){},b.console.groupEnd=function(){},b.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(f.verbose("Mark timeline not available, normalizing events"),b.console.markTimeline=function(){})},consoleClear:function(){f.debug("Disabling programmatic console clearing"),b.console.clear=function(){}},requestAnimationFrame:function(){f.debug("Normalizing requestAnimationFrame"),b.requestAnimationFrame===d&&(f.debug("RequestAnimationFrame not available, normailizing event"),b.requestAnimationFrame=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)})}},moduleExists:function(b){return a.fn[b]!==d&&a.fn[b].settings!==d},enabled:{modules:function(b){var c=[];return b=b||m.modules,a.each(b,function(a,b){f.moduleExists(b)&&c.push(b)}),c}},disabled:{modules:function(b){var c=[];return b=b||m.modules,a.each(b,function(a,b){f.moduleExists(b)||c.push(b)}),c}},change:{setting:function(b,c,e,g){e="string"==typeof e?"all"===e?m.modules:[e]:e||m.modules,g=g!==d?g:!0,a.each(e,function(d,e){var h,i=f.moduleExists(e)?a.fn[e].settings.namespace||!1:!0;f.moduleExists(e)&&(f.verbose("Changing default setting",b,c,e),a.fn[e].settings[b]=c,g&&i&&(h=a(":data(module-"+i+")"),h.size()>0&&(f.verbose("Modifying existing settings",h),h[e]("setting",b,c))))})},settings:function(b,c,e){c="string"==typeof c?[c]:c||m.modules,e=e!==d?e:!0,a.each(c,function(c,d){var g;f.moduleExists(d)&&(f.verbose("Changing default setting",b,d),a.extend(!0,a.fn[d].settings,b),e&&n&&(g=a(":data(module-"+n+")"),g.size()>0&&(f.verbose("Modifying existing settings",g),g[d]("setting",b))))})}},enable:{console:function(){f.console(!0)},debug:function(a,b){a=a||m.modules,f.debug("Enabling debug for modules",a),f.change.setting("debug",!0,a,b)},verbose:function(a,b){a=a||m.modules,f.debug("Enabling verbose debug for modules",a),f.change.setting("verbose",!0,a,b)}},disable:{console:function(){f.console(!1)},debug:function(a,b){a=a||m.modules,f.debug("Disabling debug for modules",a),f.change.setting("debug",!1,a,b)},verbose:function(a,b){a=a||m.modules,f.debug("Disabling verbose debug for modules",a),f.change.setting("verbose",!1,a,b)}},console:function(a){if(a){if(t.cache.console===d)return void f.error(o.console);f.debug("Restoring console function"),b.console=t.cache.console}else f.debug("Disabling console function"),t.cache.console=b.console,b.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){f.verbose("Destroying previous site for",r),r.removeData(p)},cache:{},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,m,b);else{if(c===d)return m[b];m[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,f,b);else{if(c===d)return f[b];f[b]=c}},debug:function(){m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;m.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:s,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,100)},display:function(){var b=m.name+":",c=0;h=!1,clearTimeout(f.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,e){var h,i,j,k=t;return c=c||l,e=s||e,"string"==typeof b&&k!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,e){var g=c!=h?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(k[g])&&c!=h)k=k[g];else{if(k[g]!==d)return i=k[g],!1;if(!a.isPlainObject(k[e])||c==h)return k[e]!==d?(i=k[e],!1):(f.error(o.method,b),!1);k=k[e]}})),a.isFunction(i)?j=i.apply(e,c):i!==d&&(j=i),a.isArray(g)?g.push(j):g!==d?g=[g,j]:j!==d&&(g=j),i}},k?(t===d&&f.initialize(),f.invoke(j)):(t!==d&&f.destroy(),f.initialize()),g!==d?g:this},a.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:!0,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","video","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])}})}(jQuery,window,document),function(a,b,c,d){a.fn.accordion=function(c){{var e,f=a(this),g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)}}return f.each(function(){var b,l=a.isPlainObject(c)?a.extend(!0,{},a.fn.accordion.settings,c):a.extend({},a.fn.accordion.settings),m=l.className,n=l.namespace,o=l.selector,p=(l.error,"."+n),q="module-"+n,r=f.selector||"",s=a(this),t=s.find(o.title),u=s.find(o.content),v=this,w=s.data(q);b={initialize:function(){b.debug("Initializing accordion with bound events",s),t.on("click"+p,b.event.click),b.instantiate()},instantiate:function(){w=b,s.data(q,b)},destroy:function(){b.debug("Destroying previous accordion for",s),s.removeData(q),t.off(p)},reset:{display:function(){b.verbose("Removing inline display from element",this),a(this).css("display",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")},opacity:function(){b.verbose("Removing inline opacity from element",this),a(this).css("opacity",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")}},event:{click:function(){a.proxy(b.toggle,this)()}},toggle:function(c){var d=c?t.eq(c):a(this),e=d.next(u),f=e.is(":visible");b.debug("Toggling visibility of content",d),f?l.collapsible?a.proxy(b.close,d)():b.debug("Cannot close accordion content collapsing is disabled"):a.proxy(b.open,d)()},open:function(c){var d=c?t.eq(c):a(this),e=d.next(u),f=e.is(":animated");f||(b.debug("Opening accordion content",d),l.exclusive&&a.proxy(b.closeOthers,d)(),d.addClass(m.active),e.stop().children().stop().animate({opacity:1},l.duration,b.reset.display).end().slideDown(l.duration,l.easing,function(){e.addClass(m.active),a.proxy(b.reset.display,this)(),a.proxy(l.onOpen,e)(),a.proxy(l.onChange,e)()}))},close:function(c){var d=c?t.eq(c):a(this),e=d.next(u);b.debug("Closing accordion content",e),d.removeClass(m.active),e.removeClass(m.active).show().stop().children().stop().animate({opacity:0},l.duration,b.reset.opacity).end().slideUp(l.duration,l.easing,function(){a.proxy(b.reset.display,this)(),a.proxy(l.onClose,e)(),a.proxy(l.onChange,e)()})},closeOthers:function(c){var d=c?t.eq(c):a(this),e=d.parents(o.content).prev(o.title),f=d.closest(o.accordion),g=f.find(o.title+"."+m.active+":visible").not(e),h=g.next(u),i=g.size()>0;i&&(b.debug("Exclusive enabled, closing other content",g),g.removeClass(m.active),h.stop().children().stop().animate({opacity:0},l.duration,b.resetOpacity).end().slideUp(l.duration,l.easing,function(){a(this).removeClass(m.active),a.proxy(b.reset.display,this)()}))},setting:function(c,e){if(b.debug("Changing setting",c,e),a.isPlainObject(c))a.extend(!0,l,c);else{if(e===d)return l[c];l[c]=e}},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:void(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e)},debug:function(){l.debug&&(l.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,l.name+":"),b.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,l.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;l.performance&&(c=(new Date).getTime(),e=g||c,d=c-e,g=c,h.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=l.name+":",e=0;g=!1,clearTimeout(b.performance.timer),a.each(h,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",r&&(c+=" '"+r+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(c),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,f){var g,h,i,j=w;return c=c||k,f=v||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},j?(w===d&&b.initialize(),b.invoke(i)):(w!==d&&b.destroy(),b.initialize())}),e!==d?e:this},a.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!1,verbose:!0,performance:!0,exclusive:!0,collapsible:!0,closeNested:!0,duration:500,easing:"easeInOutQuint",onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active"},selector:{accordion:".accordion",title:".title",content:".content"}},a.extend(a.easing,{easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c}})}(jQuery,window,document),function(a,b,c,d){a.fn.chatroom=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return a(this).each(function(){var c,e,l,m,n,o,p,q=a.extend(!0,{},a.fn.chatroom.settings,b),r=q.className,s=q.namespace,t=q.selector,u=q.error,v=a(this),w=v.find(t.expandButton),x=v.find(t.userListButton),y=v.find(t.userList),z=(v.find(t.room),v.find(t.userCount)),A=v.find(t.log),B=(v.find(t.message),v.find(t.messageInput)),C=v.find(t.messageButton),D=v.data("module"),E=this,F="",G={};p={width:{log:A.width(),userList:y.outerWidth()},initialize:function(){return Pusher===d&&p.error(u.pusher),q.key===d||q.channelName===d?(p.error(u.key),!1):q.endpoint.message||q.endpoint.authentication?(o=new Pusher(q.key),Pusher.channel_auth_endpoint=q.endpoint.authentication,c=o.subscribe(q.channelName),c.bind("pusher:subscription_succeeded",p.user.list.create),c.bind("pusher:subscription_error",p.error),c.bind("pusher:member_added",p.user.joined),c.bind("pusher:member_removed",p.user.left),c.bind("update_messages",p.message.receive),a.each(q.customEvents,function(a,b){c.bind(a,b)}),x.on("click."+s,p.event.toggleUserList),w.on("click."+s,p.event.toggleExpand),B.on("keydown."+s,p.event.input.keydown).on("keyup."+s,p.event.input.keyup),C.on("mouseenter."+s,p.event.hover).on("mouseleave."+s,p.event.hover).on("click."+s,p.event.submit),A.animate({scrollTop:A.prop("scrollHeight")},400),void v.data("module",p).addClass(r.loading)):(p.error(u.endpoint),!1)},refresh:function(){x.removeClass(r.active),p.width={log:A.width(),userList:y.outerWidth()},x.hasClass(r.active)&&p.user.list.hide(),v.data("module",p)},user:{updateCount:function(){q.userCount&&(G=v.data("users"),m=0,a.each(G,function(){m++}),z.html(q.templates.userCount(m)))},joined:function(b){G=v.data("users"),"anonymous"!=b.id&&G[b.id]===d&&(G[b.id]=b.info,q.randomColor&&b.info.color===d&&(b.info.color=q.templates.color(b.id)),F=q.templates.userList(b.info),b.info.isAdmin?a(F).prependTo(y):a(F).appendTo(y),q.partingMessages&&(A.append(q.templates.joined(b.info)),p.message.scroll.test()),p.user.updateCount())},left:function(a){G=v.data("users"),a!==d&&"anonymous"!==a.id&&(delete G[a.id],v.data("users",G),y.find("[data-id="+a.id+"]").remove(),q.partingMessages&&(A.append(q.templates.left(a.info)),p.message.scroll.test()),p.user.updateCount())},list:{create:function(b){G={},b.each(function(a){"anonymous"!==a.id&&"undefined"!==a.id&&(q.randomColor&&a.info.color===d&&(a.info.color=q.templates.color(a.id)),F=a.info.isAdmin?q.templates.userList(a.info)+F:F+q.templates.userList(a.info),G[a.id]=a.info)}),v.data("users",G).data("user",G[b.me.id]).removeClass(r.loading),y.html(F),p.user.updateCount(),a.proxy(q.onJoin,y.children())()},show:function(){A.animate({width:p.width.log-p.width.userList},{duration:q.speed,easing:q.easing,complete:p.message.scroll.move})},hide:function(){A.stop().animate({width:p.width.log},{duration:q.speed,easing:q.easing,complete:p.message.scroll.move})}}},message:{scroll:{test:function(){n=A.prop("scrollHeight")-A.height(),Math.abs(A.scrollTop()-n)<q.scrollArea&&p.message.scroll.move()},move:function(){n=A.prop("scrollHeight")-A.height(),A.scrollTop(n)}},send:function(b){p.utils.emptyString(b)||a.api({url:q.endpoint.message,method:"POST",data:{message:{content:b,timestamp:(new Date).getTime()}}})},receive:function(a){l=a.data,G=v.data("users"),e=v.data("user"),G[l.userID]!==d&&(e===d||e.id!=l.userID)&&(l.user=G[l.userID],p.message.display(l))},display:function(b){A.append(q.templates.message(b)),p.message.scroll.test(),a.proxy(q.onMessage,A.children().last())()}},expand:function(){v.addClass(r.expand),a.proxy(q.onExpand,v)(),p.refresh()},contract:function(){v.removeClass(r.expand),a.proxy(q.onContract,v)(),p.refresh()},event:{input:{keydown:function(a){13==a.which&&C.addClass(r.down)},keyup:function(a){13==a.which&&(C.removeClass(r.down),p.event.submit())}},submit:function(){var a=B.val(),b=v.data("user");b===d||p.utils.emptyString(a)||(p.message.send(a),p.message.display({user:b,text:a}),p.message.scroll.move(),B.val(""))},toggleExpand:function(){v.hasClass(r.expand)?(w.removeClass(r.active),p.contract()):(w.addClass(r.active),p.expand())},toggleUserList:function(){A.is(":animated")||(x.hasClass(r.active)?(x.removeClass("active"),p.user.list.hide()):(x.addClass(r.active),p.user.list.show()))}},utils:{emptyString:function(a){return"string"==typeof a?-1==a.search(/\S/):!1}},setting:function(b,c){return c===d?q[b]:void(a.isPlainObject(b)?a.extend(!0,q,b):q[b]=c)},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,p,b);else{if(c===d)return p[b];p[b]=c}},debug:function(){q.debug&&(q.performance?p.performance.log(arguments):(p.debug=Function.prototype.bind.call(console.info,console,q.name+":"),p.debug.apply(console,arguments)))},verbose:function(){q.verbose&&q.debug&&(q.performance?p.performance.log(arguments):(p.verbose=Function.prototype.bind.call(console.info,console,q.name+":"),p.verbose.apply(console,arguments)))},error:function(){p.error=Function.prototype.bind.call(console.error,console,q.name+":"),p.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;q.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:E,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(p.performance.timer),p.performance.timer=setTimeout(p.performance.display,100)},display:function(){var b=q.name+":",c=0;g=!1,clearTimeout(p.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,e){var f,g;return c=c||k,e=E||e,"string"==typeof b&&D!==d&&(b=b.split(/[\. ]/),f=b.length-1,a.each(b,function(c,e){a.isPlainObject(D[e])&&c!=f?D=D[e]:D[e]!==d?g=D[e]:p.error(u.method,b)})),a.isFunction(g)?g.apply(e,c):g||!1}},j?(D===d&&p.initialize(),p.invoke(i)):(D!==d&&p.destroy(),p.initialize())}),c!==d?c:this},a.fn.chatroom.settings={name:"Chat",namespace:"chat",debug:!1,channel:"present-chat",onJoin:function(){},onMessage:function(){},onExpand:function(){},onContract:function(){},customEvents:{},partingMessages:!1,userCount:!0,randomColor:!0,speed:300,easing:"easeOutQuint",scrollArea:9999,endpoint:{message:!1,authentication:!1},error:{method:"The method you called is not defined",endpoint:"Please define a message and authentication endpoint.",key:"You must specify a pusher key and channel.",pusher:"You must include the Pusher library."},className:{expand:"expand",active:"active",hover:"hover",down:"down",loading:"loading"},selector:{userCount:".actions .message",userListButton:".actions .list.button",expandButton:".actions .expand.button",room:".room",userList:".room .list",log:".room .log",message:".room .log .message",author:".room log .message .author",messageInput:".talk input",messageButton:".talk .send.button"},templates:{userCount:function(a){return a+" users in chat"},color:function(){var a=["#000000","#333333","#666666","#999999","#CC9999","#CC6666","#CC3333","#993333","#663333","#CC6633","#CC9966","#CC9933","#999966","#CCCC66","#99CC66","#669933","#669966","#33A3CC","#336633","#33CCCC","#339999","#336666","#336699","#6666CC","#9966CC","#333399","#663366","#996699","#993366","#CC6699"];return a[Math.floor(Math.random()*a.length)]},message:function(a){var b="";return a.user.isAdmin?(a.user.color="#55356A",b+='<div class="admin message">',b+='<span class="quirky ui flag team"></span>'):b+='<div class="message">',b+="<p>",b+=a.user.color!==d?'<span class="author" style="color: '+a.user.color+';">'+a.user.name+"</span>: ":'<span class="author">'+a.user.name+"</span>: ",b+=""+a.text+" </p></div>"},joined:function(a){return typeof a.name!==d?'<div class="status">'+a.name+" has joined the chat.</div>":!1},left:function(a){return typeof a.name!==d?'<div class="status">'+a.name+" has left the chat.</div>":!1},userList:function(a){var b="";return a.isAdmin&&(a.color="#55356A"),b+='<div class="user" data-id="'+a.id+'"> <div class="image"> <img src="'+a.avatarURL+'"> </div>',b+=a.color!==d?' <p><a href="/users/'+a.id+'" target="_blank" style="color: '+a.color+';">'+a.name+"</a></p>":' <p><a href="/users/'+a.id+'" target="_blank">'+a.name+"</a></p>",b+="</div>"}}}}(jQuery,window,document),function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return e.each(function(){var e,l=a.extend(!0,{},a.fn.checkbox.settings,b),m=l.className,n=l.namespace,o=(l.error,"."+n),p="module-"+n,q=a(this),r=a(this).next(l.selector.label).first(),s=a(this).find(l.selector.input),t=q.selector||"",u=q.data(p),v=this;e={initialize:function(){e.verbose("Initializing checkbox",l),l.context&&""!==t?(e.verbose("Adding delegated events"),a(v,l.context).on(t,"click"+o,e.toggle).on(t+" + "+l.selector.label,"click"+o,e.toggle)):(q.on("click"+o,e.toggle).data(p,e),s.on("keydown"+o,e.event.keydown),r.on("click"+o,e.toggle)),e.instantiate()
},instantiate:function(){e.verbose("Storing instance of module",e),u=e,q.data(p,e)},destroy:function(){e.verbose("Destroying previous module"),q.off(o).removeData(p),s.off(o,e.event.keydown),r.off(o)},event:{keydown:function(b){var c=b.which,d={enter:13,escape:27};c==d.escape&&(e.verbose("Escape key pressed blurring field"),q.blur()),b.ctrlKey||c!=d.enter||(e.verbose("Enter key pressed, toggling checkbox"),a.proxy(e.toggle,this)(),b.preventDefault())}},is:{radio:function(){return q.hasClass(m.radio)},checked:function(){return s.prop("checked")!==d&&s.prop("checked")},unchecked:function(){return!e.is.checked()}},can:{uncheck:function(){return"boolean"==typeof l.required?l.required:!e.is.radio()}},check:function(){e.debug("Enabling checkbox",s),s.prop("checked",!0).trigger("change"),a.proxy(l.onChange,s.get())(),a.proxy(l.onChecked,s.get())()},uncheck:function(){e.debug("Disabling checkbox"),s.prop("checked",!1).trigger("change"),a.proxy(l.onChange,s.get())(),a.proxy(l.onUnchecked,s.get())()},toggle:function(){e.verbose("Determining new checkbox state"),e.is.unchecked()?e.check():e.is.checked()&&e.can.uncheck()&&e.uncheck()},setting:function(b,c){if(e.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,l,b);else{if(c===d)return l[b];l[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,e,b);else{if(c===d)return e[b];e[b]=c}},debug:function(){l.debug&&(l.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,l.name+":"),e.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,l.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;l.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=l.name+":",c=0;g=!1,clearTimeout(e.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,e,f){var g,h,i,j=u;return e=e||k,f=v||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):c!==d?c=[c,i]:i!==d&&(c=i),h}},j?(u===d&&e.initialize(),e.invoke(i)):(u!==d&&e.destroy(),e.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onChecked:function(){},onUnchecked:function(){},error:{method:"The method you called is not defined."},selector:{input:"input[type=checkbox], input[type=radio]",label:"label"},className:{radio:"radio"}}}(jQuery,window,document),function(a,b,c,d){a.fn.dimmer=function(b){var e,f=a(this),g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return f.each(function(){var l,m,n,o=a.isPlainObject(b)?a.extend(!0,{},a.fn.dimmer.settings,b):a.extend({},a.fn.dimmer.settings),p=o.selector,q=o.namespace,r=o.className,s=(o.error,"."+q),t="module-"+q,u=f.selector||"",v="ontouchstart"in c.documentElement?"touchstart":"click",w=a(this),x=this,y=w.data(t);n={preinitialize:function(){n.is.dimmer()?(m=w.parent(),l=w):(m=w,l=n.has.dimmer()?m.children(p.dimmer).first():n.create())},initialize:function(){n.debug("Initializing dimmer",o),"hover"==o.on?m.on("mouseenter"+s,n.show).on("mouseleave"+s,n.hide):"click"==o.on&&m.on(v+s,n.toggle),n.is.page()&&(n.debug("Setting as a page dimmer",m),n.set.pageDimmer()),o.closable&&(n.verbose("Adding dimmer close event",l),l.on(v+s,n.event.click)),n.set.dimmable(),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),y=n,w.data(t,y)},destroy:function(){n.verbose("Destroying previous module",l),w.removeData(t),m.off(s),l.off(s)},event:{click:function(b){n.verbose("Determining if event occured on dimmer",b),(0===l.find(b.target).size()||a(b.target).is(p.content))&&(n.hide(),b.stopImmediatePropagation())}},addContent:function(b){var c=a(b);n.debug("Add content to dimmer",c),c.parent()[0]!==l[0]&&c.detach().appendTo(l)},create:function(){return a(o.template.dimmer()).appendTo(m)},animate:{show:function(b){b=a.isFunction(b)?b:function(){},n.set.dimmed(),"hover"!=o.on&&o.useCSS&&a.fn.transition!==d&&l.transition("is supported")?l.transition({animation:o.transition+" in",queue:!0,duration:n.get.duration(),complete:function(){n.set.active(),b()}}):(n.verbose("Showing dimmer animation with javascript"),l.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(n.get.duration(),1,function(){l.removeAttr("style"),n.set.active(),b()}))},hide:function(b){b=a.isFunction(b)?b:function(){},"hover"!=o.on&&o.useCSS&&a.fn.transition!==d&&l.transition("is supported")?(n.verbose("Hiding dimmer with css"),n.remove.dimmed(),l.transition({animation:o.transition+" out",duration:n.get.duration(),queue:!0,complete:function(){n.remove.active(),b()}})):(n.verbose("Hiding dimmer with javascript"),n.remove.dimmed(),l.stop().fadeOut(n.get.duration(),function(){l.removeAttr("style"),n.remove.active(),b()}))}},get:{dimmer:function(){return l},duration:function(){return"object"==typeof o.duration?n.is.active()?o.duration.hide:o.duration.show:o.duration}},has:{dimmer:function(){return w.children(p.dimmer).size()>0}},is:{active:function(){return l.hasClass(r.active)},animating:function(){return l.is(":animated")||l.hasClass(r.transition)},dimmer:function(){return w.is(p.dimmer)},dimmable:function(){return w.is(p.dimmable)},dimmed:function(){return m.hasClass(r.dimmed)},disabled:function(){return m.hasClass(r.disabled)},enabled:function(){return!n.is.disabled()},page:function(){return m.is("body")},pageDimmer:function(){return l.hasClass(r.pageDimmer)}},can:{show:function(){return!l.hasClass(r.disabled)}},set:{active:function(){n.set.dimmed(),l.removeClass(r.transition).addClass(r.active)},dimmable:function(){m.addClass(r.dimmable)},dimmed:function(){m.addClass(r.dimmed)},pageDimmer:function(){l.addClass(r.pageDimmer)},disabled:function(){l.addClass(r.disabled)}},remove:{active:function(){l.removeClass(r.transition).removeClass(r.active)},dimmed:function(){m.removeClass(r.dimmed)},disabled:function(){l.removeClass(r.disabled)}},show:function(b){b=a.isFunction(b)?b:function(){},n.debug("Showing dimmer",l,o),!n.is.active()&&n.is.enabled()?(n.animate.show(b),a.proxy(o.onShow,x)(),a.proxy(o.onChange,x)()):n.debug("Dimmer is already shown or disabled")},hide:function(b){b=a.isFunction(b)?b:function(){},n.is.active()||n.is.animating()?(n.debug("Hiding dimmer",l),n.animate.hide(b),a.proxy(o.onHide,x)(),a.proxy(o.onChange,x)()):n.debug("Dimmer is not visible")},toggle:function(){n.verbose("Toggling dimmer visibility",l),n.is.dimmed()?n.hide():n.show()},setting:function(b,c){if(n.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,o,b);else{if(c===d)return o[b];o[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];n[b]=c}},debug:function(){o.debug&&(o.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,o.name+":"),n.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,o.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;o.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=o.name+":",c=0;g=!1,clearTimeout(n.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",u&&(b+=" '"+u+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,c,f){var g,h,i,j=y;return c=c||k,f=x||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},n.preinitialize(),j?(y===d&&n.initialize(),n.invoke(i)):(y!==d&&n.destroy(),n.initialize())}),e!==d?e:this},a.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",debug:!1,verbose:!0,performance:!0,transition:"fade",useCSS:!0,on:!1,closable:!0,duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},selector:{dimmable:".ui.dimmable",dimmer:".ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return a("<div />").attr("class","ui dimmer")}},className:{active:"active",dimmable:"ui dimmable",dimmed:"dimmed",disabled:"disabled",pageDimmer:"page",hide:"hide",show:"show",transition:"transition"}}}(jQuery,window,document),function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=f.selector||"",i="ontouchstart"in c.documentElement,j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return f.each(function(){var c,o=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.extend({},a.fn.dropdown.settings),p=o.className,q=o.metadata,r=o.namespace,s=o.selector,t=o.error,u="."+r,v="module-"+r,w=a(this),x=w.find(s.item),y=w.find(s.text),z=w.find(s.input),A=w.prev().find(s.text).size()>0?w.prev().find(s.text):w.prev(),B=w.children(s.menu),C=this,D=w.data(v);c={initialize:function(){c.debug("Initializing dropdown",o),c.save.defaults(),c.set.selected(),i&&c.bind.touchEvents(),c.bind.mouseEvents(),c.bind.keyboardEvents(),c.instantiate()},instantiate:function(){c.verbose("Storing instance of dropdown",c),D=c,w.data(v,c)},destroy:function(){c.verbose("Destroying previous dropdown for",w),x.off(u),w.off(u).removeData(v)},bind:{keyboardEvents:function(){c.debug("Binding keyboard events"),w.on("keydown"+u,c.handleKeyboard),w.on("focus"+u,c.show)},touchEvents:function(){c.debug("Touch device detected binding touch events"),w.on("touchstart"+u,c.event.test.toggle),x.on("touchstart"+u,c.event.item.mouseenter).on("touchstart"+u,c.event.item.click)},mouseEvents:function(){c.verbose("Mouse detected binding mouse events"),"click"==o.on?w.on("click"+u,c.event.test.toggle):"hover"==o.on?w.on("mouseenter"+u,c.delay.show).on("mouseleave"+u,c.delay.hide):w.on(o.on+u,c.toggle),x.on("mouseenter"+u,c.event.item.mouseenter).on("mouseleave"+u,c.event.item.mouseleave).on("click"+u,c.event.item.click)},intent:function(){c.verbose("Binding hide intent event to document"),i&&g.on("touchstart"+u,c.event.test.touch).on("touchmove"+u,c.event.test.touch),g.on("click"+u,c.event.test.hide)}},unbind:{intent:function(){c.verbose("Removing hide intent event from document"),i&&g.off("touchstart"+u).off("touchmove"+u),g.off("click"+u)}},handleKeyboard:function(b){var d,e=x.filter("."+p.selected),f=b.which,g={enter:13,escape:27,upArrow:38,downArrow:40},h=p.selected,i=x.index(e),j=e.size()>0,k=x.size();if(f==g.escape&&(c.verbose("Escape key pressed, closing dropdown"),c.hide()),c.is.visible()){if(f==g.enter&&j)return c.verbose("Enter key pressed, choosing selected item"),a.proxy(c.event.item.click,x.filter("."+h))(b),b.preventDefault(),!1;f==g.upArrow?(c.verbose("Up key pressed, changing active item"),d=0>i-1?i:i-1,x.removeClass(h).eq(d).addClass(h),b.preventDefault()):f==g.downArrow&&(c.verbose("Down key pressed, changing active item"),d=i+1>=k?i:i+1,x.removeClass(h).eq(d).addClass(h),b.preventDefault())}else f==g.enter&&c.show()},event:{test:{toggle:function(a){c.determine.intent(a,c.toggle)&&a.preventDefault()},touch:function(a){c.determine.intent(a,function(){"touchstart"==a.type?c.timer=setTimeout(c.hide,o.delay.touch):"touchmove"==a.type&&clearTimeout(c.timer)}),a.stopPropagation()},hide:function(a){c.determine.intent(a,c.hide)}},item:{mouseenter:function(b){var d=a(this).find(s.menu),e=a(this).siblings(s.item).children(s.menu);d.size()>0&&(clearTimeout(c.itemTimer),c.itemTimer=setTimeout(function(){c.animate.hide(!1,e),c.verbose("Showing sub-menu",d),c.animate.show(!1,d)},2*o.delay.show),b.preventDefault())},mouseleave:function(){var b=a(this).find(s.menu);b.size()>0&&(clearTimeout(c.itemTimer),c.itemTimer=setTimeout(function(){c.verbose("Hiding sub-menu",b),c.animate.hide(!1,b)},o.delay.hide))},click:function(b){var e=a(this),f=e.data(q.text)!==d?e.data(q.text):e.text(),g=e.data(q.value)!==d?e.data(q.value):"string"==typeof f?f.toLowerCase():f,h=function(){c.determine.selectAction(f,g),a.proxy(o.onChange,C)(g,f)};0===e.find(s.menu).size()&&("touchstart"==b.type?e.one("click",h):h())}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(b,d){c.verbose("Determining action",o.action),a.isFunction(c.action[o.action])?(c.verbose("Triggering preset action",o.action,b,d),c.action[o.action](b,d)):a.isFunction(o.action)?(c.verbose("Triggering user action",o.action,b,d),o.action(b,d)):c.error(t.action,o.action)},intent:function(b,d){return c.debug("Determining whether event occurred in dropdown",b.target),d=d||function(){},0===a(b.target).closest(B).size()?(c.verbose("Triggering event",d),d(),!0):(c.verbose("Event occurred in dropdown, canceling callback"),!1)}},action:{nothing:function(){},hide:function(){c.hide()},select:function(a,b){b=b!==d?b:a,c.set.selected(b),c.set.value(b),c.hide()},activate:function(a,b){b=b!==d?b:a,c.set.selected(b),c.set.value(b),c.hide()},combo:function(a,b){b=b!==d?b:a,c.set.selected(b),c.set.value(b),c.hide()},auto:function(a,b){b=b!==d?b:a,c.set.selected(b),c.set.value(b),c.hide()},changeText:function(a,b){b=b!==d?b:a,c.set.selected(b),c.hide()},updateForm:function(a,b){b=b!==d?b:a,c.set.selected(b),c.set.value(b),c.hide()}},get:{text:function(){return y.text()},value:function(){return z.size()>0?z.val():w.data(q.value)},item:function(b,e){var f=!1;return b=b!==d?b:c.get.value()!==d?c.get.value():c.get.text(),e=""===b?!0:e||!1,b!==d?x.each(function(){var g=a(this),h=g.data(q.text)!==d?g.data(q.text):g.text(),i=g.data(q.value)!==d?g.data(q.value):"string"==typeof h?h.toLowerCase():h;e?(c.debug("Ambiguous dropdown value using strict type check",b),i===b?f=a(this):f||h!==b||(f=a(this))):i==b?f=a(this):f||h!=b||(f=a(this))}):b=c.get.text(),f||!1}},restore:{defaults:function(){c.restore.defaultText(),c.restore.defaultValue()},defaultText:function(){var a=w.data(q.defaultText);c.debug("Restoring default text",a),c.set.text(a)},defaultValue:function(){var a=w.data(q.defaultValue);a!==d&&(c.debug("Restoring default value",a),c.set.selected(a),c.set.value(a))}},save:{defaults:function(){c.save.defaultText(),c.save.defaultValue()},defaultValue:function(){w.data(q.defaultValue,c.get.value())},defaultText:function(){w.data(q.defaultText,y.text())}},set:{scrollPosition:function(){var a=c.get.item(),b=a.size()>0?a.position().top:!1;b&&(c.debug("Scrolling to active item"),B.scrollTop(b))},text:function(a){"combo"==o.action?(c.debug("Changing combo button text",a,A),A.text(a)):"select"!==o.action&&(c.debug("Changing text",a,y),y.removeClass(p.placeholder),y.text(a))},value:function(a){c.debug("Adding selected value to hidden input",a,z),z.size()>0?z.val(a).trigger("change"):w.data(q.value,a)},active:function(){w.addClass(p.active)},visible:function(){w.addClass(p.visible)},selected:function(a){var b,e=c.get.item(a);e&&(c.debug("Setting selected menu item to",e),b=e.data(q.text)!==d?e.data(q.text):e.text(),x.removeClass(p.active),e.addClass(p.active),c.set.text(b))}},remove:{active:function(){w.removeClass(p.active)},visible:function(){w.removeClass(p.visible)}},is:{selection:function(){return w.hasClass(p.selection)},animated:function(a){return a?a.is(":animated")||a.transition&&a.transition("is animating"):B.is(":animated")||B.transition&&B.transition("is animating")},visible:function(a){return a?a.is(":visible"):B.is(":visible")},hidden:function(a){return a?a.is(":not(:visible)"):B.is(":not(:visible)")}},can:{click:function(){return i||"click"==o.on},show:function(){return!w.hasClass(p.disabled)}},animate:{show:function(b,e){var f=e||B;b=b||function(){},c.is.hidden(f)&&(c.verbose("Doing menu show animation",f),"none"==o.transition?b():a.fn.transition!==d&&w.transition("is supported")?f.transition({animation:o.transition+" in",duration:o.duration,complete:b,queue:!1}):"slide down"==o.transition?f.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},o.duration,"easeOutQuad",c.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(c.event.resetStyle,this)(),b()}):"fade"==o.transition?f.hide().clearQueue().fadeIn(o.duration,function(){a.proxy(c.event.resetStyle,this)(),b()}):c.error(t.transition,o.transition))},hide:function(b,e){var f=e||B;b=b||function(){},c.is.visible(f)&&(c.verbose("Doing menu hide animation",f),a.fn.transition!==d&&w.transition("is supported")?f.transition({animation:o.transition+" out",duration:o.duration,complete:b,queue:!1}):"none"==o.transition?b():"slide down"==o.transition?f.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",c.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(c.event.resetStyle,this)(),b()}):"fade"==o.transition?f.show().clearQueue().fadeOut(150,function(){a.proxy(c.event.resetStyle,this)(),b()}):c.error(t.transition))}},show:function(){c.debug("Checking if dropdown can show"),c.is.hidden()&&(c.hideOthers(),c.set.active(),c.animate.show(function(){c.can.click()&&c.bind.intent(),c.set.visible()}),a.proxy(o.onShow,C)())},hide:function(){!c.is.animated()&&c.is.visible()&&(c.debug("Hiding dropdown"),c.can.click()&&c.unbind.intent(),c.remove.active(),c.animate.hide(c.remove.visible),a.proxy(o.onHide,C)())},delay:{show:function(){c.verbose("Delaying show event to ensure user intent"),clearTimeout(c.timer),c.timer=setTimeout(c.show,o.delay.show)},hide:function(){c.verbose("Delaying hide event to ensure user intent"),clearTimeout(c.timer),c.timer=setTimeout(c.hide,o.delay.hide)}},hideOthers:function(){c.verbose("Finding other dropdowns to hide"),f.not(w).has(s.menu+":visible").dropdown("hide")},toggle:function(){c.verbose("Toggling menu visibility"),c.is.hidden()?c.show():c.hide()},setting:function(b,e){if(c.debug("Changing setting",b,e),a.isPlainObject(b))a.extend(!0,o,b);else{if(e===d)return o[b];o[b]=e}},internal:function(b,e){if(a.isPlainObject(b))a.extend(!0,c,b);else{if(e===d)return c[b];c[b]=e}},debug:function(){o.debug&&(o.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,o.name+":"),c.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),c.verbose.apply(console,arguments)))},error:function(){c.error=Function.prototype.bind.call(console.error,console,o.name+":"),c.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;o.performance&&(b=(new Date).getTime(),e=j||b,d=b-e,j=b,k.push({Element:C,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,100)},display:function(){var b=o.name+":",e=0;j=!1,clearTimeout(c.performance.timer),a.each(k,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",h&&(b+=" '"+h+"'"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,f,g){var h,i,j,k=D;return f=f||n,g=C||g,"string"==typeof b&&k!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(e,f){var g=e!=h?f+b[e+1].charAt(0).toUpperCase()+b[e+1].slice(1):b;if(a.isPlainObject(k[g])&&e!=h)k=k[g];else{if(k[g]!==d)return i=k[g],!1;if(!a.isPlainObject(k[f])||e==h)return k[f]!==d?(i=k[f],!1):(c.error(t.method,b),!1);k=k[f]}})),a.isFunction(i)?j=i.apply(g,f):i!==d&&(j=i),a.isArray(e)?e.push(j):e!==d?e=[e,j]:j!==d&&(e=j),i}},m?(D===d&&c.initialize(),c.invoke(l)):(D!==d&&c.destroy(),c.initialize())}),e!==d?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",debug:!1,verbose:!0,performance:!0,on:"click",action:"activate",delay:{show:200,hide:300,touch:50},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible",selected:"selected",selection:"selection"}},a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}})}(jQuery,window,document),function(a,b,c,d){a.fn.modal=function(e){var f,g=a(this),h=a(b),i=a(c),j=a("body"),k=g.selector||"",l=(new Date).getTime(),m=[],n=arguments[0],o="string"==typeof n,p=[].slice.call(arguments,1),q=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};return g.each(function(){var g,r,s,t,u,v,w=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.extend({},a.fn.modal.settings),x=w.selector,y=w.className,z=w.namespace,A=w.error,B="."+z,C="module-"+z,D=a(this),E=a(w.context),F=D.find(x.close),G=this,H=D.data(C);v={initialize:function(){return v.verbose("Initializing dimmer",E),a.fn.dimmer===d?void v.error(A.dimmer):(t=E.dimmer({closable:!1,useCSS:!0,duration:{show:.9*w.duration,hide:1.1*w.duration}}),w.detachable&&t.dimmer("add content",D),u=t.dimmer("get dimmer"),r=D.siblings(x.modal),g=r.add(D),v.verbose("Attaching close events",F),F.on("click"+B,v.event.close),h.on("resize"+B,v.event.resize),void v.instantiate())},instantiate:function(){v.verbose("Storing instance of modal"),H=v,D.data(C,H)},destroy:function(){v.verbose("Destroying previous modal"),D.removeData(C).off(B),F.off(B),E.dimmer("destroy")},refresh:function(){v.remove.scrolling(),v.cacheSizes(),v.set.screenHeight(),v.set.type(),v.set.position()},attachEvents:function(b,c){var d=a(b);c=a.isFunction(v[c])?v[c]:v.toggle,d.size()>0?(v.debug("Attaching modal events to element",b,c),d.off(B).on("click"+B,c)):v.error(A.notFound)},event:{close:function(){v.verbose("Closing element pressed"),a(this).is(x.approve)?a.proxy(w.onApprove,G)()!==!1?v.hide():v.verbose("Approve callback returned false cancelling hide"):a(this).is(x.deny)?a.proxy(w.onDeny,G)()!==!1?v.hide():v.verbose("Deny callback returned false cancelling hide"):v.hide()},click:function(b){0===a(b.target).closest(x.modal).size()&&(v.debug("Dimmer clicked, hiding all modals"),w.allowMultiple?v.hide():v.hideAll(),b.stopImmediatePropagation())},debounce:function(a,b){clearTimeout(v.timer),v.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(w.closable?(v.debug("Escape key pressed hiding modal"),v.hide()):v.debug("Escape key pressed, but closable is set to false"),a.preventDefault())},resize:function(){t.dimmer("is active")&&q(v.refresh)}},toggle:function(){v.is.active()?v.hide():v.show()},show:function(b){b=a.isFunction(b)?b:function(){},v.showDimmer(),v.showModal(b)},showModal:function(b){b=a.isFunction(b)?b:function(){},v.is.active()?v.debug("Modal is already visible"):(v.cacheSizes(),v.set.position(),v.set.screenHeight(),v.set.type(),r.filter(":visible").size()>0&&!w.allowMultiple?(v.debug("Other modals visible, queueing show animation"),v.hideOthers(v.showModal)):(a.proxy(w.onShow,G)(),w.transition&&a.fn.transition!==d&&D.transition("is supported")?(v.debug("Showing modal with css animations"),D.transition(w.transition+" in",w.duration,function(){a.proxy(w.onVisible,G)(),v.set.active(),b()})):(v.debug("Showing modal with javascript"),D.fadeIn(w.duration,w.easing,function(){a.proxy(w.onVisible,G)(),v.set.active(),b()}))))},showDimmer:function(){t.dimmer("is active")?v.debug("Dimmer already visible"):(v.debug("Showing dimmer"),t.dimmer("show"))},hide:function(b){b=a.isFunction(b)?b:function(){},g.filter(":visible").size()<=1&&v.hideDimmer(),v.hideModal(b)},hideDimmer:function(){return v.is.active()?(v.debug("Hiding dimmer"),w.closable&&u.off("click"+B),void t.dimmer("hide",function(){w.transition&&a.fn.transition!==d&&D.transition("is supported")&&(D.transition("reset"),v.remove.screenHeight()),v.remove.active()})):void v.debug("Dimmer is not visible cannot hide")},hideModal:function(b){return b=a.isFunction(b)?b:function(){},v.is.active()?(v.debug("Hiding modal"),v.remove.keyboardShortcuts(),a.proxy(w.onHide,G)(),void(w.transition&&a.fn.transition!==d&&D.transition("is supported")?D.transition(w.transition+" out",w.duration,function(){a.proxy(w.onHidden,G)(),v.remove.active(),v.restore.focus(),b()}):D.fadeOut(w.duration,w.easing,function(){a.proxy(w.onHidden,G)(),v.remove.active(),v.restore.focus(),b()}))):void v.debug("Cannot hide modal it is not active")},hideAll:function(b){b=a.isFunction(b)?b:function(){},g.is(":visible")&&(v.debug("Hiding all visible modals"),v.hideDimmer(),g.filter(":visible").modal("hide modal",b))},hideOthers:function(b){b=a.isFunction(b)?b:function(){},r.is(":visible")&&(v.debug("Hiding other modals"),r.filter(":visible").modal("hide modal",b))},add:{keyboardShortcuts:function(){v.verbose("Adding keyboard shortcuts"),i.on("keyup"+B,v.event.keyboard)}},save:{focus:function(){s=a(c.activeElement).blur()}},restore:{focus:function(){s&&s.size()>0&&s.focus()}},remove:{active:function(){D.removeClass(y.active)},screenHeight:function(){v.cache.height>v.cache.pageHeight&&(v.debug("Removing page height"),j.css("height",""))},keyboardShortcuts:function(){v.verbose("Removing keyboard shortcuts"),i.off("keyup"+B)},scrolling:function(){t.removeClass(y.scrolling),D.removeClass(y.scrolling)}},cacheSizes:function(){var d=D.outerHeight();0!==d&&(v.cache={pageHeight:a(c).outerHeight(),height:d+w.offset,contextHeight:"body"==w.context?a(b).height():t.height()}),v.debug("Caching modal and container sizes",v.cache)},can:{fit:function(){return v.cache.height<v.cache.contextHeight}},is:{active:function(){return D.hasClass(y.active)},modernBrowser:function(){return!(b.ActiveXObject||"ActiveXObject"in b)}},set:{screenHeight:function(){v.cache.height>v.cache.pageHeight&&(v.debug("Modal is taller than page content, resizing page height"),j.css("height",v.cache.height+w.padding))},active:function(){v.add.keyboardShortcuts(),v.save.focus(),D.addClass(y.active),w.closable&&u.off("click"+B).on("click"+B,v.event.click)},scrolling:function(){t.addClass(y.scrolling),D.addClass(y.scrolling)},type:function(){v.can.fit()?(v.verbose("Modal fits on screen"),v.remove.scrolling()):(v.verbose("Modal cannot fit on screen setting to scrolling"),v.set.scrolling())},position:function(){v.verbose("Centering modal on page",v.cache),D.css(v.can.fit()?{top:"",marginTop:-(v.cache.height/2)}:{marginTop:"",top:i.scrollTop()})}},setting:function(b,c){if(v.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,w,b);else{if(c===d)return w[b];w[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,v,b);else{if(c===d)return v[b];v[b]=c}},debug:function(){w.debug&&(w.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,w.name+":"),v.debug.apply(console,arguments)))},verbose:function(){w.verbose&&w.debug&&(w.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,w.name+":"),v.verbose.apply(console,arguments)))},error:function(){v.error=Function.prototype.bind.call(console.error,console,w.name+":"),v.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;w.performance&&(b=(new Date).getTime(),d=l||b,c=b-d,l=b,m.push({Element:G,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,100)},display:function(){var b=w.name+":",c=0;l=!1,clearTimeout(v.performance.timer),a.each(m,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",k&&(b+=" '"+k+"'"),(console.group!==d||console.table!==d)&&m.length>0&&(console.groupCollapsed(b),console.table?console.table(m):a.each(m,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),m=[]}},invoke:function(b,c,e){var g,h,i,j=H;return c=c||p,e=G||e,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},o?(H===d&&v.initialize(),v.invoke(n)):(H!==d&&v.destroy(),v.initialize())}),f!==d?f:this},a.fn.modal.settings={name:"Modal",namespace:"modal",debug:!1,verbose:!0,performance:!0,allowMultiple:!0,detachable:!0,closable:!0,context:"body",duration:500,easing:"easeOutExpo",offset:0,transition:"scale",padding:30,onShow:function(){},onHide:function(){},onVisible:function(){},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:".close, .actions .button",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",scrolling:"scrolling"}}}(jQuery,window,document),function(a,b,c,d){a.fn.nag=function(c){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return a(this).each(function(){var m,n,o,p,q,r,s,t,u,v=a.extend(!0,{},a.fn.nag.settings,c),w=v.className,x=v.selector,y=v.error,z=v.namespace,A="."+z,B=z+"-module",C=a(this),D=C.find(x.close),E=a(v.context),F=this,G=C.data(B),H=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};u={initialize:function(){u.verbose("Initializing element"),m=C.offset(),n=C.outerHeight(),o=E.outerWidth(),p=E.outerHeight(),q=E.offset(),C.data(B,u),D.on("click"+A,u.dismiss),v.context==b&&"fixed"==v.position&&C.addClass(w.fixed),v.sticky&&(u.verbose("Adding scroll events"),"absolute"==v.position?E.on("scroll"+A,u.event.scroll).on("resize"+A,u.event.scroll):a(b).on("scroll"+A,u.event.scroll).on("resize"+A,u.event.scroll),a.proxy(u.event.scroll,this)()),v.displayTime>0&&setTimeout(u.hide,v.displayTime),u.should.show()?C.is(":visible")||u.show():u.hide()
},destroy:function(){u.verbose("Destroying instance"),C.removeData(B).off(A),v.sticky&&E.off(A)},refresh:function(){u.debug("Refreshing cached calculations"),m=C.offset(),n=C.outerHeight(),o=E.outerWidth(),p=E.outerHeight(),q=E.offset()},show:function(){u.debug("Showing nag",v.animation.show),"fade"==v.animation.show?C.fadeIn(v.duration,v.easing):C.slideDown(v.duration,v.easing)},hide:function(){u.debug("Showing nag",v.animation.hide),"fade"==v.animation.show?C.fadeIn(v.duration,v.easing):C.slideUp(v.duration,v.easing)},onHide:function(){u.debug("Removing nag",v.animation.hide),C.remove(),v.onHide&&v.onHide()},stick:function(){if(u.refresh(),"fixed"==v.position){var c=a(b).prop("pageYOffset")||a(b).scrollTop(),d=C.hasClass(w.bottom)?q.top+(p-n)-c:q.top-c;C.css({position:"fixed",top:d,left:q.left,width:o-v.scrollBarWidth})}else C.css({top:s})},unStick:function(){C.css({top:""})},dismiss:function(a){v.storageMethod&&u.storage.set(v.storedKey,v.storedValue),u.hide(),a.stopImmediatePropagation(),a.preventDefault()},should:{show:function(){return v.persist?(u.debug("Persistent nag is set, can show nag"),!0):u.storage.get(v.storedKey)!=v.storedValue?(u.debug("Stored value is not set, can show nag",u.storage.get(v.storedKey)),!0):(u.debug("Stored value is set, cannot show nag",u.storage.get(v.storedKey)),!1)},stick:function(){return r=E.prop("pageYOffset")||E.scrollTop(),s=C.hasClass(w.bottom)?p-C.outerHeight()+r:r,s>m.top?!0:"fixed"==v.position?!0:!1}},storage:{set:function(c,e){u.debug("Setting stored value",c,e,v.storageMethod),"local"==v.storageMethod&&b.store!==d?b.store.set(c,e):a.cookie!==d?a.cookie(c,e):u.error(y.noStorage)},get:function(c){return u.debug("Getting stored value",c,v.storageMethod),"local"==v.storageMethod&&b.store!==d?b.store.get(c):a.cookie!==d?a.cookie(c):void u.error(y.noStorage)}},event:{scroll:function(){t!==d&&clearTimeout(t),t=setTimeout(function(){u.should.stick()?H(u.stick):u.unStick()},v.lag)}},setting:function(b,c){if(u.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,v,b);else{if(c===d)return v[b];v[b]=c}},internal:function(b,c){return u.debug("Changing internal",b,c),c===d?u[b]:void(a.isPlainObject(b)?a.extend(!0,u,b):u[b]=c)},debug:function(){v.debug&&(v.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,v.name+":"),u.debug.apply(console,arguments)))},verbose:function(){v.verbose&&v.debug&&(v.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,v.name+":"),u.verbose.apply(console,arguments)))},error:function(){u.error=Function.prototype.bind.call(console.error,console,v.name+":"),u.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;v.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:F,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,100)},display:function(){var b=v.name+":",c=0;h=!1,clearTimeout(u.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=G;return c=c||l,f=F||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(G===d&&u.initialize(),u.invoke(j)):(G!==d&&u.destroy(),u.initialize())}),e!==d?e:this},a.fn.nag.settings={name:"Nag",debug:!1,verbose:!0,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!1,lag:0,context:b,error:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".icon.close"},speed:500,easing:"easeOutQuad",onHide:function(){}}}(jQuery,window,document),function(a,b,c,d){a.fn.popup=function(e){var f,g=a(this),h=a(c),i=g.selector||"",j=("ontouchstart"in c.documentElement,(new Date).getTime()),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var c,g,o,p=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.extend({},a.fn.popup.settings),q=p.selector,r=p.className,s=p.error,t=p.metadata,u=p.namespace,v="."+p.namespace,w="module-"+u,x=a(this),y=a(p.context),z=p.target?a(p.target):x,A=a(b),B=a("body"),C=0,D=this,E=x.data(w);o={initialize:function(){o.debug("Initializing module",x),o.refresh(),"click"==p.on?x.on("click"+v,o.toggle):o.get.startEvent()&&x.on(o.get.startEvent()+v,o.event.start).on(o.get.endEvent()+v,o.event.end),p.target&&o.debug("Target set to element",z),A.on("resize"+v,o.event.resize),o.exists()?p.hoverable&&o.bind.popup():o.create(),o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o),E=o,x.data(w,E)},refresh:function(){c=p.popup?a(p.popup):p.inline?z.next(p.selector.popup):!1,g=p.popup?c.offsetParent():p.inline?z.offsetParent():B},destroy:function(){o.debug("Destroying previous module"),c&&c.remove(),x.off(v).removeData(w)},event:{start:function(){var b=a.isPlainObject(p.delay)?p.delay.show:p.delay;clearTimeout(o.hideTimer),o.showTimer=setTimeout(function(){o.is.hidden()&&o.show()},b)},end:function(){var b=a.isPlainObject(p.delay)?p.delay.hide:p.delay;clearTimeout(o.showTimer),o.hideTimer=setTimeout(function(){o.is.visible()&&o.hide()},b)},resize:function(){o.is.visible()&&o.set.position()}},create:function(){var b=x.data(t.html)||p.html,e=x.data(t.variation)||p.variation,f=x.data(t.title)||p.title,g=x.data(t.content)||x.attr("title")||p.content;b||g||f?(o.debug("Creating pop-up html"),b||(b=p.templates.popup({title:f,content:g})),c=a("<div/>").addClass(r.popup).addClass(e).html(b),e&&c.addClass(e),p.inline?(o.verbose("Inserting popup element inline",c),c.insertAfter(x)):(o.verbose("Appending popup element to body",c),c.appendTo(y)),p.hoverable&&o.cache===d&&o.bind.popup(),a.proxy(p.onCreate,c)()):o.error(s.content,D)},toggle:function(){o.debug("Toggling pop-up"),o.is.hidden()?(o.debug("Popup is hidden, showing pop-up"),o.unbind.close(),o.hideAll(),o.show()):(o.debug("Popup is visible, hiding pop-up"),o.hide())},show:function(a){a=a||function(){},o.debug("Showing pop-up",p.transition),p.preserve||p.popup||o.refresh(),o.exists()||o.create(),c&&o.set.position()&&(o.save.conditions(),o.animate.show(a))},hide:function(a){a=a||function(){},x.removeClass(r.visible),o.unbind.close(),o.is.visible()&&(o.restore.conditions(),o.animate.hide(a))},hideAll:function(){a(q.popup).filter(":visible").popup("hide")},hideGracefully:function(b){b&&0===a(b.target).closest(q.popup).size()?(o.debug("Click occurred outside popup hiding popup"),o.hide()):o.debug("Click was inside popup, keeping popup open")},exists:function(){return c?p.inline||p.popup?0!==c.size():c.closest(y).size():!1},remove:function(){o.debug("Removing popup"),c.remove()},save:{conditions:function(){o.cache={title:x.attr("title")},o.cache.title&&x.removeAttr("title"),o.verbose("Saving original attributes",o.cache.title)}},restore:{conditions:function(){return o.cache&&o.cache.title&&(x.attr("title",o.cache.title),o.verbose("Restoring original attributes",o.cache.title)),!0}},animate:{show:function(b){b=b||function(){},x.addClass(r.visible),p.transition&&a.fn.transition!==d&&x.transition("is supported")?c.transition(p.transition+" in",p.duration,function(){o.bind.close(),a.proxy(b,D)()}):c.stop().fadeIn(p.duration,p.easing,function(){o.bind.close(),a.proxy(b,D)()}),a.proxy(p.onShow,D)()},hide:function(b){b=b||function(){},o.debug("Hiding pop-up"),p.transition&&a.fn.transition!==d&&x.transition("is supported")?c.transition(p.transition+" out",p.duration,function(){o.reset(),b()}):c.stop().fadeOut(p.duration,p.easing,function(){o.reset(),b()}),a.proxy(p.onHide,D)()}},get:{startEvent:function(){return"hover"==p.on?"mouseenter":"focus"==p.on?"focus":!1},endEvent:function(){return"hover"==p.on?"mouseleave":"focus"==p.on?"blur":!1},offstagePosition:function(){var d={top:a(b).scrollTop(),bottom:a(b).scrollTop()+a(b).height(),left:0,right:a(b).width()},e={width:c.width(),height:c.outerHeight(),position:c.offset()},f={},g=[];return e.position&&(f={top:e.position.top<d.top,bottom:e.position.top+e.height>d.bottom,right:e.position.left+e.width>d.right,left:e.position.left<d.left}),o.verbose("Checking if outside viewable area",e.position),a.each(f,function(a,b){b&&g.push(a)}),g.length>0?g.join(" "):!1},nextPosition:function(a){switch(a){case"top left":a="bottom left";break;case"bottom left":a="top right";break;case"top right":a="bottom right";break;case"bottom right":a="top center";break;case"top center":a="bottom center";break;case"bottom center":a="right center";break;case"right center":a="left center";break;case"left center":a="top center"}return a}},set:{position:function(e,f){var h,i,j=(a(b).width(),a(b).height(),z.outerWidth()),k=z.outerHeight(),l=c.width(),m=c.outerHeight(),n=g.outerWidth(),q=g.outerHeight(),u=p.distanceAway,v=p.inline||p.popup?z.position():z.offset();switch(e=e||x.data(t.position)||p.position,f=f||x.data(t.offset)||p.offset,(p.inline||p.popup)&&("left center"==e||"right center"==e?(f+=parseInt(b.getComputedStyle(D).getPropertyValue("margin-top"),10),u+=-parseInt(b.getComputedStyle(D).getPropertyValue("margin-left"),10)):(f+=parseInt(b.getComputedStyle(D).getPropertyValue("margin-left"),10),u+=parseInt(b.getComputedStyle(D).getPropertyValue("margin-top"),10))),o.debug("Calculating offset for position",e),e){case"top left":h={top:"auto",bottom:q-v.top+u,left:v.left+f,right:"auto"};break;case"top center":h={bottom:q-v.top+u,left:v.left+j/2-l/2+f,top:"auto",right:"auto"};break;case"top right":h={bottom:q-v.top+u,right:n-v.left-j-f,top:"auto",left:"auto"};break;case"left center":h={top:v.top+k/2-m/2+f,right:n-v.left+u,left:"auto",bottom:"auto"};break;case"right center":h={top:v.top+k/2-m/2+f,left:v.left+j+u,bottom:"auto",right:"auto"};break;case"bottom left":h={top:v.top+k+u,left:v.left+f,bottom:"auto",right:"auto"};break;case"bottom center":h={top:v.top+k+u,left:v.left+j/2-l/2+f,bottom:"auto",right:"auto"};break;case"bottom right":h={top:v.top+k+u,right:n-v.left-j-f,left:"auto",bottom:"auto"}}return h===d&&o.error(s.invalidPosition),c.css(h).removeClass(r.position).addClass(e).addClass(r.loading),i=o.get.offstagePosition(),i?(o.debug("Element is outside boundaries",i),C<p.maxSearchDepth?(e=o.get.nextPosition(e),C++,o.debug("Trying new position",e),c?o.set.position(e):!1):(o.error(s.recursion),C=0,o.reset(),c.removeClass(r.loading),!1)):(o.debug("Position is on stage",e),C=0,c.removeClass(r.loading),!0)}},bind:{popup:function(){p.hoverable&&(o.verbose("Allowing hover events on popup to prevent closing"),c.on("mouseenter",o.event.start).on("mouseleave",o.event.end))},close:function(){"click"==p.on&&p.closable&&(o.verbose("Binding popup close event to document"),h.on("click"+v,function(b){o.verbose("Pop-up clickaway intent detected"),a.proxy(o.hideGracefully,D)(b)}))}},unbind:{close:function(){"click"==p.on&&p.closable&&(o.verbose("Removing close event from document"),h.off("click"+v))}},is:{animating:function(){return c&&c.is(":animated")||c.hasClass(r.animating)},visible:function(){return c&&c.is(":visible")},hidden:function(){return!o.is.visible()}},reset:function(){c.removeClass(r.visible),p.preserve||p.popup?a.fn.transition!==d&&c.transition("remove transition"):o.remove()},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,p,b);else{if(c===d)return p[b];p[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,o,b);else{if(c===d)return o[b];o[b]=c}},debug:function(){p.debug&&(p.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,p.name+":"),o.debug.apply(console,arguments)))},verbose:function(){p.verbose&&p.debug&&(p.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,p.name+":"),o.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;p.performance&&(b=(new Date).getTime(),d=j||b,c=b-d,j=b,k.push({Element:D,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,100)},display:function(){var b=p.name+":",c=0;j=!1,clearTimeout(o.performance.timer),a.each(k,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",i&&(b+=" '"+i+"'"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,c,e){var g,h,i,j=E;return c=c||n,e=D||e,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},m?(E===d&&o.initialize(),o.invoke(l)):(E!==d&&o.destroy(),o.initialize())}),f!==d?f:this},a.fn.popup.settings={name:"Popup",debug:!1,verbose:!1,performance:!1,namespace:"popup",onCreate:function(){},onRemove:function(){},onShow:function(){},onHide:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",closable:!0,context:"body",position:"top left",delay:{show:50,hide:0},target:!1,popup:!1,inline:!1,preserve:!0,hoverable:!1,duration:200,easing:"easeOutQuint",transition:"scale",distanceAway:0,offset:0,maxSearchDepth:10,error:{content:"Your popup has no content specified",invalidPosition:"The position you specified is not a valid position",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{animating:"animating",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(a){var b=/[&<>"'`]/g,c=/[&<>"'`]/,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},e=function(a){return d[a]};return c.test(a)?a.replace(b,e):a},popup:function(b){var c="",e=a.fn.popup.settings.templates.escape;return typeof b!==d&&(typeof b.title!==d&&b.title&&(b.title=e(b.title),c+='<div class="header">'+b.title+"</div>"),typeof b.content!==d&&b.content&&(b.content=e(b.content),c+='<div class="content">'+b.content+"</div>")),c}}},a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}})}(jQuery,window,document),function(a,b,c,d){a.fn.rating=function(b){var c,e=a(this),f=e.selector||"",g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);return e.each(function(){var l,m=a.isPlainObject(b)?a.extend(!0,{},a.fn.rating.settings,b):a.extend({},a.fn.rating.settings),n=m.namespace,o=m.className,p=m.metadata,q=m.selector,r=(m.error,"."+n),s="module-"+n,t=this,u=a(this).data(s),v=a(this),w=v.find(q.icon);l={initialize:function(){l.verbose("Initializing rating module",m),m.interactive?l.enable():l.disable(),m.initialRating&&(l.debug("Setting initial rating"),l.setRating(m.initialRating)),v.data(p.rating)&&(l.debug("Rating found in metadata"),l.setRating(v.data(p.rating))),l.instantiate()},instantiate:function(){l.verbose("Instantiating module",m),u=l,v.data(s,l)},destroy:function(){l.verbose("Destroying previous instance",u),v.removeData(s),w.off(r)},event:{mouseenter:function(){var b=a(this);b.nextAll().removeClass(o.hover),v.addClass(o.hover),b.addClass(o.hover).prevAll().addClass(o.hover)},mouseleave:function(){v.removeClass(o.hover),w.removeClass(o.hover)},click:function(){var b=a(this),c=l.getRating(),d=w.index(b)+1,e="auto"==m.clearable?1===w.size():m.clearable;e&&c==d?l.clearRating():l.setRating(d)}},clearRating:function(){l.debug("Clearing current rating"),l.setRating(0)},getRating:function(){var a=w.filter("."+o.active).size();return l.verbose("Current rating retrieved",a),a},enable:function(){l.debug("Setting rating to interactive mode"),w.on("mouseenter"+r,l.event.mouseenter).on("mouseleave"+r,l.event.mouseleave).on("click"+r,l.event.click),v.removeClass(o.disabled)},disable:function(){l.debug("Setting rating to read-only mode"),w.off(r),v.addClass(o.disabled)},setRating:function(b){var c=b-1>=0?b-1:0,d=w.eq(c);v.removeClass(o.hover),w.removeClass(o.hover).removeClass(o.active),b>0&&(l.verbose("Setting current rating to",b),d.addClass(o.active).prevAll().addClass(o.active)),a.proxy(m.onRate,t)(b)},setting:function(b,c){if(l.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,m,b);else{if(c===d)return m[b];m[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,l,b);else{if(c===d)return l[b];l[b]=c}},debug:function(){m.debug&&(m.performance?l.performance.log(arguments):(l.debug=Function.prototype.bind.call(console.info,console,m.name+":"),l.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?l.performance.log(arguments):(l.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),l.verbose.apply(console,arguments)))},error:function(){l.error=Function.prototype.bind.call(console.error,console,m.name+":"),l.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;m.performance&&(b=(new Date).getTime(),d=g||b,c=b-d,g=b,h.push({Element:t,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(l.performance.timer),l.performance.timer=setTimeout(l.performance.display,100)},display:function(){var b=m.name+":",c=0;g=!1,clearTimeout(l.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),e.size()>1&&(b+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(b),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(b,e,f){var g,h,i,j=u;return e=e||k,f=t||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,e):h!==d&&(i=h),a.isArray(c)?c.push(i):c!==d?c=[c,i]:i!==d&&(c=i),h}},j?(u===d&&l.initialize(),l.invoke(i)):(u!==d&&l.destroy(),l.initialize())}),c!==d?c:this},a.fn.rating.settings={name:"Rating",namespace:"rating",debug:!0,verbose:!0,performance:!0,initialRating:0,interactive:!0,clearable:"auto",onRate:function(){},error:{method:"The method you called is not defined"},metadata:{rating:"rating"},className:{active:"active",disabled:"disabled",hover:"hover",loading:"loading"},selector:{icon:".icon"}}}(jQuery,window,document),function(a,b,c,d){a.fn.search=function(c){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return a(this).each(function(){var m,n=a.extend(!0,{},a.fn.search.settings,c),o=n.className,p=n.selector,q=n.error,r=n.namespace,s="."+r,t=r+"-module",u=a(this),v=u.find(p.prompt),w=u.find(p.searchButton),x=u.find(p.results),y=(u.find(p.result),u.find(p.category),this),z=u.data(t);m={initialize:function(){m.verbose("Initializing module");var a=v[0],b=a!==d&&a.oninput!==d?"input":a!==d&&a.onpropertychange!==d?"propertychange":"keyup";v.on("focus"+s,m.event.focus).on("blur"+s,m.event.blur).on("keydown"+s,m.handleKeyboard),n.automatic&&v.on(b+s,m.search.throttle),w.on("click"+s,m.search.query),x.on("click"+s,p.result,m.results.select),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),z=m,u.data(t,m)},destroy:function(){m.verbose("Destroying instance"),u.removeData(t),v.off(s),w.off(s),x.off(s)},event:{focus:function(){u.addClass(o.focus),clearTimeout(m.timer),m.search.throttle(),m.results.show()},blur:function(){m.search.cancel(),u.removeClass(o.focus),m.timer=setTimeout(m.results.hide,n.hideDelay)}},handleKeyboard:function(b){var c,d=u.find(p.result),e=u.find(p.category),f=b.which,g={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},h=o.active,i=d.index(d.filter("."+h)),j=d.size();if(f==g.escape&&(m.verbose("Escape key pressed, blurring search field"),v.trigger("blur")),x.filter(":visible").size()>0)if(f==g.enter){if(m.verbose("Enter key pressed, selecting active result"),d.filter("."+h).size()>0)return a.proxy(m.results.select,d.filter("."+h))(b),b.preventDefault(),!1}else f==g.upArrow?(m.verbose("Up key pressed, changing active result"),c=0>i-1?i:i-1,e.removeClass(h),d.removeClass(h).eq(c).addClass(h).closest(e).addClass(h),b.preventDefault()):f==g.downArrow&&(m.verbose("Down key pressed, changing active result"),c=i+1>=j?i:i+1,e.removeClass(h),d.removeClass(h).eq(c).addClass(h).closest(e).addClass(h),b.preventDefault());else f==g.enter&&(m.verbose("Enter key pressed, executing query"),m.search.query(),w.addClass(o.down),v.one("keyup",function(){w.removeClass(o.down)}))},search:{cancel:function(){var a=u.data("xhr")||!1;a&&"resolved"!=a.state()&&(m.debug("Cancelling last search"),a.abort())},throttle:function(){var a=v.val(),b=a.length;clearTimeout(m.timer),b>=n.minCharacters?m.timer=setTimeout(m.search.query,n.searchThrottle):m.results.hide()},query:function(){var b=v.val(),c=m.search.cache.read(b);c?(m.debug("Reading result for '"+b+"' from cache"),m.results.add(c)):(m.debug("Querying for '"+b+"'"),a.isPlainObject(n.source)||a.isArray(n.source)?m.search.local(b):n.apiSettings?m.search.remote(b):a.api!==d&&a.api.settings.api.search!==d?(m.debug("Searching with default search API endpoint"),n.apiSettings={action:"search"},m.search.remote(b)):m.error(q.source),a.proxy(n.onSearchQuery,u)(b))},local:function(b){var c,d=[],e=[],f=a.isArray(n.searchFields)?n.searchFields:[n.searchFields],g=new RegExp("(?:s|^)"+b,"i"),h=new RegExp(b,"i");u.addClass(o.loading),a.each(f,function(b,c){a.each(n.source,function(b,f){"string"==typeof f[c]&&-1==a.inArray(f,d)&&-1==a.inArray(f,e)&&(g.test(f[c])?d.push(f):h.test(f[c])&&e.push(f))})}),c=m.results.generate({results:a.merge(d,e)}),u.removeClass(o.loading),m.search.cache.write(b,c),m.results.add(c)},remote:function(b){var c,d={stateContext:u,urlData:{query:b},onSuccess:function(a){c=m.results.generate(a),m.search.cache.write(b,c),m.results.add(c)},failure:m.error};m.search.cancel(),m.debug("Executing search"),a.extend(!0,d,n.apiSettings),a.api(d)},cache:{read:function(a){var b=u.data("cache");return n.cache&&"object"==typeof b&&b[a]!==d?b[a]:!1},write:function(a,b){var c=u.data("cache")!==d?u.data("cache"):{};c[a]=b,u.data("cache",c)}}},results:{generate:function(b){m.debug("Generating html from response",b);var c=n.templates[n.type],d="";return a.isPlainObject(b.results)&&!a.isEmptyObject(b.results)||a.isArray(b.results)&&b.results.length>0?(n.maxResults>0&&(b.results=a.makeArray(b.results).slice(0,n.maxResults)),a.isFunction(c)?d=c(b):m.error(q.noTemplate,!1)):d=m.message(q.noResults,"empty"),a.proxy(n.onResults,u)(b),d},add:function(b){("default"==n.onResultsAdd||"default"==a.proxy(n.onResultsAdd,x)(b))&&x.html(b),m.results.show()},show:function(){0===x.filter(":visible").size()&&v.filter(":focus").size()>0&&""!==x.html()&&(n.transition&&a.fn.transition!==d&&u.transition("is supported")?(m.debug("Showing results with css animations"),x.transition(n.transition+" in",n.duration)):(m.debug("Showing results with javascript"),x.stop().fadeIn(n.duration,n.easing)),a.proxy(n.onResultsOpen,x)())},hide:function(){x.filter(":visible").size()>0&&(n.transition&&a.fn.transition!==d&&u.transition("is supported")?(m.debug("Hiding results with css animations"),x.transition(n.transition+" out",n.duration)):(m.debug("Hiding results with javascript"),x.stop().fadeIn(n.duration,n.easing)),a.proxy(n.onResultsClose,x)())},select:function(c){m.debug("Search result selected");{var d=a(this),e=d.find(".title");e.html()}if("default"==n.onSelect||"default"==a.proxy(n.onSelect,this)(c)){var f=d.find("a[href]").eq(0),g=f.attr("href")||!1,h=f.attr("target")||!1;m.results.hide(),g&&("_blank"==h||c.ctrlKey?b.open(g):b.location.href=g)}}},message:function(a,b){return b=b||"standard",m.results.add(n.templates.message(a,b)),n.templates.message(a,b)},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];n[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,m,b);else{if(c===d)return m[b];m[b]=c}},debug:function(){n.debug&&(n.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,n.name+":"),m.debug.apply(console,arguments)))},verbose:function(){n.verbose&&n.debug&&(n.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,n.name+":"),m.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;n.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:y,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,100)},display:function(){var b=n.name+":",c=0;h=!1,clearTimeout(m.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=z;return c=c||l,f=y||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(z===d&&m.initialize(),m.invoke(j)):(z!==d&&m.destroy(),m.initialize())}),e!==d?e:this},a.fn.search.settings={name:"Search Module",namespace:"search",debug:!1,verbose:!0,performance:!0,onSelect:"default",onResultsAdd:"default",onSearchQuery:function(){},onResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},source:!1,automatic:"true",type:"simple",hideDelay:300,minCharacters:3,searchThrottle:300,maxResults:7,cache:!0,searchFields:["title","description"],transition:"scale",duration:300,easing:"easeOutExpo",apiSettings:!1,className:{active:"active",down:"down",focus:"focus",empty:"empty",loading:"loading"},error:{source:"No source or api action specified",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noTemplate:"A valid template name was not specified.",serverError:"There was an issue with querying the server.",method:"The method you called is not defined."},selector:{prompt:".prompt",searchButton:".search.button",results:".results",category:".category",result:".result"},templates:{escape:function(a){var b=/[&<>"'`]/g,c=/[&<>"'`]/,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},e=function(a){return d[a]};return c.test(a)?a.replace(b,e):a},message:function(a,b){var c="";return a!==d&&b!==d&&(c+='<div class="message '+b+'">',c+="empty"==b?'<div class="header">No Results</div class="header"><div class="description">'+a+'</div class="description">':' <div class="description">'+a+"</div>",c+="</div>"),c},categories:function(b){var c="",e=a.fn.search.settings.templates.escape;return b.results!==d?(a.each(b.results,function(b,f){f.results!==d&&f.results.length>0&&(c+='<div class="category"><div class="name">'+f.name+"</div>",a.each(f.results,function(a,b){c+='<div class="result">',c+='<a href="'+b.url+'"></a>',b.image!==d&&(b.image=e(b.image),c+='<div class="image"> <img src="'+b.image+'" alt=""></div>'),c+='<div class="content">',b.price!==d&&(b.price=e(b.price),c+='<div class="price">'+b.price+"</div>"),b.title!==d&&(b.title=e(b.title),c+='<div class="title">'+b.title+"</div>"),b.description!==d&&(c+='<div class="description">'+b.description+"</div>"),c+="</div></div>"}),c+="</div>")}),b.resultPage&&(c+='<a href="'+b.resultPage.url+'" class="all">'+b.resultPage.text+"</a>"),c):!1},simple:function(b){var c="";return b.results!==d?(a.each(b.results,function(a,b){c+='<a class="result" href="'+b.url+'">',b.image!==d&&(c+='<div class="image"> <img src="'+b.image+'"></div>'),c+='<div class="content">',b.price!==d&&(c+='<div class="price">'+b.price+"</div>"),b.title!==d&&(c+='<div class="title">'+b.title+"</div>"),b.description!==d&&(c+='<div class="description">'+b.description+"</div>"),c+="</div></a>"}),b.resultPage&&(c+='<a href="'+b.resultPage.url+'" class="all">'+b.resultPage.text+"</a>"),c):!1}}}}(jQuery,window,document),function(a,b,c,d){a.fn.shape=function(b){var e,f=a(this),g=a("body"),h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return f.each(function(){var m,n,o,p=f.selector||"",q=a.extend(!0,{},a.fn.shape.settings,b),r=q.namespace,s=q.selector,t=q.error,u=q.className,v="."+r,w="module-"+r,x=a(this),y=x.find(s.sides),z=x.find(s.side),A=!1,B=this,C=x.data(w);o={initialize:function(){o.verbose("Initializing module for",B),o.set.defaultSide(),o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o),C=o,x.data(w,C)},destroy:function(){o.verbose("Destroying previous module for",B),x.removeData(w).off(v)},refresh:function(){o.verbose("Refreshing selector cache for",B),x=a(B),y=a(this).find(s.shape),z=a(this).find(s.side)},repaint:function(){o.verbose("Forcing repaint event");{var a=y.get(0)||c.createElement("div");a.offsetWidth}},animate:function(b,c){o.verbose("Animating box with properties",b),c=c||function(a){o.verbose("Executing animation callback"),a!==d&&a.stopPropagation(),o.reset(),o.set.active()},a.proxy(q.beforeChange,n[0])(),o.get.transitionEvent()?(o.verbose("Starting CSS animation"),x.addClass(u.animating),o.repaint(),x.addClass(u.animating),m.addClass(u.hidden),y.css(b).one(o.get.transitionEvent(),c),o.set.duration(q.duration)):c()},queue:function(a){o.debug("Queueing animation of",a),y.one(o.get.transitionEvent(),function(){o.debug("Executing queued animation"),setTimeout(function(){x.shape(a)},0)})},reset:function(){o.verbose("Animating states reset"),x.removeClass(u.animating).attr("style","").removeAttr("style"),y.attr("style","").removeAttr("style"),z.attr("style","").removeAttr("style").removeClass(u.hidden),n.removeClass(u.animating).attr("style","").removeAttr("style")},is:{animating:function(){return x.hasClass(u.animating)}},set:{defaultSide:function(){m=x.find("."+q.className.active),n=m.next(s.side).size()>0?m.next(s.side):x.find(s.side).first(),A=!1,o.verbose("Active side set to",m),o.verbose("Next side set to",n)},duration:function(a){a=a||q.duration,a="number"==typeof a?a+"ms":a,o.verbose("Setting animation duration",a),y.add(z).css({"-webkit-transition-duration":a,"-moz-transition-duration":a,"-ms-transition-duration":a,"-o-transition-duration":a,"transition-duration":a})
},stageSize:function(){var a=x.clone().addClass(u.loading),b=a.find("."+q.className.active),c=A?a.find(A):b.next(s.side).size()>0?b.next(s.side):a.find(s.side).first(),d={};b.removeClass(u.active),c.addClass(u.active),a.prependTo(g),d={width:c.outerWidth(),height:c.outerHeight()},a.remove(),x.css(d),o.verbose("Resizing stage to fit new content",d)},nextSide:function(a){A=a,n=x.find(a),0===n.size()&&o.error(t.side),o.verbose("Next side manually set to",n)},active:function(){o.verbose("Setting new side to active",n),z.removeClass(u.active),n.addClass(u.active),a.proxy(q.onChange,n[0])(),o.set.defaultSide()}},flip:{up:function(){o.debug("Flipping up",n),o.is.animating()?o.queue("flip up"):(o.set.stageSize(),o.stage.above(),o.animate(o.get.transform.up()))},down:function(){o.debug("Flipping down",n),o.is.animating()?o.queue("flip down"):(o.set.stageSize(),o.stage.below(),o.animate(o.get.transform.down()))},left:function(){o.debug("Flipping left",n),o.is.animating()?o.queue("flip left"):(o.set.stageSize(),o.stage.left(),o.animate(o.get.transform.left()))},right:function(){o.debug("Flipping right",n),o.is.animating()?o.queue("flip right"):(o.set.stageSize(),o.stage.right(),o.animate(o.get.transform.right()))},over:function(){o.debug("Flipping over",n),o.is.animating()?o.queue("flip over"):(o.set.stageSize(),o.stage.behind(),o.animate(o.get.transform.over()))},back:function(){o.debug("Flipping back",n),o.is.animating()?o.queue("flip back"):(o.set.stageSize(),o.stage.behind(),o.animate(o.get.transform.back()))}},get:{transform:{up:function(){var a={y:-((m.outerHeight()-n.outerHeight())/2),z:-(m.outerHeight()/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(-90deg)"}},down:function(){var a={y:-((m.outerHeight()-n.outerHeight())/2),z:-(m.outerHeight()/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(90deg)"}},left:function(){var a={x:-((m.outerWidth()-n.outerWidth())/2),z:-(m.outerWidth()/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(90deg)"}},right:function(){var a={x:-((m.outerWidth()-n.outerWidth())/2),z:-(m.outerWidth()/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(-90deg)"}},over:function(){var a={x:-((m.outerWidth()-n.outerWidth())/2)};return{transform:"translateX("+a.x+"px) rotateY(180deg)"}},back:function(){var a={x:-((m.outerWidth()-n.outerWidth())/2)};return{transform:"translateX("+a.x+"px) rotateY(-180deg)"}}},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]},nextSide:function(){return m.next(s.side).size()>0?m.next(s.side):x.find(s.side).first()}},stage:{above:function(){var a={origin:(m.outerHeight()-n.outerHeight())/2,depth:{active:n.outerHeight()/2,next:m.outerHeight()/2}};o.verbose("Setting the initial animation position as above",n,a),m.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),n.addClass(u.animating).css({display:"block",top:a.origin+"px",transform:"rotateX(90deg) translateZ("+a.depth.next+"px)"})},below:function(){var a={origin:(m.outerHeight()-n.outerHeight())/2,depth:{active:n.outerHeight()/2,next:m.outerHeight()/2}};o.verbose("Setting the initial animation position as below",n,a),m.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),n.addClass(u.animating).css({display:"block",top:a.origin+"px",transform:"rotateX(-90deg) translateZ("+a.depth.next+"px)"})},left:function(){var a={origin:(m.outerWidth()-n.outerWidth())/2,depth:{active:n.outerWidth()/2,next:m.outerWidth()/2}};o.verbose("Setting the initial animation position as left",n,a),m.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),n.addClass(u.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-90deg) translateZ("+a.depth.next+"px)"})},right:function(){var a={origin:(m.outerWidth()-n.outerWidth())/2,depth:{active:n.outerWidth()/2,next:m.outerWidth()/2}};o.verbose("Setting the initial animation position as left",n,a),m.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),n.addClass(u.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(90deg) translateZ("+a.depth.next+"px)"})},behind:function(){var a={origin:(m.outerWidth()-n.outerWidth())/2,depth:{active:n.outerWidth()/2,next:m.outerWidth()/2}};o.verbose("Setting the initial animation position as behind",n,a),m.css({transform:"rotateY(0deg)"}),n.addClass(u.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(b,c){if(o.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,q,b);else{if(c===d)return q[b];q[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,o,b);else{if(c===d)return o[b];o[b]=c}},debug:function(){q.debug&&(q.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,q.name+":"),o.debug.apply(console,arguments)))},verbose:function(){q.verbose&&q.debug&&(q.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,q.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,q.name+":"),o.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;q.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:B,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,100)},display:function(){var b=q.name+":",c=0;h=!1,clearTimeout(o.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",p&&(b+=" '"+p+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=C;return c=c||l,f=B||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(C===d&&o.initialize(),o.invoke(j)):(C!==d&&o.destroy(),o.initialize())}),e!==d?e:this},a.fn.shape.settings={name:"Shape",debug:!1,verbose:!0,performance:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},duration:700,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(a,b,c,d){"use strict";a.fn.sidebar=function(e){var f,g=a(this),h=(a("head"),g.selector||""),i=(new Date).getTime(),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1),n=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};return g.each(function(){var g,o,p=a.isPlainObject(e)?a.extend(!0,{},a.fn.sidebar.settings,e):a.extend({},a.fn.sidebar.settings),q=p.selector,r=p.className,s=p.namespace,t=p.error,u="."+s,v="module-"+s,w=a(this),x=a(p.context),y=a("style[title="+s+"]"),z=x.children(q.sidebar),A=x.children(q.pusher),B=A.children(q.page),C=A.find(q.fixed),D=this,E=w.data(v);o={initialize:function(){o.debug("Initializing sidebar",w),g=o.get.transitionEvent(),o.setup.context(),n(o.setup.layout),o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o),E=o,w.data(v,o)},destroy:function(){o.verbose("Destroying previous module for",w),w.off(u).removeData(v)},event:{clickaway:function(b){0===w.find(b.target).size()&&0===a(b.target).filter(w).size()&&(o.verbose("User clicked on dimmed page"),o.hide())},scroll:function(b){0===w.find(b.target).size()&&0===a(b.target).filter(w).size()&&b.preventDefault()}},bind:{clickaway:function(){a(b).on("DOMMouseScroll"+u,o.event.scroll),x.on("click"+u,o.event.clickaway).on("touchend"+u,o.event.clickaway)}},unbind:{clickaway:function(){x.off(u),a(b).off("DOMMouseScroll"+u)}},refresh:function(){o.verbose("Refreshing selector cache"),x=a(p.context),y=a("style[title="+s+"]"),z=x.children(q.sidebar),A=x.children(q.pusher),B=A.children(q.page),C=A.find(q.fixed)},repaint:function(){o.verbose("Forcing repaint event");x[0].offsetWidth},setup:{layout:function(){0===x.find(q.pusher).size()&&(o.debug("Adding wrapper element for sidebar"),A=a('<div class="pusher" />'),B=a('<div class="page" />'),A.append(B),x.children().not(q.omitted).not(z).wrapAll(A)),w.prevAll(B)[0]!==B[0]&&(o.debug("Moved sidebar to correct parent element"),w.detach().prependTo(x)),o.refresh()},context:function(){o.verbose("Adding pusshable class to wrapper"),x.addClass(r.pushable)}},attachEvents:function(b,c){var d=a(b);c=a.isFunction(o[c])?o[c]:o.toggle,d.size()>0?(o.debug("Attaching sidebar events to element",b,c),d.off(u).on("click"+u,c)):o.error(t.notFound)},show:function(b){b=a.isFunction(b)?b:function(){},o.debug("Showing sidebar",b),o.is.closed()?(p.overlay&&(p.transition="overlay"),"overlay"!==p.transition&&o.hideAll(),o.pushPage(function(){o.set.active(),a.proxy(b,D)(),a.proxy(p.onShow,D)()}),a.proxy(p.onChange,D)(),a.proxy(p.onVisible,D)()):o.debug("Sidebar is already visible")},hide:function(b){b=a.isFunction(b)?b:function(){},o.debug("Hiding sidebar",b),o.is.visible()&&(o.pullPage(function(){a.proxy(b,D)(),a.proxy(p.onHidden,D)()}),a.proxy(p.onChange,D)(),a.proxy(p.onHide,D)())},hideAll:function(){var a=z.find("."+r.visible);a.sidebar("hide")},toggle:function(){o.verbose("Determining toggled direction"),o.is.closed()?o.show():o.hide()},pushPage:function(c){var d,e="safe"==p.transition?x:"overlay"==p.transition?w:A;c=a.isFunction(c)?c:function(){},d=function(){o.set.visible(),o.set.transition(),o.set.direction(),n(function(){o.set.inward(),o.set.pushed()})},e.on(g,function(b){b.target==e[0]&&(e.off(g),o.remove.inward(),o.bind.clickaway(),a.proxy(c,D)())}),o.verbose("Adding context push state",x),"overlay"===p.transition?n(d):("safe"!==p.transition&&(w.scrollTop(0),"scroll"===p.workaround&&b.scrollTo(0,0)),o.remove.allVisible(),n(d))},pullPage:function(b){var c="safe"==p.transition?x:"overlay"==p.transition?w:A;b=a.isFunction(b)?b:function(){},o.verbose("Removing context push state",o.get.direction()),o.unbind.clickaway(),c.on(g,function(d){d.target==c[0]&&(c.off(g),o.remove.transition(),o.remove.direction(),o.remove.outward(),o.remove.visible(),a.proxy(b,D)())}),o.set.outward(),o.remove.active(),o.remove.pushed()},set:{active:function(){x.addClass(r.active)},direction:function(a){a=a||o.get.direction(),x.addClass(r[a])},visible:function(){w.addClass(r.visible)},transition:function(a){a=a||o.is.mobile()?p.mobileTransition:p.transition,x.addClass(a)},inward:function(){x.addClass(r.inward)},outward:function(){x.addClass(r.outward)},pushed:function(){x.addClass(r.pushed)}},remove:{active:function(){x.removeClass(r.active)},visible:function(){w.removeClass(r.visible)},allVisible:function(){z.hasClass(r.visible)&&(o.debug("Other sidebars visible, hiding"),z.removeClass(r.visible))},transition:function(a){a=a||o.is.mobile()?p.mobileTransition:p.transition,x.removeClass(a)},pushed:function(){x.removeClass(r.pushed)},inward:function(){x.removeClass(r.inward)},outward:function(){x.removeClass(r.outward)},direction:function(a){a=a||o.get.direction(),x.removeClass(r[a])}},get:{direction:function(){return w.hasClass(r.top)?r.top:w.hasClass(r.right)?r.right:w.hasClass(r.bottom)?r.bottom:r.left},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]}},is:{mobile:function(){var a=navigator.userAgent,b=/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/,c=b.test(a);return c?(o.verbose("Browser was found to be mobile",a),!0):(o.verbose("Browser is not mobile, using regular transition",a),!1)},closed:function(){return!o.is.visible()},visible:function(){return w.hasClass(r.visible)},vertical:function(){return w.hasClass(r.top)},inward:function(){return x.hasClass(r.inward)},outward:function(){return x.hasClass(r.outward)},animating:function(){return o.is.inward()||o.is.outward()}},setting:function(b,c){if(o.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,p,b);else{if(c===d)return p[b];p[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,o,b);else{if(c===d)return o[b];o[b]=c}},debug:function(){p.debug&&(p.performance?o.performance.log(arguments):(o.debug=Function.prototype.bind.call(console.info,console,p.name+":"),o.debug.apply(console,arguments)))},verbose:function(){p.verbose&&p.debug&&(p.performance?o.performance.log(arguments):(o.verbose=Function.prototype.bind.call(console.info,console,p.name+":"),o.verbose.apply(console,arguments)))},error:function(){o.error=Function.prototype.bind.call(console.error,console,p.name+":"),o.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;p.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Element:D,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,100)},display:function(){var b=p.name+":",c=0;i=!1,clearTimeout(o.performance.timer),a.each(j,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",h&&(b+=" '"+h+"'"),(console.group!==d||console.table!==d)&&j.length>0&&(console.groupCollapsed(b),console.table?console.table(j):a.each(j,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(b,c,e){var g,h,i,j=E;return c=c||m,e=D||e,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):(o.error(t.method,b),!1);j=j[e]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},l?(E===d&&o.initialize(),o.invoke(k)):(E!==d&&o.destroy(),o.initialize())}),f!==d?f:this},a.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",debug:!1,verbose:!1,performance:!1,transition:"overlay",mobileTransition:"slide along",context:"body",useCSS:!0,duration:300,dimPage:!0,exclusive:!0,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},workaround:"scroll",className:{pushable:"pushable",active:"active",visible:"visible",pushed:"pushed",inward:"show",outward:"hide"},selector:{sidebar:".ui.sidebar",pusher:".pusher",fixed:".ui.fixed",page:".page",omitted:"script, link, style, .ui.modal, .ui.nag"},error:{method:"The method you called is not defined.",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(a,b,c,d){a.fn.sticky=function(c){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return f.each(function(){var f,m,n,o=a.extend(!0,{},a.fn.sticky.settings,c),p=o.className,q=o.namespace,r=o.error,s="."+q,t="module-"+q,u=a(this),v=a(b),w=u.offsetParent(),x=a(o.scrollContext),y=(u.selector||"",u.data(t)),z=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},A=this;n={initialize:function(){return u.is(":visible")||n.error(r.visible,u),f=o.context?a(o.context):w,0===f.size()?void n.error(r.invalidContext,o.context,u):(n.supports.sticky(),v.on("resize"+s,n.event.resize),x.on("scroll"+s,n.event.scroll),n.verbose("Initializing sticky",o,w),n.save.positions(),n.observeChanges(),void n.instantiate())},instantiate:function(){n.verbose("Storing instance of module",n),y=n,u.data(t,n)},destroy:function(){n.verbose("Destroying previous module"),n.reset(),v.off("resize",n.event.resize).off("scroll",n.event.scroll),u.removeData(t)},observeChanges:function(){var a=f[0];MutationObserver!==d&&(m=new MutationObserver(function(){clearTimeout(n.timer),n.timer=setTimeout(function(){n.verbose("DOM tree modified, updating sticky menu"),n.refresh()},200)}),m.observe(A,{childList:!0,subtree:!0}),m.observe(a,{childList:!0,subtree:!0}),n.debug("Setting up mutation observer",m))},event:{resize:function(){z(n.refresh)},scroll:function(){z(function(){n.stick(),a.proxy(o.onScroll,A)()})}},refresh:function(b){n.reset(),b&&(w=u.offsetParent()),n.save.positions(),a.proxy(o.onReposition,A)()},supports:{sticky:function(){{var b=a("<div/>");b.get()}return b.addClass(p.supported),b.css("position").match("sticky")}},save:{scroll:function(a){n.lastScroll=a},positions:function(){var a={height:v.height()},b={margin:{top:parseInt(u.css("margin-top"),10),bottom:parseInt(u.css("margin-bottom"),10)},offset:u.offset(),width:u.outerWidth(),height:u.outerHeight()},c={offset:f.offset(),height:f.outerHeight()};n.cache={fits:b.height<v.height(),window:{height:a.height},element:{margin:b.margin,top:b.offset.top-b.margin.top,left:b.offset.left,width:b.width,height:b.height,bottom:b.offset.top+b.height},context:{top:c.offset.top,height:c.height,bottom:c.offset.top+c.height}},n.set.containerSize(),n.set.size(),n.stick(),n.debug("Caching element positions",n.cache)}},get:{direction:function(a){var b="down";return a=a||x.scrollTop(),n.lastScroll!==d&&(n.lastScroll<a?b="down":n.lastScroll>a&&(b="up")),b},currentOffset:function(){return n.is.top()?parseInt(u.css("top"),10)||0:parseInt(u.css("bottom"),10)||0},offsetChange:function(a){return a=a||x.scrollTop(),n.lastScroll?Math.abs(a-n.lastScroll):0},newOffset:function(a){a=a||x.scrollTop();var b=n.get.currentOffset(),c=n.get.offsetChange(a);return Math.abs(b-c)}},set:{containerSize:function(){var a=w.get(0).tagName;"HTML"===a||"body"==a?(n.error(r.container,a,u),w=u.offsetParent()):(n.debug("Settings container size",n.cache.context.height),w.height(n.cache.context.height))},size:function(){0!==n.cache.element.height&&0!==n.cache.element.width&&u.css({width:n.cache.element.width,height:n.cache.element.height})}},is:{top:function(){return u.hasClass(p.top)},bottom:function(){return u.hasClass(p.bottom)},bound:function(){return u.hasClass(p.bound)},fixed:function(){return u.hasClass(p.fixed)}},stick:function(){var a=n.cache,b=a.fits,c=a.element,d=a.window,e=a.context,f=x.scrollTop(),g={top:f+o.offset,bottom:f+d.height+o.offset},h=n.get.direction(f),i=(n.get.currentOffset(),n.get.newOffset(f)),j=g.bottom>c.top+c.height,k=a.element.height+g.top;n.save.scroll(f),0!==c.height&&(n.is.fixed()?b?(n.is.top()&&(g.top<c.top?n.unfix():k>e.bottom&&(n.debug("Top attached rail has reached bottom of container"),n.bindBottom())),n.is.bottom()&&(g.bottom-c.height<c.top?n.unfix():g.bottom>e.bottom&&(n.debug("Bottom attached rail has reached bottom of container"),n.bindBottom())),k>e.bottom&&n.bindBottom()):g.bottom>e.bottom?n.bindBottom():j?(n.is.top()&&"down"==h&&(n.debug("Stuck content at bottom edge"),i>=c.height-d.height?(u.css("top",""),n.stickBottom()):u.css("top",-i)),n.is.bottom()&&"up"==h&&(n.debug("Stuck content at top edge"),i>=c.height-d.height?(u.css("bottom",""),n.stickTop()):u.css("bottom",-i))):n.unfix():(g.top+c.height>e.bottom&&n.bindBottom(),b?n.is.bottom()?o.pushing?n.is.bound()&&g.bottom<e.bottom&&n.stickBottom():n.is.bound()&&g.top<e.bottom-c.height&&n.stickTop():g.top>=c.top&&g.top<e.bottom-c.height&&n.stickTop():j&&g.bottom<e.bottom&&n.stickBottom()))},bindTop:function(){n.debug("Binding element to top of parent container"),u.css("left","").removeClass(p.fixed).removeClass(p.bottom).addClass(p.bound).addClass(p.top),a.proxy(o.onTop,A)(),a.proxy(o.onUnstick,A)()},bindBottom:function(){n.debug("Binding element to bottom of parent container"),u.css("left","").removeClass(p.fixed).removeClass(p.top).addClass(p.bound).addClass(p.bottom),a.proxy(o.onBottom,A)(),a.proxy(o.onUnstick,A)()},stickTop:function(){n.debug("Fixing element to top of page"),u.css("left",n.cache.element.left).removeClass(p.bound).removeClass(p.bottom).addClass(p.fixed).addClass(p.top),a.proxy(o.onStick,A)()},stickBottom:function(){n.debug("Sticking element to bottom of page"),u.css("left",n.cache.element.left).removeClass(p.bound).removeClass(p.top).addClass(p.fixed).addClass(p.bottom),a.proxy(o.onStick,A)()},unbind:function(){n.debug("Removing absolute position on element"),u.removeClass(p.bound).removeClass(p.top).removeClass(p.bottom)},unfix:function(){n.debug("Removing fixed position on element"),u.removeClass(p.fixed).removeClass(p.top).removeClass(p.bottom),a.proxy(o.onUnstick,this)()},reset:function(){n.debug("Reseting elements position"),n.unbind(),n.unfix(),n.resetCSS()},resetCSS:function(){u.css({top:"",bottom:"",width:"",height:""}),w.css({height:""})},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,o,b);else{if(c===d)return o[b];o[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];n[b]=c}},debug:function(){o.debug&&(o.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,o.name+":"),n.debug.apply(console,arguments)))},verbose:function(){o.verbose&&o.debug&&(o.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,o.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,o.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;o.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:A,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,0)},display:function(){var b=o.name+":",c=0;h=!1,clearTimeout(n.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=y;return c=c||l,f=A||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(y===d&&n.initialize(),n.invoke(j)):(y!==d&&n.destroy(),n.initialize())}),e!==d?e:this},a.fn.sticky.settings={name:"Sticky",namespace:"sticky",verbose:!1,debug:!1,performance:!1,pushing:!1,context:!1,scrollContext:b,offset:0,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible",method:"The method you called is not defined.",invalidContext:"Context specified does not exist"},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(a,b,c,d){a.tab=a.fn.tab=function(c){var e,f,g=a(a.isFunction(this)?b:this),h=a.isPlainObject(c)?a.extend(!0,{},a.fn.tab.settings,c):a.extend({},a.fn.tab.settings),i=g.selector||"",j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var c,o,p,q,r=h.className,s=h.metadata,t=h.selector,u=h.error,v="."+h.namespace,w="module-"+h.namespace,x=a(this),y=a(t.tabs),z={},A=!0,B=0,C=this,D=x.data(w);e={initialize:function(){e.debug("Initializing tab menu item",x),h.context&&(e.determineTabs(),e.debug("Using only tabs inside context",h.context,y)),h.auto&&(e.verbose("Setting up automatic tab retrieval from server"),h.apiSettings={url:h.path+"/{$tab}"}),a.isWindow(C)||(e.debug("Attaching tab activation events to element",x),x.on("click"+v,e.event.click)),e.instantiate()},determineTabs:function(){var b;"parent"===h.context?(x.closest("."+r.ui).size()>0?(b=x.closest("."+r.ui),e.verbose("Using closest UI element for determining parent",b)):b=x,c=b.parent(),e.verbose("Determining parent element for creating context",c)):(c=a(h.context),e.verbose("Using selector for tab context",h.context,c)),h.childrenOnly?(y=c.children(t.tabs),e.debug("Searching tab context children for tabs",c,y)):(y=c.find(t.tabs),e.debug("Searching tab context for tabs",c,y))},initializeHistory:function(){if(h.history){if(e.debug("Initializing page state"),a.address===d)return e.error(u.state),!1;if("state"==h.historyType){if(e.debug("Using HTML5 to manage state"),h.path===!1)return e.error(u.path),!1;a.address.history(!0).state(h.path)}a.address.bind("change",e.event.history.change)}},instantiate:function(){e.verbose("Storing instance of module",e),x.data(w,e)},destroy:function(){e.debug("Destroying tabs",x),x.removeData(w).off(v)},event:{click:function(b){var c=a(this).data(s.tab);c!==d?(h.history?(e.verbose("Updating page state",b),a.address.value(c)):(e.verbose("Changing tab",b),e.changeTab(c)),b.preventDefault()):e.debug("No tab specified")},history:{change:function(b){var c=b.pathNames.join("/")||e.get.initialPath(),f=h.templates.determineTitle(c)||!1;e.performance.display(),e.debug("History change event",c,b),q=b,c!==d&&e.changeTab(c),f&&a.address.title(f)}}},refresh:function(){o&&(e.debug("Refreshing tab",o),e.changeTab(o))},cache:{read:function(a){return a!==d?z[a]:!1},add:function(a,b){a=a||o,e.debug("Adding cached content for",a),z[a]=b},remove:function(a){a=a||o,e.debug("Removing cached content for",a),delete z[a]}},set:{state:function(b){a.address.value(b)}},changeTab:function(c){var d=b.history&&b.history.pushState,f=d&&h.ignoreFirstLoad&&A,g=h.auto||a.isPlainObject(h.apiSettings),i=g&&!f?e.utilities.pathToArray(c):e.get.defaultPathArray(c);c=e.utilities.arrayToPath(i),a.each(i,function(b,d){var j,k,l,m=i.slice(0,b+1),n=e.utilities.arrayToPath(m),r=e.is.tab(n),s=b+1==i.length,t=e.get.tabElement(n);return e.verbose("Looking for tab",d),r?(e.verbose("Tab was found",d),o=n,p=e.utilities.filterArray(i,m),s?l=!0:(j=i.slice(0,b+2),k=e.utilities.arrayToPath(j),l=!e.is.tab(k),l&&e.verbose("Tab parameters found",j)),l&&g?(f?(e.debug("Ignoring remote content on first tab load",n),A=!1,e.cache.add(c,t.html()),e.activate.all(n),a.proxy(h.onTabInit,t)(n,p,q),a.proxy(h.onTabLoad,t)(n,p,q)):(e.activate.navigation(n),e.content.fetch(n,c)),!1):(e.debug("Opened local tab",n),e.activate.all(n),e.cache.read(n)||(e.cache.add(n,!0),e.debug("First time tab loaded calling tab init"),a.proxy(h.onTabInit,t)(n,p,q)),a.proxy(h.onTabLoad,t)(n,p,q),void 0)):(h.history||e.error(u.missingTab,x,n),!1)})},content:{fetch:function(b,c){var f,g,i=e.get.tabElement(b),j={dataType:"html",stateContext:i,onSuccess:function(d){e.cache.add(c,d),e.content.update(b,d),b==o?(e.debug("Content loaded",b),e.activate.tab(b)):e.debug("Content loaded in background",b),a.proxy(h.onTabInit,i)(b,p,q),a.proxy(h.onTabLoad,i)(b,p,q)},urlData:{tab:c}},k=i.data(s.promise)||!1,l=k&&"pending"===k.state();c=c||b,g=e.cache.read(c),h.cache&&g?(e.debug("Showing existing content",c),e.content.update(b,g),e.activate.tab(b),a.proxy(h.onTabLoad,i)(b,p,q)):l?(e.debug("Content is already loading",c),i.addClass(r.loading)):a.api!==d?(f=a.extend(!0,{headers:{"X-Remote":!0}},h.apiSettings,j),e.debug("Retrieving remote content",c,f),a.api(f)):e.error(u.api)},update:function(a,b){e.debug("Updating html for",a);var c=e.get.tabElement(a);c.html(b)}},activate:{all:function(a){e.activate.tab(a),e.activate.navigation(a)},tab:function(a){var b=e.get.tabElement(a);e.verbose("Showing tab content for",b),b.addClass(r.active).siblings(y).removeClass(r.active+" "+r.loading)},navigation:function(a){var b=e.get.navElement(a);e.verbose("Activating tab navigation for",b,a),b.addClass(r.active).siblings(g).removeClass(r.active+" "+r.loading)}},deactivate:{all:function(){e.deactivate.navigation(),e.deactivate.tabs()},navigation:function(){g.removeClass(r.active)},tabs:function(){y.removeClass(r.active+" "+r.loading)}},is:{tab:function(a){return a!==d?e.get.tabElement(a).size()>0:!1}},get:{initialPath:function(){return g.eq(0).data(s.tab)||y.eq(0).data(s.tab)},path:function(){return a.address.value()},defaultPathArray:function(a){return e.utilities.pathToArray(e.get.defaultPath(a))},defaultPath:function(a){var b=g.filter("[data-"+s.tab+'^="'+a+'/"]').eq(0),c=b.data(s.tab)||!1;if(c){if(e.debug("Found default tab",c),B<h.maxDepth)return B++,e.get.defaultPath(c);e.error(u.recursion)}else e.debug("No default tabs found for",a,y);return B=0,a},navElement:function(a){return a=a||o,g.filter("[data-"+s.tab+'="'+a+'"]')},tabElement:function(a){var b,c,d,f;return a=a||o,d=e.utilities.pathToArray(a),f=e.utilities.last(d),b=y.filter("[data-"+s.tab+'="'+f+'"]'),c=y.filter("[data-"+s.tab+'="'+a+'"]'),b.size()>0?b:c},tab:function(){return o}},utilities:{filterArray:function(b,c){return a.grep(b,function(b){return-1==a.inArray(b,c)})},last:function(b){return a.isArray(b)?b[b.length-1]:!1},pathToArray:function(a){return a===d&&(a=o),"string"==typeof a?a.split("/"):[a]},arrayToPath:function(b){return a.isArray(b)?b.join("/"):!1}},setting:function(b,c){if(e.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,h,b);else{if(c===d)return h[b];h[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,e,b);else{if(c===d)return e[b];e[b]=c}},debug:function(){h.debug&&(h.performance?e.performance.log(arguments):(e.debug=Function.prototype.bind.call(console.info,console,h.name+":"),e.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?e.performance.log(arguments):(e.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),e.verbose.apply(console,arguments)))},error:function(){e.error=Function.prototype.bind.call(console.error,console,h.name+":"),e.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;h.performance&&(b=(new Date).getTime(),d=j||b,c=b-d,j=b,k.push({Element:C,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(e.performance.timer),e.performance.timer=setTimeout(e.performance.display,100)},display:function(){var b=h.name+":",c=0;j=!1,clearTimeout(e.performance.timer),a.each(k,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",i&&(b+=" '"+i+"'"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,c,g){var h,i,j,k=D;return c=c||n,g=C||g,"string"==typeof b&&k!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(k[g])&&c!=h)k=k[g];else{if(k[g]!==d)return i=k[g],!1;if(!a.isPlainObject(k[f])||c==h)return k[f]!==d?(i=k[f],!1):(e.error(u.method,b),!1);k=k[f]}})),a.isFunction(i)?j=i.apply(g,c):i!==d&&(j=i),a.isArray(f)?f.push(j):f!==d?f=[f,j]:j!==d&&(f=j),i}},m?(D===d&&e.initialize(),e.invoke(l)):(D!==d&&e.destroy(),e.initialize())}),e&&!m&&e.initializeHistory(),f!==d?f:this},a.tab=function(c){a(b).tab(c)},a.fn.tab.settings={name:"Tab",namespace:"tab",debug:!1,verbose:!1,performance:!1,onTabInit:function(){},onTabLoad:function(){},templates:{determineTitle:function(){}},auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,ignoreFirstLoad:!1,alwaysRefresh:!1,cache:!0,apiSettings:!1,error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found for this context.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",state:"The state library has not been initialized"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active",ui:"ui"},selector:{tabs:".ui.tab"}}
}(jQuery,window,document),function(a,b,c,d){a.fn.transition=function(){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments,k=j[0],l=[].slice.call(arguments,1),m="string"==typeof k,n=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};return f.each(function(){var b,o,p,q,r,s,t,u,v,w,x=a(this),y=this;w={initialize:function(){b=w.get.settings.apply(y,j),w.verbose("Converted arguments into settings object",b),p=b.error,q=b.className,u=b.namespace,r=b.metadata,v="module-"+u,s=w.get.animationEvent(),t=w.get.animationName(),o=x.data(v)||w,m&&(m=w.invoke(k)),m===!1&&(w.animate(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of module",w),x.data(v,o)},destroy:function(){w.verbose("Destroying previous module for",y),x.removeData(v)},refresh:function(){w.verbose("Refreshing display type on next animation"),delete o.displayType},forceRepaint:function(){w.verbose("Forcing element repaint");var a=x.parent(),b=x.next();0===b.size()?x.detach().appendTo(a):x.detach().insertBefore(b)},repaint:function(){w.verbose("Repainting element");y.offsetWidth},animate:function(a){return b=a||b,w.is.supported()?(w.debug("Preparing animation",b.animation),w.is.animating()&&b.queue?(!b.allowRepeats&&w.has.direction()&&w.is.occuring()&&o.queuing!==!0?w.error(p.repeated):w.queue(b.animation),!1):void(w.can.animate?w.set.animating(b.animation):w.error(p.noAnimation,b.animation))):(w.error(p.support),!1)},reset:function(){w.debug("Resetting animation to beginning conditions"),x.off(s),w.restore.conditions(),w.hide(),w.remove.animating()},queue:function(a){w.debug("Queueing animation of",a),o.queuing=!0,x.one(s,function(){o.queuing=!1,w.repaint(),w.animate.apply(this,b)})},complete:function(){w.verbose("CSS animation complete",b.animation),w.is.looping()||(w.is.outward()?(w.verbose("Animation is outward, hiding element"),w.restore.conditions(),w.remove.display(),w.hide(),a.proxy(b.onHide,this)()):w.is.inward()?(w.verbose("Animation is outward, showing element"),w.restore.conditions(),w.show(),a.proxy(b.onShow,this)()):w.restore.conditions(),w.remove.duration(),w.remove.animating()),a.proxy(b.complete,this)()},has:{direction:function(a){return a=a||b.animation,-1!==a.search(q.inward)||-1!==a.search(q.outward)?(w.debug("Direction already set in animation"),!0):!1}},set:{animating:function(a){a=a||b.animation,w.save.conditions(),w.can.transition()&&!w.has.direction()&&w.set.direction(),w.remove.hidden(),w.set.display(),x.addClass(q.animating).addClass(q.transition).addClass(a).one(s,w.complete),w.set.duration(b.duration),w.debug("Starting tween",b.animation,x.attr("class"))},display:function(){var a=x.css("style"),b=w.get.displayType(),c=a+";display: "+b+" !important;";"block"!==b&&(w.verbose("Setting final visibility to",b),x.attr("style",c))},direction:function(){x.is(":visible")?(w.debug("Automatically determining the direction of animation","Outward"),x.removeClass(q.inward).addClass(q.outward)):(w.debug("Automatically determining the direction of animation","Inward"),x.removeClass(q.outward).addClass(q.inward))},looping:function(){w.debug("Transition set to loop"),x.addClass(q.looping)},duration:function(a){a=a||b.duration,a="number"==typeof a?a+"ms":a,w.verbose("Setting animation duration",a),x.css({"-webkit-animation-duration":a,"-moz-animation-duration":a,"-ms-animation-duration":a,"-o-animation-duration":a,"animation-duration":a})},hidden:function(){x.addClass(q.transition).addClass(q.hidden),n(function(){"none"!==x.css("display")&&(w.verbose("Overriding default display to hide element"),x.css("display","none"))})},visible:function(){x.addClass(q.transition).addClass(q.visible)}},save:{displayType:function(a){o.displayType=a},transitionExists:function(b,c){a.fn.transition.exists[b]=c,w.verbose("Saving existence of transition",b,c)},conditions:function(){o.cache={className:x.attr("class"),style:x.attr("style")},w.verbose("Saving original attributes",o.cache)}},restore:{conditions:function(){return o.cache===d?!1:(o.cache.className?x.attr("class",o.cache.className):x.removeAttr("class"),o.cache.style?x.attr("style",o.cache.style):"block"===w.get.displayType()&&x.removeAttr("style"),w.is.looping()&&w.remove.looping(),void w.verbose("Restoring original attributes",o.cache))}},remove:{animating:function(){x.removeClass(q.animating)},display:function(){o.displayType!==d&&x.css("display","")},duration:function(){x.css({"-webkit-animation-duration":"","-moz-animation-duration":"","-ms-animation-duration":"","-o-animation-duration":"","animation-duration":""})},hidden:function(){x.removeClass(q.hidden)},visible:function(){x.removeClass(q.visible)},looping:function(){w.debug("Transitions are no longer looping"),x.removeClass(q.looping),w.forceRepaint()},transition:function(){x.removeClass(q.visible).removeClass(q.hidden)}},get:{settings:function(b,c,d){return"object"==typeof b?a.extend(!0,{},a.fn.transition.settings,b):"function"==typeof d?a.extend({},a.fn.transition.settings,{animation:b,complete:d,duration:c}):"string"==typeof c||"number"==typeof c?a.extend({},a.fn.transition.settings,{animation:b,duration:c}):"object"==typeof c?a.extend({},a.fn.transition.settings,c,{animation:b}):"function"==typeof c?a.extend({},a.fn.transition.settings,{animation:b,complete:c}):a.extend({},a.fn.transition.settings,{animation:b})},displayType:function(){return o.displayType===d&&w.can.transition(),o.displayType},transitionExists:function(b){return a.fn.transition.exists[b]},animationName:function(){var a,b=c.createElement("div"),e={animation:"animationName",OAnimation:"oAnimationName",MozAnimation:"mozAnimationName",WebkitAnimation:"webkitAnimationName"};for(a in e)if(b.style[a]!==d)return w.verbose("Determined animation vendor name property",e[a]),e[a];return!1},animationEvent:function(){var a,b=c.createElement("div"),e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(a in e)if(b.style[a]!==d)return w.verbose("Determined animation vendor end event",e[a]),e[a];return!1}},can:{animate:function(){return"none"!==x.css(b.animation)?(w.debug("CSS definition found",x.css(b.animation)),!0):(w.debug("Unable to find css definition",x.attr("class")),!1)},transition:function(){var c,e,f,g,h=x.attr("class"),i=b.animation,j=w.get.transitionExists(b.animation);return(j===d||o.displayType===d)&&(w.verbose("Determining whether animation exists"),c=a("<div>").addClass(h).appendTo(a("body")),e=c.removeClass(q.inward).removeClass(q.outward).addClass(q.animating).addClass(q.transition).addClass(i).css(t),f=c.addClass(q.inward).css(t),g=c.attr("class",h).show().css("display"),w.verbose("Determining final display state",g),e!=f?(w.debug("Transition exists for animation",i),j=!0):(w.debug("Static animation found",i,g),j=!1),c.remove(),w.save.displayType(g),w.save.transitionExists(i,j)),j}},is:{animating:function(){return x.hasClass(q.animating)},inward:function(){return x.hasClass(q.inward)},outward:function(){return x.hasClass(q.outward)},looping:function(){return x.hasClass(q.looping)},occuring:function(a){return a=a||b.animation,x.hasClass(a)},visible:function(){return x.is(":visible")},supported:function(){return t!==!1&&s!==!1}},hide:function(){w.verbose("Hiding element"),w.remove.visible(),w.set.hidden(),w.repaint()},show:function(a){w.verbose("Showing element",a),w.remove.hidden(),w.set.visible(),w.repaint()},start:function(){w.verbose("Starting animation"),x.removeClass(q.disabled)},stop:function(){w.debug("Stopping animation"),x.addClass(q.disabled)},toggle:function(){w.debug("Toggling play status"),x.toggleClass(q.disabled)},setting:function(c,e){if(w.debug("Changing setting",c,e),a.isPlainObject(c))a.extend(!0,b,c);else{if(e===d)return b[c];b[c]=e}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,w,b);else{if(c===d)return w[b];w[b]=c}},debug:function(){b.debug&&(b.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,b.name+":"),w.debug.apply(console,arguments)))},verbose:function(){b.verbose&&b.debug&&(b.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,b.name+":"),w.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;b.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:y,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,100)},display:function(){var c=b.name+":",e=0;h=!1,clearTimeout(w.performance.timer),a.each(i,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",g&&(c+=" '"+g+"'"),f.size()>1&&(c+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(c),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=o;return c=c||l,f=y||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h||!1}},w.initialize()}),e!==d?e:this},a.fn.transition.exists={},a.fn.transition.settings={name:"Transition",debug:!1,verbose:!0,performance:!0,namespace:"transition",complete:function(){},onShow:function(){},onHide:function(){},allowRepeats:!1,animation:"fade",duration:"500ms",queue:!0,className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"ui transition",visible:"visible"},error:{noAnimation:"There is no css animation matching the one you specified.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(a,b,c,d){a.fn.video=function(c){{var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)}}return f.each(function(){var m,n=a.isPlainObject(c)?a.extend(!0,{},a.fn.video.settings,c):a.extend({},a.fn.video.settings),o=n.selector,p=n.className,q=n.error,r=n.metadata,s=n.namespace,t=n.templates,u="."+s,v="module-"+s,w=(a(b),a(this)),x=w.find(o.placeholder),y=w.find(o.playButton),z=w.find(o.embed),A=this,B=w.data(v);m={initialize:function(){m.debug("Initializing video"),m.create(),x.on("click"+u,m.play),y.on("click"+u,m.play),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),B=m,w.data(v,m)},create:function(){var a=w.data(r.image),b=t.video(a);w.html(b),m.refresh(),a||m.play(),m.debug("Creating html for video element",b)},destroy:function(){m.verbose("Destroying previous instance of video"),w.removeData(v).off(u),x.off(u),y.off(u)},refresh:function(){m.verbose("Refreshing selector cache"),x=w.find(o.placeholder),y=w.find(o.playButton),z=w.find(o.embed)},change:function(a,b,c){m.debug("Changing video to ",a,b,c),w.data(r.source,a).data(r.id,b).data(r.url,c),n.onChange()},reset:function(){m.debug("Clearing video embed and showing placeholder"),w.removeClass(p.active),z.html(" "),x.show(),n.onReset()},play:function(){m.debug("Playing video");var a=w.data(r.source)||!1,b=w.data(r.url)||!1,c=w.data(r.id)||!1;z.html(m.generate.html(a,c,b)),w.addClass(p.active),n.onPlay()},get:{source:function(a){return"string"!=typeof a?!1:-1!==a.search("youtube.com")?"youtube":-1!==a.search("vimeo.com")?"vimeo":!1},id:function(a){return n.regExp.youtube.test(a)?a.match(n.regExp.youtube)[1]:n.regExp.vimeo.test(a)?a.match(n.regExp.vimeo)[2]:!1}},generate:{html:function(a,b,c){m.debug("Generating embed html");var d;return a=a||n.source,b=b||n.id,a&&b||c?(a&&b||(a=m.get.source(c),b=m.get.id(c)),"vimeo"==a?d='<iframe src="http://player.vimeo.com/video/'+b+"?="+m.generate.url(a)+'" width="100%" height="100%" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':"youtube"==a&&(d='<iframe src="http://www.youtube.com/embed/'+b+"?="+m.generate.url(a)+'" width="100%" height="100%" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>')):m.error(q.noVideo),d},url:function(a){var b=n.api?1:0,c="auto"===n.autoplay?w.data("image")!==d:n.autoplay,e=n.hd?1:0,f=n.showUI?1:0,g=n.showUI?0:1,h="";return"vimeo"==a&&(h="api="+b+"&amp;title="+f+"&amp;byline="+f+"&amp;portrait="+f+"&amp;autoplay="+c,n.color&&(h+="&amp;color="+n.color)),"ustream"==a?(h="autoplay="+c,n.color&&(h+="&amp;color="+n.color)):"youtube"==a&&(h="enablejsapi="+b+"&amp;autoplay="+c+"&amp;autohide="+g+"&amp;hq="+e+"&amp;modestbranding=1",n.color&&(h+="&amp;color="+n.color)),h}},setting:function(b,c){if(m.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];n[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,m,b);else{if(c===d)return m[b];m[b]=c}},debug:function(){n.debug&&(n.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,n.name+":"),m.debug.apply(console,arguments)))},verbose:function(){n.verbose&&n.debug&&(n.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,n.name+":"),m.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;n.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Element:A,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,100)},display:function(){var b=n.name+":",c=0;h=!1,clearTimeout(m.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(b,c,f){var g,h,i,j=B;return c=c||l,f=A||f,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):e!==d?e=[e,i]:i!==d&&(e=i),h}},k?(B===d&&m.initialize(),m.invoke(j)):(B!==d&&m.destroy(),m.initialize())}),e!==d?e:this},a.fn.video.settings={name:"Video",namespace:"video",debug:!1,verbose:!0,performance:!0,metadata:{id:"id",image:"image",source:"source",url:"url"},source:!1,url:!1,id:!1,aspectRatio:16/9,onPlay:function(){},onReset:function(){},onChange:function(){},onPause:function(){},onStop:function(){},width:"auto",height:"auto",autoplay:"auto",color:"#442359",hd:!0,showUI:!1,api:!0,regExp:{youtube:/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,vimeo:/http:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/},error:{noVideo:"No video specified",method:"The method you called is not defined"},className:{active:"active"},selector:{embed:".embed",placeholder:".placeholder",playButton:".play"}},a.fn.video.settings.templates={video:function(a){var b="";return a&&(b+='<i class="play sign icon"></i><img class="placeholder" src="'+a+'">'),b+='<div class="embed"></div>'}}}(jQuery,window,document);