!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, normalizing 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,a.each(e,function(d,e){var h,i=!f.moduleExists(e)||a.fn[e].settings.namespace||!1;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.length>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,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.length>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,500)},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:!1,performance:!0,modules:["accordion","api","checkbox","dimmer","dropdown","embed","form","modal","nag","popup","rating","shape","sidebar","state","sticky","tab","transition","visit","visibility"],siteNamespace:"site",namespaceStub:{cache:{},config:{},sections:{},section:{},utilities:{}}},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){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.form=function(b){var e,f=a(this),g=f.selector||"",h=(new Date).getTime(),i=[],j=arguments[0],k=arguments[1],l="string"==typeof j,m=[].slice.call(arguments,1);return f.each(function(){var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a(this),G=this,H=[],I=!1;E={initialize:function(){E.get.settings(),l?(D===d&&E.instantiate(),E.invoke(j)):(D!==d&&D.invoke("destroy"),E.verbose("Initializing form validation",F,u),E.bindEvents(),E.set.defaults(),E.instantiate())},instantiate:function(){E.verbose("Storing instance of module",E),D=E,F.data(B,E)},destroy:function(){E.verbose("Destroying previous module",D),E.removeEvents(),F.removeData(B)},refresh:function(){E.verbose("Refreshing selector cache"),n=F.find(x.field),o=F.find(x.group),p=F.find(x.message),q=F.find(x.prompt),r=F.find(x.submit),s=F.find(x.clear),t=F.find(x.reset)},submit:function(){E.verbose("Submitting form",F),F.submit()},attachEvents:function(b,c){c=c||"submit",a(b).on("click"+C,function(a){E[c](),a.preventDefault()})},bindEvents:function(){E.verbose("Attaching form events"),F.on("submit"+C,E.validate.form).on("blur"+C,x.field,E.event.field.blur).on("click"+C,x.submit,E.submit).on("click"+C,x.reset,E.reset).on("click"+C,x.clear,E.clear),u.keyboardShortcuts&&F.on("keydown"+C,x.field,E.event.field.keydown),n.each(function(){var b=a(this),c=b.prop("type"),d=E.get.changeEvent(c,b);a(this).on(d+C,E.event.field.change)})},clear:function(){n.each(function(){var b=a(this),c=b.parent(),d=b.closest(o),e=d.find(x.prompt),f=b.data(w.defaultValue)||"",g=c.is(x.uiCheckbox),h=c.is(x.uiDropdown),i=d.hasClass(y.error);i&&(E.verbose("Resetting error on field",d),d.removeClass(y.error),e.remove()),h?(E.verbose("Resetting dropdown value",c,f),c.dropdown("clear")):g?b.prop("checked",!1):(E.verbose("Resetting field value",b,f),b.val(""))})},reset:function(){n.each(function(){var b=a(this),c=b.parent(),e=b.closest(o),f=e.find(x.prompt),g=b.data(w.defaultValue),h=c.is(x.uiCheckbox),i=c.is(x.uiDropdown),j=e.hasClass(y.error);g!==d&&(j&&(E.verbose("Resetting error on field",e),e.removeClass(y.error),f.remove()),i?(E.verbose("Resetting dropdown value",c,g),c.dropdown("restore defaults")):h?(E.verbose("Resetting checkbox value",c,g),b.prop("checked",g)):(E.verbose("Resetting field value",b,g),b.val(g)))})},is:{bracketedRule:function(a){return a.type&&a.type.match(u.regExp.bracket)},empty:function(a){return!a||0===a.length||(a.is('input[type="checkbox"]')?!a.is(":checked"):E.is.blank(a))},blank:function(b){return""===a.trim(b.val())},valid:function(){var b=!0;return E.verbose("Checking if form is valid"),a.each(v,function(a,c){E.validate.field(c,a)||(b=!1)}),b}},removeEvents:function(){F.off(C),n.off(C),r.off(C),n.off(C)},event:{field:{keydown:function(b){var c=a(this),d=b.which,e=c.is(x.input),f=c.is(x.checkbox),g=c.closest(x.uiDropdown).length>0,h={enter:13,escape:27};d==h.escape&&(E.verbose("Escape key pressed blurring field"),c.blur()),b.ctrlKey||d!=h.enter||!e||g||f||(I||(c.one("keyup"+C,E.event.field.keyup),E.submit(),E.debug("Enter pressed on input submitting form")),I=!0)},keyup:function(){I=!1},blur:function(b){var c=a(this),d=c.closest(o),e=E.get.validation(c);d.hasClass(y.error)?(E.debug("Revalidating field",c,e),e&&E.validate.field(e)):"blur"!=u.on&&"change"!=u.on||e&&E.validate.field(e)},change:function(b){var c=a(this),d=c.closest(o),e=E.get.validation(c);("change"==u.on||d.hasClass(y.error)&&u.revalidate)&&(clearTimeout(E.timer),E.timer=setTimeout(function(){E.debug("Revalidating field",c,E.get.validation(c)),E.validate.field(e)},u.delay))}}},get:{ancillaryValue:function(a){return!(!a.type||!a.value&&!E.is.bracketedRule(a))&&(a.value!==d?a.value:a.type.match(u.regExp.bracket)[1]+"")},ruleName:function(a){return E.is.bracketedRule(a)?a.type.replace(a.type.match(u.regExp.bracket)[0],""):a.type},changeEvent:function(a,b){return"checkbox"==a||"radio"==a||"hidden"==a||b.is("select")?"change":E.get.inputEvent()},inputEvent:function(){return c.createElement("input").oninput!==d?"input":c.createElement("input").onpropertychange!==d?"propertychange":"keyup"},prompt:function(a,b){var c,d,e,f=E.get.ruleName(a),g=E.get.ancillaryValue(a),h=a.prompt||u.prompt[f]||u.text.unspecifiedRule,i=h.search("{value}")!==-1,j=h.search("{name}")!==-1;return(j||i)&&(d=E.get.field(b.identifier)),i&&(h=h.replace("{value}",d.val())),j&&(c=d.closest(x.group).find("label").eq(0),e=1==c.length?c.text():d.prop("placeholder")||u.text.unspecifiedField,h=h.replace("{name}",e)),h=h.replace("{identifier}",b.identifier),h=h.replace("{ruleValue}",g),a.prompt||E.verbose("Using default validation prompt for type",h,f),h},settings:function(){if(a.isPlainObject(b)){var c,e=Object.keys(b),f=e.length>0&&b[e[0]].identifier!==d&&b[e[0]].rules!==d;f?(u=a.extend(!0,{},a.fn.form.settings,k),v=a.extend({},a.fn.form.settings.defaults,b),E.error(u.error.oldSyntax,G),E.verbose("Extending settings from legacy parameters",v,u)):(b.fields&&(c=Object.keys(b.fields),("string"==typeof b.fields[c[0]]||a.isArray(b.fields[c[0]]))&&a.each(b.fields,function(c,d){"string"==typeof d&&(d=[d]),b.fields[c]={rules:[]},a.each(d,function(a,d){b.fields[c].rules.push({type:d})})})),u=a.extend(!0,{},a.fn.form.settings,b),v=a.extend({},a.fn.form.settings.defaults,u.fields),E.verbose("Extending settings",v,u))}else u=a.fn.form.settings,v=a.fn.form.settings.defaults,E.verbose("Using default form validation",v,u);A=u.namespace,w=u.metadata,x=u.selector,y=u.className,z=u.error,B="module-"+A,C="."+A,D=F.data(B),E.refresh()},field:function(b){return E.verbose("Finding field with identifier",b),n.filter("#"+b).length>0?n.filter("#"+b):n.filter('[name="'+b+'"]').length>0?n.filter('[name="'+b+'"]'):n.filter('[name="'+b+'[]"]').length>0?n.filter('[name="'+b+'[]"]'):n.filter("[data-"+w.validate+'="'+b+'"]').length>0?n.filter("[data-"+w.validate+'="'+b+'"]'):a(" ")},fields:function(b){var c=a();return a.each(b,function(a,b){c=c.add(E.get.field(b))}),c},validation:function(b){var c,d;return!!v&&(a.each(v,function(a,e){d=e.identifier||a,E.get.field(d)[0]==b[0]&&(e.identifier=d,c=e)}),c||!1)},value:function(a){var b,c=[];return c.push(a),b=E.get.values.call(G,c),b[a]},values:function(b){var c=a.isArray(b)?E.get.fields(b):n,d={};return c.each(function(b,c){var e=a(c),f=(e.prop("type"),e.prop("name")),g=e.val(),h=e.is(x.checkbox),i=e.is(x.radio),j=f.indexOf("[]")!==-1,k=!!h&&e.is(":checked");f&&(j?(f=f.replace("[]",""),d[f]||(d[f]=[]),h?k?d[f].push(g||!0):d[f].push(!1):d[f].push(g)):i?k&&(d[f]=g):h?k?d[f]=g||!0:d[f]=!1:d[f]=g)}),d}},has:{field:function(a){return E.verbose("Checking for existence of a field with identifier",a),"string"!=typeof a&&E.error(z.identifier,a),n.filter("#"+a).length>0||n.filter('[name="'+a+'"]').length>0||n.filter("[data-"+w.validate+'="'+a+'"]').length>0}},add:{prompt:function(b,c){var e=E.get.field(b),f=e.closest(o),g=f.children(x.prompt),h=0!==g.length;c="string"==typeof c?[c]:c,E.verbose("Adding field error state",b),f.addClass(y.error),u.inline&&(h||(g=u.templates.prompt(c),g.appendTo(f)),g.html(c[0]),h?E.verbose("Inline errors are disabled, no inline error added",b):u.transition&&a.fn.transition!==d&&F.transition("is supported")?(E.verbose("Displaying error with css transition",u.transition),g.transition(u.transition+" in",u.duration)):(E.verbose("Displaying error with fallback javascript animation"),g.fadeIn(u.duration)))},errors:function(a){E.debug("Adding form error messages",a),E.set.error(),p.html(u.templates.error(a))}},remove:{prompt:function(b){var c=E.get.field(b),e=c.closest(o),f=e.children(x.prompt);e.removeClass(y.error),u.inline&&f.is(":visible")&&(E.verbose("Removing prompt for field",b),u.transition&&a.fn.transition!==d&&F.transition("is supported")?f.transition(u.transition+" out",u.duration,function(){f.remove()}):f.fadeOut(u.duration,function(){f.remove()}))}},set:{success:function(){F.removeClass(y.error).addClass(y.success)},defaults:function(){n.each(function(){var b=a(this),c=b.filter(x.checkbox).length>0,d=c?b.is(":checked"):b.val();b.data(w.defaultValue,d)})},error:function(){F.removeClass(y.success).addClass(y.error)},value:function(a,b){var c={};return c[a]=b,E.set.values.call(G,c)},values:function(b){a.isEmptyObject(b)||a.each(b,function(b,c){var d,e=E.get.field(b),f=e.parent(),g=a.isArray(c),h=f.is(x.uiCheckbox),i=f.is(x.uiDropdown),j=e.is(x.radio)&&h,k=e.length>0;k&&(g&&h?(E.verbose("Selecting multiple",c,e),f.checkbox("uncheck"),a.each(c,function(a,b){d=e.filter('[value="'+b+'"]'),f=d.parent(),d.length>0&&f.checkbox("check")})):j?(E.verbose("Selecting radio value",c,e),e.filter('[value="'+c+'"]').parent(x.uiCheckbox).checkbox("check")):h?(E.verbose("Setting checkbox value",c,f),c===!0?f.checkbox("check"):f.checkbox("uncheck")):i?(E.verbose("Setting dropdown value",c,f),f.dropdown("set selected",c)):(E.verbose("Setting field value",c,e),e.val(c)))})}},validate:{form:function(a,b){var c=E.get.values();if(I)return!1;if(H=[],E.is.valid()){if(E.debug("Form has no validation errors, submitting"),E.set.success(),b!==!0)return u.onSuccess.call(G,a,c)}else if(E.debug("Form has errors"),E.set.error(),u.inline||E.add.errors(H),F.data("moduleApi")!==d&&a.stopImmediatePropagation(),b!==!0)return u.onFailure.call(G,H,c)},field:function(b,c){var e=b.identifier||c,f=E.get.field(e),g=!!b.depends&&E.get.field(b.depends),h=!0,i=[];return b.identifier||(E.debug("Using field name as identifier",e),b.identifier=e),f.prop("disabled")?(E.debug("Field is disabled. Skipping",e),h=!0):b.optional&&E.is.blank(f)?(E.debug("Field is optional and blank. Skipping",e),h=!0):b.depends&&E.is.empty(g)?(E.debug("Field depends on another value that is not present or empty. Skipping",g),h=!0):b.rules!==d&&a.each(b.rules,function(a,c){E.has.field(e)&&!E.validate.rule(b,c)&&(E.debug("Field is invalid",e,c.type),i.push(E.get.prompt(c,b)),h=!1)}),h?(E.remove.prompt(e,i),u.onValid.call(f),!0):(H=H.concat(i),E.add.prompt(e,i),u.onInvalid.call(f,i),!1)},rule:function(b,c){var e=E.get.field(b.identifier),f=(c.type,e.val()),g=E.get.ancillaryValue(c),h=E.get.ruleName(c),i=u.rules[h];return a.isFunction(i)?(f=f===d||""===f||null===f?"":a.trim(f+""),i.call(e,f,g)):void E.error(z.noRule,h)}},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,u,b);else{if(c===d)return u[b];u[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(){!u.silent&&u.debug&&(u.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,u.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),E.verbose.apply(console,arguments)))},error:function(){u.silent||(E.error=Function.prototype.bind.call(console.error,console,u.name+":"),E.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;u.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:G,"Execution Time":c})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var b=u.name+":",c=0;h=!1,clearTimeout(E.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.length>1&&(b+=" ("+f.length+")"),(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=D;return c=c||m,f=G||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);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}},E.initialize()}),e!==d?e:this},a.fn.form.settings={name:"Form",namespace:"form",debug:!1,verbose:!1,performance:!0,fields:!1,keyboardShortcuts:!0,on:"submit",inline:!1,delay:200,revalidate:!0,transition:"scale",duration:200,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{defaultValue:"default",validate:"validate"},regExp:{bracket:/\[(.*)\]/i,decimal:/^\d*(\.)\d+/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,flags:/^\/(.*)\/(.*)?/,integer:/^\-?\d+$/,number:/^\-?\d*(\.\d+)?$/,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i},text:{unspecifiedRule:"Please enter a valid value",unspecifiedField:"This field"},prompt:{empty:"{name} must have a value",checked:"{name} must be checked",email:"{name} must be a valid e-mail",url:"{name} must be a valid url",regExp:"{name} is not formatted correctly",integer:"{name} must be an integer",decimal:"{name} must be a decimal number",number:"{name} must be set to a number",is:'{name} must be "{ruleValue}"',isExactly:'{name} must be exactly "{ruleValue}"',not:'{name} cannot be set to "{ruleValue}"',notExactly:'{name} cannot be set to exactly "{ruleValue}"',contain:'{name} cannot contain "{ruleValue}"',containExactly:'{name} cannot contain exactly "{ruleValue}"',doesntContain:'{name} must contain "{ruleValue}"',doesntContainExactly:'{name} must contain exactly "{ruleValue}"',minLength:"{name} must be at least {ruleValue} characters",length:"{name} must be at least {ruleValue} characters",exactLength:"{name} must be exactly {ruleValue} characters",maxLength:"{name} cannot be longer than {ruleValue} characters",match:"{name} must match {ruleValue} field",different:"{name} must have a different value than {ruleValue} field",creditCard:"{name} must be a valid credit card number",minCount:"{name} must have at least {ruleValue} choices",exactCount:"{name} must have exactly {ruleValue} choices",maxCount:"{name} must have {ruleValue} or less choices"},selector:{checkbox:'input[type="checkbox"], input[type="radio"]',clear:".clear",field:"input, textarea, select",group:".field",input:"input",message:".error.message",prompt:".prompt.label",radio:'input[type="radio"]',reset:'.reset:not([type="reset"])',submit:'.submit:not([type="submit"])',uiCheckbox:".ui.checkbox",uiDropdown:".ui.dropdown"},className:{error:"error",label:"ui prompt label",pressed:"down",success:"success"},error:{identifier:"You must specify a string identifier for each field",method:"The method you called is not defined.",noRule:"There is no rule matching the one you specified",oldSyntax:"Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."},templates:{error:function(b){var c='
';return a.each(b,function(a,b){c+=""+b+" "}),c+=" ",a(c)},prompt:function(b){return a("
").addClass("ui basic red pointing prompt label").html(b[0])}},rules:{empty:function(b){return!(b===d||""===b||a.isArray(b)&&0===b.length)},checked:function(){return a(this).filter(":checked").length>0},email:function(b){return a.fn.form.settings.regExp.email.test(b)},url:function(b){return a.fn.form.settings.regExp.url.test(b)},regExp:function(b,c){if(c instanceof RegExp)return b.match(c);var d,e=c.match(a.fn.form.settings.regExp.flags);return e&&(c=e.length>=2?e[1]:c,d=e.length>=3?e[2]:""),b.match(new RegExp(c,d))},integer:function(b,c){var e,f,g,h=a.fn.form.settings.regExp.integer;return c&&["",".."].indexOf(c)===-1&&(c.indexOf("..")==-1?h.test(c)&&(e=f=c-0):(g=c.split("..",2),h.test(g[0])&&(e=g[0]-0),h.test(g[1])&&(f=g[1]-0))),h.test(b)&&(e===d||b>=e)&&(f===d||b<=f)},decimal:function(b){return a.fn.form.settings.regExp.decimal.test(b)},number:function(b){return a.fn.form.settings.regExp.number.test(b)},is:function(a,b){return b="string"==typeof b?b.toLowerCase():b,a="string"==typeof a?a.toLowerCase():a,a==b},isExactly:function(a,b){return a==b},not:function(a,b){return a="string"==typeof a?a.toLowerCase():a,b="string"==typeof b?b.toLowerCase():b,a!=b},notExactly:function(a,b){return a!=b},contains:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c,"i"))!==-1},containsExactly:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c))!==-1},doesntContain:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c,"i"))===-1},doesntContainExactly:function(b,c){return c=c.replace(a.fn.form.settings.regExp.escape,"\\$&"),b.search(new RegExp(c))===-1},minLength:function(a,b){return a!==d&&a.length>=b},length:function(a,b){return a!==d&&a.length>=b},exactLength:function(a,b){return a!==d&&a.length==b},maxLength:function(a,b){return a!==d&&a.length<=b},match:function(b,c){var e;return a(this),a('[data-validate="'+c+'"]').length>0?e=a('[data-validate="'+c+'"]').val():a("#"+c).length>0?e=a("#"+c).val():a('[name="'+c+'"]').length>0?e=a('[name="'+c+'"]').val():a('[name="'+c+'[]"]').length>0&&(e=a('[name="'+c+'[]"]')),e!==d&&b.toString()==e.toString()},different:function(b,c){var e;return a(this),a('[data-validate="'+c+'"]').length>0?e=a('[data-validate="'+c+'"]').val():a("#"+c).length>0?e=a("#"+c).val():a('[name="'+c+'"]').length>0?e=a('[name="'+c+'"]').val():a('[name="'+c+'[]"]').length>0&&(e=a('[name="'+c+'[]"]')),e!==d&&b.toString()!==e.toString()},creditCard:function(b,c){var d,e,f={visa:{pattern:/^4/,length:[16]},amex:{pattern:/^3[47]/,length:[15]},mastercard:{pattern:/^5[1-5]/,length:[16]},discover:{pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,length:[16]},unionPay:{pattern:/^(62|88)/,length:[16,17,18,19]},jcb:{pattern:/^35(2[89]|[3-8][0-9])/,length:[16]},maestro:{pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,length:[12,13,14,15,16,17,18,19]},dinersClub:{pattern:/^(30[0-5]|^36)/,length:[14]},laser:{pattern:/^(6304|670[69]|6771)/,length:[16,17,18,19]},visaElectron:{pattern:/^(4026|417500|4508|4844|491(3|7))/,length:[16]}},g={},h=!1,i="string"==typeof c&&c.split(",");if("string"==typeof b&&0!==b.length){if(i&&(a.each(i,function(c,d){e=f[d],e&&(g={length:a.inArray(b.length,e.length)!==-1,pattern:b.search(e.pattern)!==-1},g.length&&g.pattern&&(h=!0))}),!h))return!1;if(d={number:a.inArray(b.length,f.unionPay.length)!==-1,pattern:b.search(f.unionPay.pattern)!==-1},d.number&&d.pattern)return!0;for(var j=b.length,k=0,l=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],m=0;j--;)m+=l[k][parseInt(b.charAt(j),10)],k^=1;return m%10===0&&m>0}},minCount:function(a,b){return 0==b||(1==b?""!==a:a.split(",").length>=b)},exactCount:function(a,b){return 0==b?""===a:1==b?""!==a&&a.search(",")===-1:a.split(",").length==b},maxCount:function(a,b){return 0!=b&&(1==b?a.search(",")===-1:a.split(",").length<=b)}}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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);return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(){var l,m,n=a.isPlainObject(c)?a.extend(!0,{},a.fn.accordion.settings,c):a.extend({},a.fn.accordion.settings),o=n.className,p=n.namespace,q=n.selector,r=n.error,s="."+p,t="module-"+p,u=f.selector||"",v=a(this),w=v.find(q.title),x=v.find(q.content),y=this,z=v.data(t);m={initialize:function(){m.debug("Initializing",v),m.bind.events(),n.observeChanges&&m.observeChanges(),m.instantiate()},instantiate:function(){z=m,v.data(t,m)},destroy:function(){m.debug("Destroying previous instance",v),v.off(s).removeData(t)},refresh:function(){w=v.find(q.title),x=v.find(q.content)},observeChanges:function(){"MutationObserver"in b&&(l=new MutationObserver(function(a){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),l.observe(y,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",l))},bind:{events:function(){m.debug("Binding delegated events"),v.on(n.on+s,q.trigger,m.event.click)}},event:{click:function(){m.toggle.call(this)}},toggle:function(b){var c=b!==d?"number"==typeof b?w.eq(b):a(b).closest(q.title):a(this).closest(q.title),e=c.next(x),f=e.hasClass(o.animating),g=e.hasClass(o.active),h=g&&!f,i=!g&&f;m.debug("Toggling visibility of content",c),h||i?n.collapsible?m.close.call(c):m.debug("Cannot close accordion content collapsing is disabled"):m.open.call(c)},open:function(b){var c=b!==d?"number"==typeof b?w.eq(b):a(b).closest(q.title):a(this).closest(q.title),e=c.next(x),f=e.hasClass(o.animating),g=e.hasClass(o.active),h=g||f;return h?void m.debug("Accordion already open, skipping",e):(m.debug("Opening accordion content",c),n.onOpening.call(e),n.exclusive&&m.closeOthers.call(c),c.addClass(o.active),e.stop(!0,!0).addClass(o.animating),n.animateChildren&&(a.fn.transition!==d&&v.transition("is supported")?e.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:n.debug,verbose:n.verbose,duration:n.duration}):e.children().stop(!0,!0).animate({opacity:1},n.duration,m.resetOpacity)),void e.slideDown(n.duration,n.easing,function(){e.removeClass(o.animating).addClass(o.active),m.reset.display.call(this),n.onOpen.call(this),n.onChange.call(this)}))},close:function(b){var c=b!==d?"number"==typeof b?w.eq(b):a(b).closest(q.title):a(this).closest(q.title),e=c.next(x),f=e.hasClass(o.animating),g=e.hasClass(o.active),h=!g&&f,i=g&&f;!g&&!h||i||(m.debug("Closing accordion content",e),n.onClosing.call(e),c.removeClass(o.active),e.stop(!0,!0).addClass(o.animating),n.animateChildren&&(a.fn.transition!==d&&v.transition("is supported")?e.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:n.debug,verbose:n.verbose,duration:n.duration}):e.children().stop(!0,!0).animate({opacity:0},n.duration,m.resetOpacity)),e.slideUp(n.duration,n.easing,function(){e.removeClass(o.animating).removeClass(o.active),m.reset.display.call(this),n.onClose.call(this),n.onChange.call(this)}))},closeOthers:function(b){var c,e,f,g=b!==d?w.eq(b):a(this).closest(q.title),h=g.parents(q.content).prev(q.title),i=g.closest(q.accordion),j=q.title+"."+o.active+":visible",k=q.content+"."+o.active+":visible";n.closeNested?(c=i.find(j).not(h),f=c.next(x)):(c=i.find(j).not(h),e=i.find(k).find(j).not(h),c=c.not(e),f=c.next(x)),c.length>0&&(m.debug("Exclusive enabled, closing other content",c),c.removeClass(o.active),f.removeClass(o.animating).stop(!0,!0),n.animateChildren&&(a.fn.transition!==d&&v.transition("is supported")?f.children().transition({animation:"fade out",useFailSafe:!0,debug:n.debug,verbose:n.verbose,duration:n.duration}):f.children().stop(!0,!0).animate({opacity:0},n.duration,m.resetOpacity)),f.slideUp(n.duration,n.easing,function(){a(this).removeClass(o.active),m.reset.display.call(this)}))},reset:{display:function(){m.verbose("Removing inline display from element",this),a(this).css("display",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),a(this).css("opacity",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")}},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];a.isPlainObject(n[b])?a.extend(!0,n[b],c):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.silent&&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.silent&&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(){n.silent||(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=g||b,c=b-d,g=b,h.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:y,"Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var b=n.name+":",c=0;g=!1,clearTimeout(m.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",u&&(b+=" '"+u+"'"),(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=z;return c=c||k,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):(m.error(r.method,b),!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?(z===d&&m.initialize(),m.invoke(i)):(z!==d&&z.invoke("destroy"),m.initialize())}),e!==d?e:this},a.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onOpen:function(){},onClosing:function(){},
onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating"},selector:{accordion:".accordion",title:".title",trigger:".title",content:".content"}},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){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.checkbox=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,o=a.extend(!0,{},a.fn.checkbox.settings,e),p=o.className,q=o.namespace,r=o.selector,s=o.error,t="."+q,u="module-"+q,v=a(this),w=a(this).children(r.label),x=a(this).children(r.input),y=x[0],z=!1,A=!1,B=v.data(u),C=this;n={initialize:function(){n.verbose("Initializing checkbox",o),n.create.label(),n.bind.events(),n.set.tabbable(),n.hide.input(),n.observeChanges(),n.instantiate(),n.setup()},instantiate:function(){n.verbose("Storing instance of module",n),B=n,v.data(u,n)},destroy:function(){n.verbose("Destroying module"),n.unbind.events(),n.show.input(),v.removeData(u)},fix:{reference:function(){v.is(r.input)&&(n.debug("Behavior called on adjusting invoked element"),v=v.closest(r.checkbox),n.refresh())}},setup:function(){n.set.initialLoad(),n.is.indeterminate()?(n.debug("Initial value is indeterminate"),n.indeterminate()):n.is.checked()?(n.debug("Initial value is checked"),n.check()):(n.debug("Initial value is unchecked"),n.uncheck()),n.remove.initialLoad()},refresh:function(){w=v.children(r.label),x=v.children(r.input),y=x[0]},hide:{input:function(){n.verbose("Modifying z-index to be unselectable"),x.addClass(p.hidden)}},show:{input:function(){n.verbose("Modifying z-index to be selectable"),x.removeClass(p.hidden)}},observeChanges:function(){"MutationObserver"in b&&(g=new MutationObserver(function(a){n.debug("DOM tree modified, updating selector cache"),n.refresh()}),g.observe(C,{childList:!0,subtree:!0}),n.debug("Setting up mutation observer",g))},attachEvents:function(b,c){var d=a(b);c=a.isFunction(n[c])?n[c]:n.toggle,d.length>0?(n.debug("Attaching checkbox events to element",b,c),d.on("click"+t,c)):n.error(s.notFound)},event:{click:function(b){var c=a(b.target);return c.is(r.input)?void n.verbose("Using default check action on initialized checkbox"):c.is(r.link)?void n.debug("Clicking link inside checkbox, skipping toggle"):(n.toggle(),x.focus(),void b.preventDefault())},keydown:function(a){var b=a.which,c={enter:13,space:32,escape:27};b==c.escape?(n.verbose("Escape key pressed blurring field"),x.blur(),A=!0):a.ctrlKey||b!=c.space&&b!=c.enter?A=!1:(n.verbose("Enter/space key pressed, toggling checkbox"),n.toggle(),A=!0)},keyup:function(a){A&&a.preventDefault()}},check:function(){n.should.allowCheck()&&(n.debug("Checking checkbox",x),n.set.checked(),n.should.ignoreCallbacks()||(o.onChecked.call(y),o.onChange.call(y)))},uncheck:function(){n.should.allowUncheck()&&(n.debug("Unchecking checkbox"),n.set.unchecked(),n.should.ignoreCallbacks()||(o.onUnchecked.call(y),o.onChange.call(y)))},indeterminate:function(){return n.should.allowIndeterminate()?void n.debug("Checkbox is already indeterminate"):(n.debug("Making checkbox indeterminate"),n.set.indeterminate(),void(n.should.ignoreCallbacks()||(o.onIndeterminate.call(y),o.onChange.call(y))))},determinate:function(){return n.should.allowDeterminate()?void n.debug("Checkbox is already determinate"):(n.debug("Making checkbox determinate"),n.set.determinate(),void(n.should.ignoreCallbacks()||(o.onDeterminate.call(y),o.onChange.call(y))))},enable:function(){return n.is.enabled()?void n.debug("Checkbox is already enabled"):(n.debug("Enabling checkbox"),n.set.enabled(),o.onEnable.call(y),void o.onEnabled.call(y))},disable:function(){return n.is.disabled()?void n.debug("Checkbox is already disabled"):(n.debug("Disabling checkbox"),n.set.disabled(),o.onDisable.call(y),void o.onDisabled.call(y))},get:{radios:function(){var b=n.get.name();return a('input[name="'+b+'"]').closest(r.checkbox)},otherRadios:function(){return n.get.radios().not(v)},name:function(){return x.attr("name")}},is:{initialLoad:function(){return z},radio:function(){return x.hasClass(p.radio)||"radio"==x.attr("type")},indeterminate:function(){return x.prop("indeterminate")!==d&&x.prop("indeterminate")},checked:function(){return x.prop("checked")!==d&&x.prop("checked")},disabled:function(){return x.prop("disabled")!==d&&x.prop("disabled")},enabled:function(){return!n.is.disabled()},determinate:function(){return!n.is.indeterminate()},unchecked:function(){return!n.is.checked()}},should:{allowCheck:function(){return n.is.determinate()&&n.is.checked()&&!n.should.forceCallbacks()?(n.debug("Should not allow check, checkbox is already checked"),!1):o.beforeChecked.apply(y)!==!1||(n.debug("Should not allow check, beforeChecked cancelled"),!1)},allowUncheck:function(){return n.is.determinate()&&n.is.unchecked()&&!n.should.forceCallbacks()?(n.debug("Should not allow uncheck, checkbox is already unchecked"),!1):o.beforeUnchecked.apply(y)!==!1||(n.debug("Should not allow uncheck, beforeUnchecked cancelled"),!1)},allowIndeterminate:function(){return n.is.indeterminate()&&!n.should.forceCallbacks()?(n.debug("Should not allow indeterminate, checkbox is already indeterminate"),!1):o.beforeIndeterminate.apply(y)!==!1||(n.debug("Should not allow indeterminate, beforeIndeterminate cancelled"),!1)},allowDeterminate:function(){return n.is.determinate()&&!n.should.forceCallbacks()?(n.debug("Should not allow determinate, checkbox is already determinate"),!1):o.beforeDeterminate.apply(y)!==!1||(n.debug("Should not allow determinate, beforeDeterminate cancelled"),!1)},forceCallbacks:function(){return n.is.initialLoad()&&o.fireOnInit},ignoreCallbacks:function(){return z&&!o.fireOnInit}},can:{change:function(){return!(v.hasClass(p.disabled)||v.hasClass(p.readOnly)||x.prop("disabled")||x.prop("readonly"))},uncheck:function(){return"boolean"==typeof o.uncheckable?o.uncheckable:!n.is.radio()}},set:{initialLoad:function(){z=!0},checked:function(){return n.verbose("Setting class to checked"),v.removeClass(p.indeterminate).addClass(p.checked),n.is.radio()&&n.uncheckOthers(),!n.is.indeterminate()&&n.is.checked()?void n.debug("Input is already checked, skipping input property change"):(n.verbose("Setting state to checked",y),x.prop("indeterminate",!1).prop("checked",!0),void n.trigger.change())},unchecked:function(){return n.verbose("Removing checked class"),v.removeClass(p.indeterminate).removeClass(p.checked),!n.is.indeterminate()&&n.is.unchecked()?void n.debug("Input is already unchecked"):(n.debug("Setting state to unchecked"),x.prop("indeterminate",!1).prop("checked",!1),void n.trigger.change())},indeterminate:function(){return n.verbose("Setting class to indeterminate"),v.addClass(p.indeterminate),n.is.indeterminate()?void n.debug("Input is already indeterminate, skipping input property change"):(n.debug("Setting state to indeterminate"),x.prop("indeterminate",!0),void n.trigger.change())},determinate:function(){return n.verbose("Removing indeterminate class"),v.removeClass(p.indeterminate),n.is.determinate()?void n.debug("Input is already determinate, skipping input property change"):(n.debug("Setting state to determinate"),void x.prop("indeterminate",!1))},disabled:function(){return n.verbose("Setting class to disabled"),v.addClass(p.disabled),n.is.disabled()?void n.debug("Input is already disabled, skipping input property change"):(n.debug("Setting state to disabled"),x.prop("disabled","disabled"),void n.trigger.change())},enabled:function(){return n.verbose("Removing disabled class"),v.removeClass(p.disabled),n.is.enabled()?void n.debug("Input is already enabled, skipping input property change"):(n.debug("Setting state to enabled"),x.prop("disabled",!1),void n.trigger.change())},tabbable:function(){n.verbose("Adding tabindex to checkbox"),x.attr("tabindex")===d&&x.attr("tabindex",0)}},remove:{initialLoad:function(){z=!1}},trigger:{change:function(){var a=c.createEvent("HTMLEvents"),b=x[0];b&&(n.verbose("Triggering native change event"),a.initEvent("change",!0,!1),b.dispatchEvent(a))}},create:{label:function(){x.prevAll(r.label).length>0?(x.prev(r.label).detach().insertAfter(x),n.debug("Moving existing label",w)):n.has.label()||(w=a("").insertAfter(x),n.debug("Creating label",w))}},has:{label:function(){return w.length>0}},bind:{events:function(){n.verbose("Attaching checkbox events"),v.on("click"+t,n.event.click).on("keydown"+t,r.input,n.event.keydown).on("keyup"+t,r.input,n.event.keyup)}},unbind:{events:function(){n.debug("Removing events"),v.off(t)}},uncheckOthers:function(){var a=n.get.otherRadios();n.debug("Unchecking other radios",a),a.removeClass(p.checked)},toggle:function(){return n.can.change()?void(n.is.indeterminate()||n.is.unchecked()?(n.debug("Currently unchecked"),n.check()):n.is.checked()&&n.can.uncheck()&&(n.debug("Currently checked"),n.uncheck())):void(n.is.radio()||n.debug("Checkbox is read-only or disabled, ignoring toggle"))},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];a.isPlainObject(o[b])?a.extend(!0,o[b],c):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.silent&&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.silent&&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(){o.silent||(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=i||b,c=b-d,i=b,j.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:C,"Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},display:function(){var b=o.name+":",c=0;i=!1,clearTimeout(n.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=B;return c=c||m,e=C||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):(n.error(s.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?(B===d&&n.initialize(),n.invoke(k)):(B!==d&&B.invoke("destroy"),n.initialize())}),f!==d?f:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",silent:!1,debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!1,onChange:function(){},beforeChecked:function(){},beforeUnchecked:function(){},beforeDeterminate:function(){},beforeIndeterminate:function(){},onChecked:function(){},onUnchecked:function(){},onDeterminate:function(){},onIndeterminate:function(){},onEnable:function(){},onDisable:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",indeterminate:"indeterminate",disabled:"disabled",hidden:"hidden",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",label:"label, .box",input:'input[type="checkbox"], input[type="radio"]',link:"a[href]"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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,t="."+q,u="module-"+q,v=f.selector||"",w="ontouchstart"in c.documentElement?"touchstart":"click",x=a(this),y=this,z=x.data(u);n={preinitialize:function(){n.is.dimmer()?(m=x.parent(),l=x):(m=x,l=n.has.dimmer()?o.dimmerName?m.find(p.dimmer).filter("."+o.dimmerName):m.find(p.dimmer):n.create(),n.set.variation())},initialize:function(){n.debug("Initializing dimmer",o),n.bind.events(),n.set.dimmable(),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),z=n,x.data(u,z)},destroy:function(){n.verbose("Destroying previous module",l),n.unbind.events(),n.remove.variation(),m.off(t)},bind:{events:function(){"hover"==o.on?m.on("mouseenter"+t,n.show).on("mouseleave"+t,n.hide):"click"==o.on&&m.on(w+t,n.toggle),n.is.page()&&(n.debug("Setting as a page dimmer",m),n.set.pageDimmer()),n.is.closable()&&(n.verbose("Adding dimmer close event",l),m.on(w+t,p.dimmer,n.event.click))}},unbind:{events:function(){x.removeData(u),m.off(t)}},event:{click:function(b){n.verbose("Determining if event occured on dimmer",b),(0===l.find(b.target).length||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(){var b=a(o.template.dimmer());return o.dimmerName&&(n.debug("Creating named dimmer",o.dimmerName),b.addClass(o.dimmerName)),b.appendTo(m),b},show:function(b){b=a.isFunction(b)?b:function(){},n.debug("Showing dimmer",l,o),n.is.dimmed()&&!n.is.animating()||!n.is.enabled()?n.debug("Dimmer is already shown or disabled"):(n.animate.show(b),o.onShow.call(y),o.onChange.call(y))},hide:function(b){b=a.isFunction(b)?b:function(){},n.is.dimmed()||n.is.animating()?(n.debug("Hiding dimmer",l),n.animate.hide(b),o.onHide.call(y),o.onChange.call(y)):n.debug("Dimmer is not visible")},toggle:function(){n.verbose("Toggling dimmer visibility",l),n.is.dimmed()?n.hide():n.show()},animate:{show:function(b){b=a.isFunction(b)?b:function(){},o.useCSS&&a.fn.transition!==d&&l.transition("is supported")?("auto"!==o.opacity&&n.set.opacity(),l.transition({animation:o.transition+" in",queue:!1,duration:n.get.duration(),useFailSafe:!0,onStart:function(){n.set.dimmed()},onComplete:function(){n.set.active(),b()}})):(n.verbose("Showing dimmer animation with javascript"),n.set.dimmed(),"auto"==o.opacity&&(o.opacity=.8),l.stop().css({opacity:0,width:"100%",height:"100%"}).fadeTo(n.get.duration(),o.opacity,function(){l.removeAttr("style"),n.set.active(),b()}))},hide:function(b){b=a.isFunction(b)?b:function(){},o.useCSS&&a.fn.transition!==d&&l.transition("is supported")?(n.verbose("Hiding dimmer with css"),l.transition({animation:o.transition+" out",queue:!1,duration:n.get.duration(),useFailSafe:!0,onStart:function(){n.remove.dimmed()},onComplete:function(){n.remove.active(),b()}})):(n.verbose("Hiding dimmer with javascript"),n.remove.dimmed(),l.stop().fadeOut(n.get.duration(),function(){n.remove.active(),l.removeAttr("style"),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 o.dimmerName?x.find(p.dimmer).filter("."+o.dimmerName).length>0:x.find(p.dimmer).length>0}},is:{active:function(){return l.hasClass(r.active)},animating:function(){return l.is(":animated")||l.hasClass(r.animating)},closable:function(){return"auto"==o.closable?"hover"!=o.on:o.closable},dimmer:function(){return x.hasClass(r.dimmer)},dimmable:function(){return x.hasClass(r.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:{opacity:function(a){var b=l.css("background-color"),c=b.split(","),d=c&&3==c.length,e=c&&4==c.length;a=0===o.opacity?0:o.opacity||a,d||e?(c[3]=a+")",b=c.join(",")):b="rgba(0, 0, 0, "+a+")",n.debug("Setting opacity to",a),l.css("background-color",b)},active:function(){l.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)},variation:function(a){a=a||o.variation,a&&l.addClass(a)}},remove:{active:function(){l.removeClass(r.active)},dimmed:function(){m.removeClass(r.dimmed)},disabled:function(){l.removeClass(r.disabled)},variation:function(a){a=a||o.variation,a&&l.removeClass(a)}},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];a.isPlainObject(o[b])?a.extend(!0,o[b],c):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.silent&&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.silent&&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(){o.silent||(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({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:y,"Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},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",v&&(b+=" '"+v+"'"),f.length>1&&(b+=" ("+f.length+")"),(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=z;return c=c||k,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):(n.error(s.method,b),!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?(z===d&&n.initialize(),n.invoke(i)):(z!==d&&z.invoke("destroy"),n.initialize())}),e!==d?e:this},a.fn.dimmer.settings={name:"Dimmer",namespace:"dimmer",silent:!1,debug:!1,verbose:!1,performance:!0,dimmerName:!1,variation:!1,closable:"auto",useCSS:!0,transition:"fade",on:!1,opacity:"auto",duration:{show:500,hide:500},onChange:function(){},onShow:function(){},onHide:function(){},error:{method:"The method you called is not defined."},className:{active:"active",animating:"animating",dimmable:"dimmable",dimmed:"dimmed",dimmer:"dimmer",disabled:"disabled",hide:"hide",pageDimmer:"page",show:"show"},selector:{dimmer:"> .ui.dimmer",content:".ui.dimmer > .content, .ui.dimmer > .content > .center"},template:{dimmer:function(){return a("
").attr("class","ui dimmer")}}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.dropdown=function(e){var f,g=a(this),h=a(c),i=g.selector||"",j="ontouchstart"in c.documentElement,k=(new Date).getTime(),l=[],m=arguments[0],n="string"==typeof m,o=[].slice.call(arguments,1);return g.each(function(p){var q,r,s,t,u,v,w,x,y=a.isPlainObject(e)?a.extend(!0,{},a.fn.dropdown.settings,e):a.extend({},a.fn.dropdown.settings),z=y.className,A=y.message,B=y.fields,C=y.keys,D=y.metadata,E=y.namespace,F=y.regExp,G=y.selector,H=y.error,I=y.templates,J="."+E,K="module-"+E,L=a(this),M=a(y.context),N=L.find(G.text),O=L.find(G.search),P=L.find(G.sizer),Q=L.find(G.input),R=L.find(G.icon),S=L.prev().find(G.text).length>0?L.prev().find(G.text):L.prev(),T=L.children(G.menu),U=T.find(G.item),V=!1,W=!1,X=!1,Y=this,Z=L.data(K);x={initialize:function(){x.debug("Initializing dropdown",y),x.is.alreadySetup()?x.setup.reference():(x.setup.layout(),x.refreshData(),x.save.defaults(),x.restore.selected(),x.create.id(),x.bind.events(),x.observeChanges(),x.instantiate())},instantiate:function(){x.verbose("Storing instance of dropdown",x),Z=x,L.data(K,x)},destroy:function(){x.verbose("Destroying previous dropdown",L),x.remove.tabbable(),L.off(J).removeData(K),T.off(J),h.off(t),x.disconnect.menuObserver(),x.disconnect.selectObserver()},observeChanges:function(){"MutationObserver"in b&&(v=new MutationObserver(x.event.select.mutation),w=new MutationObserver(x.event.menu.mutation),x.debug("Setting up mutation observer",v,w),x.observe.select(),x.observe.menu())},disconnect:{menuObserver:function(){w&&w.disconnect()},selectObserver:function(){v&&v.disconnect()}},observe:{select:function(){x.has.input()&&v.observe(Q[0],{childList:!0,subtree:!0})},menu:function(){x.has.menu()&&w.observe(T[0],{childList:!0,subtree:!0})}},create:{id:function(){u=(Math.random().toString(16)+"000000000").substr(2,8),t="."+u,x.verbose("Creating unique id for element",u)},userChoice:function(b){var c,e,f;return!!(b=b||x.get.userValues())&&(b=a.isArray(b)?b:[b],a.each(b,function(b,g){x.get.item(g)===!1&&(f=y.templates.addition(x.add.variables(A.addResult,g)),e=a("
").html(f).attr("data-"+D.value,g).attr("data-"+D.text,g).addClass(z.addition).addClass(z.item),y.hideAdditions&&e.addClass(z.hidden),c=c===d?e:c.add(e),x.verbose("Creating user choices for value",g,e))}),c)},userLabels:function(b){var c=x.get.userValues();c&&(x.debug("Adding user labels",c),a.each(c,function(a,b){x.verbose("Adding custom user value"),x.add.label(b,b)}))},menu:function(){T=a("
").addClass(z.menu).appendTo(L)},sizer:function(){P=a(" ").addClass(z.sizer).insertAfter(O)}},search:function(a){a=a!==d?a:x.get.query(),x.verbose("Searching for query",a),x.has.minCharacters(a)?x.filter(a):x.hide()},select:{firstUnfiltered:function(){x.verbose("Selecting first non-filtered element"),x.remove.selectedItem(),U.not(G.unselectable).not(G.addition+G.hidden).eq(0).addClass(z.selected)},nextAvailable:function(a){a=a.eq(0);var b=a.nextAll(G.item).not(G.unselectable).eq(0),c=a.prevAll(G.item).not(G.unselectable).eq(0),d=b.length>0;d?(x.verbose("Moving selection to",b),b.addClass(z.selected)):(x.verbose("Moving selection to",c),c.addClass(z.selected))}},setup:{api:function(){var a={debug:y.debug,urlData:{value:x.get.value(),query:x.get.query()},on:!1};x.verbose("First request, initializing API"),L.api(a)},layout:function(){L.is("select")&&(x.setup.select(),x.setup.returnedObject()),x.has.menu()||x.create.menu(),x.is.search()&&!x.has.search()&&(x.verbose("Adding search input"),O=a(" ").addClass(z.search).prop("autocomplete","off").insertBefore(N)),x.is.multiple()&&x.is.searchSelection()&&!x.has.sizer()&&x.create.sizer(),y.allowTab&&x.set.tabbable()},select:function(){var b=x.get.selectValues();x.debug("Dropdown initialized on a select",b),L.is("select")&&(Q=L),Q.parent(G.dropdown).length>0?(x.debug("UI dropdown already exists. Creating dropdown menu only"),L=Q.closest(G.dropdown),x.has.menu()||x.create.menu(),T=L.children(G.menu),x.setup.menu(b)):(x.debug("Creating entire dropdown from select"),L=a("
").attr("class",Q.attr("class")).addClass(z.selection).addClass(z.dropdown).html(I.dropdown(b)).insertBefore(Q),Q.hasClass(z.multiple)&&Q.prop("multiple")===!1&&(x.error(H.missingMultiple),Q.prop("multiple",!0)),Q.is("[multiple]")&&x.set.multiple(),Q.prop("disabled")&&(x.debug("Disabling dropdown"),L.addClass(z.disabled)),Q.removeAttr("class").detach().prependTo(L)),x.refresh()},menu:function(a){T.html(I.menu(a,B)),U=T.find(G.item)},reference:function(){x.debug("Dropdown behavior was called on select, replacing with closest dropdown"),L=L.parent(G.dropdown),x.refresh(),x.setup.returnedObject(),n&&(Z=x,x.invoke(m))},returnedObject:function(){var a=g.slice(0,p),b=g.slice(p+1);g=a.add(L).add(b)}},refresh:function(){x.refreshSelectors(),x.refreshData()},refreshItems:function(){U=T.find(G.item)},refreshSelectors:function(){x.verbose("Refreshing selector cache"),N=L.find(G.text),O=L.find(G.search),Q=L.find(G.input),R=L.find(G.icon),S=L.prev().find(G.text).length>0?L.prev().find(G.text):L.prev(),T=L.children(G.menu),U=T.find(G.item)},refreshData:function(){x.verbose("Refreshing cached metadata"),U.removeData(D.text).removeData(D.value)},clearData:function(){x.verbose("Clearing metadata"),U.removeData(D.text).removeData(D.value),L.removeData(D.defaultText).removeData(D.defaultValue).removeData(D.placeholderText)},toggle:function(){x.verbose("Toggling menu visibility"),x.is.active()?x.hide():x.show()},show:function(b){if(b=a.isFunction(b)?b:function(){},x.can.show()&&!x.is.active()){if(x.debug("Showing dropdown"),!x.has.message()||x.has.maxSelections()||x.has.allResultsFiltered()||x.remove.message(),x.is.allFiltered())return!0;y.onShow.call(Y)!==!1&&x.animate.show(function(){x.can.click()&&x.bind.intent(),x.has.menuSearch()&&x.focusSearch(),x.set.visible(),b.call(Y)})}},hide:function(b){b=a.isFunction(b)?b:function(){},x.is.active()&&(x.debug("Hiding dropdown"),y.onHide.call(Y)!==!1&&x.animate.hide(function(){x.remove.visible(),b.call(Y)}))},hideOthers:function(){x.verbose("Finding other dropdowns to hide"),g.not(L).has(G.menu+"."+z.visible).dropdown("hide")},hideMenu:function(){x.verbose("Hiding menu instantaneously"),x.remove.active(),x.remove.visible(),T.transition("hide")},hideSubMenus:function(){var a=T.children(G.item).find(G.menu);x.verbose("Hiding sub menus",a),a.transition("hide")},bind:{events:function(){j&&x.bind.touchEvents(),x.bind.keyboardEvents(),x.bind.inputEvents(),x.bind.mouseEvents()},touchEvents:function(){x.debug("Touch device detected binding additional touch events"),x.is.searchSelection()||x.is.single()&&L.on("touchstart"+J,x.event.test.toggle),T.on("touchstart"+J,G.item,x.event.item.mouseenter)},keyboardEvents:function(){x.verbose("Binding keyboard events"),L.on("keydown"+J,x.event.keydown),x.has.search()&&L.on(x.get.inputEvent()+J,G.search,x.event.input),x.is.multiple()&&h.on("keydown"+t,x.event.document.keydown)},inputEvents:function(){x.verbose("Binding input change events"),L.on("change"+J,G.input,x.event.change)},mouseEvents:function(){x.verbose("Binding mouse events"),x.is.multiple()&&L.on("click"+J,G.label,x.event.label.click).on("click"+J,G.remove,x.event.remove.click),x.is.searchSelection()?(L.on("mousedown"+J,x.event.mousedown).on("mouseup"+J,x.event.mouseup).on("mousedown"+J,G.menu,x.event.menu.mousedown).on("mouseup"+J,G.menu,x.event.menu.mouseup).on("click"+J,G.icon,x.event.icon.click).on("focus"+J,G.search,x.event.search.focus).on("click"+J,G.search,x.event.search.focus).on("blur"+J,G.search,x.event.search.blur).on("click"+J,G.text,x.event.text.focus),x.is.multiple()&&L.on("click"+J,x.event.click)):("click"==y.on?L.on("click"+J,G.icon,x.event.icon.click).on("click"+J,x.event.test.toggle):"hover"==y.on?L.on("mouseenter"+J,x.delay.show).on("mouseleave"+J,x.delay.hide):L.on(y.on+J,x.toggle),L.on("mousedown"+J,x.event.mousedown).on("mouseup"+J,x.event.mouseup).on("focus"+J,x.event.focus).on("blur"+J,x.event.blur)),T.on("mouseenter"+J,G.item,x.event.item.mouseenter).on("mouseleave"+J,G.item,x.event.item.mouseleave).on("click"+J,G.item,x.event.item.click)},intent:function(){x.verbose("Binding hide intent event to document"),j&&h.on("touchstart"+t,x.event.test.touch).on("touchmove"+t,x.event.test.touch),h.on("click"+t,x.event.test.hide)}},unbind:{intent:function(){x.verbose("Removing hide intent event from document"),j&&h.off("touchstart"+t).off("touchmove"+t),h.off("click"+t)}},filter:function(a){var b=a!==d?a:x.get.query(),c=function(){x.is.multiple()&&x.filterActive(),x.select.firstUnfiltered(),x.has.allResultsFiltered()?y.onNoResults.call(Y,b)?y.allowAdditions?y.hideAdditions&&(x.verbose("User addition with no menu, setting empty style"),x.set.empty(),x.hideMenu()):(x.verbose("All items filtered, showing message",b),x.add.message(A.noResults)):(x.verbose("All items filtered, hiding dropdown",b),x.hideMenu()):(x.remove.empty(),x.remove.message()),y.allowAdditions&&x.add.userSuggestion(a),x.is.searchSelection()&&x.can.show()&&x.is.focusedOnSearch()&&x.show()};y.useLabels&&x.has.maxSelections()||(y.apiSettings?x.can.useAPI()?x.queryRemote(b,function(){c()}):x.error(H.noAPI):(x.filterItems(b),c()))},queryRemote:function(b,c){var d={errorDuration:!1,cache:"local",throttle:y.throttle,urlData:{query:b},onError:function(){x.add.message(A.serverError),c()},onFailure:function(){x.add.message(A.serverError),c()},onSuccess:function(a){x.remove.message(),x.setup.menu({values:a[B.remoteValues]}),c()}};L.api("get request")||x.setup.api(),d=a.extend(!0,{},d,y.apiSettings),L.api("setting",d).api("query")},filterItems:function(b){var c=b!==d?b:x.get.query(),e=null,f=x.escape.regExp(c),g=new RegExp("^"+f,"igm");x.has.query()&&(e=[],x.verbose("Searching for matching values",c),U.each(function(){var b,d,f=a(this);if("both"==y.match||"text"==y.match){if(b=String(x.get.choiceText(f,!1)),b.search(g)!==-1)return e.push(this),!0;if("exact"===y.fullTextSearch&&x.exactSearch(c,b))return e.push(this),!0;if(y.fullTextSearch===!0&&x.fuzzySearch(c,b))return e.push(this),!0}if("both"==y.match||"value"==y.match){if(d=String(x.get.choiceValue(f,b)),d.search(g)!==-1)return e.push(this),!0;if(y.fullTextSearch&&x.fuzzySearch(c,d))return e.push(this),!0}})),x.debug("Showing only matched items",c),x.remove.filteredItem(),e&&U.not(e).addClass(z.filtered)},fuzzySearch:function(a,b){var c=b.length,d=a.length;if(a=a.toLowerCase(),b=b.toLowerCase(),d>c)return!1;if(d===c)return a===b;a:for(var e=0,f=0;e-1},filterActive:function(){y.useLabels&&U.filter("."+z.active).addClass(z.filtered)},focusSearch:function(a){x.has.search()&&!x.is.focusedOnSearch()&&(a?(L.off("focus"+J,G.search),O.focus(),L.on("focus"+J,G.search,x.event.search.focus)):O.focus())},forceSelection:function(){var a=U.not(z.filtered).filter("."+z.selected).eq(0),b=U.not(z.filtered).filter("."+z.active).eq(0),c=a.length>0?a:b,d=c.length>0;return d?(x.debug("Forcing partial selection to selected item",c),void x.event.item.click.call(c,{},!0)):void(y.allowAdditions?(x.set.selected(x.get.query()),x.remove.searchTerm()):x.remove.searchTerm())},event:{change:function(){X||(x.debug("Input changed, updating selection"),x.set.selected())},focus:function(){y.showOnFocus&&!V&&x.is.hidden()&&!r&&x.show()},blur:function(a){r=c.activeElement===this,V||r||(x.remove.activeLabel(),x.hide())},mousedown:function(){x.is.searchSelection()?s=!0:V=!0},mouseup:function(){x.is.searchSelection()?s=!1:V=!1},click:function(b){var c=a(b.target);c.is(L)&&(x.is.focusedOnSearch()?x.show():x.focusSearch())},search:{focus:function(){V=!0,x.is.multiple()&&x.remove.activeLabel(),y.showOnFocus&&x.search()},blur:function(a){r=c.activeElement===this,s||W||r||(y.forceSelection&&x.forceSelection(),x.hide()),s=!1}},icon:{click:function(a){x.toggle()}},text:{focus:function(a){V=!0,x.focusSearch()}},input:function(a){(x.is.multiple()||x.is.searchSelection())&&x.set.filtered(),clearTimeout(x.timer),x.timer=setTimeout(x.search,y.delay.search);
},label:{click:function(b){var c=a(this),d=L.find(G.label),e=d.filter("."+z.active),f=c.nextAll("."+z.active),g=c.prevAll("."+z.active),h=f.length>0?c.nextUntil(f).add(e).add(c):c.prevUntil(g).add(e).add(c);b.shiftKey?(e.removeClass(z.active),h.addClass(z.active)):b.ctrlKey?c.toggleClass(z.active):(e.removeClass(z.active),c.addClass(z.active)),y.onLabelSelect.apply(this,d.filter("."+z.active))}},remove:{click:function(){var b=a(this).parent();b.hasClass(z.active)?x.remove.activeLabels():x.remove.activeLabels(b)}},test:{toggle:function(a){var b=x.is.multiple()?x.show:x.toggle;x.is.bubbledLabelClick(a)||x.is.bubbledIconClick(a)||x.determine.eventOnElement(a,b)&&a.preventDefault()},touch:function(a){x.determine.eventOnElement(a,function(){"touchstart"==a.type?x.timer=setTimeout(function(){x.hide()},y.delay.touch):"touchmove"==a.type&&clearTimeout(x.timer)}),a.stopPropagation()},hide:function(a){x.determine.eventInModule(a,x.hide)}},select:{mutation:function(a){x.debug(" modified, recreating menu"),x.setup.select()}},menu:{mutation:function(b){var c=b[0],d=a(!!c.addedNodes&&c.addedNodes[0]),e=a(!!c.removedNodes&&c.removedNodes[0]),f=d.add(e),g=f.is(G.addition)||f.closest(G.addition).length>0,h=f.is(G.message)||f.closest(G.message).length>0;g||h?(x.debug("Updating item selector cache"),x.refreshItems()):(x.debug("Menu modified, updating selector cache"),x.refresh())},mousedown:function(){W=!0},mouseup:function(){W=!1}},item:{mouseenter:function(b){var c=a(b.target),d=a(this),e=d.children(G.menu),f=d.siblings(G.item).children(G.menu),g=e.length>0,h=e.find(c).length>0;!h&&g&&(clearTimeout(x.itemTimer),x.itemTimer=setTimeout(function(){x.verbose("Showing sub-menu",e),a.each(f,function(){x.animate.hide(!1,a(this))}),x.animate.show(!1,e)},y.delay.show),b.preventDefault())},mouseleave:function(b){var c=a(this).children(G.menu);c.length>0&&(clearTimeout(x.itemTimer),x.itemTimer=setTimeout(function(){x.verbose("Hiding sub-menu",c),x.animate.hide(!1,c)},y.delay.hide))},click:function(b,c){var d=a(this),e=a(b?b.target:""),f=d.find(G.menu),g=x.get.choiceText(d),h=x.get.choiceValue(d,g),i=f.length>0,j=f.find(e).length>0;j||i&&!y.allowCategorySelection||(x.is.searchSelection()&&(y.allowAdditions&&x.remove.userAddition(),x.remove.searchTerm(),x.is.focusedOnSearch()||1==c||x.focusSearch(!0)),y.useLabels||(x.remove.filteredItem(),x.set.scrollPosition(d)),x.determine.selectAction.call(this,g,h))}},document:{keydown:function(a){var b=a.which,c=x.is.inObject(b,C);if(c){var d=L.find(G.label),e=d.filter("."+z.active),f=(e.data(D.value),d.index(e)),g=d.length,h=e.length>0,i=e.length>1,j=0===f,k=f+1==g,l=x.is.searchSelection(),m=x.is.focusedOnSearch(),n=x.is.focused(),o=m&&0===x.get.caretPosition();if(l&&!h&&!m)return;b==C.leftArrow?!n&&!o||h?h&&(a.shiftKey?x.verbose("Adding previous label to selection"):(x.verbose("Selecting previous label"),d.removeClass(z.active)),j&&!i?e.addClass(z.active):e.prev(G.siblingLabel).addClass(z.active).end(),a.preventDefault()):(x.verbose("Selecting previous label"),d.last().addClass(z.active)):b==C.rightArrow?(n&&!h&&d.first().addClass(z.active),h&&(a.shiftKey?x.verbose("Adding next label to selection"):(x.verbose("Selecting next label"),d.removeClass(z.active)),k?l?m?d.removeClass(z.active):x.focusSearch():i?e.next(G.siblingLabel).addClass(z.active):e.addClass(z.active):e.next(G.siblingLabel).addClass(z.active),a.preventDefault())):b==C.deleteKey||b==C.backspace?h?(x.verbose("Removing active labels"),k&&l&&!m&&x.focusSearch(),e.last().next(G.siblingLabel).addClass(z.active),x.remove.activeLabels(e),a.preventDefault()):o&&!h&&b==C.backspace&&(x.verbose("Removing last label on input backspace"),e=d.last().addClass(z.active),x.remove.activeLabels(e)):e.removeClass(z.active)}}},keydown:function(a){var b=a.which,c=x.is.inObject(b,C);if(c){var d,e,f=U.not(G.unselectable).filter("."+z.selected).eq(0),g=T.children("."+z.active).eq(0),h=f.length>0?f:g,i=h.length>0?h.siblings(":not(."+z.filtered+")").addBack():T.children(":not(."+z.filtered+")"),j=h.children(G.menu),k=h.closest(G.menu),l=k.hasClass(z.visible)||k.hasClass(z.animating)||k.parent(G.menu).length>0,m=j.length>0,n=h.length>0,o=h.not(G.unselectable).length>0,p=b==C.delimiter&&y.allowAdditions&&x.is.multiple(),q=y.allowAdditions&&y.hideAdditions&&(b==C.enter||p)&&o;if(q&&(x.verbose("Selecting item from keyboard shortcut",h),x.event.item.click.call(h,a),x.is.searchSelection()&&x.remove.searchTerm()),x.is.visible()){if((b==C.enter||p)&&(b==C.enter&&n&&m&&!y.allowCategorySelection?(x.verbose("Pressed enter on unselectable category, opening sub menu"),b=C.rightArrow):o&&(x.verbose("Selecting item from keyboard shortcut",h),x.event.item.click.call(h,a),x.is.searchSelection()&&x.remove.searchTerm()),a.preventDefault()),n&&(b==C.leftArrow&&(e=k[0]!==T[0],e&&(x.verbose("Left key pressed, closing sub-menu"),x.animate.hide(!1,k),h.removeClass(z.selected),k.closest(G.item).addClass(z.selected),a.preventDefault())),b==C.rightArrow&&m&&(x.verbose("Right key pressed, opening sub-menu"),x.animate.show(!1,j),h.removeClass(z.selected),j.find(G.item).eq(0).addClass(z.selected),a.preventDefault())),b==C.upArrow){if(d=n&&l?h.prevAll(G.item+":not("+G.unselectable+")").eq(0):U.eq(0),i.index(d)<0)return x.verbose("Up key pressed but reached top of current menu"),void a.preventDefault();x.verbose("Up key pressed, changing active item"),h.removeClass(z.selected),d.addClass(z.selected),x.set.scrollPosition(d),y.selectOnKeydown&&x.is.single()&&x.set.selectedItem(d),a.preventDefault()}if(b==C.downArrow){if(d=n&&l?d=h.nextAll(G.item+":not("+G.unselectable+")").eq(0):U.eq(0),0===d.length)return x.verbose("Down key pressed but reached bottom of current menu"),void a.preventDefault();x.verbose("Down key pressed, changing active item"),U.removeClass(z.selected),d.addClass(z.selected),x.set.scrollPosition(d),y.selectOnKeydown&&x.is.single()&&x.set.selectedItem(d),a.preventDefault()}b==C.pageUp&&(x.scrollPage("up"),a.preventDefault()),b==C.pageDown&&(x.scrollPage("down"),a.preventDefault()),b==C.escape&&(x.verbose("Escape key pressed, closing dropdown"),x.hide())}else p&&a.preventDefault(),b!=C.downArrow||x.is.visible()||(x.verbose("Down key pressed, showing dropdown"),x.select.firstUnfiltered(),x.show(),a.preventDefault())}else x.has.search()||x.set.selectedLetter(String.fromCharCode(b))}},trigger:{change:function(){var a=c.createEvent("HTMLEvents"),b=Q[0];b&&(x.verbose("Triggering native change event"),a.initEvent("change",!0,!1),b.dispatchEvent(a))}},determine:{selectAction:function(b,c){x.verbose("Determining action",y.action),a.isFunction(x.action[y.action])?(x.verbose("Triggering preset action",y.action,b,c),x.action[y.action].call(Y,b,c,this)):a.isFunction(y.action)?(x.verbose("Triggering user action",y.action,b,c),y.action.call(Y,b,c,this)):x.error(H.action,y.action)},eventInModule:function(b,d){var e=a(b.target),f=e.closest(c.documentElement).length>0,g=e.closest(L).length>0;return d=a.isFunction(d)?d:function(){},f&&!g?(x.verbose("Triggering event",d),d(),!0):(x.verbose("Event occurred in dropdown, canceling callback"),!1)},eventOnElement:function(b,d){var e=a(b.target),f=e.closest(G.siblingLabel),g=c.body.contains(b.target),h=0===L.find(f).length,i=0===e.closest(T).length;return d=a.isFunction(d)?d:function(){},g&&h&&i?(x.verbose("Triggering event",d),d(),!0):(x.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(b,c,e){if(c=c!==d?c:b,x.can.activate(a(e))){if(x.set.selected(c,a(e)),x.is.multiple()&&!x.is.allFiltered())return;x.hideAndClear()}},select:function(b,c,e){if(c=c!==d?c:b,x.can.activate(a(e))){if(x.set.value(c,a(e)),x.is.multiple()&&!x.is.allFiltered())return;x.hideAndClear()}},combo:function(b,c,e){c=c!==d?c:b,x.set.selected(c,a(e)),x.hideAndClear()},hide:function(a,b,c){x.set.value(b,a),x.hideAndClear()}},get:{id:function(){return u},defaultText:function(){return L.data(D.defaultText)},defaultValue:function(){return L.data(D.defaultValue)},placeholderText:function(){return L.data(D.placeholderText)||""},text:function(){return N.text()},query:function(){return a.trim(O.val())},searchWidth:function(a){return a=a!==d?a:O.val(),P.text(a),Math.ceil(P.width()+1)},selectionCount:function(){var b,c=x.get.values();return b=x.is.multiple()?a.isArray(c)?c.length:0:""!==x.get.value()?1:0},transition:function(a){return"auto"==y.transition?x.is.upward(a)?"slide up":"slide down":y.transition},userValues:function(){var b=x.get.values();return!!b&&(b=a.isArray(b)?b:[b],a.grep(b,function(a){return x.get.item(a)===!1}))},uniqueArray:function(b){return a.grep(b,function(c,d){return a.inArray(c,b)===d})},caretPosition:function(){var a,b,d=O.get(0);return"selectionStart"in d?d.selectionStart:c.selection?(d.focus(),a=c.selection.createRange(),b=a.text.length,a.moveStart("character",-d.value.length),a.text.length-b):void 0},value:function(){var b=Q.length>0?Q.val():L.data(D.value),c=a.isArray(b)&&1===b.length&&""===b[0];return b===d||c?"":b},values:function(){var a=x.get.value();return""===a?"":!x.has.selectInput()&&x.is.multiple()?"string"==typeof a?a.split(y.delimiter):"":a},remoteValues:function(){var b=x.get.values(),c=!1;return b&&("string"==typeof b&&(b=[b]),a.each(b,function(a,b){var d=x.read.remoteData(b);x.verbose("Restoring value from session data",d,b),d&&(c||(c={}),c[b]=d)})),c},choiceText:function(b,c){if(c=c!==d?c:y.preserveHTML,b)return b.find(G.menu).length>0&&(x.verbose("Retrieving text of element with sub-menu"),b=b.clone(),b.find(G.menu).remove(),b.find(G.menuIcon).remove()),b.data(D.text)!==d?b.data(D.text):c?a.trim(b.html()):a.trim(b.text())},choiceValue:function(b,c){return c=c||x.get.choiceText(b),!!b&&(b.data(D.value)!==d?String(b.data(D.value)):"string"==typeof c?a.trim(c.toLowerCase()):String(c))},inputEvent:function(){var a=O[0];return!!a&&(a.oninput!==d?"input":a.onpropertychange!==d?"propertychange":"keyup")},selectValues:function(){var b={};return b.values=[],L.find("option").each(function(){var c=a(this),e=c.html(),f=c.attr("disabled"),g=c.attr("value")!==d?c.attr("value"):e;"auto"===y.placeholder&&""===g?b.placeholder=e:b.values.push({name:e,value:g,disabled:f})}),y.placeholder&&"auto"!==y.placeholder&&(x.debug("Setting placeholder value to",y.placeholder),b.placeholder=y.placeholder),y.sortSelect?(b.values.sort(function(a,b){return a.name>b.name?1:-1}),x.debug("Retrieved and sorted values from select",b)):x.debug("Retrieved values from select",b),b},activeItem:function(){return U.filter("."+z.active)},selectedItem:function(){var a=U.not(G.unselectable).filter("."+z.selected);return a.length>0?a:U.eq(0)},itemWithAdditions:function(a){var b=x.get.item(a),c=x.create.userChoice(a),d=c&&c.length>0;return d&&(b=b.length>0?b.add(c):c),b},item:function(b,c){var e,f,g=!1;return b=b!==d?b:x.get.values()!==d?x.get.values():x.get.text(),e=f?b.length>0:b!==d&&null!==b,f=x.is.multiple()&&a.isArray(b),c=""===b||0===b||c||!1,e&&U.each(function(){var e=a(this),h=x.get.choiceText(e),i=x.get.choiceValue(e,h);if(null!==i&&i!==d)if(f)a.inArray(String(i),b)===-1&&a.inArray(h,b)===-1||(g=g?g.add(e):e);else if(c){if(x.verbose("Ambiguous dropdown value using strict type check",e,b),i===b||h===b)return g=e,!0}else if(String(i)==String(b)||h==b)return x.verbose("Found select item by value",i,b),g=e,!0}),g}},check:{maxSelections:function(a){return!y.maxSelections||(a=a!==d?a:x.get.selectionCount(),a>=y.maxSelections?(x.debug("Maximum selection count reached"),y.useLabels&&(U.addClass(z.filtered),x.add.message(A.maxSelections)),!0):(x.verbose("No longer at maximum selection count"),x.remove.message(),x.remove.filteredItem(),x.is.searchSelection()&&x.filterItems(),!1))}},restore:{defaults:function(){x.clear(),x.restore.defaultText(),x.restore.defaultValue()},defaultText:function(){var a=x.get.defaultText(),b=x.get.placeholderText;a===b?(x.debug("Restoring default placeholder text",a),x.set.placeholderText(a)):(x.debug("Restoring default text",a),x.set.text(a))},placeholderText:function(){x.set.placeholderText()},defaultValue:function(){var a=x.get.defaultValue();a!==d&&(x.debug("Restoring default value",a),""!==a?(x.set.value(a),x.set.selected()):(x.remove.activeItem(),x.remove.selectedItem()))},labels:function(){y.allowAdditions&&(y.useLabels||(x.error(H.labels),y.useLabels=!0),x.debug("Restoring selected values"),x.create.userLabels()),x.check.maxSelections()},selected:function(){x.restore.values(),x.is.multiple()?(x.debug("Restoring previously selected values and labels"),x.restore.labels()):x.debug("Restoring previously selected values")},values:function(){x.set.initialLoad(),y.apiSettings&&y.saveRemoteData&&x.get.remoteValues()?x.restore.remoteValues():x.set.selected(),x.remove.initialLoad()},remoteValues:function(){var b=x.get.remoteValues();x.debug("Recreating selected from session data",b),b&&(x.is.single()?a.each(b,function(a,b){x.set.text(b)}):a.each(b,function(a,b){x.add.label(a,b)}))}},read:{remoteData:function(a){var c;return b.Storage===d?void x.error(H.noStorage):(c=sessionStorage.getItem(a),c!==d&&c)}},save:{defaults:function(){x.save.defaultText(),x.save.placeholderText(),x.save.defaultValue()},defaultValue:function(){var a=x.get.value();x.verbose("Saving default value as",a),L.data(D.defaultValue,a)},defaultText:function(){var a=x.get.text();x.verbose("Saving default text as",a),L.data(D.defaultText,a)},placeholderText:function(){var a;y.placeholder!==!1&&N.hasClass(z.placeholder)&&(a=x.get.text(),x.verbose("Saving placeholder text as",a),L.data(D.placeholderText,a))},remoteData:function(a,c){return b.Storage===d?void x.error(H.noStorage):(x.verbose("Saving remote data to session storage",c,a),void sessionStorage.setItem(c,a))}},clear:function(){x.is.multiple()&&y.useLabels?x.remove.labels():(x.remove.activeItem(),x.remove.selectedItem()),x.set.placeholderText(),x.clearValue()},clearValue:function(){x.set.value("")},scrollPage:function(a,b){var c,d,e,f=b||x.get.selectedItem(),g=f.closest(G.menu),h=g.outerHeight(),i=g.scrollTop(),j=U.eq(0).outerHeight(),k=Math.floor(h/j),l=(g.prop("scrollHeight"),"up"==a?i-j*k:i+j*k),m=U.not(G.unselectable);e="up"==a?m.index(f)-k:m.index(f)+k,c="up"==a?e>=0:e0&&(x.debug("Scrolling page",a,d),f.removeClass(z.selected),d.addClass(z.selected),y.selectOnKeydown&&x.is.single()&&x.set.selectedItem(d),g.scrollTop(l))},set:{filtered:function(){var a=x.is.multiple(),b=x.is.searchSelection(),c=a&&b,d=b?x.get.query():"",e="string"==typeof d&&d.length>0,f=x.get.searchWidth(),g=""!==d;a&&e&&(x.verbose("Adjusting input width",f,y.glyphWidth),O.css("width",f)),e||c&&g?(x.verbose("Hiding placeholder text"),N.addClass(z.filtered)):(!a||c&&!g)&&(x.verbose("Showing placeholder text"),N.removeClass(z.filtered))},empty:function(){L.addClass(z.empty)},loading:function(){L.addClass(z.loading)},placeholderText:function(a){a=a||x.get.placeholderText(),x.debug("Setting placeholder text",a),x.set.text(a),N.addClass(z.placeholder)},tabbable:function(){x.has.search()?(x.debug("Added tabindex to searchable dropdown"),O.val("").attr("tabindex",0),T.attr("tabindex",-1)):(x.debug("Added tabindex to dropdown"),L.attr("tabindex")===d&&(L.attr("tabindex",0),T.attr("tabindex",-1)))},initialLoad:function(){x.verbose("Setting initial load"),q=!0},activeItem:function(a){y.allowAdditions&&a.filter(G.addition).length>0?a.addClass(z.filtered):a.addClass(z.active)},partialSearch:function(a){var b=x.get.query().length;O.val(a.substr(0,b))},scrollPosition:function(a,b){var c,e,f,g,h,i,j,k,l,m=5;a=a||x.get.selectedItem(),c=a.closest(G.menu),e=a&&a.length>0,b=b!==d&&b,a&&c.length>0&&e&&(g=a.position().top,c.addClass(z.loading),i=c.scrollTop(),h=c.offset().top,g=a.offset().top,f=i-h+g,b||(j=c.height(),l=i+j0&&x.has.firstLetter(d,b),f=!1;e&&(c=d.nextAll(U).eq(0),x.has.firstLetter(c,b)&&(f=c)),f||U.each(function(){if(x.has.firstLetter(a(this),b))return f=a(this),!1}),f&&(x.verbose("Scrolling to next value with letter",b),x.set.scrollPosition(f),d.removeClass(z.selected),f.addClass(z.selected),y.selectOnKeydown&&x.is.single()&&x.set.selectedItem(f))},direction:function(a){"auto"==y.direction?x.is.onScreen(a)?x.remove.upward(a):x.set.upward(a):"upward"==y.direction&&x.set.upward(a)},upward:function(a){var b=a||L;b.addClass(z.upward)},value:function(a,b,c){var e=x.escape.value(a),f=Q.length>0,g=(!x.has.value(a),x.get.values()),h=a!==d?String(a):a;if(f){if(!y.allowReselection&&h==g&&(x.verbose("Skipping value update already same value",a,g),!x.is.initialLoad()))return;x.is.single()&&x.has.selectInput()&&x.can.extendSelect()&&(x.debug("Adding user option",a),x.add.optionValue(a)),x.debug("Updating input value",e,g),X=!0,Q.val(e),y.fireOnInit===!1&&x.is.initialLoad()?x.debug("Input native change event ignored on initial load"):x.trigger.change(),X=!1}else x.verbose("Storing value in metadata",e,Q),e!==g&&L.data(D.value,h);y.fireOnInit===!1&&x.is.initialLoad()?x.verbose("No callback on initial load",y.onChange):y.onChange.call(Y,a,b,c)},active:function(){L.addClass(z.active)},multiple:function(){L.addClass(z.multiple)},visible:function(){L.addClass(z.visible)},exactly:function(a,b){x.debug("Setting selected to exact values"),x.clear(),x.set.selected(a,b)},selected:function(b,c){var d=x.is.multiple();c=y.allowAdditions?c||x.get.itemWithAdditions(b):c||x.get.item(b),c&&(x.debug("Setting selected menu item to",c),x.is.multiple()&&x.remove.searchWidth(),x.is.single()?(x.remove.activeItem(),x.remove.selectedItem()):y.useLabels&&x.remove.selectedItem(),c.each(function(){var b=a(this),e=x.get.choiceText(b),f=x.get.choiceValue(b,e),g=b.hasClass(z.filtered),h=b.hasClass(z.active),i=b.hasClass(z.addition),j=d&&1==c.length;d?!h||i?(y.apiSettings&&y.saveRemoteData&&x.save.remoteData(e,f),y.useLabels?(x.add.value(f,e,b),x.add.label(f,e,j),x.set.activeItem(b),x.filterActive(),x.select.nextAvailable(c)):(x.add.value(f,e,b),x.set.text(x.add.variables(A.count)),x.set.activeItem(b))):g||(x.debug("Selected active value, removing label"),x.remove.selected(f)):(y.apiSettings&&y.saveRemoteData&&x.save.remoteData(e,f),x.set.text(e),x.set.value(f,e,b),b.addClass(z.active).addClass(z.selected))}))}},add:{label:function(b,c,d){var e,f=x.is.searchSelection()?O:N,g=x.escape.value(b);return e=a(" ").addClass(z.label).attr("data-value",g).html(I.label(g,c)),e=y.onLabelCreate.call(e,g,c),x.has.label(b)?void x.debug("Label already exists, skipping",g):(y.label.variation&&e.addClass(y.label.variation),void(d===!0?(x.debug("Animating in label",e),e.addClass(z.hidden).insertBefore(f).transition(y.label.transition,y.label.duration)):(x.debug("Adding selection label",e),e.insertBefore(f))))},message:function(b){var c=T.children(G.message),d=y.templates.message(x.add.variables(b));c.length>0?c.html(d):c=a("
").html(d).addClass(z.message).appendTo(T)},optionValue:function(b){var c=x.escape.value(b),d=Q.find('option[value="'+c+'"]'),e=d.length>0;e||(x.disconnect.selectObserver(),x.is.single()&&(x.verbose("Removing previous user addition"),Q.find("option."+z.addition).remove()),a(" ").prop("value",c).addClass(z.addition).html(b).appendTo(Q),x.verbose("Adding user addition as an ",b),x.observe.select())},userSuggestion:function(a){var b,c=T.children(G.addition),d=x.get.item(a),e=d&&d.not(G.addition).length,f=c.length>0;if(!y.useLabels||!x.has.maxSelections()){if(""===a||e)return void c.remove();f?(c.data(D.value,a).data(D.text,a).attr("data-"+D.value,a).attr("data-"+D.text,a).removeClass(z.filtered),y.hideAdditions||(b=y.templates.addition(x.add.variables(A.addResult,a)),c.html(b)),x.verbose("Replacing user suggestion with new value",c)):(c=x.create.userChoice(a),c.prependTo(T),x.verbose("Adding item choice to menu corresponding with user choice addition",c)),y.hideAdditions&&!x.is.allFiltered()||c.addClass(z.selected).siblings().removeClass(z.selected),x.refreshItems()}},variables:function(a,b){var c,d,e=a.search("{count}")!==-1,f=a.search("{maxCount}")!==-1,g=a.search("{term}")!==-1;return x.verbose("Adding templated variables to message",a),e&&(c=x.get.selectionCount(),a=a.replace("{count}",c)),f&&(c=x.get.selectionCount(),a=a.replace("{maxCount}",y.maxSelections)),g&&(d=b||x.get.query(),a=a.replace("{term}",d)),a},value:function(b,c,d){var e,f=x.get.values();return""===b?void x.debug("Cannot select blank values from multiselect"):(a.isArray(f)?(e=f.concat([b]),e=x.get.uniqueArray(e)):e=[b],x.has.selectInput()?x.can.extendSelect()&&(x.debug("Adding value to select",b,e,Q),x.add.optionValue(b)):(e=e.join(y.delimiter),x.debug("Setting hidden input to delimited value",e,Q)),y.fireOnInit===!1&&x.is.initialLoad()?x.verbose("Skipping onadd callback on initial load",y.onAdd):y.onAdd.call(Y,b,c,d),x.set.value(e,b,c,d),void x.check.maxSelections())}},remove:{active:function(){L.removeClass(z.active)},activeLabel:function(){L.find(G.label).removeClass(z.active)},empty:function(){L.removeClass(z.empty)},loading:function(){L.removeClass(z.loading)},initialLoad:function(){q=!1},upward:function(a){var b=a||L;b.removeClass(z.upward)},visible:function(){L.removeClass(z.visible)},activeItem:function(){U.removeClass(z.active)},filteredItem:function(){y.useLabels&&x.has.maxSelections()||(y.useLabels&&x.is.multiple()?U.not("."+z.active).removeClass(z.filtered):U.removeClass(z.filtered),x.remove.empty())},optionValue:function(a){var b=x.escape.value(a),c=Q.find('option[value="'+b+'"]'),d=c.length>0;d&&c.hasClass(z.addition)&&(v&&(v.disconnect(),x.verbose("Temporarily disconnecting mutation observer")),c.remove(),x.verbose("Removing user addition as an ",b),v&&v.observe(Q[0],{childList:!0,subtree:!0}))},message:function(){T.children(G.message).remove()},searchWidth:function(){O.css("width","")},searchTerm:function(){x.verbose("Cleared search term"),O.val(""),x.set.filtered()},userAddition:function(){U.filter(G.addition).remove()},selected:function(b,c){return!!(c=y.allowAdditions?c||x.get.itemWithAdditions(b):c||x.get.item(b))&&void c.each(function(){var b=a(this),c=x.get.choiceText(b),d=x.get.choiceValue(b,c);x.is.multiple()?y.useLabels?(x.remove.value(d,c,b),x.remove.label(d)):(x.remove.value(d,c,b),0===x.get.selectionCount()?x.set.placeholderText():x.set.text(x.add.variables(A.count))):x.remove.value(d,c,b),b.removeClass(z.filtered).removeClass(z.active),y.useLabels&&b.removeClass(z.selected)})},selectedItem:function(){U.removeClass(z.selected)},value:function(a,b,c){var d,e=x.get.values();x.has.selectInput()?(x.verbose("Input is removing selected option",a),d=x.remove.arrayValue(a,e),x.remove.optionValue(a)):(x.verbose("Removing from delimited values",a),d=x.remove.arrayValue(a,e),d=d.join(y.delimiter)),y.fireOnInit===!1&&x.is.initialLoad()?x.verbose("No callback on initial load",y.onRemove):y.onRemove.call(Y,a,b,c),x.set.value(d,b,c),x.check.maxSelections()},arrayValue:function(b,c){return a.isArray(c)||(c=[c]),c=a.grep(c,function(a){return b!=a}),x.verbose("Removed value from delimited string",b,c),c},label:function(a,b){var c=L.find(G.label),d=c.filter('[data-value="'+a+'"]');x.verbose("Removing label",d),d.remove()},activeLabels:function(a){a=a||L.find(G.label).filter("."+z.active),x.verbose("Removing active label selections",a),x.remove.labels(a)},labels:function(b){b=b||L.find(G.label),x.verbose("Removing labels",b),b.each(function(){var b=a(this),c=b.data(D.value),e=c!==d?String(c):c,f=x.is.userValue(e);return y.onLabelRemove.call(b,c)===!1?void x.debug("Label remove callback cancelled removal"):(x.remove.message(),void(f?(x.remove.value(e),x.remove.label(e)):x.remove.selected(e)))})},tabbable:function(){x.has.search()?(x.debug("Searchable dropdown initialized"),O.removeAttr("tabindex"),T.removeAttr("tabindex")):(x.debug("Simple selection dropdown initialized"),L.removeAttr("tabindex"),T.removeAttr("tabindex"))}},has:{menuSearch:function(){return x.has.search()&&O.closest(T).length>0},search:function(){return O.length>0},sizer:function(){return P.length>0},selectInput:function(){return Q.is("select")},minCharacters:function(a){return!y.minCharacters||(a=a!==d?String(a):String(x.get.query()),a.length>=y.minCharacters)},firstLetter:function(a,b){var c,d;return!(!a||0===a.length||"string"!=typeof b)&&(c=x.get.choiceText(a,!1),b=b.toLowerCase(),d=String(c).charAt(0).toLowerCase(),b==d)},input:function(){return Q.length>0},items:function(){return U.length>0},menu:function(){return T.length>0},message:function(){return 0!==T.children(G.message).length},label:function(a){var b=x.escape.value(a),c=L.find(G.label);return c.filter('[data-value="'+b+'"]').length>0},maxSelections:function(){return y.maxSelections&&x.get.selectionCount()>=y.maxSelections},allResultsFiltered:function(){var a=U.not(G.addition);return a.filter(G.unselectable).length===a.length},userSuggestion:function(){return T.children(G.addition).length>0},query:function(){return""!==x.get.query()},value:function(b){var c=x.get.values(),d=a.isArray(c)?c&&a.inArray(b,c)!==-1:c==b;return!!d}},is:{active:function(){return L.hasClass(z.active)},bubbledLabelClick:function(b){return a(b.target).is("select, input")&&L.closest("label").length>0},bubbledIconClick:function(b){return a(b.target).closest(R).length>0},alreadySetup:function(){return L.is("select")&&L.parent(G.dropdown).length>0&&0===L.prev().length},animating:function(a){return a?a.transition&&a.transition("is animating"):T.transition&&T.transition("is animating")},disabled:function(){return L.hasClass(z.disabled)},focused:function(){return c.activeElement===L[0]},focusedOnSearch:function(){return c.activeElement===O[0]},allFiltered:function(){return(x.is.multiple()||x.has.search())&&!(0==y.hideAdditions&&x.has.userSuggestion())&&!x.has.message()&&x.has.allResultsFiltered()},hidden:function(a){return!x.is.visible(a)},initialLoad:function(){return q},onScreen:function(a){var b,c=a||T,d=!0,e={};return c.addClass(z.loading),b={context:{scrollTop:M.scrollTop(),height:M.outerHeight()},menu:{offset:c.offset(),height:c.outerHeight()}},e={above:b.context.scrollTop<=b.menu.offset.top-b.menu.height,below:b.context.scrollTop+b.context.height>=b.menu.offset.top+b.menu.height},e.below?(x.verbose("Dropdown can fit in context downward",e),d=!0):e.below||e.above?(x.verbose("Dropdown cannot fit below, opening upward",e),d=!1):(x.verbose("Dropdown cannot fit in either direction, favoring downward",e),d=!0),c.removeClass(z.loading),d},inObject:function(b,c){var d=!1;return a.each(c,function(a,c){if(c==b)return d=!0,!0}),d},multiple:function(){return L.hasClass(z.multiple)},single:function(){return!x.is.multiple()},selectMutation:function(b){var c=!1;return a.each(b,function(b,d){if(d.target&&a(d.target).is("select"))return c=!0,!0}),c},search:function(){return L.hasClass(z.search)},searchSelection:function(){return x.has.search()&&1===O.parent(G.dropdown).length},selection:function(){return L.hasClass(z.selection)},userValue:function(b){return a.inArray(b,x.get.userValues())!==-1},upward:function(a){var b=a||L;return b.hasClass(z.upward)},visible:function(a){return a?a.hasClass(z.visible):T.hasClass(z.visible)}},can:{activate:function(a){return!!y.useLabels||!x.has.maxSelections()||!(!x.has.maxSelections()||!a.hasClass(z.active))},click:function(){return j||"click"==y.on},extendSelect:function(){return y.allowAdditions||y.apiSettings},show:function(){return!x.is.disabled()&&(x.has.items()||x.has.message())},useAPI:function(){return a.fn.api!==d}},animate:{show:function(b,c){var e,f=c||T,g=c?function(){}:function(){x.hideSubMenus(),x.hideOthers(),x.set.active()};b=a.isFunction(b)?b:function(){},x.verbose("Doing menu show animation",f),x.set.direction(c),e=x.get.transition(c),x.is.selection()&&x.set.scrollPosition(x.get.selectedItem(),!0),(x.is.hidden(f)||x.is.animating(f))&&("none"==e?(g(),f.transition("show"),b.call(Y)):a.fn.transition!==d&&L.transition("is supported")?f.transition({animation:e+" in",debug:y.debug,verbose:y.verbose,duration:y.duration,queue:!0,onStart:g,onComplete:function(){b.call(Y)}}):x.error(H.noTransition,e))},hide:function(b,c){var e=c||T,f=(c?.9*y.duration:y.duration,c?function(){}:function(){x.can.click()&&x.unbind.intent(),x.remove.active()}),g=x.get.transition(c);b=a.isFunction(b)?b:function(){},(x.is.visible(e)||x.is.animating(e))&&(x.verbose("Doing menu hide animation",e),"none"==g?(f(),e.transition("hide"),b.call(Y)):a.fn.transition!==d&&L.transition("is supported")?e.transition({animation:g+" out",duration:y.duration,debug:y.debug,verbose:y.verbose,queue:!0,onStart:f,onComplete:function(){"auto"==y.direction&&x.remove.upward(c),b.call(Y)}}):x.error(H.transition))}},hideAndClear:function(){x.remove.searchTerm(),x.has.maxSelections()||(x.has.search()?x.hide(function(){x.remove.filteredItem()}):x.hide())},delay:{show:function(){x.verbose("Delaying show event to ensure user intent"),clearTimeout(x.timer),x.timer=setTimeout(x.show,y.delay.show)},hide:function(){x.verbose("Delaying hide event to ensure user intent"),clearTimeout(x.timer),x.timer=setTimeout(x.hide,y.delay.hide)}},escape:{value:function(b){var c=a.isArray(b),d="string"==typeof b,e=!d&&!c,f=d&&b.search(F.quote)!==-1,g=[];return x.has.selectInput()&&!e&&f?(x.debug("Encoding quote values for use in select",b),c?(a.each(b,function(a,b){g.push(b.replace(F.quote,"""))}),g):b.replace(F.quote,""")):b},regExp:function(a){return a=String(a),a.replace(F.escape,"\\$&")}},setting:function(b,c){if(x.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,y,b);else{if(c===d)return y[b];a.isPlainObject(y[b])?a.extend(!0,y[b],c):y[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,x,b);else{if(c===d)return x[b];x[b]=c}},debug:function(){!y.silent&&y.debug&&(y.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,y.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!y.silent&&y.verbose&&y.debug&&(y.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),x.verbose.apply(console,arguments)))},error:function(){y.silent||(x.error=Function.prototype.bind.call(console.error,console,y.name+":"),x.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;y.performance&&(b=(new Date).getTime(),d=k||b,c=b-d,k=b,l.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:Y,"Execution Time":c})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var b=y.name+":",c=0;k=!1,clearTimeout(x.performance.timer),a.each(l,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",i&&(b+=" '"+i+"'"),(console.group!==d||console.table!==d)&&l.length>0&&(console.groupCollapsed(b),console.table?console.table(l):a.each(l,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(b,c,e){var g,h,i,j=Z;return c=c||o,e=Y||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):(x.error(H.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}},n?(Z===d&&x.initialize(),x.invoke(m)):(Z!==d&&Z.invoke("destroy"),
x.initialize())}),f!==d?f:g},a.fn.dropdown.settings={silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",action:"activate",apiSettings:!1,selectOnKeydown:!0,minCharacters:0,saveRemoteData:!0,throttle:200,context:b,direction:"auto",keepOnScreen:!0,match:"both",fullTextSearch:!1,placeholder:"auto",preserveHTML:!0,sortSelect:!1,forceSelection:!0,allowAdditions:!1,hideAdditions:!0,maxSelections:!1,useLabels:!0,delimiter:",",showOnFocus:!0,allowReselection:!1,allowTab:!0,allowCategorySelection:!1,fireOnInit:!1,transition:"auto",duration:200,glyphWidth:1.037,label:{transition:"scale",duration:200,variation:!1},delay:{hide:300,show:200,search:20,touch:50},onChange:function(a,b,c){},onAdd:function(a,b,c){},onRemove:function(a,b,c){},onLabelSelect:function(a){},onLabelCreate:function(b,c){return a(this)},onLabelRemove:function(a){return!0},onNoResults:function(a){return!0},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",message:{addResult:"Add {term} ",count:"{count} selected",maxSelections:"Max {maxCount} selections",noResults:"No results found.",serverError:"There was an error contacting the server"},error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",labels:"Allowing user additions currently requires the use of labels.",missingMultiple:" requires multiple property to be set to correctly preserve multiple values",method:"The method you called is not defined.",noAPI:"The API module is required to load resources remotely",noStorage:"Saving remote data requires session storage",noTransition:"This module requires ui transitions "},regExp:{escape:/[-[\]{}()*+?.,\\^$|#\s]/g,quote:/"/g},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholder",text:"text",value:"value"},fields:{remoteValues:"results",values:"values",disabled:"disabled",name:"name",value:"value",text:"text"},keys:{backspace:8,delimiter:188,deleteKey:46,enter:13,escape:27,pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},selector:{addition:".addition",dropdown:".ui.dropdown",hidden:".hidden",icon:"> .dropdown.icon",input:'> input[type="hidden"], > select',item:".item",label:"> .label",remove:"> .label > .delete.icon",siblingLabel:".label",menu:".menu",message:".message",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input, .menu input.search",sizer:"> input.sizer",text:"> .text:not(.icon)",unselectable:".disabled, .filtered"},className:{active:"active",addition:"addition",animating:"animating",disabled:"disabled",empty:"empty",dropdown:"ui dropdown",filtered:"filtered",hidden:"hidden transition",item:"item",label:"ui label",loading:"loading",menu:"menu",message:"message",multiple:"multiple",placeholder:"default",sizer:"sizer",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},a.fn.dropdown.settings.templates={dropdown:function(b){var c=b.placeholder||!1,d=(b.values||{},"");return d+=' ',d+=b.placeholder?''+c+"
":'
',d+='"},menu:function(b,c){var d=b[c.values]||{},e="";return a.each(d,function(a,b){var d=b[c.text]?'data-text="'+b[c.text]+'"':"",f=b[c.disabled]?"disabled ":"";e+='",e+=b[c.name],e+="
"}),e},label:function(a,b){return b+' '},message:function(a){return a},addition:function(a){return a}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.embed=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 m,n=a.isPlainObject(c)?a.extend(!0,{},a.fn.embed.settings,c):a.extend({},a.fn.embed.settings),o=n.selector,p=n.className,q=n.sources,r=n.error,s=n.metadata,t=n.namespace,u=n.templates,v="."+t,w="module-"+t,x=(a(b),a(this)),y=x.find(o.placeholder),z=x.find(o.icon),A=x.find(o.embed),B=this,C=x.data(w);m={initialize:function(){m.debug("Initializing embed"),m.determine.autoplay(),m.create(),m.bind.events(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of module",m),C=m,x.data(w,m)},destroy:function(){m.verbose("Destroying previous instance of embed"),m.reset(),x.removeData(w).off(v)},refresh:function(){m.verbose("Refreshing selector cache"),y=x.find(o.placeholder),z=x.find(o.icon),A=x.find(o.embed)},bind:{events:function(){m.has.placeholder()&&(m.debug("Adding placeholder events"),x.on("click"+v,o.placeholder,m.createAndShow).on("click"+v,o.icon,m.createAndShow))}},create:function(){var a=m.get.placeholder();a?m.createPlaceholder():m.createAndShow()},createPlaceholder:function(a){var b=m.get.icon(),c=m.get.url();m.generate.embed(c),a=a||m.get.placeholder(),x.html(u.placeholder(a,b)),m.debug("Creating placeholder for embed",a,b)},createEmbed:function(b){m.refresh(),b=b||m.get.url(),A=a("
").addClass(p.embed).html(m.generate.embed(b)).appendTo(x),n.onCreate.call(B,b),m.debug("Creating embed object",A)},changeEmbed:function(a){A.html(m.generate.embed(a))},createAndShow:function(){m.createEmbed(),m.show()},change:function(a,b,c){m.debug("Changing video to ",a,b,c),x.data(s.source,a).data(s.id,b),c?x.data(s.url,c):x.removeData(s.url),m.has.embed()?m.changeEmbed():m.create()},reset:function(){m.debug("Clearing embed and showing placeholder"),m.remove.active(),m.remove.embed(),m.showPlaceholder(),n.onReset.call(B)},show:function(){m.debug("Showing embed"),m.set.active(),n.onDisplay.call(B)},hide:function(){m.debug("Hiding embed"),m.showPlaceholder()},showPlaceholder:function(){m.debug("Showing placeholder image"),m.remove.active(),n.onPlaceholderDisplay.call(B)},get:{id:function(){return n.id||x.data(s.id)},placeholder:function(){return n.placeholder||x.data(s.placeholder)},icon:function(){return n.icon?n.icon:x.data(s.icon)!==d?x.data(s.icon):m.determine.icon()},source:function(a){return n.source?n.source:x.data(s.source)!==d?x.data(s.source):m.determine.source()},type:function(){var a=m.get.source();return q[a]!==d&&q[a].type},url:function(){return n.url?n.url:x.data(s.url)!==d?x.data(s.url):m.determine.url()}},determine:{autoplay:function(){m.should.autoplay()&&(n.autoplay=!0)},source:function(b){var c=!1;return b=b||m.get.url(),b&&a.each(q,function(a,d){if(b.search(d.domain)!==-1)return c=a,!1}),c},icon:function(){var a=m.get.source();return q[a]!==d&&q[a].icon},url:function(){var a,b=n.id||x.data(s.id),c=n.source||x.data(s.source);return a=q[c]!==d&&q[c].url.replace("{id}",b),a&&x.data(s.url,a),a}},set:{active:function(){x.addClass(p.active)}},remove:{active:function(){x.removeClass(p.active)},embed:function(){A.empty()}},encode:{parameters:function(a){var b,c=[];for(b in a)c.push(encodeURIComponent(b)+"="+encodeURIComponent(a[b]));return c.join("&")}},generate:{embed:function(a){m.debug("Generating embed html");var b,c,d=m.get.source();return a=m.get.url(a),a?(c=m.generate.parameters(d),b=u.iframe(a,c)):m.error(r.noURL,x),b},parameters:function(b,c){var e=q[b]&&q[b].parameters!==d?q[b].parameters(n):{};return c=c||n.parameters,c&&(e=a.extend({},e,c)),e=n.onEmbed(e),m.encode.parameters(e)}},has:{embed:function(){return A.length>0},placeholder:function(){return n.placeholder||x.data(s.placeholder)}},should:{autoplay:function(){return"auto"===n.autoplay?n.placeholder||x.data(s.placeholder)!==d:n.autoplay}},is:{video:function(){return"video"==m.get.type()}},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];a.isPlainObject(n[b])?a.extend(!0,n[b],c):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.silent&&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.silent&&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(){n.silent||(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({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:B,"Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},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.length>1&&(b+=" ("+f.length+")"),(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):(m.error(r.method,b),!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&&m.initialize(),m.invoke(j)):(C!==d&&C.invoke("destroy"),m.initialize())}),e!==d?e:this},a.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,autoplay:"auto",color:"#444444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(a){},onEmbed:function(a){return a},metadata:{id:"id",icon:"icon",placeholder:"placeholder",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(a){return{autohide:!a.brandedUI,autoplay:a.autoplay,color:a.color||d,hq:a.hd,jsapi:a.api,modestbranding:!a.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(a){return{api:a.api,autoplay:a.autoplay,byline:a.brandedUI,color:a.color||d,portrait:a.brandedUI,title:a.brandedUI}}}},templates:{iframe:function(a,b){var c=a;return b&&(c+="?"+b),''},placeholder:function(a,b){var c="";return b&&(c+=' '),a&&(c+=' '),c}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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,x,y,z=a.isPlainObject(e)?a.extend(!0,{},a.fn.modal.settings,e):a.extend({},a.fn.modal.settings),A=z.selector,B=z.className,C=z.namespace,D=z.error,E="."+C,F="module-"+C,G=a(this),H=a(z.context),I=G.find(A.close),J=this,K=G.data(F);y={initialize:function(){y.verbose("Initializing dimmer",H),y.create.id(),y.create.dimmer(),y.refreshModals(),y.bind.events(),z.observeChanges&&y.observeChanges(),y.instantiate()},instantiate:function(){y.verbose("Storing instance of modal"),K=y,G.data(F,K)},create:{dimmer:function(){var b={debug:z.debug,dimmerName:"modals",duration:{show:z.duration,hide:z.duration}},c=a.extend(!0,b,z.dimmerSettings);return z.inverted&&(c.variation=c.variation!==d?c.variation+" inverted":"inverted"),a.fn.dimmer===d?void y.error(D.dimmer):(y.debug("Creating dimmer with settings",c),t=H.dimmer(c),z.detachable?(y.verbose("Modal is detachable, moving content into dimmer"),t.dimmer("add content",G)):y.set.undetached(),z.blurring&&t.addClass(B.blurring),void(u=t.dimmer("get dimmer")))},id:function(){w=(Math.random().toString(16)+"000000000").substr(2,8),v="."+w,y.verbose("Creating unique id for element",w)}},destroy:function(){y.verbose("Destroying previous modal"),G.removeData(F).off(E),h.off(v),u.off(v),I.off(E),H.dimmer("destroy")},observeChanges:function(){"MutationObserver"in b&&(x=new MutationObserver(function(a){y.debug("DOM tree modified, refreshing"),y.refresh()}),x.observe(J,{childList:!0,subtree:!0}),y.debug("Setting up mutation observer",x))},refresh:function(){y.remove.scrolling(),y.cacheSizes(),y.set.screenHeight(),y.set.type(),y.set.position()},refreshModals:function(){r=G.siblings(A.modal),g=r.add(G)},attachEvents:function(b,c){var d=a(b);c=a.isFunction(y[c])?y[c]:y.toggle,d.length>0?(y.debug("Attaching modal events to element",b,c),d.off(E).on("click"+E,c)):y.error(D.notFound,b)},bind:{events:function(){y.verbose("Attaching events"),G.on("click"+E,A.close,y.event.close).on("click"+E,A.approve,y.event.approve).on("click"+E,A.deny,y.event.deny),h.on("resize"+v,y.event.resize)}},get:{id:function(){return(Math.random().toString(16)+"000000000").substr(2,8)}},event:{approve:function(){return z.onApprove.call(J,a(this))===!1?void y.verbose("Approve callback returned false cancelling hide"):void y.hide()},deny:function(){return z.onDeny.call(J,a(this))===!1?void y.verbose("Deny callback returned false cancelling hide"):void y.hide()},close:function(){y.hide()},click:function(b){var d=a(b.target),e=d.closest(A.modal).length>0,f=a.contains(c.documentElement,b.target);!e&&f&&(y.debug("Dimmer clicked, hiding all modals"),y.is.active()&&(y.remove.clickaway(),z.allowMultiple?y.hide():y.hideAll()))},debounce:function(a,b){clearTimeout(y.timer),y.timer=setTimeout(a,b)},keyboard:function(a){var b=a.which,c=27;b==c&&(z.closable?(y.debug("Escape key pressed hiding modal"),y.hide()):y.debug("Escape key pressed, but closable is set to false"),a.preventDefault())},resize:function(){t.dimmer("is active")&&q(y.refresh)}},toggle:function(){y.is.active()||y.is.animating()?y.hide():y.show()},show:function(b){b=a.isFunction(b)?b:function(){},y.refreshModals(),y.showModal(b)},hide:function(b){b=a.isFunction(b)?b:function(){},y.refreshModals(),y.hideModal(b)},showModal:function(b){b=a.isFunction(b)?b:function(){},y.is.animating()||!y.is.active()?(y.showDimmer(),y.cacheSizes(),y.set.position(),y.set.screenHeight(),y.set.type(),y.set.clickaway(),!z.allowMultiple&&y.others.active()?y.hideOthers(y.showModal):(z.onShow.call(J),z.transition&&a.fn.transition!==d&&G.transition("is supported")?(y.debug("Showing modal with css animations"),G.transition({debug:z.debug,animation:z.transition+" in",queue:z.queue,duration:z.duration,useFailSafe:!0,onComplete:function(){z.onVisible.apply(J),z.keyboardShortcuts&&y.add.keyboardShortcuts(),y.save.focus(),y.set.active(),z.autofocus&&y.set.autofocus(),b()}})):y.error(D.noTransition))):y.debug("Modal is already visible")},hideModal:function(b,c){return b=a.isFunction(b)?b:function(){},y.debug("Hiding modal"),z.onHide.call(J,a(this))===!1?void y.verbose("Hide callback returned false cancelling hide"):void((y.is.animating()||y.is.active())&&(z.transition&&a.fn.transition!==d&&G.transition("is supported")?(y.remove.active(),G.transition({debug:z.debug,animation:z.transition+" out",queue:z.queue,duration:z.duration,useFailSafe:!0,onStart:function(){y.others.active()||c||y.hideDimmer(),z.keyboardShortcuts&&y.remove.keyboardShortcuts()},onComplete:function(){z.onHidden.call(J),y.restore.focus(),b()}})):y.error(D.noTransition)))},showDimmer:function(){t.dimmer("is animating")||!t.dimmer("is active")?(y.debug("Showing dimmer"),t.dimmer("show")):y.debug("Dimmer already visible")},hideDimmer:function(){return t.dimmer("is animating")||t.dimmer("is active")?void t.dimmer("hide",function(){y.remove.clickaway(),y.remove.screenHeight()}):void y.debug("Dimmer is not visible cannot hide")},hideAll:function(b){var c=g.filter("."+B.active+", ."+B.animating);b=a.isFunction(b)?b:function(){},c.length>0&&(y.debug("Hiding all visible modals"),y.hideDimmer(),c.modal("hide modal",b))},hideOthers:function(b){var c=r.filter("."+B.active+", ."+B.animating);b=a.isFunction(b)?b:function(){},c.length>0&&(y.debug("Hiding other modals",r),c.modal("hide modal",b,!0))},others:{active:function(){return r.filter("."+B.active).length>0},animating:function(){return r.filter("."+B.animating).length>0}},add:{keyboardShortcuts:function(){y.verbose("Adding keyboard shortcuts"),i.on("keyup"+E,y.event.keyboard)}},save:{focus:function(){s=a(c.activeElement).blur()}},restore:{focus:function(){s&&s.length>0&&s.focus()}},remove:{active:function(){G.removeClass(B.active)},clickaway:function(){z.closable&&u.off("click"+v)},bodyStyle:function(){""===j.attr("style")&&(y.verbose("Removing style attribute"),j.removeAttr("style"))},screenHeight:function(){y.debug("Removing page height"),j.css("height","")},keyboardShortcuts:function(){y.verbose("Removing keyboard shortcuts"),i.off("keyup"+E)},scrolling:function(){t.removeClass(B.scrolling),G.removeClass(B.scrolling)}},cacheSizes:function(){var e=G.outerHeight();y.cache!==d&&0===e||(y.cache={pageHeight:a(c).outerHeight(),height:e+z.offset,contextHeight:"body"==z.context?a(b).height():t.height()}),y.debug("Caching modal and container sizes",y.cache)},can:{fit:function(){return y.cache.height+2*z.padding0?b.first():a.first();c.length>0&&c.focus()},clickaway:function(){z.closable&&u.on("click"+v,y.event.click)},screenHeight:function(){y.can.fit()?j.css("height",""):(y.debug("Modal is taller than page content, resizing page height"),j.css("height",y.cache.height+2*z.padding))},active:function(){G.addClass(B.active)},scrolling:function(){t.addClass(B.scrolling),G.addClass(B.scrolling)},type:function(){y.can.fit()?(y.verbose("Modal fits on screen"),y.others.active()||y.others.animating()||y.remove.scrolling()):(y.verbose("Modal cannot fit on screen setting to scrolling"),y.set.scrolling())},position:function(){y.verbose("Centering modal on page",y.cache),y.can.fit()?G.css({top:"",marginTop:-(y.cache.height/2)}):G.css({marginTop:"",top:i.scrollTop()})},undetached:function(){t.addClass(B.undetached)}},setting:function(b,c){if(y.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,z,b);else{if(c===d)return z[b];a.isPlainObject(z[b])?a.extend(!0,z[b],c):z[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,y,b);else{if(c===d)return y[b];y[b]=c}},debug:function(){!z.silent&&z.debug&&(z.performance?y.performance.log(arguments):(y.debug=Function.prototype.bind.call(console.info,console,z.name+":"),y.debug.apply(console,arguments)))},verbose:function(){!z.silent&&z.verbose&&z.debug&&(z.performance?y.performance.log(arguments):(y.verbose=Function.prototype.bind.call(console.info,console,z.name+":"),y.verbose.apply(console,arguments)))},error:function(){z.silent||(y.error=Function.prototype.bind.call(console.error,console,z.name+":"),y.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;z.performance&&(b=(new Date).getTime(),d=l||b,c=b-d,l=b,m.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:J,"Execution Time":c})),clearTimeout(y.performance.timer),y.performance.timer=setTimeout(y.performance.display,500)},display:function(){var b=z.name+":",c=0;l=!1,clearTimeout(y.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=K;return c=c||p,e=J||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);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?(K===d&&y.initialize(),y.invoke(n)):(K!==d&&K.invoke("destroy"),y.initialize())}),f!==d?f:this},a.fn.modal.settings={name:"Modal",namespace:"modal",silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,inverted:!1,blurring:!1,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,offset:0,transition:"scale",padding:50,onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:function(){},onApprove:function(){return!0},onDeny:function(){return!0},selector:{close:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",scrolling:"scrolling",undetached:"undetached"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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 f.each(function(){var f,m=a.isPlainObject(c)?a.extend(!0,{},a.fn.nag.settings,c):a.extend({},a.fn.nag.settings),n=(m.className,m.selector),o=m.error,p=m.namespace,q="."+p,r=p+"-module",s=a(this),t=(s.find(n.close),a(m.context?m.context:"body")),u=this,v=s.data(r);b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f={initialize:function(){f.verbose("Initializing element"),s.on("click"+q,n.close,f.dismiss).data(r,f),m.detachable&&s.parent()[0]!==t[0]&&s.detach().prependTo(t),m.displayTime>0&&setTimeout(f.hide,m.displayTime),f.show()},destroy:function(){f.verbose("Destroying instance"),s.removeData(r).off(q)},show:function(){f.should.show()&&!s.is(":visible")&&(f.debug("Showing nag",m.animation.show),"fade"==m.animation.show?s.fadeIn(m.duration,m.easing):s.slideDown(m.duration,m.easing))},hide:function(){f.debug("Showing nag",m.animation.hide),"fade"==m.animation.show?s.fadeIn(m.duration,m.easing):s.slideUp(m.duration,m.easing)},onHide:function(){f.debug("Removing nag",m.animation.hide),s.remove(),m.onHide&&m.onHide()},dismiss:function(a){m.storageMethod&&f.storage.set(m.key,m.value),f.hide(),a.stopImmediatePropagation(),a.preventDefault()},should:{show:function(){return m.persist?(f.debug("Persistent nag is set, can show nag"),!0):f.storage.get(m.key)!=m.value.toString()?(f.debug("Stored value is not set, can show nag",f.storage.get(m.key)),!0):(f.debug("Stored value is set, cannot show nag",f.storage.get(m.key)),!1)}},get:{storageOptions:function(){var a={};return m.expires&&(a.expires=m.expires),m.domain&&(a.domain=m.domain),m.path&&(a.path=m.path),a}},clear:function(){f.storage.remove(m.key)},storage:{set:function(c,e){var g=f.get.storageOptions();if("localstorage"==m.storageMethod&&b.localStorage!==d)b.localStorage.setItem(c,e),f.debug("Value stored using local storage",c,e);else if("sessionstorage"==m.storageMethod&&b.sessionStorage!==d)b.sessionStorage.setItem(c,e),f.debug("Value stored using session storage",c,e);else{if(a.cookie===d)return void f.error(o.noCookieStorage);a.cookie(c,e,g),f.debug("Value stored using cookie",c,e,g)}},get:function(c,e){var g;return"localstorage"==m.storageMethod&&b.localStorage!==d?g=b.localStorage.getItem(c):"sessionstorage"==m.storageMethod&&b.sessionStorage!==d?g=b.sessionStorage.getItem(c):a.cookie!==d?g=a.cookie(c):f.error(o.noCookieStorage),"undefined"!=g&&"null"!=g&&g!==d&&null!==g||(g=d),g},remove:function(c){var e=f.get.storageOptions();"localstorage"==m.storageMethod&&b.localStorage!==d?b.localStorage.removeItem(c):"sessionstorage"==m.storageMethod&&b.sessionStorage!==d?b.sessionStorage.removeItem(c):a.cookie!==d?a.removeCookie(c,e):f.error(o.noStorage)}},setting:function(b,c){if(f.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,m,b);else{if(c===d)return m[b];a.isPlainObject(m[b])?a.extend(!0,m[b],c):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.silent&&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.silent&&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(){m.silent||(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({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:u,"Execution Time":c})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},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",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,g){var h,i,j,k=v;return c=c||l,g=u||g,"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(g,c):i!==d&&(j=i),a.isArray(e)?e.push(j):e!==d?e=[e,j]:j!==d&&(e=j),i}},k?(v===d&&f.initialize(),f.invoke(j)):(v!==d&&v.invoke("destroy"),f.initialize())}),e!==d?e:this},a.fn.nag.settings={name:"Nag",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noCookieStorage:"$.cookie is not included. A storage solution is required.",noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}},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){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.popup=function(e){var f,g=a(this),h=a(c),i=a(b),j=a("body"),k=g.selector||"",l=!0,m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1);return g.each(function(){var g,r,s,t,u,v,w=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.extend({},a.fn.popup.settings),x=w.selector,y=w.className,z=w.error,A=w.metadata,B=w.namespace,C="."+w.namespace,D="module-"+B,E=a(this),F=a(w.context),G=a(w.scrollContext),H=a(w.boundary),I=w.target?a(w.target):E,J=0,K=!1,L=!1,M=this,N=E.data(D);v={initialize:function(){v.debug("Initializing",E),v.createID(),v.bind.events(),!v.exists()&&w.preserve&&v.create(),w.observeChanges&&v.observeChanges(),v.instantiate()},instantiate:function(){v.verbose("Storing instance",v),N=v,E.data(D,N)},observeChanges:function(){"MutationObserver"in b&&(s=new MutationObserver(v.event.documentChanged),s.observe(c,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",s))},refresh:function(){w.popup?g=a(w.popup).eq(0):w.inline&&(g=I.nextAll(x.popup).eq(0),w.popup=g),w.popup?(g.addClass(y.loading),r=v.get.offsetParent(),g.removeClass(y.loading),w.movePopup&&v.has.popup()&&v.get.offsetParent(g)[0]!==r[0]&&(v.debug("Moving popup to the same offset parent as activating element"),g.detach().appendTo(r))):r=w.inline?v.get.offsetParent(I):v.has.popup()?v.get.offsetParent(g):j,r.is("html")&&r[0]!==j[0]&&(v.debug("Setting page as offset parent"),r=j),v.get.variation()&&v.set.variation()},reposition:function(){v.refresh(),v.set.position()},destroy:function(){v.debug("Destroying previous module"),s&&s.disconnect(),g&&!w.preserve&&v.removePopup(),clearTimeout(v.hideTimer),clearTimeout(v.showTimer),v.unbind.close(),v.unbind.events(),E.removeData(D)},event:{start:function(b){var c=a.isPlainObject(w.delay)?w.delay.show:w.delay;clearTimeout(v.hideTimer),L||(v.showTimer=setTimeout(v.show,c))},end:function(){var b=a.isPlainObject(w.delay)?w.delay.hide:w.delay;clearTimeout(v.showTimer),v.hideTimer=setTimeout(v.hide,b)},touchstart:function(a){L=!0,v.show()},resize:function(){v.is.visible()&&v.set.position()},documentChanged:function(b){[].forEach.call(b,function(b){b.removedNodes&&[].forEach.call(b.removedNodes,function(b){(b==M||a(b).find(M).length>0)&&(v.debug("Element removed from DOM, tearing down events"),v.destroy())})})},hideGracefully:function(b){var d=a(b.target),e=a.contains(c.documentElement,b.target),f=d.closest(x.popup).length>0;b&&!f&&e?(v.debug("Click occurred outside popup hiding popup"),v.hide()):v.debug("Click was inside popup, keeping popup open")}},create:function(){var b=v.get.html(),c=v.get.title(),d=v.get.content();b||d||c?(v.debug("Creating pop-up html"),b||(b=w.templates.popup({title:c,content:d})),g=a("
").addClass(y.popup).data(A.activator,E).html(b),w.inline?(v.verbose("Inserting popup element inline",g),g.insertAfter(E)):(v.verbose("Appending popup element to body",g),g.appendTo(F)),v.refresh(),v.set.variation(),w.hoverable&&v.bind.popup(),w.onCreate.call(g,M)):0!==I.next(x.popup).length?(v.verbose("Pre-existing popup found"),w.inline=!0,w.popup=I.next(x.popup).data(A.activator,E),v.refresh(),w.hoverable&&v.bind.popup()):w.popup?(a(w.popup).data(A.activator,E),v.verbose("Used popup specified in settings"),v.refresh(),w.hoverable&&v.bind.popup()):v.debug("No content specified skipping display",M)},createID:function(){u=(Math.random().toString(16)+"000000000").substr(2,8),t="."+u,v.verbose("Creating unique id for element",u)},toggle:function(){v.debug("Toggling pop-up"),v.is.hidden()?(v.debug("Popup is hidden, showing pop-up"),v.unbind.close(),v.show()):(v.debug("Popup is visible, hiding pop-up"),
v.hide())},show:function(a){if(a=a||function(){},v.debug("Showing pop-up",w.transition),v.is.hidden()&&(!v.is.active()||!v.is.dropdown())){if(v.exists()||v.create(),w.onShow.call(g,M)===!1)return void v.debug("onShow callback returned false, cancelling popup animation");w.preserve||w.popup||v.refresh(),g&&v.set.position()&&(v.save.conditions(),w.exclusive&&v.hideAll(),v.animate.show(a))}},hide:function(a){if(a=a||function(){},v.is.visible()||v.is.animating()){if(w.onHide.call(g,M)===!1)return void v.debug("onHide callback returned false, cancelling popup animation");v.remove.visible(),v.unbind.close(),v.restore.conditions(),v.animate.hide(a)}},hideAll:function(){a(x.popup).filter("."+y.visible).each(function(){a(this).data(A.activator).popup("hide")})},exists:function(){return!!g&&(w.inline||w.popup?v.has.popup():g.closest(F).length>=1)},removePopup:function(){v.has.popup()&&!w.popup&&(v.debug("Removing popup",g),g.remove(),g=d,w.onRemove.call(g,M))},save:{conditions:function(){v.cache={title:E.attr("title")},v.cache.title&&E.removeAttr("title"),v.verbose("Saving original attributes",v.cache.title)}},restore:{conditions:function(){return v.cache&&v.cache.title&&(E.attr("title",v.cache.title),v.verbose("Restoring original attributes",v.cache.title)),!0}},supports:{svg:function(){return typeof SVGGraphicsElement===d}},animate:{show:function(b){b=a.isFunction(b)?b:function(){},w.transition&&a.fn.transition!==d&&E.transition("is supported")?(v.set.visible(),g.transition({animation:w.transition+" in",queue:!1,debug:w.debug,verbose:w.verbose,duration:w.duration,onComplete:function(){v.bind.close(),b.call(g,M),w.onVisible.call(g,M)}})):v.error(z.noTransition)},hide:function(b){return b=a.isFunction(b)?b:function(){},v.debug("Hiding pop-up"),w.onHide.call(g,M)===!1?void v.debug("onHide callback returned false, cancelling popup animation"):void(w.transition&&a.fn.transition!==d&&E.transition("is supported")?g.transition({animation:w.transition+" out",queue:!1,duration:w.duration,debug:w.debug,verbose:w.verbose,onComplete:function(){v.reset(),b.call(g,M),w.onHidden.call(g,M)}}):v.error(z.noTransition))}},change:{content:function(a){g.html(a)}},get:{html:function(){return E.removeData(A.html),E.data(A.html)||w.html},title:function(){return E.removeData(A.title),E.data(A.title)||w.title},content:function(){return E.removeData(A.content),E.data(A.content)||E.attr("title")||w.content},variation:function(){return E.removeData(A.variation),E.data(A.variation)||w.variation},popup:function(){return g},popupOffset:function(){return g.offset()},calculations:function(){var a,c=I[0],d=H[0]==b,e=w.inline||w.popup&&w.movePopup?I.position():I.offset(),f=d?{top:0,left:0}:H.offset(),h={},j=d?{top:i.scrollTop(),left:i.scrollLeft()}:{top:0,left:0};return h={target:{element:I[0],width:I.outerWidth(),height:I.outerHeight(),top:e.top,left:e.left,margin:{}},popup:{width:g.outerWidth(),height:g.outerHeight()},parent:{width:r.outerWidth(),height:r.outerHeight()},screen:{top:f.top,left:f.left,scroll:{top:j.top,left:j.left},width:H.width(),height:H.height()}},w.setFluidWidth&&v.is.fluid()&&(h.container={width:g.parent().outerWidth()},h.popup.width=h.container.width),h.target.margin.top=w.inline?parseInt(b.getComputedStyle(c).getPropertyValue("margin-top"),10):0,h.target.margin.left=w.inline?v.is.rtl()?parseInt(b.getComputedStyle(c).getPropertyValue("margin-right"),10):parseInt(b.getComputedStyle(c).getPropertyValue("margin-left"),10):0,a=h.screen,h.boundary={top:a.top+a.scroll.top,bottom:a.top+a.scroll.top+a.height,left:a.left+a.scroll.left,right:a.left+a.scroll.left+a.width},h},id:function(){return u},startEvent:function(){return"hover"==w.on?"mouseenter":"focus"==w.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==w.on?"mouseleave":"focus"==w.on&&"blur"},distanceFromBoundary:function(a,b){var c,d,e={};return b=b||v.get.calculations(),c=b.popup,d=b.boundary,a&&(e={top:a.top-d.top,left:a.left-d.left,right:d.right-(a.left+c.width),bottom:d.bottom-(a.top+c.height)},v.verbose("Distance from boundaries determined",a,e)),e},offsetParent:function(b){var c=b!==d?b[0]:E[0],e=c.parentNode,f=a(e);if(e)for(var g="none"===f.css("transform"),h="static"===f.css("position"),i=f.is("html");e&&!i&&h&&g;)e=e.parentNode,f=a(e),g="none"===f.css("transform"),h="static"===f.css("position"),i=f.is("html");return f&&f.length>0?f:a()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(a){var b=a.split(" "),c=b[0],d=b[1],e={top:"bottom",bottom:"top",left:"right",right:"left"},f={left:"center",center:"right",right:"left"},g={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"},h="top"==c||"bottom"==c,i=!1,j=!1,k=!1;return K||(v.verbose("All available positions available"),K=v.get.positions()),v.debug("Recording last position tried",a),K[a]=!0,"opposite"===w.prefer&&(k=[e[c],d],k=k.join(" "),i=K[k]===!0,v.debug("Trying opposite strategy",k)),"adjacent"===w.prefer&&h&&(k=[c,f[d]],k=k.join(" "),j=K[k]===!0,v.debug("Trying adjacent strategy",k)),(j||i)&&(v.debug("Using backup position",k),k=g[a]),k}},set:{position:function(a,b){if(0===I.length||0===g.length)return void v.error(z.notFound);var c,e,f,h,i,j,k,l;if(b=b||v.get.calculations(),a=a||E.data(A.position)||w.position,c=E.data(A.offset)||w.offset,e=w.distanceAway,f=b.target,h=b.popup,i=b.parent,0===f.width&&0===f.height&&!v.is.svg(f.element))return v.debug("Popup target is hidden, no action taken"),!1;switch(w.inline&&(v.debug("Adding margin to calculation",f.margin),"left center"==a||"right center"==a?(c+=f.margin.top,e+=-f.margin.left):"top left"==a||"top center"==a||"top right"==a?(c+=f.margin.left,e-=f.margin.top):(c+=f.margin.left,e+=f.margin.top)),v.debug("Determining popup position from calculations",a,b),v.is.rtl()&&(a=a.replace(/left|right/g,function(a){return"left"==a?"right":"left"}),v.debug("RTL: Popup position updated",a)),J==w.maxSearchDepth&&"string"==typeof w.lastResort&&(a=w.lastResort),a){case"top left":j={top:"auto",bottom:i.height-f.top+e,left:f.left+c,right:"auto"};break;case"top center":j={bottom:i.height-f.top+e,left:f.left+f.width/2-h.width/2+c,top:"auto",right:"auto"};break;case"top right":j={bottom:i.height-f.top+e,right:i.width-f.left-f.width-c,top:"auto",left:"auto"};break;case"left center":j={top:f.top+f.height/2-h.height/2+c,right:i.width-f.left+e,left:"auto",bottom:"auto"};break;case"right center":j={top:f.top+f.height/2-h.height/2+c,left:f.left+f.width+e,bottom:"auto",right:"auto"};break;case"bottom left":j={top:f.top+f.height+e,left:f.left+c,bottom:"auto",right:"auto"};break;case"bottom center":j={top:f.top+f.height+e,left:f.left+f.width/2-h.width/2+c,bottom:"auto",right:"auto"};break;case"bottom right":j={top:f.top+f.height+e,right:i.width-f.left-f.width-c,left:"auto",bottom:"auto"}}if(j===d&&v.error(z.invalidPosition,a),v.debug("Calculated popup positioning values",j),g.css(j).removeClass(y.position).addClass(a).addClass(y.loading),k=v.get.popupOffset(),l=v.get.distanceFromBoundary(k,b),v.is.offstage(l,a)){if(v.debug("Position is outside viewport",a),J0}},is:{offstage:function(b,c){var d=[];return a.each(b,function(a,b){b<-w.jitter&&(v.debug("Position exceeds allowable distance from edge",a,b,c),d.push(a))}),d.length>0},svg:function(a){return v.supports.svg()&&a instanceof SVGGraphicsElement},active:function(){return E.hasClass(y.active)},animating:function(){return g!==d&&g.hasClass(y.animating)},fluid:function(){return g!==d&&g.hasClass(y.fluid)},visible:function(){return g!==d&&g.hasClass(y.visible)},dropdown:function(){return E.hasClass(y.dropdown)},hidden:function(){return!v.is.visible()},rtl:function(){return"rtl"==E.css("direction")}},reset:function(){v.remove.visible(),w.preserve?a.fn.transition!==d&&g.transition("remove transition"):v.removePopup()},setting:function(b,c){if(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.silent&&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.silent&&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(){w.silent||(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=m||b,c=b-d,m=b,n.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:M,"Execution Time":c})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var b=w.name+":",c=0;m=!1,clearTimeout(v.performance.timer),a.each(n,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",k&&(b+=" '"+k+"'"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(b),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(b,c,e){var g,h,i,j=N;return c=c||q,e=M||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);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}},p?(N===d&&v.initialize(),v.invoke(o)):(N!==d&&N.invoke("destroy"),v.initialize())}),f!==d?f:this},a.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:b,addTouchEvents:!0,position:"top left",variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:b,prefer:"opposite",lastResort:!1,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions ",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(a){var b=/[&<>"'`]/g,c=/[&<>"'`]/,d={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},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+='"),typeof b.content!==d&&b.content&&(b.content=e(b.content),c+=''+b.content+"
")),c}}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),"undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.progress=function(b){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=a.isPlainObject(b)?a.extend(!0,{},a.fn.progress.settings,b):a.extend({},a.fn.progress.settings),o=n.className,p=n.metadata,q=n.namespace,r=n.selector,s=n.error,t="."+q,u="module-"+q,v=a(this),w=a(this).find(r.bar),x=a(this).find(r.progress),y=a(this).find(r.label),z=this,A=v.data(u),B=!1;m={initialize:function(){m.debug("Initializing progress bar",n),m.set.duration(),m.set.transitionEvent(),m.read.metadata(),m.read.settings(),m.instantiate()},instantiate:function(){m.verbose("Storing instance of progress",m),A=m,v.data(u,m)},destroy:function(){m.verbose("Destroying previous progress for",v),clearInterval(A.interval),m.remove.state(),v.removeData(u),A=d},reset:function(){m.remove.nextValue(),m.update.progress(0)},complete:function(){(m.percent===d||m.percent<100)&&(m.remove.progressPoll(),m.set.percent(100))},read:{metadata:function(){var a={percent:v.data(p.percent),total:v.data(p.total),value:v.data(p.value)};a.percent&&(m.debug("Current percent value set from metadata",a.percent),m.set.percent(a.percent)),a.total&&(m.debug("Total value set from metadata",a.total),m.set.total(a.total)),a.value&&(m.debug("Current value set from metadata",a.value),m.set.value(a.value),m.set.progress(a.value))},settings:function(){n.total!==!1&&(m.debug("Current total set in settings",n.total),m.set.total(n.total)),n.value!==!1&&(m.debug("Current value set in settings",n.value),m.set.value(n.value),m.set.progress(m.value)),n.percent!==!1&&(m.debug("Current percent set in settings",n.percent),m.set.percent(n.percent))}},increment:function(a){var b,c,d;m.has.total()?(c=m.get.value(),a=a||1,d=c+a):(c=m.get.percent(),a=a||m.get.randomValue(),d=c+a,b=100,m.debug("Incrementing percentage by",c,d)),d=m.get.normalizedValue(d),m.set.progress(d)},decrement:function(a){var b,c,d=m.get.total();d?(b=m.get.value(),a=a||1,c=b-a,m.debug("Decrementing value by",a,b)):(b=m.get.percent(),a=a||m.get.randomValue(),c=b-a,m.debug("Decrementing percentage by",a,b)),c=m.get.normalizedValue(c),m.set.progress(c)},has:{progressPoll:function(){return m.progressPoll},total:function(){return m.get.total()!==!1}},get:{text:function(a){var b=m.value||0,c=m.total||0,d=B?m.get.displayPercent():m.percent||0,e=m.total>0?c-b:100-d;return a=a||"",a=a.replace("{value}",b).replace("{total}",c).replace("{left}",e).replace("{percent}",d),m.verbose("Adding variables to progress bar text",a),a},normalizedValue:function(a){if(a<0)return m.debug("Value cannot decrement below 0"),0;if(m.has.total()){if(a>m.total)return m.debug("Value cannot increment above total",m.total),m.total}else if(a>100)return m.debug("Value cannot increment above 100 percent"),100;return a},updateInterval:function(){return"auto"==n.updateInterval?n.duration:n.updateInterval},randomValue:function(){return m.debug("Generating random increment percentage"),Math.floor(Math.random()*n.random.max+n.random.min)},numericValue:function(a){return"string"==typeof a?""!==a.replace(/[^\d.]/g,"")&&+a.replace(/[^\d.]/g,""):a},transitionEnd: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]},displayPercent:function(){var a=w.width(),b=v.width(),c=parseInt(w.css("min-width"),10),d=a>c?a/b*100:m.percent;return n.precision>0?Math.round(d*(10*n.precision))/(10*n.precision):Math.round(d)},percent:function(){return m.percent||0},value:function(){return m.nextValue||m.value||0},total:function(){return m.total||!1}},create:{progressPoll:function(){m.progressPoll=setTimeout(function(){m.update.toNextValue(),m.remove.progressPoll()},m.get.updateInterval())}},is:{complete:function(){return m.is.success()||m.is.warning()||m.is.error()},success:function(){return v.hasClass(o.success)},warning:function(){return v.hasClass(o.warning)},error:function(){return v.hasClass(o.error)},active:function(){return v.hasClass(o.active)},visible:function(){return v.is(":visible")}},remove:{progressPoll:function(){m.verbose("Removing progress poll timer"),m.progressPoll&&(clearTimeout(m.progressPoll),delete m.progressPoll)},nextValue:function(){m.verbose("Removing progress value stored for next update"),delete m.nextValue},state:function(){m.verbose("Removing stored state"),delete m.total,delete m.percent,delete m.value},active:function(){m.verbose("Removing active state"),v.removeClass(o.active)},success:function(){m.verbose("Removing success state"),v.removeClass(o.success)},warning:function(){m.verbose("Removing warning state"),v.removeClass(o.warning)},error:function(){m.verbose("Removing error state"),v.removeClass(o.error)}},set:{barWidth:function(a){a>100?m.error(s.tooHigh,a):a<0?m.error(s.tooLow,a):(w.css("width",a+"%"),v.attr("data-percent",parseInt(a,10)))},duration:function(a){a=a||n.duration,a="number"==typeof a?a+"ms":a,m.verbose("Setting progress bar transition duration",a),w.css({"transition-duration":a})},percent:function(a){a="string"==typeof a?+a.replace("%",""):a,a=n.precision>0?Math.round(a*(10*n.precision))/(10*n.precision):Math.round(a),m.percent=a,m.has.total()||(m.value=n.precision>0?Math.round(a/100*m.total*(10*n.precision))/(10*n.precision):Math.round(a/100*m.total*10)/10,n.limitValues&&(m.value=m.value>100?100:m.value<0?0:m.value)),m.set.barWidth(a),m.set.labelInterval(),m.set.labels(),n.onChange.call(z,a,m.value,m.total)},labelInterval:function(){var b=function(){m.verbose("Bar finished animating, removing continuous label updates"),clearInterval(m.interval),B=!1,m.set.labels()};clearInterval(m.interval),w.one(f+t,b),B=!0,m.interval=setInterval(function(){var b=a.contains(c.documentElement,z);b||(clearInterval(m.interval),B=!1),m.set.labels()},n.framerate)},labels:function(){m.verbose("Setting both bar progress and outer label text"),m.set.barLabel(),m.set.state()},label:function(a){a=a||"",a&&(a=m.get.text(a),m.verbose("Setting label to text",a),y.text(a))},state:function(a){a=a!==d?a:m.percent,100===a?n.autoSuccess&&!(m.is.warning()||m.is.error()||m.is.success())?(m.set.success(),m.debug("Automatically triggering success at 100%")):(m.verbose("Reached 100% removing active state"),m.remove.active(),m.remove.progressPoll()):a>0?(m.verbose("Adjusting active progress bar label",a),m.set.active()):(m.remove.active(),m.set.label(n.text.active))},barLabel:function(a){a!==d?x.text(m.get.text(a)):"ratio"==n.label&&m.total?(m.verbose("Adding ratio to bar label"),x.text(m.get.text(n.text.ratio))):"percent"==n.label&&(m.verbose("Adding percentage to bar label"),x.text(m.get.text(n.text.percent)))},active:function(a){a=a||n.text.active,m.debug("Setting active state"),n.showActivity&&!m.is.active()&&v.addClass(o.active),m.remove.warning(),m.remove.error(),m.remove.success(),a=n.onLabelUpdate("active",a,m.value,m.total),a&&m.set.label(a),w.one(f+t,function(){n.onActive.call(z,m.value,m.total)})},success:function(a){a=a||n.text.success||n.text.active,m.debug("Setting success state"),v.addClass(o.success),m.remove.active(),m.remove.warning(),m.remove.error(),m.complete(),n.text.success?(a=n.onLabelUpdate("success",a,m.value,m.total),m.set.label(a)):(a=n.onLabelUpdate("active",a,m.value,m.total),m.set.label(a)),w.one(f+t,function(){n.onSuccess.call(z,m.total)})},warning:function(a){a=a||n.text.warning,m.debug("Setting warning state"),v.addClass(o.warning),m.remove.active(),m.remove.success(),m.remove.error(),m.complete(),a=n.onLabelUpdate("warning",a,m.value,m.total),a&&m.set.label(a),w.one(f+t,function(){n.onWarning.call(z,m.value,m.total)})},error:function(a){a=a||n.text.error,m.debug("Setting error state"),v.addClass(o.error),m.remove.active(),m.remove.success(),m.remove.warning(),m.complete(),a=n.onLabelUpdate("error",a,m.value,m.total),a&&m.set.label(a),w.one(f+t,function(){n.onError.call(z,m.value,m.total)})},transitionEvent:function(){f=m.get.transitionEnd()},total:function(a){m.total=a},value:function(a){m.value=a},progress:function(a){m.has.progressPoll()?(m.debug("Updated within interval, setting next update to use new value",a),m.set.nextValue(a)):(m.debug("First update in progress update interval, immediately updating",a),m.update.progress(a),m.create.progressPoll())},nextValue:function(a){m.nextValue=a}},update:{toNextValue:function(){var a=m.nextValue;a&&(m.debug("Update interval complete using last updated value",a),m.update.progress(a),m.remove.nextValue())},progress:function(a){var b;a=m.get.numericValue(a),a===!1&&m.error(s.nonNumeric,a),a=m.get.normalizedValue(a),m.has.total()?(m.set.value(a),b=a/m.total*100,m.debug("Calculating percent complete from total",b),m.set.percent(b)):(b=a,m.debug("Setting value to exact percentage value",b),m.set.percent(b))}},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];a.isPlainObject(n[b])?a.extend(!0,n[b],c):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.silent&&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.silent&&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(){n.silent||(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({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:z,"Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},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+"'"),(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=A;return c=c||l,f=z||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):(m.error(s.method,b),!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?(A===d&&m.initialize(),m.invoke(j)):(A!==d&&A.invoke("destroy"),m.initialize())}),e!==d?e:this},a.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,onLabelUpdate:function(a,b,c,d){return b},onChange:function(a,b,c){},onSuccess:function(a){},onActive:function(a,b){},onError:function(a,b){},onWarning:function(a,b){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}"},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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,n=a.isPlainObject(b)?a.extend(!0,{},a.fn.rating.settings,b):a.extend({},a.fn.rating.settings),o=n.namespace,p=n.className,q=n.metadata,r=n.selector,s=(n.error,"."+o),t="module-"+o,u=this,v=a(this).data(t),w=a(this),x=w.find(r.icon);m={initialize:function(){m.verbose("Initializing rating module",n),0===x.length&&m.setup.layout(),n.interactive?m.enable():m.disable(),m.set.initialLoad(),m.set.rating(m.get.initialRating()),m.remove.initialLoad(),m.instantiate()},instantiate:function(){m.verbose("Instantiating module",n),v=m,w.data(t,m)},destroy:function(){m.verbose("Destroying previous instance",v),m.remove.events(),w.removeData(t)},refresh:function(){x=w.find(r.icon)},setup:{layout:function(){var b=m.get.maxRating(),c=a.fn.rating.settings.templates.icon(b);m.debug("Generating icon html dynamically"),w.html(c),m.refresh()}},event:{mouseenter:function(){var b=a(this);b.nextAll().removeClass(p.selected),w.addClass(p.selected),b.addClass(p.selected).prevAll().addClass(p.selected)},mouseleave:function(){w.removeClass(p.selected),x.removeClass(p.selected)},click:function(){var b=a(this),c=m.get.rating(),d=x.index(b)+1,e="auto"==n.clearable?1===x.length:n.clearable;e&&c==d?m.clearRating():m.set.rating(d)}},clearRating:function(){m.debug("Clearing current rating"),m.set.rating(0)},bind:{events:function(){m.verbose("Binding events"),w.on("mouseenter"+s,r.icon,m.event.mouseenter).on("mouseleave"+s,r.icon,m.event.mouseleave).on("click"+s,r.icon,m.event.click)}},remove:{events:function(){m.verbose("Removing events"),w.off(s)},initialLoad:function(){l=!1}},enable:function(){m.debug("Setting rating to interactive mode"),m.bind.events(),w.removeClass(p.disabled)},disable:function(){m.debug("Setting rating to read-only mode"),m.remove.events(),w.addClass(p.disabled)},is:{initialLoad:function(){return l}},get:{initialRating:function(){return w.data(q.rating)!==d?(w.removeData(q.rating),w.data(q.rating)):n.initialRating},maxRating:function(){return w.data(q.maxRating)!==d?(w.removeData(q.maxRating),w.data(q.maxRating)):n.maxRating},rating:function(){var a=x.filter("."+p.active).length;return m.verbose("Current rating retrieved",a),a}},set:{rating:function(a){var b=a-1>=0?a-1:0,c=x.eq(b);w.removeClass(p.selected),x.removeClass(p.selected).removeClass(p.active),a>0&&(m.verbose("Setting current rating to",a),c.prevAll().addBack().addClass(p.active)),m.is.initialLoad()||n.onRate.call(u,a)},initialLoad:function(){l=!0}},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];a.isPlainObject(n[b])?a.extend(!0,n[b],c):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.silent&&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.silent&&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(){n.silent||(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=g||b,c=b-d,g=b,h.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:u,"Execution Time":c})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var b=n.name+":",c=0;g=!1,clearTimeout(m.performance.timer),a.each(h,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",f&&(b+=" '"+f+"'"),e.length>1&&(b+=" ("+e.length+")"),(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=v;return e=e||k,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);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?(v===d&&m.initialize(),m.invoke(i)):(v!==d&&v.invoke("destroy"),m.initialize())}),c!==d?c:this},a.fn.rating.settings={name:"Rating",namespace:"rating",slent:!1,debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",fireOnInit:!1,onRate:function(a){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(a){for(var b=1,c="";b<=a;)c+=' ',b++;return c}}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.search=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 a(this).each(function(){var n,o=a.isPlainObject(e)?a.extend(!0,{},a.fn.search.settings,e):a.extend({},a.fn.search.settings),p=o.className,q=o.metadata,r=o.regExp,s=o.fields,t=o.selector,u=o.error,v=o.namespace,w="."+v,x=v+"-module",y=a(this),z=y.find(t.prompt),A=y.find(t.searchButton),B=y.find(t.results),C=y.find(t.result),D=y.find(t.category),E=this,F=y.data(x),G=!1;
n={initialize:function(){n.verbose("Initializing module"),n.determine.searchFields(),n.bind.events(),n.set.type(),n.create.results(),n.instantiate()},instantiate:function(){n.verbose("Storing instance of module",n),F=n,y.data(x,n)},destroy:function(){n.verbose("Destroying instance"),y.off(w).removeData(x)},refresh:function(){n.debug("Refreshing selector cache"),z=y.find(t.prompt),A=y.find(t.searchButton),D=y.find(t.category),B=y.find(t.results),C=y.find(t.result)},refreshResults:function(){B=y.find(t.results),C=y.find(t.result)},bind:{events:function(){n.verbose("Binding events to search"),o.automatic&&(y.on(n.get.inputEvent()+w,t.prompt,n.event.input),z.attr("autocomplete","off")),y.on("focus"+w,t.prompt,n.event.focus).on("blur"+w,t.prompt,n.event.blur).on("keydown"+w,t.prompt,n.handleKeyboard).on("click"+w,t.searchButton,n.query).on("mousedown"+w,t.results,n.event.result.mousedown).on("mouseup"+w,t.results,n.event.result.mouseup).on("click"+w,t.result,n.event.result.click)}},determine:{searchFields:function(){e&&e.searchFields!==d&&(o.searchFields=e.searchFields)}},event:{input:function(){clearTimeout(n.timer),n.timer=setTimeout(n.query,o.searchDelay)},focus:function(){n.set.focus(),n.has.minimumCharacters()&&(n.query(),n.can.show()&&n.showResults())},blur:function(a){var b=c.activeElement===this,d=function(){n.cancel.query(),n.remove.focus(),n.timer=setTimeout(n.hideResults,o.hideDelay)};b||(n.resultsClicked?(n.debug("Determining if user action caused search to close"),y.one("click.close"+w,t.results,function(a){return n.is.inMessage(a)||G?void z.focus():(G=!1,void(n.is.animating()||n.is.hidden()||d()))})):(n.debug("Input blurred without user action, closing results"),d()))},result:{mousedown:function(){n.resultsClicked=!0},mouseup:function(){n.resultsClicked=!1},click:function(c){n.debug("Search result selected");var d=a(this),e=d.find(t.title).eq(0),f=d.is("a[href]")?d:d.find("a[href]").eq(0),g=f.attr("href")||!1,h=f.attr("target")||!1,i=(e.html(),e.length>0&&e.text()),j=n.get.results(),k=d.data(q.result)||n.get.result(i,j);return a.isFunction(o.onSelect)&&o.onSelect.call(E,k,j)===!1?(n.debug("Custom onSelect callback cancelled default select action"),void(G=!0)):(n.hideResults(),i&&n.set.value(i),void(g&&(n.verbose("Opening search link found in result",f),"_blank"==h||c.ctrlKey?b.open(g):b.location.href=g)))}}},handleKeyboard:function(a){var b,c=y.find(t.result),d=y.find(t.category),e=c.index(c.filter("."+p.active)),f=c.length,g=a.which,h={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(g==h.escape&&(n.verbose("Escape key pressed, blurring search field"),n.trigger.blur()),n.is.visible())if(g==h.enter){if(n.verbose("Enter key pressed, selecting active result"),c.filter("."+p.active).length>0)return n.event.result.click.call(c.filter("."+p.active),a),a.preventDefault(),!1}else g==h.upArrow?(n.verbose("Up key pressed, changing active result"),b=e-1<0?e:e-1,d.removeClass(p.active),c.removeClass(p.active).eq(b).addClass(p.active).closest(d).addClass(p.active),a.preventDefault()):g==h.downArrow&&(n.verbose("Down key pressed, changing active result"),b=e+1>=f?e:e+1,d.removeClass(p.active),c.removeClass(p.active).eq(b).addClass(p.active).closest(d).addClass(p.active),a.preventDefault());else g==h.enter&&(n.verbose("Enter key pressed, executing query"),n.query(),n.set.buttonPressed(),z.one("keyup",n.remove.buttonFocus))},setup:{api:function(b){var c={debug:o.debug,on:!1,cache:!0,action:"search",urlData:{query:b},onSuccess:function(a){n.parse.response.call(E,a,b)},onAbort:function(a){},onFailure:function(){n.displayMessage(u.serverError)},onError:n.error};a.extend(!0,c,o.apiSettings),n.verbose("Setting up API request",c),y.api(c)}},can:{useAPI:function(){return a.fn.api!==d},show:function(){return n.is.focused()&&!n.is.visible()&&!n.is.empty()},transition:function(){return o.transition&&a.fn.transition!==d&&y.transition("is supported")}},is:{animating:function(){return B.hasClass(p.animating)},hidden:function(){return B.hasClass(p.hidden)},inMessage:function(b){return b.target&&a(b.target).closest(t.message).length>0},empty:function(){return""===B.html()},visible:function(){return B.filter(":visible").length>0},focused:function(){return z.filter(":focus").length>0}},trigger:{blur:function(){var a=c.createEvent("HTMLEvents"),b=z[0];b&&(n.verbose("Triggering native blur event"),a.initEvent("blur",!1,!1),b.dispatchEvent(a))}},get:{inputEvent:function(){var a=z[0],b=a!=d&&a.oninput!=d?"input":a!=d&&a.onpropertychange!=d?"propertychange":"keyup";return b},value:function(){return z.val()},results:function(){var a=y.data(q.results);return a},result:function(b,c){var e=["title","id"],f=!1;return b=b!==d?b:n.get.value(),c=c!==d?c:n.get.results(),"category"===o.type?(n.debug("Finding result that matches",b),a.each(c,function(c,d){if(a.isArray(d.results)&&(f=n.search.object(b,d.results,e)[0]))return!1})):(n.debug("Finding result in results object",b),f=n.search.object(b,c,e)[0]),f||!1}},select:{firstResult:function(){n.verbose("Selecting first result"),C.first().addClass(p.active)}},set:{focus:function(){y.addClass(p.focus)},loading:function(){y.addClass(p.loading)},value:function(a){n.verbose("Setting search input value",a),z.val(a)},type:function(a){a=a||o.type,"category"==o.type&&y.addClass(o.type)},buttonPressed:function(){A.addClass(p.pressed)}},remove:{loading:function(){y.removeClass(p.loading)},focus:function(){y.removeClass(p.focus)},buttonPressed:function(){A.removeClass(p.pressed)}},query:function(){var b=n.get.value(),c=n.read.cache(b);n.has.minimumCharacters()?(c?(n.debug("Reading result from cache",b),n.save.results(c.results),n.addResults(c.html),n.inject.id(c.results)):(n.debug("Querying for",b),a.isPlainObject(o.source)||a.isArray(o.source)?n.search.local(b):n.can.useAPI()?n.search.remote(b):n.error(u.source)),o.onSearchQuery.call(E,b)):n.hideResults()},search:{local:function(a){var b,c=n.search.object(a,o.content);n.set.loading(),n.save.results(c),n.debug("Returned local search results",c),b=n.generateResults({results:c}),n.remove.loading(),n.addResults(b),n.inject.id(c),n.write.cache(a,{html:b,results:c})},remote:function(a){y.api("is loading")&&y.api("abort"),n.setup.api(a),y.api("query")},object:function(b,c,e){var f=[],g=[],h=b.toString().replace(r.escape,"\\$&"),i=new RegExp(r.beginsWith+h,"i"),j=function(b,c){var d=a.inArray(c,f)==-1,e=a.inArray(c,g)==-1;d&&e&&b.push(c)};return c=c||o.source,e=e!==d?e:o.searchFields,a.isArray(e)||(e=[e]),c===d||c===!1?(n.error(u.source),[]):(a.each(e,function(d,e){a.each(c,function(a,c){var d="string"==typeof c[e];d&&(c[e].search(i)!==-1?j(f,c):o.searchFullText&&n.fuzzySearch(b,c[e])&&j(g,c))})}),a.merge(f,g))}},fuzzySearch:function(a,b){var c=b.length,d=a.length;if("string"!=typeof a)return!1;if(a=a.toLowerCase(),b=b.toLowerCase(),d>c)return!1;if(d===c)return a===b;a:for(var e=0,f=0;e=o.minCharacters}},clear:{cache:function(a){var b=y.data(q.cache);a?a&&b&&b[a]&&(n.debug("Removing value from cache",a),delete b[a],y.data(q.cache,b)):(n.debug("Clearing cache",a),y.removeData(q.cache))}},read:{cache:function(a){var b=y.data(q.cache);return!!o.cache&&(n.verbose("Checking cache for generated html for query",a),"object"==typeof b&&b[a]!==d&&b[a])}},create:{id:function(a,b){var c,e,f=a+1;return b!==d?(c=String.fromCharCode(97+b),e=c+f,n.verbose("Creating category result id",e)):(e=f,n.verbose("Creating result id",e)),e},results:function(){0===B.length&&(B=a("
").addClass(p.results).appendTo(y))}},inject:{result:function(a,b,c){n.verbose("Injecting result into results");var e=c!==d?B.children().eq(c).children(t.result).eq(b):B.children(t.result).eq(b);n.verbose("Injecting results metadata",e),e.data(q.result,a)},id:function(b){n.debug("Injecting unique ids into results");var c=0,e=0;return"category"===o.type?a.each(b,function(b,f){e=0,a.each(f.results,function(a,b){var g=f.results[a];g.id===d&&(g.id=n.create.id(e,c)),n.inject.result(g,e,c),e++}),c++}):a.each(b,function(a,c){var f=b[a];f.id===d&&(f.id=n.create.id(e)),n.inject.result(f,e),e++}),b}},save:{results:function(a){n.verbose("Saving current search results to metadata",a),y.data(q.results,a)}},write:{cache:function(a,b){var c=y.data(q.cache)!==d?y.data(q.cache):{};o.cache&&(n.verbose("Writing generated html to cache",a,b),c[a]=b,y.data(q.cache,c))}},addResults:function(b){return a.isFunction(o.onResultsAdd)&&o.onResultsAdd.call(B,b)===!1?(n.debug("onResultsAdd callback cancelled default action"),!1):void(b?(B.html(b),n.refreshResults(),o.selectFirstResult&&n.select.firstResult(),n.showResults()):n.hideResults())},showResults:function(){n.is.visible()||(n.can.transition()?(n.debug("Showing results with css animations"),B.transition({animation:o.transition+" in",debug:o.debug,verbose:o.verbose,duration:o.duration,queue:!0})):(n.debug("Showing results with javascript"),B.stop().fadeIn(o.duration,o.easing)),o.onResultsOpen.call(B))},hideResults:function(){n.is.visible()&&(n.can.transition()?(n.debug("Hiding results with css animations"),B.transition({animation:o.transition+" out",debug:o.debug,verbose:o.verbose,duration:o.duration,queue:!0})):(n.debug("Hiding results with javascript"),B.stop().fadeOut(o.duration,o.easing)),o.onResultsClose.call(B))},generateResults:function(b){n.debug("Generating html from response",b);var c=o.templates[o.type],d=a.isPlainObject(b[s.results])&&!a.isEmptyObject(b[s.results]),e=a.isArray(b[s.results])&&b[s.results].length>0,f="";return d||e?(o.maxResults>0&&(d?"standard"==o.type&&n.error(u.maxResults):b[s.results]=b[s.results].slice(0,o.maxResults)),a.isFunction(c)?f=c(b,s):n.error(u.noTemplate,!1)):o.showNoResults&&(f=n.displayMessage(u.noResults,"empty")),o.onResults.call(E,b),f},displayMessage:function(a,b){return b=b||"standard",n.debug("Displaying message",a,b),n.addResults(o.templates.message(a,b)),o.templates.message(a,b)},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.silent&&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.silent&&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(){o.silent||(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=i||b,c=b-d,i=b,j.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:E,"Execution Time":c})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,500)},display:function(){var b=o.name+":",c=0;i=!1,clearTimeout(n.performance.timer),a.each(j,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",h&&(b+=" '"+h+"'"),g.length>1&&(b+=" ("+g.length+")"),(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=F;return c=c||m,e=E||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);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?(F===d&&n.initialize(),n.invoke(k)):(F!==d&&F.invoke("destroy"),n.initialize())}),f!==d?f:this},a.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchFields:["title","description"],displayField:"",searchFullText:!0,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(a){},onResults:function(a){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Semantic API module was not included",noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noEndpoint:"No search endpoint was specified",noTemplate:"A valid template name was not specified.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined."},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,beginsWith:"(?:s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(a){var b=/[&<>"'`]/g,c=/[&<>"'`]/,d={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},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+='',c+="empty"==b?'
'+a+'
':'
'+a+"
",c+="
"),c},category:function(b,c){var e="";return a.fn.search.settings.templates.escape,b[c.categoryResults]!==d&&(a.each(b[c.categoryResults],function(b,f){f[c.results]!==d&&f.results.length>0&&(e+='',f[c.categoryName]!==d&&(e+='
'+f[c.categoryName]+"
"),a.each(f.results,function(a,b){e+=b[c.url]?'
':' ',b[c.image]!==d&&(e+=''),e+='',b[c.price]!==d&&(e+='
'+b[c.price]+"
"),b[c.title]!==d&&(e+='
'+b[c.title]+"
"),b[c.description]!==d&&(e+='
'+b[c.description]+"
"),e+="
",e+=" "}),e+="
")}),b[c.action]&&(e+=''+b[c.action][c.actionText]+" "),e)},standard:function(b,c){var e="";return b[c.results]!==d&&(a.each(b[c.results],function(a,b){e+=b[c.url]?'':' ',b[c.image]!==d&&(e+=''),e+='',b[c.price]!==d&&(e+='
'+b[c.price]+"
"),b[c.title]!==d&&(e+='
'+b[c.title]+"
"),b[c.description]!==d&&(e+='
'+b[c.description]+"
"),e+="
",e+=" "}),b[c.action]&&(e+=''+b[c.action][c.actionText]+" "),e)}}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.shape=function(e){var f,g=a(this),h=(a("body"),(new Date).getTime()),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1),m=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};return g.each(function(){var b,n,o,p=g.selector||"",q=a.isPlainObject(e)?a.extend(!0,{},a.fn.shape.settings,e):a.extend({},a.fn.shape.settings),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[0]||c.createElement("div");a.offsetWidth},animate:function(a,c){o.verbose("Animating box with properties",a),c=c||function(a){o.verbose("Executing animation callback"),a!==d&&a.stopPropagation(),o.reset(),o.set.active()},q.beforeChange.call(n[0]),o.get.transitionEvent()?(o.verbose("Starting CSS animation"),x.addClass(u.animating),y.css(a).one(o.get.transitionEvent(),c),o.set.duration(q.duration),m(function(){x.addClass(u.animating),b.addClass(u.hidden)})):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:{complete:function(){return z.filter("."+u.active)[0]==n[0]},animating:function(){return x.hasClass(u.animating)}},set:{defaultSide:function(){b=x.find("."+q.className.active),n=b.next(s.side).length>0?b.next(s.side):x.find(s.side).first(),A=!1,o.verbose("Active side set to",b),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),(q.duration||0===q.duration)&&y.add(z).css({"-webkit-transition-duration":a,"-moz-transition-duration":a,"-ms-transition-duration":a,"-o-transition-duration":a,"transition-duration":a})},currentStageSize:function(){var a=x.find("."+q.className.active),b=a.outerWidth(!0),c=a.outerHeight(!0);x.css({width:b,height:c})},stageSize:function(){var a=x.clone().addClass(u.loading),b=a.find("."+q.className.active),c=A?a.find(s.side).eq(A):b.next(s.side).length>0?b.next(s.side):a.find(s.side).first(),d="next"==q.width?c.outerWidth(!0):"initial"==q.width?x.width():q.width,e="next"==q.height?c.outerHeight(!0):"initial"==q.height?x.height():q.height;b.removeClass(u.active),c.addClass(u.active),a.insertAfter(x),a.remove(),"auto"!=q.width&&(x.css("width",d+q.jitter),o.verbose("Specifying width during animation",d)),"auto"!=q.height&&(x.css("height",e+q.jitter),o.verbose("Specifying height during animation",e))},nextSide:function(a){A=a,n=z.filter(a),A=z.index(n),0===n.length&&(o.set.defaultSide(),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),q.onChange.call(n[0]),o.set.defaultSide()}},flip:{up:function(){if(o.is.complete()&&!o.is.animating()&&!q.allowRepeats)return void o.debug("Side already visible",n);if(o.is.animating())o.queue("flip up");else{o.debug("Flipping up",n);var a=o.get.transform.up();o.set.stageSize(),o.stage.above(),o.animate(a)}},down:function(){if(o.is.complete()&&!o.is.animating()&&!q.allowRepeats)return void o.debug("Side already visible",n);if(o.is.animating())o.queue("flip down");else{o.debug("Flipping down",n);var a=o.get.transform.down();o.set.stageSize(),o.stage.below(),o.animate(a)}},left:function(){if(o.is.complete()&&!o.is.animating()&&!q.allowRepeats)return void o.debug("Side already visible",n);if(o.is.animating())o.queue("flip left");else{o.debug("Flipping left",n);var a=o.get.transform.left();o.set.stageSize(),o.stage.left(),o.animate(a)}},right:function(){if(o.is.complete()&&!o.is.animating()&&!q.allowRepeats)return void o.debug("Side already visible",n);if(o.is.animating())o.queue("flip right");else{o.debug("Flipping right",n);var a=o.get.transform.right();o.set.stageSize(),o.stage.right(),o.animate(a)}},over:function(){return!o.is.complete()||o.is.animating()||q.allowRepeats?void(o.is.animating()?o.queue("flip over"):(o.debug("Flipping over",n),o.set.stageSize(),o.stage.behind(),o.animate(o.get.transform.over()))):void o.debug("Side already visible",n)},back:function(){return!o.is.complete()||o.is.animating()||q.allowRepeats?void(o.is.animating()?o.queue("flip back"):(o.debug("Flipping back",n),o.set.stageSize(),o.stage.behind(),o.animate(o.get.transform.back()))):void o.debug("Side already visible",n)}},get:{transform:{up:function(){var a={y:-((b.outerHeight(!0)-n.outerHeight(!0))/2),z:-(b.outerHeight(!0)/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(-90deg)"}},down:function(){var a={y:-((b.outerHeight(!0)-n.outerHeight(!0))/2),z:-(b.outerHeight(!0)/2)};return{transform:"translateY("+a.y+"px) translateZ("+a.z+"px) rotateX(90deg)"}},left:function(){var a={x:-((b.outerWidth(!0)-n.outerWidth(!0))/2),z:-(b.outerWidth(!0)/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(90deg)"}},right:function(){var a={x:-((b.outerWidth(!0)-n.outerWidth(!0))/2),z:-(b.outerWidth(!0)/2)};return{transform:"translateX("+a.x+"px) translateZ("+a.z+"px) rotateY(-90deg)"}},over:function(){var a={x:-((b.outerWidth(!0)-n.outerWidth(!0))/2)};return{transform:"translateX("+a.x+"px) rotateY(180deg)"}},back:function(){var a={x:-((b.outerWidth(!0)-n.outerWidth(!0))/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 b.next(s.side).length>0?b.next(s.side):x.find(s.side).first()}},stage:{above:function(){var a={origin:(b.outerHeight(!0)-n.outerHeight(!0))/2,depth:{active:n.outerHeight(!0)/2,next:b.outerHeight(!0)/2}};o.verbose("Setting the initial animation position as above",n,a),y.css({transform:"translateZ(-"+a.depth.active+"px)"}),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),n.addClass(u.animating).css({top:a.origin+"px",transform:"rotateX(90deg) translateZ("+a.depth.next+"px)"})},below:function(){var a={origin:(b.outerHeight(!0)-n.outerHeight(!0))/2,depth:{active:n.outerHeight(!0)/2,next:b.outerHeight(!0)/2}};o.verbose("Setting the initial animation position as below",n,a),y.css({transform:"translateZ(-"+a.depth.active+"px)"}),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),n.addClass(u.animating).css({top:a.origin+"px",transform:"rotateX(-90deg) translateZ("+a.depth.next+"px)"})},left:function(){var a={active:b.outerWidth(!0),next:n.outerWidth(!0)},c={origin:(a.active-a.next)/2,depth:{active:a.next/2,next:a.active/2}};o.verbose("Setting the initial animation position as left",n,c),y.css({transform:"translateZ(-"+c.depth.active+"px)"}),b.css({transform:"rotateY(0deg) translateZ("+c.depth.active+"px)"}),n.addClass(u.animating).css({left:c.origin+"px",transform:"rotateY(-90deg) translateZ("+c.depth.next+"px)"})},right:function(){var a={active:b.outerWidth(!0),next:n.outerWidth(!0)},c={origin:(a.active-a.next)/2,depth:{active:a.next/2,next:a.active/2}};o.verbose("Setting the initial animation position as left",n,c),y.css({transform:"translateZ(-"+c.depth.active+"px)"}),b.css({transform:"rotateY(0deg) translateZ("+c.depth.active+"px)"}),n.addClass(u.animating).css({left:c.origin+"px",transform:"rotateY(90deg) translateZ("+c.depth.next+"px)"})},behind:function(){var a={active:b.outerWidth(!0),next:n.outerWidth(!0)},c={origin:(a.active-a.next)/2,depth:{active:a.next/2,next:a.active/2}};o.verbose("Setting the initial animation position as behind",n,c),b.css({transform:"rotateY(0deg)"}),n.addClass(u.animating).css({left:c.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];a.isPlainObject(q[b])?a.extend(!0,q[b],c):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.silent&&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.silent&&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(){q.silent||(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({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:B,"Execution Time":c})),clearTimeout(o.performance.timer),o.performance.timer=setTimeout(o.performance.display,500)},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+"'"),g.length>1&&(b+=" ("+g.length+")"),(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 g,h,i,j=C;return c=c||l,e=B||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);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}},k?(C===d&&o.initialize(),o.invoke(j)):(C!==d&&C.invoke("destroy"),o.initialize())}),f!==d?f:this},a.fn.shape.settings={name:"Shape",silent:!1,debug:!1,verbose:!1,jitter:0,performance:!0,namespace:"shape",width:"initial",height:"initial",beforeChange:function(){},onChange:function(){},allowRepeats:!1,duration:!1,error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{animating:"animating",hidden:"hidden",loading:"loading",active:"active"},selector:{sides:".sides",side:".side"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.sidebar=function(e){var f,g=a(this),h=a(b),i=a(c),j=a("html"),k=a("head"),l=g.selector||"",m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1),r=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};return g.each(function(){var g,s,t,u,v,w,x=a.isPlainObject(e)?a.extend(!0,{},a.fn.sidebar.settings,e):a.extend({},a.fn.sidebar.settings),y=x.selector,z=x.className,A=x.namespace,B=x.regExp,C=x.error,D="."+A,E="module-"+A,F=a(this),G=a(x.context),H=F.children(y.sidebar),I=G.children(y.fixed),J=G.children(y.pusher),K=this,L=F.data(E);w={initialize:function(){w.debug("Initializing sidebar",e),w.create.id(),v=w.get.transitionEvent(),w.is.ios()&&w.set.ios(),x.delaySetup?r(w.setup.layout):w.setup.layout(),r(function(){w.setup.cache()}),w.instantiate()},instantiate:function(){w.verbose("Storing instance of module",w),L=w,F.data(E,w)},create:{id:function(){t=(Math.random().toString(16)+"000000000").substr(2,8),s="."+t,w.verbose("Creating unique id for element",t)}},destroy:function(){w.verbose("Destroying previous module for",F),F.off(D).removeData(E),w.is.ios()&&w.remove.ios(),G.off(s),h.off(s),i.off(s)},event:{clickaway:function(a){var b=J.find(a.target).length>0||J.is(a.target),c=G.is(a.target);b&&(w.verbose("User clicked on dimmed page"),w.hide()),c&&(w.verbose("User clicked on dimmable context (scaled out page)"),w.hide())},touch:function(a){},containScroll:function(a){K.scrollTop<=0&&(K.scrollTop=1),K.scrollTop+K.offsetHeight>=K.scrollHeight&&(K.scrollTop=K.scrollHeight-K.offsetHeight-1)},scroll:function(b){0===a(b.target).closest(y.sidebar).length&&b.preventDefault()}},bind:{clickaway:function(){w.verbose("Adding clickaway events to context",G),x.closable&&G.on("click"+s,w.event.clickaway).on("touchend"+s,w.event.clickaway)},scrollLock:function(){x.scrollLock&&(w.debug("Disabling page scroll"),h.on("DOMMouseScroll"+s,w.event.scroll)),w.verbose("Adding events to contain sidebar scroll"),i.on("touchmove"+s,w.event.touch),F.on("scroll"+D,w.event.containScroll)}},unbind:{clickaway:function(){w.verbose("Removing clickaway events from context",G),G.off(s)},scrollLock:function(){w.verbose("Removing scroll lock from page"),i.off(s),h.off(s),F.off("scroll"+D)}},add:{inlineCSS:function(){var b,c=w.cache.width||F.outerWidth(),d=w.cache.height||F.outerHeight(),e=w.is.rtl(),f=w.get.direction(),h={left:c,right:-c,top:d,bottom:-d};e&&(w.verbose("RTL detected, flipping widths"),h.left=-c,h.right=c),b="",g=a(b).appendTo(k),w.debug("Adding sizing css to head",g)}},refresh:function(){w.verbose("Refreshing selector cache"),G=a(x.context),H=G.children(y.sidebar),J=G.children(y.pusher),I=G.children(y.fixed),w.clear.cache()},refreshSidebars:function(){w.verbose("Refreshing other sidebars"),H=G.children(y.sidebar)},repaint:function(){w.verbose("Forcing repaint event"),K.style.display="none",K.offsetHeight,K.scrollTop=K.scrollTop,K.style.display=""},setup:{cache:function(){w.cache={width:F.outerWidth(),height:F.outerHeight(),rtl:"rtl"==F.css("direction")}},layout:function(){0===G.children(y.pusher).length&&(w.debug("Adding wrapper element for sidebar"),w.error(C.pusher),J=a('
'),G.children().not(y.omitted).not(H).wrapAll(J),w.refresh()),0!==F.nextAll(y.pusher).length&&F.nextAll(y.pusher)[0]===J[0]||(w.debug("Moved sidebar to correct parent element"),w.error(C.movedSidebar,K),F.detach().prependTo(G),w.refresh()),w.clear.cache(),w.set.pushable(),w.set.direction()}},attachEvents:function(b,c){var d=a(b);c=a.isFunction(w[c])?w[c]:w.toggle,d.length>0?(w.debug("Attaching sidebar events to element",b,c),
d.on("click"+D,c)):w.error(C.notFound,b)},show:function(b){if(b=a.isFunction(b)?b:function(){},w.is.hidden()){if(w.refreshSidebars(),x.overlay&&(w.error(C.overlay),x.transition="overlay"),w.refresh(),w.othersActive())if(w.debug("Other sidebars currently visible"),x.exclusive){if("overlay"!=x.transition)return void w.hideOthers(w.show);w.hideOthers()}else x.transition="overlay";w.pushPage(function(){b.call(K),x.onShow.call(K)}),x.onChange.call(K),x.onVisible.call(K)}else w.debug("Sidebar is already visible")},hide:function(b){b=a.isFunction(b)?b:function(){},(w.is.visible()||w.is.animating())&&(w.debug("Hiding sidebar",b),w.refreshSidebars(),w.pullPage(function(){b.call(K),x.onHidden.call(K)}),x.onChange.call(K),x.onHide.call(K))},othersAnimating:function(){return H.not(F).filter("."+z.animating).length>0},othersVisible:function(){return H.not(F).filter("."+z.visible).length>0},othersActive:function(){return w.othersVisible()||w.othersAnimating()},hideOthers:function(a){var b=H.not(F).filter("."+z.visible),c=b.length,d=0;a=a||function(){},b.sidebar("hide",function(){d++,d==c&&a()})},toggle:function(){w.verbose("Determining toggled direction"),w.is.hidden()?w.show():w.hide()},pushPage:function(b){var c,d,e,f=w.get.transition(),g="overlay"===f||w.othersActive()?F:J;b=a.isFunction(b)?b:function(){},"scale down"==x.transition&&w.scrollToTop(),w.set.transition(f),w.repaint(),c=function(){w.bind.clickaway(),w.add.inlineCSS(),w.set.animating(),w.set.visible()},d=function(){w.set.dimmed()},e=function(a){a.target==g[0]&&(g.off(v+s,e),w.remove.animating(),w.bind.scrollLock(),b.call(K))},g.off(v+s),g.on(v+s,e),r(c),x.dimPage&&!w.othersVisible()&&r(d)},pullPage:function(b){var c,d,e=w.get.transition(),f="overlay"==e||w.othersActive()?F:J;b=a.isFunction(b)?b:function(){},w.verbose("Removing context push state",w.get.direction()),w.unbind.clickaway(),w.unbind.scrollLock(),c=function(){w.set.transition(e),w.set.animating(),w.remove.visible(),x.dimPage&&!w.othersVisible()&&J.removeClass(z.dimmed)},d=function(a){a.target==f[0]&&(f.off(v+s,d),w.remove.animating(),w.remove.transition(),w.remove.inlineCSS(),("scale down"==e||x.returnScroll&&w.is.mobile())&&w.scrollBack(),b.call(K))},f.off(v+s),f.on(v+s,d),r(c)},scrollToTop:function(){w.verbose("Scrolling to top of page to avoid animation issues"),u=a(b).scrollTop(),F.scrollTop(0),b.scrollTo(0,0)},scrollBack:function(){w.verbose("Scrolling back to original page position"),b.scrollTo(0,u)},clear:{cache:function(){w.verbose("Clearing cached dimensions"),w.cache={}}},set:{ios:function(){j.addClass(z.ios)},pushed:function(){G.addClass(z.pushed)},pushable:function(){G.addClass(z.pushable)},dimmed:function(){J.addClass(z.dimmed)},active:function(){F.addClass(z.active)},animating:function(){F.addClass(z.animating)},transition:function(a){a=a||w.get.transition(),F.addClass(a)},direction:function(a){a=a||w.get.direction(),F.addClass(z[a])},visible:function(){F.addClass(z.visible)},overlay:function(){F.addClass(z.overlay)}},remove:{inlineCSS:function(){w.debug("Removing inline css styles",g),g&&g.length>0&&g.remove()},ios:function(){j.removeClass(z.ios)},pushed:function(){G.removeClass(z.pushed)},pushable:function(){G.removeClass(z.pushable)},active:function(){F.removeClass(z.active)},animating:function(){F.removeClass(z.animating)},transition:function(a){a=a||w.get.transition(),F.removeClass(a)},direction:function(a){a=a||w.get.direction(),F.removeClass(z[a])},visible:function(){F.removeClass(z.visible)},overlay:function(){F.removeClass(z.overlay)}},get:{direction:function(){return F.hasClass(z.top)?z.top:F.hasClass(z.right)?z.right:F.hasClass(z.bottom)?z.bottom:z.left},transition:function(){var a,b=w.get.direction();return a=w.is.mobile()?"auto"==x.mobileTransition?x.defaultTransition.mobile[b]:x.mobileTransition:"auto"==x.transition?x.defaultTransition.computer[b]:x.transition,w.verbose("Determined transition",a),a},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:{ie:function(){var a=!b.ActiveXObject&&"ActiveXObject"in b,c="ActiveXObject"in b;return a||c},ios:function(){var a=navigator.userAgent,b=a.match(B.ios),c=a.match(B.mobileChrome);return!(!b||c||(w.verbose("Browser was found to be iOS",a),0))},mobile:function(){var a=navigator.userAgent,b=a.match(B.mobile);return b?(w.verbose("Browser was found to be mobile",a),!0):(w.verbose("Browser is not mobile, using regular transition",a),!1)},hidden:function(){return!w.is.visible()},visible:function(){return F.hasClass(z.visible)},open:function(){return w.is.visible()},closed:function(){return w.is.hidden()},vertical:function(){return F.hasClass(z.top)},animating:function(){return G.hasClass(z.animating)},rtl:function(){return w.cache.rtl===d&&(w.cache.rtl="rtl"==F.css("direction")),w.cache.rtl}},setting:function(b,c){if(w.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,x,b);else{if(c===d)return x[b];a.isPlainObject(x[b])?a.extend(!0,x[b],c):x[b]=c}},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(){!x.silent&&x.debug&&(x.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,x.name+":"),w.debug.apply(console,arguments)))},verbose:function(){!x.silent&&x.verbose&&x.debug&&(x.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,x.name+":"),w.verbose.apply(console,arguments)))},error:function(){x.silent||(w.error=Function.prototype.bind.call(console.error,console,x.name+":"),w.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;x.performance&&(b=(new Date).getTime(),d=m||b,c=b-d,m=b,n.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:K,"Execution Time":c})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var b=x.name+":",c=0;m=!1,clearTimeout(w.performance.timer),a.each(n,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",l&&(b+=" '"+l+"'"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(b),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(b,c,e){var g,h,i,j=L;return c=c||q,e=K||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):(w.error(C.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}},p?(L===d&&w.initialize(),w.invoke(o)):(L!==d&&w.invoke("destroy"),w.initialize())}),f!==d?f:this},a.fn.sidebar.settings={name:"Sidebar",namespace:"sidebar",silent:!1,debug:!1,verbose:!1,performance:!0,transition:"auto",mobileTransition:"auto",defaultTransition:{computer:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"},mobile:{left:"uncover",right:"uncover",top:"overlay",bottom:"overlay"}},context:"body",exclusive:!1,closable:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,duration:500,onChange:function(){},onShow:function(){},onHide:function(){},onHidden:function(){},onVisible:function(){},className:{active:"active",animating:"animating",dimmed:"dimmed",ios:"ios",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible"},selector:{fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",sidebar:".ui.sidebar"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedSidebar:"Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag",overlay:"The overlay setting is no longer supported, use animation: overlay",notFound:"There were no elements that matched the specified selector"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.sticky=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,o,p,q,r=a.isPlainObject(e)?a.extend(!0,{},a.fn.sticky.settings,e):a.extend({},a.fn.sticky.settings),s=r.className,t=r.namespace,u=r.error,v="."+t,w="module-"+t,x=a(this),y=a(b),z=a(r.scrollContext),A=(x.selector||"",x.data(w)),B=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},C=this;q={initialize:function(){q.determineContainer(),q.determineContext(),q.verbose("Initializing sticky",r,g),q.save.positions(),q.checkErrors(),q.bind.events(),r.observeChanges&&q.observeChanges(),q.instantiate()},instantiate:function(){q.verbose("Storing instance of module",q),A=q,x.data(w,q)},destroy:function(){q.verbose("Destroying previous instance"),q.reset(),o&&o.disconnect(),p&&p.disconnect(),y.off("load"+v,q.event.load).off("resize"+v,q.event.resize),z.off("scrollchange"+v,q.event.scrollchange),x.removeData(w)},observeChanges:function(){"MutationObserver"in b&&(o=new MutationObserver(q.event.documentChanged),p=new MutationObserver(q.event.changed),o.observe(c,{childList:!0,subtree:!0}),p.observe(C,{childList:!0,subtree:!0}),p.observe(n[0],{childList:!0,subtree:!0}),q.debug("Setting up mutation observer",p))},determineContainer:function(){g=x.offsetParent()},determineContext:function(){if(n=r.context?a(r.context):g,0===n.length)return void q.error(u.invalidContext,r.context,x)},checkErrors:function(){if(q.is.hidden()&&q.error(u.visible,x),q.cache.element.height>q.cache.context.height)return q.reset(),void q.error(u.elementSize,x)},bind:{events:function(){y.on("load"+v,q.event.load).on("resize"+v,q.event.resize),z.off("scroll"+v).on("scroll"+v,q.event.scroll).on("scrollchange"+v,q.event.scrollchange)}},event:{changed:function(a){clearTimeout(q.timer),q.timer=setTimeout(function(){q.verbose("DOM tree modified, updating sticky menu",a),q.refresh()},100)},documentChanged:function(b){[].forEach.call(b,function(b){b.removedNodes&&[].forEach.call(b.removedNodes,function(b){(b==C||a(b).find(C).length>0)&&(q.debug("Element removed from DOM, tearing down events"),q.destroy())})})},load:function(){q.verbose("Page contents finished loading"),B(q.refresh)},resize:function(){q.verbose("Window resized"),B(q.refresh)},scroll:function(){B(function(){z.triggerHandler("scrollchange"+v,z.scrollTop())})},scrollchange:function(a,b){q.stick(b),r.onScroll.call(C)}},refresh:function(a){q.reset(),r.context||q.determineContext(),a&&q.determineContainer(),q.save.positions(),q.stick(),r.onReposition.call(C)},supports:{sticky:function(){var b=a("
");return b[0],b.addClass(s.supported),b.css("position").match("sticky")}},save:{lastScroll:function(a){q.lastScroll=a},elementScroll:function(a){q.elementScroll=a},positions:function(){var a={height:z.height()},b={margin:{top:parseInt(x.css("margin-top"),10),bottom:parseInt(x.css("margin-bottom"),10)},offset:x.offset(),width:x.outerWidth(),height:x.outerHeight()},c={offset:n.offset(),height:n.outerHeight()};({height:g.outerHeight()}),q.is.standardScroll()||(q.debug("Non-standard scroll. Removing scroll offset from element offset"),a.top=z.scrollTop(),a.left=z.scrollLeft(),b.offset.top+=a.top,c.offset.top+=a.top,b.offset.left+=a.left,c.offset.left+=a.left),q.cache={fits:b.heighta&&(b="up")),b},scrollChange:function(a){return a=a||z.scrollTop(),q.lastScroll?a-q.lastScroll:0},currentElementScroll:function(){return q.elementScroll?q.elementScroll:q.is.top()?Math.abs(parseInt(x.css("top"),10))||0:Math.abs(parseInt(x.css("bottom"),10))||0},elementScroll:function(a){a=a||z.scrollTop();var b=q.cache.element,c=q.cache.scrollContext,d=q.get.scrollChange(a),e=b.height-c.height+r.offset,f=q.get.currentElementScroll(),g=f+d;return f=q.cache.fits||g<0?0:g>e?e:g}},remove:{lastScroll:function(){delete q.lastScroll},elementScroll:function(a){delete q.elementScroll},offset:function(){x.css("margin-top","")}},set:{offset:function(){q.verbose("Setting offset on element",r.offset),x.css("margin-top",r.offset)},containerSize:function(){var a=g.get(0).tagName;"HTML"===a||"body"==a?q.determineContainer():Math.abs(g.outerHeight()-q.cache.context.height)>r.jitter&&(q.debug("Context has padding, specifying exact height for container",q.cache.context.height),g.css({height:q.cache.context.height}))},minimumSize:function(){var a=q.cache.element;g.css("min-height",a.height)},scroll:function(a){q.debug("Setting scroll on element",a),q.elementScroll!=a&&(q.is.top()&&x.css("bottom","").css("top",-a),q.is.bottom()&&x.css("top","").css("bottom",a))},size:function(){0!==q.cache.element.height&&0!==q.cache.element.width&&(C.style.setProperty("width",q.cache.element.width+"px","important"),C.style.setProperty("height",q.cache.element.height+"px","important"))}},is:{standardScroll:function(){return z[0]==b},top:function(){return x.hasClass(s.top)},bottom:function(){return x.hasClass(s.bottom)},initialPosition:function(){return!q.is.fixed()&&!q.is.bound()},hidden:function(){return!x.is(":visible")},bound:function(){return x.hasClass(s.bound)},fixed:function(){return x.hasClass(s.fixed)}},stick:function(a){var b=a||z.scrollTop(),c=q.cache,d=c.fits,e=c.element,f=c.scrollContext,g=c.context,h=q.is.bottom()&&r.pushing?r.bottomOffset:r.offset,a={top:b+h,bottom:b+h+f.height},i=(q.get.direction(a.top),d?0:q.get.elementScroll(a.top)),j=!d,k=0!==e.height;k&&(q.is.initialPosition()?a.top>=g.bottom?(q.debug("Initial element position is bottom of container"),q.bindBottom()):a.top>e.top&&(e.height+a.top-i>=g.bottom?(q.debug("Initial element position is bottom of container"),q.bindBottom()):(q.debug("Initial element position is fixed"),q.fixTop())):q.is.fixed()?q.is.top()?a.top<=e.top?(q.debug("Fixed element reached top of container"),q.setInitialPosition()):e.height+a.top-i>=g.bottom?(q.debug("Fixed element reached bottom of container"),q.bindBottom()):j&&(q.set.scroll(i),q.save.lastScroll(a.top),q.save.elementScroll(i)):q.is.bottom()&&(a.bottom-e.height<=e.top?(q.debug("Bottom fixed rail has reached top of container"),q.setInitialPosition()):a.bottom>=g.bottom?(q.debug("Bottom fixed rail has reached bottom of container"),q.bindBottom()):j&&(q.set.scroll(i),q.save.lastScroll(a.top),q.save.elementScroll(i))):q.is.bottom()&&(a.top<=e.top?(q.debug("Jumped from bottom fixed to top fixed, most likely used home/end button"),q.setInitialPosition()):r.pushing?q.is.bound()&&a.bottom<=g.bottom&&(q.debug("Fixing bottom attached element to bottom of browser."),q.fixBottom()):q.is.bound()&&a.top<=g.bottom-e.height&&(q.debug("Fixing bottom attached element to top of browser."),q.fixTop())))},bindTop:function(){q.debug("Binding element to top of parent container"),q.remove.offset(),x.css({left:"",top:"",marginBottom:""}).removeClass(s.fixed).removeClass(s.bottom).addClass(s.bound).addClass(s.top),r.onTop.call(C),r.onUnstick.call(C)},bindBottom:function(){q.debug("Binding element to bottom of parent container"),q.remove.offset(),x.css({left:"",top:""}).removeClass(s.fixed).removeClass(s.top).addClass(s.bound).addClass(s.bottom),r.onBottom.call(C),r.onUnstick.call(C)},setInitialPosition:function(){q.debug("Returning to initial position"),q.unfix(),q.unbind()},fixTop:function(){q.debug("Fixing element to top of page"),q.set.minimumSize(),q.set.offset(),x.css({left:q.cache.element.left,bottom:"",marginBottom:""}).removeClass(s.bound).removeClass(s.bottom).addClass(s.fixed).addClass(s.top),r.onStick.call(C)},fixBottom:function(){q.debug("Sticking element to bottom of page"),q.set.minimumSize(),q.set.offset(),x.css({left:q.cache.element.left,bottom:"",marginBottom:""}).removeClass(s.bound).removeClass(s.top).addClass(s.fixed).addClass(s.bottom),r.onStick.call(C)},unbind:function(){q.is.bound()&&(q.debug("Removing container bound position on element"),q.remove.offset(),x.removeClass(s.bound).removeClass(s.top).removeClass(s.bottom))},unfix:function(){q.is.fixed()&&(q.debug("Removing fixed position on element"),q.remove.offset(),x.removeClass(s.fixed).removeClass(s.top).removeClass(s.bottom),r.onUnstick.call(C))},reset:function(){q.debug("Resetting elements position"),q.unbind(),q.unfix(),q.resetCSS(),q.remove.offset(),q.remove.lastScroll()},resetCSS:function(){x.css({width:"",height:""}),g.css({height:""})},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,r,b);else{if(c===d)return r[b];r[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,q,b);else{if(c===d)return q[b];q[b]=c}},debug:function(){!r.silent&&r.debug&&(r.performance?q.performance.log(arguments):(q.debug=Function.prototype.bind.call(console.info,console,r.name+":"),q.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?q.performance.log(arguments):(q.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),q.verbose.apply(console,arguments)))},error:function(){r.silent||(q.error=Function.prototype.bind.call(console.error,console,r.name+":"),q.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;r.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:C,"Execution Time":c})),clearTimeout(q.performance.timer),q.performance.timer=setTimeout(q.performance.display,0)},display:function(){var b=r.name+":",c=0;i=!1,clearTimeout(q.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=A;return c=c||m,e=C||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);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?(A===d&&q.initialize(),q.invoke(k)):(A!==d&&A.invoke("destroy"),q.initialize())}),f!==d?f:this},a.fn.sticky.settings={name:"Sticky",namespace:"sticky",silent:!1,debug:!1,verbose:!0,performance:!0,pushing:!1,context:!1,scrollContext:b,offset:0,bottomOffset:0,jitter:5,observeChanges:!1,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible. Use silent setting to surpress this warning in production.",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.tab=function(e){var f,g=a(a.isFunction(this)?b:this),h=g.selector||"",i=(new Date).getTime(),j=[],k=arguments[0],l="string"==typeof k,m=[].slice.call(arguments,1),n=!1;return g.each(function(){var o,p,q,r,s,t,u=a.isPlainObject(e)?a.extend(!0,{},a.fn.tab.settings,e):a.extend({},a.fn.tab.settings),v=u.className,w=u.metadata,x=u.selector,y=u.error,z="."+u.namespace,A="module-"+u.namespace,B=a(this),C={},D=!0,E=0,F=this,G=B.data(A);s={initialize:function(){s.debug("Initializing tab menu item",B),s.fix.callbacks(),s.determineTabs(),s.debug("Determining tabs",u.context,p),u.auto&&s.set.auto(),s.bind.events(),u.history&&!n&&(s.initializeHistory(),n=!0),s.instantiate()},instantiate:function(){s.verbose("Storing instance of module",s),G=s,B.data(A,s)},destroy:function(){s.debug("Destroying tabs",B),B.removeData(A).off(z)},bind:{events:function(){a.isWindow(F)||(s.debug("Attaching tab activation events to element",B),B.on("click"+z,s.event.click))}},determineTabs:function(){var b;"parent"===u.context?(B.closest(x.ui).length>0?(b=B.closest(x.ui),s.verbose("Using closest UI element as parent",b)):b=B,o=b.parent(),s.verbose("Determined parent element for creating context",o)):u.context?(o=a(u.context),s.verbose("Using selector for tab context",u.context,o)):o=a("body"),u.childrenOnly?(p=o.children(x.tabs),s.debug("Searching tab context children for tabs",o,p)):(p=o.find(x.tabs),s.debug("Searching tab context for tabs",o,p))},fix:{callbacks:function(){a.isPlainObject(e)&&(e.onTabLoad||e.onTabInit)&&(e.onTabLoad&&(e.onLoad=e.onTabLoad,delete e.onTabLoad,s.error(y.legacyLoad,e.onLoad)),e.onTabInit&&(e.onFirstLoad=e.onTabInit,delete e.onTabInit,s.error(y.legacyInit,e.onFirstLoad)),u=a.extend(!0,{},a.fn.tab.settings,e))}},initializeHistory:function(){if(s.debug("Initializing page state"),a.address===d)return s.error(y.state),!1;if("state"==u.historyType){if(s.debug("Using HTML5 to manage state"),u.path===!1)return s.error(y.path),!1;a.address.history(!0).state(u.path)}a.address.bind("change",s.event.history.change)},event:{click:function(b){var c=a(this).data(w.tab);c!==d?(u.history?(s.verbose("Updating page state",b),a.address.value(c)):(s.verbose("Changing tab",b),s.changeTab(c)),b.preventDefault()):s.debug("No tab specified")},history:{change:function(b){var c=b.pathNames.join("/")||s.get.initialPath(),e=u.templates.determineTitle(c)||!1;s.performance.display(),s.debug("History change event",c,b),t=b,c!==d&&s.changeTab(c),e&&a.address.title(e)}}},refresh:function(){q&&(s.debug("Refreshing tab",q),s.changeTab(q))},cache:{read:function(a){return a!==d&&C[a]},add:function(a,b){a=a||q,s.debug("Adding cached content for",a),C[a]=b},remove:function(a){a=a||q,s.debug("Removing cached content for",a),delete C[a]}},set:{auto:function(){var b="string"==typeof u.path?u.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";s.verbose("Setting up automatic tab retrieval from server",b),a.isPlainObject(u.apiSettings)?u.apiSettings.url=b:u.apiSettings={url:b}},loading:function(a){var b=s.get.tabElement(a),c=b.hasClass(v.loading);c||(s.verbose("Setting loading state for",b),b.addClass(v.loading).siblings(p).removeClass(v.active+" "+v.loading),b.length>0&&u.onRequest.call(b[0],a))},state:function(b){a.address.value(b)}},changeTab:function(c){var d=b.history&&b.history.pushState,e=d&&u.ignoreFirstLoad&&D,f=u.auto||a.isPlainObject(u.apiSettings),g=f&&!e?s.utilities.pathToArray(c):s.get.defaultPathArray(c);c=s.utilities.arrayToPath(g),a.each(g,function(b,d){var h,i,j,k,l=g.slice(0,b+1),m=s.utilities.arrayToPath(l),n=s.is.tab(m),p=b+1==g.length,x=s.get.tabElement(m);if(s.verbose("Looking for tab",d),n){if(s.verbose("Tab was found",d),q=m,r=s.utilities.filterArray(g,l),p?k=!0:(i=g.slice(0,b+2),j=s.utilities.arrayToPath(i),k=!s.is.tab(j),k&&s.verbose("Tab parameters found",i)),k&&f)return e?(s.debug("Ignoring remote content on first tab load",m),D=!1,s.cache.add(c,x.html()),s.activate.all(m),u.onFirstLoad.call(x[0],m,r,t),u.onLoad.call(x[0],m,r,t)):(s.activate.navigation(m),s.fetch.content(m,c)),!1;s.debug("Opened local tab",m),s.activate.all(m),s.cache.read(m)||(s.cache.add(m,!0),s.debug("First time tab loaded calling tab init"),u.onFirstLoad.call(x[0],m,r,t)),u.onLoad.call(x[0],m,r,t)}else{if(c.search("/")!=-1||""===c)return s.error(y.missingTab,B,o,m),!1;if(h=a("#"+c+', a[name="'+c+'"]'),m=h.closest("[data-tab]").data(w.tab),x=s.get.tabElement(m),h&&h.length>0&&m)return s.debug("Anchor link used, opening parent tab",x,h),x.hasClass(v.active)||setTimeout(function(){s.scrollTo(h)},0),s.activate.all(m),s.cache.read(m)||(s.cache.add(m,!0),s.debug("First time tab loaded calling tab init"),u.onFirstLoad.call(x[0],m,r,t)),u.onLoad.call(x[0],m,r,t),!1}})},scrollTo:function(b){var d=!!(b&&b.length>0)&&b.offset().top;d!==!1&&(s.debug("Forcing scroll to an in-page link in a hidden tab",d,b),a(c).scrollTop(d))},update:{content:function(a,b,c){var e=s.get.tabElement(a),f=e[0];c=c!==d?c:u.evaluateScripts,c?(s.debug("Updating HTML and evaluating inline scripts",a,b),e.html(b)):(s.debug("Updating HTML",a,b),f.innerHTML=b)}},fetch:{content:function(b,c){var e,f,g=s.get.tabElement(b),h={dataType:"html",encodeParameters:!1,on:"now",cache:u.alwaysRefresh,headers:{"X-Remote":!0},onSuccess:function(a){"response"==u.cacheType&&s.cache.add(c,a),s.update.content(b,a),b==q?(s.debug("Content loaded",b),s.activate.tab(b)):s.debug("Content loaded in background",b),u.onFirstLoad.call(g[0],b,r,t),u.onLoad.call(g[0],b,r,t),"response"!=u.cacheType&&s.cache.add(c,g.html())},urlData:{tab:c}},i=g.api("get request")||!1,j=i&&"pending"===i.state();c=c||b,f=s.cache.read(c),u.cache&&f?(s.activate.tab(b),s.debug("Adding cached content",c),"once"==u.evaluateScripts?s.update.content(b,f,!1):s.update.content(b,f),u.onLoad.call(g[0],b,r,t)):j?(s.set.loading(b),s.debug("Content is already loading",c)):a.api!==d?(e=a.extend(!0,{},u.apiSettings,h),s.debug("Retrieving remote content",c,e),s.set.loading(b),g.api(e)):s.error(y.api)}},activate:{all:function(a){s.activate.tab(a),s.activate.navigation(a)},tab:function(a){var b=s.get.tabElement(a),c="siblings"==u.deactivate?b.siblings(p):p.not(b),d=b.hasClass(v.active);s.verbose("Showing tab content for",b),d||(b.addClass(v.active),c.removeClass(v.active+" "+v.loading),b.length>0&&u.onVisible.call(b[0],a))},navigation:function(a){var b=s.get.navElement(a),c="siblings"==u.deactivate?b.siblings(g):g.not(b),d=b.hasClass(v.active);s.verbose("Activating tab navigation for",b,a),d||(b.addClass(v.active),c.removeClass(v.active+" "+v.loading))}},deactivate:{all:function(){s.deactivate.navigation(),s.deactivate.tabs()},navigation:function(){g.removeClass(v.active)},tabs:function(){p.removeClass(v.active+" "+v.loading)}},is:{tab:function(a){return a!==d&&s.get.tabElement(a).length>0}},get:{initialPath:function(){return g.eq(0).data(w.tab)||p.eq(0).data(w.tab)},path:function(){return a.address.value()},defaultPathArray:function(a){return s.utilities.pathToArray(s.get.defaultPath(a))},defaultPath:function(a){var b=g.filter("[data-"+w.tab+'^="'+a+'/"]').eq(0),c=b.data(w.tab)||!1;if(c){if(s.debug("Found default tab",c),E0?b:c},tab:function(){return q}},utilities:{filterArray:function(b,c){return a.grep(b,function(b){return a.inArray(b,c)==-1})},last:function(b){return!!a.isArray(b)&&b[b.length-1]},pathToArray:function(a){return a===d&&(a=q),"string"==typeof a?a.split("/"):[a]},arrayToPath:function(b){return!!a.isArray(b)&&b.join("/")}},setting:function(b,c){if(s.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,u,b);else{if(c===d)return u[b];a.isPlainObject(u[b])?a.extend(!0,u[b],c):u[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,s,b);else{if(c===d)return s[b];s[b]=c}},debug:function(){!u.silent&&u.debug&&(u.performance?s.performance.log(arguments):(s.debug=Function.prototype.bind.call(console.info,console,u.name+":"),s.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?s.performance.log(arguments):(s.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),s.verbose.apply(console,arguments)))},error:function(){u.silent||(s.error=Function.prototype.bind.call(console.error,console,u.name+":"),s.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;u.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:F,"Execution Time":c})),clearTimeout(s.performance.timer),s.performance.timer=setTimeout(s.performance.display,500)},display:function(){var b=u.name+":",c=0;i=!1,clearTimeout(s.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=G;return c=c||m,e=F||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):(s.error(y.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?(G===d&&s.initialize(),s.invoke(k)):(G!==d&&G.invoke("destroy"),s.initialize())}),f!==d?f:this},a.tab=function(){a(b).tab.apply(this,arguments)},a.fn.tab.settings={name:"Tab",namespace:"tab",silent:!1,debug:!1,verbose:!1,performance:!0,auto:!1,history:!1,historyType:"hash",path:!1,context:!1,childrenOnly:!1,maxDepth:25,deactivate:"siblings",alwaysRefresh:!1,cache:!0,cacheType:"response",ignoreFirstLoad:!1,apiSettings:!1,evaluateScripts:"once",onFirstLoad:function(a,b,c){},onLoad:function(a,b,c){},onVisible:function(a,b,c){},onRequest:function(a,b,c){},templates:{determineTitle:function(a){}},error:{api:"You attempted to load content without API module",method:"The method you called is not defined",missingTab:"Activated tab cannot be found. Tabs are case-sensitive.",noContent:"The tab you specified is missing a content url.",path:"History enabled, but no path was specified",recursion:"Max recursive depth reached",legacyInit:"onTabInit has been renamed to onFirstLoad in 2.0, please adjust your code.",legacyLoad:"onTabLoad has been renamed to onLoad in 2.0. Please adjust your code",state:"History requires Asual's Address library "},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".ui.tab",ui:".ui"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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;return b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},f.each(function(b){var n,o,p,q,r,s,t,u,v,w=a(this),x=this;v={initialize:function(){n=v.get.settings.apply(x,j),q=n.className,p=n.error,r=n.metadata,u="."+n.namespace,
t="module-"+n.namespace,o=w.data(t)||v,s=v.get.animationEndEvent(),m&&(m=v.invoke(k)),m===!1&&(v.verbose("Converted arguments into settings object",n),n.interval?v.delay(n.animate):v.animate(),v.instantiate())},instantiate:function(){v.verbose("Storing instance of module",v),o=v,w.data(t,o)},destroy:function(){v.verbose("Destroying previous module for",x),w.removeData(t)},refresh:function(){v.verbose("Refreshing display type on next animation"),delete v.displayType},forceRepaint:function(){v.verbose("Forcing element repaint");var a=w.parent(),b=w.next();0===b.length?w.detach().appendTo(a):w.detach().insertBefore(b)},repaint:function(){v.verbose("Repainting element"),x.offsetWidth},delay:function(a){var c,e,g=v.get.animationDirection();g||(g=v.can.transition()?v.get.direction():"static"),a=a!==d?a:n.interval,c="auto"==n.reverse&&g==q.outward,e=c||1==n.reverse?(f.length-b)*n.interval:b*n.interval,v.debug("Delaying animation by",e),setTimeout(v.animate,e)},animate:function(a){if(n=a||n,!v.is.supported())return v.error(p.support),!1;if(v.debug("Preparing animation",n.animation),v.is.animating()){if(n.queue)return!n.allowRepeats&&v.has.direction()&&v.is.occurring()&&v.queuing!==!0?v.debug("Animation is currently occurring, preventing queueing same animation",n.animation):v.queue(n.animation),!1;if(!n.allowRepeats&&v.is.occurring())return v.debug("Animation is already occurring, will not execute repeated animation",n.animation),!1;v.debug("New animation started, completing previous early",n.animation),o.complete()}v.can.animate()?v.set.animating(n.animation):v.error(p.noAnimation,n.animation,x)},reset:function(){v.debug("Resetting animation to beginning conditions"),v.remove.animationCallbacks(),v.restore.conditions(),v.remove.animating()},queue:function(a){v.debug("Queueing animation of",a),v.queuing=!0,w.one(s+".queue"+u,function(){v.queuing=!1,v.repaint(),v.animate.apply(this,n)})},complete:function(a){v.debug("Animation complete",n.animation),v.remove.completeCallback(),v.remove.failSafe(),v.is.looping()||(v.is.outward()?(v.verbose("Animation is outward, hiding element"),v.restore.conditions(),v.hide()):v.is.inward()?(v.verbose("Animation is outward, showing element"),v.restore.conditions(),v.show()):(v.verbose("Static animation completed"),v.restore.conditions(),n.onComplete.call(x)))},force:{visible:function(){var a=w.attr("style"),b=v.get.userStyle(),c=v.get.displayType(),e=b+"display: "+c+" !important;",f=w.css("display"),g=a===d||""===a;f!==c?(v.verbose("Overriding default display to show element",c),w.attr("style",e)):g&&w.removeAttr("style")},hidden:function(){var a=w.attr("style"),b=w.css("display"),c=a===d||""===a;"none"===b||v.is.hidden()?c&&w.removeAttr("style"):(v.verbose("Overriding default display to hide element"),w.css("display","none"))}},has:{direction:function(b){var c=!1;return b=b||n.animation,"string"==typeof b&&(b=b.split(" "),a.each(b,function(a,b){b!==q.inward&&b!==q.outward||(c=!0)})),c},inlineDisplay:function(){var b=w.attr("style")||"";return a.isArray(b.match(/display.*?;/,""))}},set:{animating:function(a){var b;v.remove.completeCallback(),a=a||n.animation,b=v.get.animationClass(a),v.save.animation(b),v.force.visible(),v.remove.hidden(),v.remove.direction(),v.start.animation(b)},duration:function(a,b){b=b||n.duration,b="number"==typeof b?b+"ms":b,(b||0===b)&&(v.verbose("Setting animation duration",b),w.css({"animation-duration":b}))},direction:function(a){a=a||v.get.direction(),a==q.inward?v.set.inward():v.set.outward()},looping:function(){v.debug("Transition set to loop"),w.addClass(q.looping)},hidden:function(){w.addClass(q.transition).addClass(q.hidden)},inward:function(){v.debug("Setting direction to inward"),w.removeClass(q.outward).addClass(q.inward)},outward:function(){v.debug("Setting direction to outward"),w.removeClass(q.inward).addClass(q.outward)},visible:function(){w.addClass(q.transition).addClass(q.visible)}},start:{animation:function(a){a=a||v.get.animationClass(),v.debug("Starting tween",a),w.addClass(a).one(s+".complete"+u,v.complete),n.useFailSafe&&v.add.failSafe(),v.set.duration(n.duration),n.onStart.call(x)}},save:{animation:function(a){v.cache||(v.cache={}),v.cache.animation=a},displayType:function(a){"none"!==a&&w.data(r.displayType,a)},transitionExists:function(b,c){a.fn.transition.exists[b]=c,v.verbose("Saving existence of transition",b,c)}},restore:{conditions:function(){var a=v.get.currentAnimation();a&&(w.removeClass(a),v.verbose("Removing animation class",v.cache)),v.remove.duration()}},add:{failSafe:function(){var a=v.get.duration();v.timer=setTimeout(function(){w.triggerHandler(s)},a+n.failSafeDelay),v.verbose("Adding fail safe timer",v.timer)}},remove:{animating:function(){w.removeClass(q.animating)},animationCallbacks:function(){v.remove.queueCallback(),v.remove.completeCallback()},queueCallback:function(){w.off(".queue"+u)},completeCallback:function(){w.off(".complete"+u)},display:function(){w.css("display","")},direction:function(){w.removeClass(q.inward).removeClass(q.outward)},duration:function(){w.css("animation-duration","")},failSafe:function(){v.verbose("Removing fail safe timer",v.timer),v.timer&&clearTimeout(v.timer)},hidden:function(){w.removeClass(q.hidden)},visible:function(){w.removeClass(q.visible)},looping:function(){v.debug("Transitions are no longer looping"),v.is.looping()&&(v.reset(),w.removeClass(q.looping))},transition:function(){w.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,onComplete: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,onComplete:c}):a.extend({},a.fn.transition.settings,{animation:b})},animationClass:function(a){var b=a||n.animation,c=v.can.transition()&&!v.has.direction()?v.get.direction()+" ":"";return q.animating+" "+q.transition+" "+c+b},currentAnimation:function(){return!(!v.cache||v.cache.animation===d)&&v.cache.animation},currentDirection:function(){return v.is.inward()?q.inward:q.outward},direction:function(){return v.is.hidden()||!v.is.visible()?q.inward:q.outward},animationDirection:function(b){var c;return b=b||n.animation,"string"==typeof b&&(b=b.split(" "),a.each(b,function(a,b){b===q.inward?c=q.inward:b===q.outward&&(c=q.outward)})),!!c&&c},duration:function(a){return a=a||n.duration,a===!1&&(a=w.css("animation-duration")||0),"string"==typeof a?a.indexOf("ms")>-1?parseFloat(a):1e3*parseFloat(a):a},displayType:function(){return n.displayType?n.displayType:(w.data(r.displayType)===d&&v.can.transition(!0),w.data(r.displayType))},userStyle:function(a){return a=a||w.attr("style")||"",a.replace(/display.*?;/,"")},transitionExists:function(b){return a.fn.transition.exists[b]},animationStartEvent:function(){var a,b=c.createElement("div"),e={animation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"mozAnimationStart",WebkitAnimation:"webkitAnimationStart"};for(a in e)if(b.style[a]!==d)return e[a];return!1},animationEndEvent: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 e[a];return!1}},can:{transition:function(b){var c,e,f,g,h,i,j,k=n.animation,l=v.get.transitionExists(k);if(l===d||b){if(v.verbose("Determining whether animation exists"),c=w.attr("class"),e=w.prop("tagName"),f=a("<"+e+" />").addClass(c).insertAfter(w),g=f.addClass(k).removeClass(q.inward).removeClass(q.outward).addClass(q.animating).addClass(q.transition).css("animationName"),h=f.addClass(q.inward).css("animationName"),j=f.attr("class",c).removeAttr("style").removeClass(q.hidden).removeClass(q.visible).show().css("display"),v.verbose("Determining final display state",j),v.save.displayType(j),f.remove(),g!=h)v.debug("Direction exists for animation",k),i=!0;else{if("none"==g||!g)return void v.debug("No animation defined in css",k);v.debug("Static animation found",k,j),i=!1}v.save.transitionExists(k,i)}return l!==d?l:i},animate:function(){return v.can.transition()!==d}},is:{animating:function(){return w.hasClass(q.animating)},inward:function(){return w.hasClass(q.inward)},outward:function(){return w.hasClass(q.outward)},looping:function(){return w.hasClass(q.looping)},occurring:function(a){return a=a||n.animation,a="."+a.replace(" ","."),w.filter(a).length>0},visible:function(){return w.is(":visible")},hidden:function(){return"hidden"===w.css("visibility")},supported:function(){return s!==!1}},hide:function(){v.verbose("Hiding element"),v.is.animating()&&v.reset(),x.blur(),v.remove.display(),v.remove.visible(),v.set.hidden(),v.force.hidden(),n.onHide.call(x),n.onComplete.call(x)},show:function(a){v.verbose("Showing element",a),v.remove.hidden(),v.set.visible(),v.force.visible(),n.onShow.call(x),n.onComplete.call(x)},toggle:function(){v.is.visible()?v.hide():v.show()},stop:function(){v.debug("Stopping current animation"),w.triggerHandler(s)},stopAll:function(){v.debug("Stopping all animation"),v.remove.queueCallback(),w.triggerHandler(s)},clear:{queue:function(){v.debug("Clearing animation queue"),v.remove.queueCallback()}},enable:function(){v.verbose("Starting animation"),w.removeClass(q.disabled)},disable:function(){v.debug("Stopping animation"),w.addClass(q.disabled)},setting:function(b,c){if(v.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,n,b);else{if(c===d)return n[b];a.isPlainObject(n[b])?a.extend(!0,n[b],c):n[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(){!n.silent&&n.debug&&(n.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,n.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!n.silent&&n.verbose&&n.debug&&(n.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,n.name+":"),v.verbose.apply(console,arguments)))},error:function(){n.silent||(v.error=Function.prototype.bind.call(console.error,console,n.name+":"),v.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({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:x,"Execution Time":c})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var b=n.name+":",c=0;h=!1,clearTimeout(v.performance.timer),a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.length>1&&(b+=" ("+f.length+")"),(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=o;return c=c||l,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);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!==d&&h}},v.initialize()}),e!==d?e:this},a.fn.transition.exists={},a.fn.transition.settings={name:"Transition",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"transition",interval:0,reverse:"auto",onStart:function(){},onComplete:function(){},onShow:function(){},onHide:function(){},useFailSafe:!0,failSafeDelay:100,allowRepeats:!1,displayType:!1,animation:"fade",duration:!1,queue:!0,metadata:{displayType:"display"},className:{animating:"animating",disabled:"disabled",hidden:"hidden",inward:"in",loading:"loading",looping:"looping",outward:"out",transition:"transition",visible:"visible"},error:{noAnimation:"Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production.",repeated:"That animation is already occurring, cancelling repeated animation",method:"The method you called is not defined",support:"This browser does not support CSS animations"}}}(jQuery,window,document),function(a,b,c,d){"use strict";var b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();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 f,m,n,o,p,q,r=a.isPlainObject(c)?a.extend(!0,{},a.fn.api.settings,c):a.extend({},a.fn.api.settings),s=r.namespace,t=r.metadata,u=r.selector,v=r.error,w=r.className,x="."+s,y="module-"+s,z=a(this),A=z.closest(u.form),B=r.stateContext?a(r.stateContext):z,C=this,D=B[0],E=z.data(y);q={initialize:function(){k||q.bind.events(),q.instantiate()},instantiate:function(){q.verbose("Storing instance of module",q),E=q,z.data(y,E)},destroy:function(){q.verbose("Destroying previous module for",C),z.removeData(y).off(x)},bind:{events:function(){var a=q.get.event();a?(q.verbose("Attaching API events to element",a),z.on(a+x,q.event.trigger)):"now"==r.on&&(q.debug("Querying API endpoint immediately"),q.query())}},decode:{json:function(a){if(a!==d&&"string"==typeof a)try{a=JSON.parse(a)}catch(a){}return a}},read:{cachedResponse:function(a){var c;return b.Storage===d?void q.error(v.noStorage):(c=sessionStorage.getItem(a),q.debug("Using cached response",a,c),c=q.decode.json(c))}},write:{cachedResponse:function(c,e){return e&&""===e?void q.debug("Response empty, not caching",e):b.Storage===d?void q.error(v.noStorage):(a.isPlainObject(e)&&(e=JSON.stringify(e)),sessionStorage.setItem(c,e),void q.verbose("Storing cached response for url",c,e))}},query:function(){if(q.is.disabled())return void q.debug("Element is disabled API request aborted");if(q.is.loading()){if(!r.interruptRequests)return void q.debug("Cancelling request, previous request is still pending");q.debug("Interrupting previous request"),q.abort()}return r.defaultData&&a.extend(!0,r.urlData,q.get.defaultData()),r.serializeForm&&(r.data=q.add.formData(r.data)),m=q.get.settings(),m===!1?(q.cancelled=!0,void q.error(v.beforeSend)):(q.cancelled=!1,n=q.get.templatedURL(),n||q.is.mocked()?(n=q.add.urlData(n),n||q.is.mocked()?(m.url=r.base+n,f=a.extend(!0,{},r,{type:r.method||r.type,data:o,url:r.base+n,beforeSend:r.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),q.debug("Querying URL",f.url),q.verbose("Using AJAX settings",f),"local"===r.cache&&q.read.cachedResponse(n)?(q.debug("Response returned from local cache"),q.request=q.create.request(),void q.request.resolveWith(D,[q.read.cachedResponse(n)])):void(r.throttle?r.throttleFirstRequest||q.timer?(q.debug("Throttling request",r.throttle),clearTimeout(q.timer),q.timer=setTimeout(function(){q.timer&&delete q.timer,q.debug("Sending throttled request",o,f.method),q.send.request()},r.throttle)):(q.debug("Sending request",o,f.method),q.send.request(),q.timer=setTimeout(function(){},r.throttle)):(q.debug("Sending request",o,f.method),q.send.request()))):void 0):void q.error(v.missingURL))},should:{removeError:function(){return r.hideError===!0||"auto"===r.hideError&&!q.is.form()}},is:{disabled:function(){return z.filter(u.disabled).length>0},expectingJSON:function(){return"json"===r.dataType||"jsonp"===r.dataType},form:function(){return z.is("form")||B.is("form")},mocked:function(){return r.mockResponse||r.mockResponseAsync||r.response||r.responseAsync},input:function(){return z.is("input")},loading:function(){return!!q.request&&"pending"==q.request.state()},abortedRequest:function(a){return a&&a.readyState!==d&&0===a.readyState?(q.verbose("XHR request determined to be aborted"),!0):(q.verbose("XHR request was not aborted"),!1)},validResponse:function(b){return q.is.expectingJSON()&&a.isFunction(r.successTest)?(q.debug("Checking JSON returned success",r.successTest,b),r.successTest(b)?(q.debug("Response passed success test",b),!0):(q.debug("Response failed success test",b),!1)):(q.verbose("Response is not JSON, skipping validation",r.successTest,b),!0)}},was:{cancelled:function(){return q.cancelled||!1},succesful:function(){return q.request&&"resolved"==q.request.state()},failure:function(){return q.request&&"rejected"==q.request.state()},complete:function(){return q.request&&("resolved"==q.request.state()||"rejected"==q.request.state())}},add:{urlData:function(b,c){var e,f;return b&&(e=b.match(r.regExp.required),f=b.match(r.regExp.optional),c=c||r.urlData,e&&(q.debug("Looking for required URL variables",e),a.each(e,function(e,f){var g=f.indexOf("$")!==-1?f.substr(2,f.length-3):f.substr(1,f.length-2),h=a.isPlainObject(c)&&c[g]!==d?c[g]:z.data(g)!==d?z.data(g):B.data(g)!==d?B.data(g):c[g];return h===d?(q.error(v.requiredParameter,g,b),b=!1,!1):(q.verbose("Found required variable",g,h),h=r.encodeParameters?q.get.urlEncodedValue(h):h,void(b=b.replace(f,h)))})),f&&(q.debug("Looking for optional URL variables",e),a.each(f,function(e,f){var g=f.indexOf("$")!==-1?f.substr(3,f.length-4):f.substr(2,f.length-3),h=a.isPlainObject(c)&&c[g]!==d?c[g]:z.data(g)!==d?z.data(g):B.data(g)!==d?B.data(g):c[g];h!==d?(q.verbose("Optional variable Found",g,h),b=b.replace(f,h)):(q.verbose("Optional variable not found",g),b=b.indexOf("/"+f)!==-1?b.replace("/"+f,""):b.replace(f,""))}))),b},formData:function(b){var c,e=a.fn.serializeObject!==d,f=e?A.serializeObject():A.serialize();return b=b||r.data,c=a.isPlainObject(b),c?e?(q.debug("Extending existing data with form data",b,f),b=a.extend(!0,{},b,f)):(q.error(v.missingSerialize),q.debug("Cant extend data. Replacing data with form data",b,f),b=f):(q.debug("Adding form data",f),b=f),b}},send:{request:function(){q.set.loading(),q.request=q.create.request(),q.is.mocked()?q.mockedXHR=q.create.mockedXHR():q.xhr=q.create.xhr(),r.onRequest.call(D,q.request,q.xhr)}},event:{trigger:function(a){q.query(),"submit"!=a.type&&"click"!=a.type||a.preventDefault()},xhr:{always:function(){},done:function(b,c,d){var e=this,f=(new Date).getTime()-p,g=r.loadingDuration-f,h=!!a.isFunction(r.onResponse)&&(q.is.expectingJSON()?r.onResponse.call(e,a.extend(!0,{},b)):r.onResponse.call(e,b));g=g>0?g:0,h&&(q.debug("Modified API response in onResponse callback",r.onResponse,h,b),b=h),g>0&&q.debug("Response completed early delaying state change by",g),setTimeout(function(){q.is.validResponse(b)?q.request.resolveWith(e,[b,d]):q.request.rejectWith(e,[d,"invalid"])},g)},fail:function(a,b,c){var d=this,e=(new Date).getTime()-p,f=r.loadingDuration-e;f=f>0?f:0,f>0&&q.debug("Response completed early delaying state change by",f),setTimeout(function(){q.is.abortedRequest(a)?q.request.rejectWith(d,[a,"aborted",c]):q.request.rejectWith(d,[a,"error",b,c])},f)}},request:{done:function(a,b){q.debug("Successful API Response",a),"local"===r.cache&&n&&(q.write.cachedResponse(n,a),q.debug("Saving server response locally",q.cache)),r.onSuccess.call(D,a,z,b)},complete:function(a,b){var c,d;q.was.succesful()?(d=a,c=b):(c=a,d=q.get.responseFromXHR(c)),q.remove.loading(),r.onComplete.call(D,d,z,c)},fail:function(a,b,c){var e=q.get.responseFromXHR(a),g=q.get.errorFromRequest(e,b,c);return"aborted"==b?(q.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",b,c),r.onAbort.call(D,b,z,a),!0):("invalid"==b?q.debug("JSON did not pass success test. A server-side error has most likely occurred",e):"error"==b&&a!==d&&(q.debug("XHR produced a server error",b,c),200!=a.status&&c!==d&&""!==c&&q.error(v.statusMessage+c,f.url),r.onError.call(D,g,z,a)),r.errorDuration&&"aborted"!==b&&(q.debug("Adding error state"),q.set.error(),q.should.removeError()&&setTimeout(q.remove.error,r.errorDuration)),q.debug("API Request failed",g,a),void r.onFailure.call(D,e,z,a))}}},create:{request:function(){return a.Deferred().always(q.event.request.complete).done(q.event.request.done).fail(q.event.request.fail)},mockedXHR:function(){var b,c,d,e=!1,f=!1,g=!1,h=r.mockResponse||r.response,i=r.mockResponseAsync||r.responseAsync;return d=a.Deferred().always(q.event.xhr.complete).done(q.event.xhr.done).fail(q.event.xhr.fail),h?(a.isFunction(h)?(q.debug("Using specified synchronous callback",h),c=h.call(D,m)):(q.debug("Using settings specified response",h),c=h),d.resolveWith(D,[c,e,{responseText:c}])):a.isFunction(i)&&(b=function(a){q.debug("Async callback returned response",a),a?d.resolveWith(D,[a,e,{responseText:a}]):d.rejectWith(D,[{responseText:a},f,g])},q.debug("Using specified async response callback",i),i.call(D,m,b)),d},xhr:function(){var b;return b=a.ajax(f).always(q.event.xhr.always).done(q.event.xhr.done).fail(q.event.xhr.fail),q.verbose("Created server request",b,f),b}},set:{error:function(){q.verbose("Adding error state to element",B),B.addClass(w.error)},loading:function(){q.verbose("Adding loading state to element",B),B.addClass(w.loading),p=(new Date).getTime()}},remove:{error:function(){q.verbose("Removing error state from element",B),B.removeClass(w.error)},loading:function(){q.verbose("Removing loading state from element",B),B.removeClass(w.loading)}},get:{responseFromXHR:function(b){return!!a.isPlainObject(b)&&(q.is.expectingJSON()?q.decode.json(b.responseText):b.responseText)},errorFromRequest:function(b,c,e){return a.isPlainObject(b)&&b.error!==d?b.error:r.error[c]!==d?r.error[c]:e},request:function(){return q.request||!1},xhr:function(){return q.xhr||!1},settings:function(){var b;return b=r.beforeSend.call(D,r),b&&(b.success!==d&&(q.debug("Legacy success callback detected",b),q.error(v.legacyParameters,b.success),b.onSuccess=b.success),b.failure!==d&&(q.debug("Legacy failure callback detected",b),q.error(v.legacyParameters,b.failure),b.onFailure=b.failure),b.complete!==d&&(q.debug("Legacy complete callback detected",b),q.error(v.legacyParameters,b.complete),b.onComplete=b.complete)),b===d&&q.error(v.noReturnedValue),b===!1?b:b!==d?a.extend(!0,{},b):a.extend(!0,{},r)},urlEncodedValue:function(a){var c=b.decodeURIComponent(a),d=b.encodeURIComponent(a),e=c!==a;return e?(q.debug("URL value is already encoded, avoiding double encoding",a),a):(q.verbose("Encoding value using encodeURIComponent",a,d),d)},defaultData:function(){var b={};return a.isWindow(C)||(q.is.input()?b.value=z.val():q.is.form()||(b.text=z.text())),b},event:function(){return a.isWindow(C)||"now"==r.on?(q.debug("API called without element, no events attached"),!1):"auto"==r.on?z.is("input")?C.oninput!==d?"input":C.onpropertychange!==d?"propertychange":"keyup":z.is("form")?"submit":"click":r.on},templatedURL:function(a){if(a=a||z.data(t.action)||r.action||!1,n=z.data(t.url)||r.url||!1)return q.debug("Using specified url",n),n;if(a){if(q.debug("Looking up url for action",a,r.api),r.api[a]===d&&!q.is.mocked())return void q.error(v.missingAction,r.action,r.api);n=r.api[a]}else q.is.form()&&(n=z.attr("action")||B.attr("action")||!1,q.debug("No url or action specified, defaulting to form action",n));return n}},abort:function(){var a=q.get.xhr();a&&"resolved"!==a.state()&&(q.debug("Cancelling API request"),a.abort())},reset:function(){q.remove.error(),q.remove.loading()},setting:function(b,c){if(q.debug("Changing setting",b,c),a.isPlainObject(b))a.extend(!0,r,b);else{if(c===d)return r[b];a.isPlainObject(r[b])?a.extend(!0,r[b],c):r[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,q,b);else{if(c===d)return q[b];q[b]=c}},debug:function(){!r.silent&&r.debug&&(r.performance?q.performance.log(arguments):(q.debug=Function.prototype.bind.call(console.info,console,r.name+":"),q.debug.apply(console,arguments)))},verbose:function(){!r.silent&&r.verbose&&r.debug&&(r.performance?q.performance.log(arguments):(q.verbose=Function.prototype.bind.call(console.info,console,r.name+":"),q.verbose.apply(console,arguments)))},error:function(){r.silent||(q.error=Function.prototype.bind.call(console.error,console,r.name+":"),q.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;r.performance&&(b=(new Date).getTime(),d=h||b,c=b-d,h=b,i.push({Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(q.performance.timer),q.performance.timer=setTimeout(q.performance.display,500)},display:function(){var b=r.name+":",c=0;h=!1,clearTimeout(q.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=E;return c=c||l,f=C||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):(q.error(v.method,b),!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?(E===d&&q.initialize(),q.invoke(j)):(E!==d&&E.invoke("destroy"),q.initialize())}),e!==d?e:this},a.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,beforeSend:function(a){return a},beforeXHR:function(a){},onRequest:function(a,b){},onResponse:!1,onSuccess:function(a,b){},onComplete:function(a,b){},onFailure:function(a,b){},onError:function(a,b){},onAbort:function(a,b){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingSerialize:"jquery-serialize-object is required to add form data to an existing data object",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),a.fn.state=function(b){var e,f=a(this),g=f.selector||"",h=("ontouchstart"in c.documentElement,(new Date).getTime()),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return f.each(function(){var c,m=a.isPlainObject(b)?a.extend(!0,{},a.fn.state.settings,b):a.extend({},a.fn.state.settings),n=m.error,o=m.metadata,p=m.className,q=m.namespace,r=m.states,s=m.text,t="."+q,u=q+"-module",v=a(this),w=this,x=v.data(u);c={initialize:function(){c.verbose("Initializing module"),m.automatic&&c.add.defaults(),m.context&&""!==g?a(m.context).on(g,"mouseenter"+t,c.change.text).on(g,"mouseleave"+t,c.reset.text).on(g,"click"+t,c.toggle.state):v.on("mouseenter"+t,c.change.text).on("mouseleave"+t,c.reset.text).on("click"+t,c.toggle.state),c.instantiate()},instantiate:function(){c.verbose("Storing instance of module",c),x=c,v.data(u,c)},destroy:function(){c.verbose("Destroying previous module",x),v.off(t).removeData(u)},refresh:function(){c.verbose("Refreshing selector cache"),v=a(w)},add:{defaults:function(){var e=b&&a.isPlainObject(b.states)?b.states:{};a.each(m.defaults,function(b,f){c.is[b]!==d&&c.is[b]()&&(c.verbose("Adding default states",b,w),a.extend(m.states,f,e))})}},is:{active:function(){return v.hasClass(p.active)},loading:function(){return v.hasClass(p.loading)},inactive:function(){return!v.hasClass(p.active)},state:function(a){return p[a]!==d&&v.hasClass(p[a])},enabled:function(){return!v.is(m.filter.active)},disabled:function(){return v.is(m.filter.active)},textEnabled:function(){return!v.is(m.filter.text)},button:function(){return v.is(".button:not(a, .submit)")},input:function(){return v.is("input")},progress:function(){return v.is(".ui.progress")}},allow:function(a){c.debug("Now allowing state",a),r[a]=!0},disallow:function(a){c.debug("No longer allowing",a),r[a]=!1},allows:function(a){return r[a]||!1},enable:function(){v.removeClass(p.disabled)},disable:function(){v.addClass(p.disabled)},setState:function(a){c.allows(a)&&v.addClass(p[a])},removeState:function(a){c.allows(a)&&v.removeClass(p[a])},toggle:{state:function(){var b,e;if(c.allows("active")&&c.is.enabled()){if(c.refresh(),a.fn.api!==d)if(b=v.api("get request"),e=v.api("was cancelled"))c.debug("API Request cancelled by beforesend"),m.activateTest=function(){return!1},m.deactivateTest=function(){return!1};else if(b)return void c.listenTo(b);c.change.state()}}},listenTo:function(b){c.debug("API request detected, waiting for state signal",b),b&&(s.loading&&c.update.text(s.loading),a.when(b).then(function(){"resolved"==b.state()?(c.debug("API request succeeded"),m.activateTest=function(){return!0},m.deactivateTest=function(){return!0}):(c.debug("API request failed"),m.activateTest=function(){return!1},m.deactivateTest=function(){return!1}),c.change.state()}))},change:{state:function(){c.debug("Determining state change direction"),c.is.inactive()?c.activate():c.deactivate(),m.sync&&c.sync(),m.onChange.call(w)},text:function(){c.is.textEnabled()&&(c.is.disabled()?(c.verbose("Changing text to disabled text",s.hover),c.update.text(s.disabled)):c.is.active()?s.hover?(c.verbose("Changing text to hover text",s.hover),c.update.text(s.hover)):s.deactivate&&(c.verbose("Changing text to deactivating text",s.deactivate),c.update.text(s.deactivate)):s.hover?(c.verbose("Changing text to hover text",s.hover),c.update.text(s.hover)):s.activate&&(c.verbose("Changing text to activating text",s.activate),c.update.text(s.activate)))}},activate:function(){m.activateTest.call(w)&&(c.debug("Setting state to active"),v.addClass(p.active),c.update.text(s.active),m.onActivate.call(w))},deactivate:function(){m.deactivateTest.call(w)&&(c.debug("Setting state to inactive"),v.removeClass(p.active),c.update.text(s.inactive),m.onDeactivate.call(w))},sync:function(){c.verbose("Syncing other buttons to current state"),c.is.active()?f.not(v).state("activate"):f.not(v).state("deactivate")},get:{text:function(){return m.selector.text?v.find(m.selector.text).text():v.html()},textFor:function(a){return s[a]||!1}},flash:{text:function(a,b,d){var e=c.get.text();c.debug("Flashing text message",a,b),a=a||m.text.flash,b=b||m.flashDuration,d=d||function(){},c.update.text(a),setTimeout(function(){c.update.text(e),d.call(w)},b)}},reset:{text:function(){var a=s.active||v.data(o.storedText),b=s.inactive||v.data(o.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),m.selector.text?v.data(o.storedText,a).find(m.selector.text).text(a):v.data(o.storedText,a).html(a)):c.debug("Text is already set, ignoring update",a)}},setting:function(b,e){
if(c.debug("Changing setting",b,e),a.isPlainObject(b))a.extend(!0,m,b);else{if(e===d)return m[b];a.isPlainObject(m[b])?a.extend(!0,m[b],e):m[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(){!m.silent&&m.debug&&(m.performance?c.performance.log(arguments):(c.debug=Function.prototype.bind.call(console.info,console,m.name+":"),c.debug.apply(console,arguments)))},verbose:function(){!m.silent&&m.verbose&&m.debug&&(m.performance?c.performance.log(arguments):(c.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),c.verbose.apply(console,arguments)))},error:function(){m.silent||(c.error=Function.prototype.bind.call(console.error,console,m.name+":"),c.error.apply(console,arguments))},performance:{log:function(a){var b,d,e;m.performance&&(b=(new Date).getTime(),e=h||b,d=b-e,h=b,i.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:w,"Execution Time":d})),clearTimeout(c.performance.timer),c.performance.timer=setTimeout(c.performance.display,500)},display:function(){var b=m.name+":",e=0;h=!1,clearTimeout(c.performance.timer),a.each(i,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"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,f,g){var h,i,j,k=x;return f=f||l,g=w||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(n.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}},k?(x===d&&c.initialize(),c.invoke(j)):(x!==d&&x.invoke("destroy"),c.initialize())}),e!==d?e:this},a.fn.state.settings={name:"State",debug:!1,verbose:!1,namespace:"state",performance:!0,onActivate:function(){},onDeactivate:function(){},onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:1e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,error:{beforeSend:"The before send function has cancelled state change",method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{active:"active",disabled:"disabled",error:"error",loading:"loading",success:"success",warning:"warning"},selector:{text:!1},defaults:{input:{disabled:!0,loading:!0,active:!0},button:{disabled:!0,loading:!0,active:!0},progress:{active:!0,success:!0,warning:!0,error:!0}},states:{active:!0,disabled:!0,error:!0,loading:!0,success:!0,warning:!0},text:{disabled:!1,flash:!1,hover:!1,active:!1,inactive:!1,activate:!1,deactivate:!1}}}(jQuery,window,document),function(a,b,c,d){"use strict";b="undefined"!=typeof b&&b.Math==Math?b:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),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),n=g.length,o=0;return g.each(function(){var g,p,q,r,s=a.isPlainObject(e)?a.extend(!0,{},a.fn.visibility.settings,e):a.extend({},a.fn.visibility.settings),t=s.className,u=s.namespace,v=s.error,w=s.metadata,x="."+u,y="module-"+u,z=a(b),A=a(this),B=a(s.context),C=(A.selector||"",A.data(y)),D=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)},E=this,F=!1;r={initialize:function(){r.debug("Initializing",s),r.setup.cache(),r.should.trackChanges()&&("image"==s.type&&r.setup.image(),"fixed"==s.type&&r.setup.fixed(),s.observeChanges&&r.observeChanges(),r.bind.events()),r.save.position(),r.is.visible()||r.error(v.visible,A),s.initialCheck&&r.checkVisibility(),r.instantiate()},instantiate:function(){r.debug("Storing instance",r),A.data(y,r),C=r},destroy:function(){r.verbose("Destroying previous module"),q&&q.disconnect(),p&&p.disconnect(),z.off("load"+x,r.event.load).off("resize"+x,r.event.resize),B.off("scroll"+x,r.event.scroll).off("scrollchange"+x,r.event.scrollchange),"fixed"==s.type&&(r.resetFixed(),r.remove.placeholder()),A.off(x).removeData(y)},observeChanges:function(){"MutationObserver"in b&&(p=new MutationObserver(r.event.contextChanged),q=new MutationObserver(r.event.changed),p.observe(c,{childList:!0,subtree:!0}),q.observe(E,{childList:!0,subtree:!0}),r.debug("Setting up mutation observer",q))},bind:{events:function(){r.verbose("Binding visibility events to scroll and resize"),s.refreshOnLoad&&z.on("load"+x,r.event.load),z.on("resize"+x,r.event.resize),B.off("scroll"+x).on("scroll"+x,r.event.scroll).on("scrollchange"+x,r.event.scrollchange)}},event:{changed:function(a){r.verbose("DOM tree modified, updating visibility calculations"),r.timer=setTimeout(function(){r.verbose("DOM tree modified, updating sticky menu"),r.refresh()},100)},contextChanged:function(b){[].forEach.call(b,function(b){b.removedNodes&&[].forEach.call(b.removedNodes,function(b){(b==E||a(b).find(E).length>0)&&(r.debug("Element removed from DOM, tearing down events"),r.destroy())})})},resize:function(){r.debug("Window resized"),s.refreshOnResize&&D(r.refresh)},load:function(){r.debug("Page finished loading"),D(r.refresh)},scroll:function(){s.throttle?(clearTimeout(r.timer),r.timer=setTimeout(function(){B.triggerHandler("scrollchange"+x,[B.scrollTop()])},s.throttle)):D(function(){B.triggerHandler("scrollchange"+x,[B.scrollTop()])})},scrollchange:function(a,b){r.checkVisibility(b)}},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)},enableCallbacks:function(){r.debug("Allowing callbacks to occur"),F=!1},disableCallbacks:function(){r.debug("Disabling all callbacks temporarily"),F=!0},should:{trackChanges:function(){return l?(r.debug("One time query, no need to bind events"),!1):(r.debug("Callbacks being attached"),!0)}},setup:{cache:function(){r.cache={occurred:{},screen:{},element:{}}},image:function(){var a=A.data(w.src);a&&(r.verbose("Lazy loading image",a),s.once=!0,s.observeChanges=!1,s.onOnScreen=function(){r.debug("Image on screen",E),r.precache(a,function(){r.set.image(a,function(){o++,o==n&&s.onAllLoaded.call(this),s.onLoad.call(this)})})})},fixed:function(){r.debug("Setting up fixed"),s.once=!1,s.observeChanges=!1,s.initialCheck=!0,s.refreshOnLoad=!0,e.transition||(s.transition=!1),r.create.placeholder(),r.debug("Added placeholder",g),s.onTopPassed=function(){r.debug("Element passed, adding fixed position",A),r.show.placeholder(),r.set.fixed(),s.transition&&a.fn.transition!==d&&A.transition(s.transition,s.duration)},s.onTopPassedReverse=function(){r.debug("Element returned to position, removing fixed",A),r.hide.placeholder(),r.remove.fixed()}}},create:{placeholder:function(){r.verbose("Creating fixed position placeholder"),g=A.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(A)}},show:{placeholder:function(){r.verbose("Showing placeholder"),g.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){r.verbose("Hiding placeholder"),g.css("display","none").css("visibility","")}},set:{fixed:function(){r.verbose("Setting element to fixed position"),A.addClass(t.fixed).css({position:"fixed",top:s.offset+"px",left:"auto",zIndex:s.zIndex}),s.onFixed.call(E)},image:function(b,c){A.attr("src",b),s.transition?a.fn.transition!==d?A.transition(s.transition,s.duration,c):A.fadeIn(s.duration,c):A.show()}},is:{onScreen:function(){var a=r.get.elementCalculations();return a.onScreen},offScreen:function(){var a=r.get.elementCalculations();return a.offScreen},visible:function(){return!(!r.cache||!r.cache.element||0===r.cache.element.width&&0===r.cache.element.offset.top)}},refresh:function(){r.debug("Refreshing constants (width/height)"),"fixed"==s.type&&r.resetFixed(),r.reset(),r.save.position(),s.checkOnRefresh&&r.checkVisibility(),s.onRefresh.call(E)},resetFixed:function(){r.remove.fixed(),r.remove.occurred()},reset:function(){r.verbose("Resetting all cached values"),a.isPlainObject(r.cache)&&(r.cache.screen={},r.cache.element={})},checkVisibility:function(a){r.verbose("Checking visibility of element",r.cache.element),!F&&r.is.visible()&&(r.save.scroll(a),r.save.calculations(),r.passed(),r.passingReverse(),r.topVisibleReverse(),r.bottomVisibleReverse(),r.topPassedReverse(),r.bottomPassedReverse(),r.onScreen(),r.offScreen(),r.passing(),r.topVisible(),r.bottomVisible(),r.topPassed(),r.bottomPassed(),s.onUpdate&&s.onUpdate.call(E,r.get.elementCalculations()))},passed:function(b,c){var e=r.get.elementCalculations();if(b&&c)s.onPassed[b]=c;else{if(b!==d)return r.get.pixelsPassed(b)>e.pixelsPassed;e.passing&&a.each(s.onPassed,function(a,b){e.bottomVisible||e.pixelsPassed>r.get.pixelsPassed(a)?r.execute(b,a):s.once||r.remove.occurred(b)})}},onScreen:function(a){var b=r.get.elementCalculations(),c=a||s.onOnScreen,e="onScreen";if(a&&(r.debug("Adding callback for onScreen",a),s.onOnScreen=a),b.onScreen?r.execute(c,e):s.once||r.remove.occurred(e),a!==d)return b.onOnScreen},offScreen:function(a){var b=r.get.elementCalculations(),c=a||s.onOffScreen,e="offScreen";if(a&&(r.debug("Adding callback for offScreen",a),s.onOffScreen=a),b.offScreen?r.execute(c,e):s.once||r.remove.occurred(e),a!==d)return b.onOffScreen},passing:function(a){var b=r.get.elementCalculations(),c=a||s.onPassing,e="passing";if(a&&(r.debug("Adding callback for passing",a),s.onPassing=a),b.passing?r.execute(c,e):s.once||r.remove.occurred(e),a!==d)return b.passing},topVisible:function(a){var b=r.get.elementCalculations(),c=a||s.onTopVisible,e="topVisible";if(a&&(r.debug("Adding callback for top visible",a),s.onTopVisible=a),b.topVisible?r.execute(c,e):s.once||r.remove.occurred(e),a===d)return b.topVisible},bottomVisible:function(a){var b=r.get.elementCalculations(),c=a||s.onBottomVisible,e="bottomVisible";if(a&&(r.debug("Adding callback for bottom visible",a),s.onBottomVisible=a),b.bottomVisible?r.execute(c,e):s.once||r.remove.occurred(e),a===d)return b.bottomVisible},topPassed:function(a){var b=r.get.elementCalculations(),c=a||s.onTopPassed,e="topPassed";if(a&&(r.debug("Adding callback for top passed",a),s.onTopPassed=a),b.topPassed?r.execute(c,e):s.once||r.remove.occurred(e),a===d)return b.topPassed},bottomPassed:function(a){var b=r.get.elementCalculations(),c=a||s.onBottomPassed,e="bottomPassed";if(a&&(r.debug("Adding callback for bottom passed",a),s.onBottomPassed=a),b.bottomPassed?r.execute(c,e):s.once||r.remove.occurred(e),a===d)return b.bottomPassed},passingReverse:function(a){var b=r.get.elementCalculations(),c=a||s.onPassingReverse,e="passingReverse";if(a&&(r.debug("Adding callback for passing reverse",a),s.onPassingReverse=a),b.passing?s.once||r.remove.occurred(e):r.get.occurred("passing")&&r.execute(c,e),a!==d)return!b.passing},topVisibleReverse:function(a){var b=r.get.elementCalculations(),c=a||s.onTopVisibleReverse,e="topVisibleReverse";if(a&&(r.debug("Adding callback for top visible reverse",a),s.onTopVisibleReverse=a),b.topVisible?s.once||r.remove.occurred(e):r.get.occurred("topVisible")&&r.execute(c,e),a===d)return!b.topVisible},bottomVisibleReverse:function(a){var b=r.get.elementCalculations(),c=a||s.onBottomVisibleReverse,e="bottomVisibleReverse";if(a&&(r.debug("Adding callback for bottom visible reverse",a),s.onBottomVisibleReverse=a),b.bottomVisible?s.once||r.remove.occurred(e):r.get.occurred("bottomVisible")&&r.execute(c,e),a===d)return!b.bottomVisible},topPassedReverse:function(a){var b=r.get.elementCalculations(),c=a||s.onTopPassedReverse,e="topPassedReverse";if(a&&(r.debug("Adding callback for top passed reverse",a),s.onTopPassedReverse=a),b.topPassed?s.once||r.remove.occurred(e):r.get.occurred("topPassed")&&r.execute(c,e),a===d)return!b.onTopPassed},bottomPassedReverse:function(a){var b=r.get.elementCalculations(),c=a||s.onBottomPassedReverse,e="bottomPassedReverse";if(a&&(r.debug("Adding callback for bottom passed reverse",a),s.onBottomPassedReverse=a),b.bottomPassed?s.once||r.remove.occurred(e):r.get.occurred("bottomPassed")&&r.execute(c,e),a===d)return!b.bottomPassed},execute:function(a,b){var c=r.get.elementCalculations(),d=r.get.screenCalculations();a=a||!1,a&&(s.continuous?(r.debug("Callback being called continuously",b,c),a.call(E,c,d)):r.get.occurred(b)||(r.debug("Conditions met",b,c),a.call(E,c,d))),r.save.occurred(b)},remove:{fixed:function(){r.debug("Removing fixed position"),A.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),s.onUnfixed.call(E)},placeholder:function(){r.debug("Removing placeholder content"),g&&g.remove()},occurred:function(a){if(a){var b=r.cache.occurred;b[a]!==d&&b[a]===!0&&(r.debug("Callback can now be called again",a),r.cache.occurred[a]=!1)}else r.cache.occurred={}}},save:{calculations:function(){r.verbose("Saving all calculations necessary to determine positioning"),r.save.direction(),r.save.screenCalculations(),r.save.elementCalculations()},occurred:function(a){a&&(r.cache.occurred[a]!==d&&r.cache.occurred[a]===!0||(r.verbose("Saving callback occurred",a),r.cache.occurred[a]=!0))},scroll:function(a){a=a+s.offset||B.scrollTop()+s.offset,r.cache.scroll=a},direction:function(){var a,b=r.get.scroll(),c=r.get.lastScroll();return a=b>c&&c?"down":b=b.top,b.topPassed=a.top>=b.top,b.bottomVisible=a.bottom>=b.bottom,b.bottomPassed=a.top>=b.bottom,b.pixelsPassed=0,b.percentagePassed=0,b.onScreen=b.topVisible&&!b.bottomPassed,b.passing=b.topPassed&&!b.bottomPassed,b.offScreen=!b.onScreen,b.passing&&(b.pixelsPassed=a.top-b.top,b.percentagePassed=(a.top-b.top)/b.height),r.cache.element=b,r.verbose("Updated element calculations",b),b},screenCalculations:function(){var a=r.get.scroll();return r.save.direction(),r.cache.screen.top=a,r.cache.screen.bottom=a+r.cache.screen.height,r.cache.screen},screenSize:function(){r.verbose("Saving window position"),r.cache.screen={height:B.height()}},position:function(){r.save.screenSize(),r.save.elementPosition()}},get:{pixelsPassed:function(a){var b=r.get.elementCalculations();return a.search("%")>-1?b.height*(parseInt(a,10)/100):parseInt(a,10)},occurred:function(a){return r.cache.occurred!==d&&(r.cache.occurred[a]||!1)},direction:function(){return r.cache.direction===d&&r.save.direction(),r.cache.direction},elementPosition:function(){return r.cache.element===d&&r.save.elementPosition(),r.cache.element},elementCalculations:function(){return r.cache.element===d&&r.save.elementCalculations(),r.cache.element},screenCalculations:function(){return r.cache.screen===d&&r.save.screenCalculations(),r.cache.screen},screenSize:function(){return r.cache.screen===d&&r.save.screenSize(),r.cache.screen},scroll:function(){return r.cache.scroll===d&&r.save.scroll(),r.cache.scroll},lastScroll:function(){return r.cache.screen===d?(r.debug("First scroll event, no last scroll could be found"),!1):r.cache.screen.top}},setting:function(b,c){if(a.isPlainObject(b))a.extend(!0,s,b);else{if(c===d)return s[b];s[b]=c}},internal:function(b,c){if(a.isPlainObject(b))a.extend(!0,r,b);else{if(c===d)return r[b];r[b]=c}},debug:function(){!s.silent&&s.debug&&(s.performance?r.performance.log(arguments):(r.debug=Function.prototype.bind.call(console.info,console,s.name+":"),r.debug.apply(console,arguments)))},verbose:function(){!s.silent&&s.verbose&&s.debug&&(s.performance?r.performance.log(arguments):(r.verbose=Function.prototype.bind.call(console.info,console,s.name+":"),r.verbose.apply(console,arguments)))},error:function(){s.silent||(r.error=Function.prototype.bind.call(console.error,console,s.name+":"),r.error.apply(console,arguments))},performance:{log:function(a){var b,c,d;s.performance&&(b=(new Date).getTime(),d=i||b,c=b-d,i=b,j.push({Name:a[0],Arguments:[].slice.call(a,1)||"",Element:E,"Execution Time":c})),clearTimeout(r.performance.timer),r.performance.timer=setTimeout(r.performance.display,500)},display:function(){var b=s.name+":",c=0;i=!1,clearTimeout(r.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=C;return c=c||m,e=E||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):(r.error(v.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?(C===d&&r.initialize(),C.save.scroll(),C.save.calculations(),r.invoke(k)):(C!==d&&C.invoke("destroy"),r.initialize())}),f!==d?f:this},a.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:b,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document);var dom = {}
var core = {
init:function(){
//dom.game = $("#game");
//console.log("init...");
//console.log(core.vars.section);
banner.init();
featured.init();
//news.init();
offers.init();
//trae baners,ofertas y buenas inversiones
dom.buscador = $("#buscador");
dom.buscador.find(".buscar" ).on( "click", function(e) {
e.preventDefault();
if(dom.buscador.find("[name=ps_codigo]").val()!="")
{
//alert("busca por el codigo de la propiedad")
search.init();
dom.buscador.find("[name=ps_codigo]").val("");
//window.location = core.path+core.vars.nav+"/"+dom.buscador.find("[name=ps_codigo]").val()+"/"+dom.buscador.find("[name=ps_location]").val();
return false;
}
//alert("busca por el codigo de la comuna");
//search.init();
window.location = core.path+core.vars.nav+"/"+core.vars.section+"/"+dom.buscador.find("[name=ps_location]").val();
});
modal.init();
analytics.init();
//conf
/*$("a#inline").fancybox({
'hideOnContentClick': true
});*/
},
transport:function(url, obj, fn, type, fne){
if(type=='post'){
$.post(core.path+url, obj, function(data){ fn(data); }, "json").fail(function() {
if (typeof(fne) != "undefined") fne();
});
}
else if(type=='get')
{
$.get(core.path+url, obj, function(data){ fn(data); }, "json").fail(function() {
if (typeof(fne) != "undefined") fne();
});
}
else if(type=='postform'){
$.ajax({
url: url,
type: "POST",
data: obj,
contentType: false,
cache: false,
processData:false,
success: function(data) {
fn(data);
}
}).fail(function() {
if (typeof(fne) != "undefined") fne();
})
}
},
} // llave del core
var modal = {
init:function(){
modal.dom = $("#test-popup");
$('.open-popup-link').magnificPopup({
type:'inline',
closeOnBgClick: false,
//modal:true
})
modal.files.init();
modal.dom.find("#btn_enviar").on("click",function(e){
e.preventDefault();
//valida formulario
modal.dom.find("#entreguenos").submit();
//modal.sendMail()
})
//modal.semantic.form();
},
files:{
file:' ',
init:function(){
modal.files.dom = modal.dom.find(".files");
modal.dom.find(".add").on("click",function(e){
e.preventDefault();
elements = modal.files.dom.find( ":input" ).length
if(elements==15){
alert("maximo de 15 fotos");
return false;
}
elements = modal.files.dom.find( ":input" ).length
modal.files.dom.append(modal.files.file);
})
modal.dom.find(".remove").on("click",function(e){
e.preventDefault();
elements = modal.files.dom.find( ":input" ).length
if(elements==1){
alert("debe ingresar por lo menos una foto");
return false;
}
//borrar ultimo
modal.files.dom.find( ":input" ).last().remove();
})
modal.files.dom.html(modal.files.file);
},
},
resetForm: function(){
modal.dom.find("#entreguenos")[0].reset();
},
}
var banner = {
dom:null,
init:function(){
banner.dom=$("#rev_slider_5_1")
banner.get();
},
get:function(){
var o = {
};
//core.transport('api/getBanners', o, banner.deploy ,'get', function(){ console.log('error');});
},
deploy:function(r){
var html="";
$.each(r.result, function( index, value ) {
html+='';
html+=' ';
html=' ';
console.log(core.path+"images/banner/"+value.foto)
});
//banner.dom.html(html)
},
show:function(){ banner.dom.show(); },
hide:function(){ banner.dom.hide();}
};
var featured = {
dom:null,
init:function(){
featured.dom=$("#featured");
featured.get();
},
get:function(){
var o = {
};
core.transport('api/getFeatured', o, featured.deploy ,'get', function(){ console.log('error');});
},
deploy:function(r){
console.log(r);
var html = "";
$.each(r.result, function( index, value ) {
if(index==0){
html+='';
html+='
';
html+='
DESTACADO
';
html+='
';
html+='
';
html+=' ';
html+='';
html+=''+value.location+' ';
html+=''+value.comuna+' ';
html+=' ';
html+=' ';
html+='
';
html+='
';
//html+='
On the best lot at Phuket is situated the Kailua Residence. It features Ipe hardwood flooring on the interior and granite stone flooring on the lanais, high vaulted cedar ceilings.
';
html+='
';
html+='
';
html+='
';
/*
html+='
';
html+='
';
html+='';
html+=' ';
html+='Quiet Neighbourhood
';
html+=' ';
html+='';
html+=' ';
html+='Great Local Community
';
html+=' ';
html+=' ';
html+='
';
html+='
';
*/
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='$ '+formatNumber.new(Math.round(value.price))+' ';
html+='
';
html+='
';
html+=''+formatNumber.new(value.ground)+' m2 ';
//html+=''+value.prop_dormitorios+' ';
//html+=''+value.prop_banos+' ';
html+=''+value.built+' m2 ';
html+='Cod: '+value.code+' ';
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='';
html+='
';
html+=' ';
html+=' ';
html+='
';
}
});
featured.dom.html(html);
},
show:function(){ featured.dom.show(); },
hide:function(){ featured.dom.hide();}
};
var news = {
dom:null,
init:function(){
news.dom=$("#news")
news.get();
},
get:function(){
var o = {
};
core.transport('api/getNews', o, news.deploy ,'get', function(){ console.log('error');});
},
deploy:function(r){
var html = "";
$.each(r.result, function( index, value ) {
html+='';
html+='
';
html+='
';
html+='
';
html+='
'+value.titulo+' ';
html+='
'+value.cuerpo+'
';
/*html+='
';
html+='More Info ';
html+='
';*/
html+='
';
html+='
';
html+='
';
});
news.dom.html(html);
},
show:function(){ news.dom.show(); },
hide:function(){ news.dom.hide();}
};
var offers = {
dom:null,
init:function(){
offers.dom=$("#offers");
offers.get();
},
get:function(){
var o = {
};
core.transport('api/getOffers', o, offers.deploy ,'get', function(){ console.log('error');});
},
deploy:function(r){
var html = "";
$.each(r.result, function( index, value ) {
if(index!=3){
var mod = (value.modalidad=="ARRIENDOS")?'arriendo':'venta';
html+='';
html+='
';
html+='
';
html+='
';
html+='
Pripiedad en '+mod+'
';
html+='
';
html+='
';
html+=' ';
html+='
';
html+='
';
html+='
';
html+='
'+value.location+'
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+=''+formatNumber.new(value.ground)+' m2 '+value.built+' m2 Cod: '+value.code+' ';
html+='
';
html+='
';
html+='
';
}
/*
html+='';
html+='
';
html+='
';
html+='
';
html+='
'+value.prop_titulo+' ';
html+='
';
html+='More Info ';
html+='
';
html+='
';
html+='
';
html+='
';
*/
});
offers.dom.html(html);
},
show:function(){ offers.dom.show(); },
hide:function(){ offers.dom.hide();}
};
var search = {
dom:null,
init:function(){
search.dom=$("#lista");
search.get();
},
get:function(){
var o = {
};
core.transport('api/getProperty/1/'+dom.buscador.find("[name=ps_codigo]").val()+'', o, search.deploy ,'get', function(){ console.log('error');});
},
deploy:function(r){
var html = "";
$.each(r.result, function( index, value ) {
var mod = (value.prop_modalidad=="ARRIENDOS")?'arriendo':'venta';
html+='';
html+='
';
html+='
';
html+='
';
html+='
Propiedad en '+mod+'
';
html+='
';
html+='
';
html+=' ';
html+='
';
html+='
';
html+='
';
html+='
'+value.location+'
';
html+='
';
html+='
';
html+='
';
html+='
';
html+='
';
html+=''+formatNumber.new(value.ground)+' m2 ';
html+=''+value.bedrooms+' ';
html+=''+value.bathrooms+' ';
html+='
';
html+='
';
html+='
';
});
search.dom.html(html);
},
show:function(){ search.dom.show(); },
hide:function(){ search.dom.hide();}
};
var formatNumber = {
separador: ".", // separador para los miles
sepDecimal: ',', // separador para los decimales
formatear:function (num){
num +='';
var splitStr = num.split('.');
var splitLeft = splitStr[0];
var splitRight = splitStr.length > 1 ? this.sepDecimal + splitStr[1] : '';
var regx = /(\d+)(\d{3})/;
while (regx.test(splitLeft)) {
splitLeft = splitLeft.replace(regx, '$1' + this.separador + '$2');
}
return this.simbol + splitLeft +splitRight;
},
new:function(num, simbol){
this.simbol = simbol ||'';
return this.formatear(num);
}
}
$( document ).ready(function() {
core.init();
});
/* GOOGLE ANALYTICS
------------------------------------------------------------------------------------------------------------------------------------------------------*/
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-89744925-1', 'auto');
ga('send', 'pageview');
var analytics = {
init:function(){
console.log('Analytics INIT...');
$(document).on('click','[data-ga]',function(e){
//$( "[data-ga]" ).click(function(e){
var o = $(this);
var track = o.attr('data-ga');
analytics.mark(track);
});
$( "[data-ga]" ).each(function(k, v){
var o = $(v);
var track = o.attr('data-ga');
//console.log('GA: '+track);
});
},
mark:function(e){
console.log('GA MARK', e);
//var lng = (lang=='esp') ? 'es': 'en';
var l = e.split(".");
var label = l[0];
var c = l.length;
for(var i=1; i li').each(function() {
if (jQuery(this).find('ul').length > 0) {
jQuery(this).addClass('has_children');
}
});
// Archive widget decoration
jQuery('.widget_archive a').each(function() {
var val = jQuery(this).html().split(' ');
if (val.length > 1) {
val[val.length-1] = '' + val[val.length-1] + ' ';
jQuery(this).html(val.join(' '))
}
});
// Calendar handlers - change months
jQuery('.widget_calendar').on('click', '.month_prev a, .month_next a', function(e) {
"use strict";
var calendar = jQuery(this).parents('.wp-calendar');
var m = jQuery(this).data('month');
var y = jQuery(this).data('year');
var pt = jQuery(this).data('type');
jQuery.post(YREG_ESTATE_STORAGE['ajax_url'], {
action: 'calendar_change_month',
nonce: YREG_ESTATE_STORAGE['ajax_nonce'],
month: m,
year: y,
post_type: pt
}).done(function(response) {
var rez = {};
try {
rez = JSON.parse(response);
} catch (e) {
rez = { error: YREG_ESTATE_STORAGE['ajax_error'] };
console.log(response);
}
if (rez.error === '') {
calendar.parent().fadeOut(200, function() {
jQuery(this).find('.wp-calendar').remove();
jQuery(this).append(rez.data).fadeIn(200);
});
}
});
e.preventDefault();
return false;
});
// Media setup
//----------------------------------------------
// Video background init
jQuery('.video_background').each(function() {
"use strict";
var youtube = jQuery(this).data('youtube-code');
if (youtube) {
jQuery(this).tubular({videoId: youtube});
}
});
// Menu
//----------------------------------------------
// Prepare menus
if (YREG_ESTATE_STORAGE['menu_cache']) yreg_estate_prepare_menus();
// Clone side menu for responsive
var menu_side=jQuery('ul#menu_side');
if (menu_side.length > 0) {
menu_side.clone().removeAttr('id').removeClass('menu_side_nav').addClass('menu_side_responsive').insertAfter('ul#menu_side');
yreg_estate_show_current_menu_item(jQuery('.menu_side_responsive'), jQuery('.sidebar_outer_menu_responsive_button'));
}
// Clone main menu for responsive
var menu_main=jQuery('.menu_main_nav_area ul#menu_main');
if (menu_main.length > 0) {
var menu_responsive = menu_main.clone().removeAttr('id').removeClass('menu_main_nav').addClass('menu_main_responsive'); //.insertAfter('ul#menu_main');
menu_main.parent().parent().append(menu_responsive);
yreg_estate_show_current_menu_item(jQuery('.menu_main_responsive'), jQuery('.top_panel_style_1 .menu_main_responsive_button, .top_panel_style_2 .menu_main_responsive_button'));
}
// Responsive menu button
jQuery('.menu_main_responsive_button, .sidebar_outer_menu_responsive_button').on('click', function(e){
"use strict";
if (jQuery(this).hasClass('menu_main_responsive_button'))
jQuery('.menu_main_responsive').slideToggle();
else {
jQuery(this).toggleClass('icon-down').toggleClass('icon-up');
jQuery('.menu_side_responsive').slideToggle();
}
e.preventDefault();
return false;
});
// Push menu button
jQuery('.menu_pushy_button').on('click', function(e){
"use strict";
jQuery('body').addClass('pushy-active').css('overflow', 'hidden');
jQuery('.site-overlay').fadeIn('fast');
e.preventDefault();
return false;
});
jQuery('.pushy .close-pushy,.site-overlay').on('click', function(e){
"use strict";
jQuery('body').removeClass('pushy-active').css('overflow', 'visible');
jQuery('.site-overlay').fadeOut('fast');
e.preventDefault();
return false;
});
// Side menu widgets button
jQuery('.sidebar_outer_widgets_button').on('click', function(e){
"use strict";
jQuery('.sidebar_outer_widgets').slideToggle();
e.preventDefault();
return false;
});
// Add arrows in responsive menu
jQuery('.menu_main_responsive .menu-item-has-children > a, .menu_side_responsive .menu-item-has-children > a, .menu_pushy_nav_area .menu-item-has-children > a, body:not(.woocommerce) .sidebar .widget_product_categories ul.product-categories .has_children > a').prepend('');
// Submenu click handler for the responsive menu
jQuery('.menu_main_responsive, .menu_side_responsive, .menu_pushy_nav_area, body:not(.woocommerce) .sidebar .widget_product_categories').on('click', 'li a,li a .open_child_menu, ul.product-categories.plain li a .open_child_menu', function(e) {
"use strict";
var is_menu_main = jQuery(this).parents('.menu_main_responsive').length > 0;
var $a = jQuery(this).hasClass('open_child_menu') ? jQuery(this).parent() : jQuery(this);
if ((!is_menu_main || jQuery('body').hasClass('responsive_menu')) && ($a.parent().hasClass('menu-item-has-children') || $a.parent().hasClass('has_children'))) {
if ($a.siblings('ul:visible').length > 0)
$a.siblings('ul').slideUp().parent().removeClass('opened');
else {
jQuery(this).parents('li').siblings('li').find('ul:visible').slideUp().parent().removeClass('opened');
$a.siblings('ul').slideDown().parent().addClass('opened');
}
}
// Ignore link for parent menu items
if (jQuery(this).hasClass('open_child_menu') || $a.attr('href')=='#') {
e.preventDefault();
return false;
}
});
// Init superfish menus
yreg_estate_init_sfmenu('.menu_main_nav_area ul#menu_main, ul#menu_user, ul#menu_side, body:not(.woocommerce) .sidebar .widget_product_categories ul.product-categories');
// Slide effect for main menu
if (YREG_ESTATE_STORAGE['menu_slider']) {
jQuery('#menu_main').spasticNav({
color: YREG_ESTATE_STORAGE['accent2_color']
});
}
// Show table of contents for the current page
if (YREG_ESTATE_STORAGE['toc_menu'] != 'no') {
yreg_estate_build_page_toc();
}
// One page mode for menu links (scroll to anchor)
jQuery('#toc, ul#menu_main li, ul#menu_user li, ul#menu_side li, ul#menu_footer li, ul#menu_pushy li').on('click', 'a', function(e) {
"use strict";
var href = jQuery(this).attr('href');
if (href===undefined) return;
var pos = href.indexOf('#');
if (pos < 0 || href.length == 1) return;
if (jQuery(href.substr(pos)).length > 0) {
var loc = window.location.href;
var pos2 = loc.indexOf('#');
if (pos2 > 0) loc = loc.substring(0, pos2);
var now = pos==0;
if (!now) now = loc == href.substring(0, pos);
if (now) {
yreg_estate_document_animate_to(href.substr(pos));
yreg_estate_document_set_location(pos==0 ? loc + href : href);
e.preventDefault();
return false;
}
}
});
// Store height of the top and side panels
YREG_ESTATE_STORAGE['top_panel_height'] = 0; //Math.max(0, jQuery('.top_panel_wrap').height());
YREG_ESTATE_STORAGE['side_panel_height'] = 0;
// Pagination
//----------------------------------------------
// Page navigation (style slider)
jQuery('.pager_cur').on('click', function(e) {
"use strict";
jQuery('.pager_slider').slideDown(300, function() {
"use strict";
yreg_estate_init_shortcodes(jQuery('.pager_slider').eq(0));
});
e.preventDefault();
return false;
});
// View More button
var viewmore_link=jQuery('#viewmore_link');
viewmore_link.on('click', function(e) {
"use strict";
if (!YREG_ESTATE_STORAGE['viewmore_busy'] && !jQuery(this).hasClass('viewmore_empty')) {
jQuery(this).parent().addClass('loading');
YREG_ESTATE_STORAGE['viewmore_busy'] = true;
jQuery.post(YREG_ESTATE_STORAGE['ajax_url'], {
action: 'view_more_posts',
nonce: YREG_ESTATE_STORAGE['ajax_nonce'],
page: YREG_ESTATE_STORAGE['viewmore_page']+1,
data: YREG_ESTATE_STORAGE['viewmore_data'],
vars: YREG_ESTATE_STORAGE['viewmore_vars']
}).done(function(response) {
"use strict";
var rez = {};
try {
rez = JSON.parse(response);
} catch (e) {
rez = { error: YREG_ESTATE_STORAGE['ajax_error'] };
console.log(response);
}
viewmore_link.parent().removeClass('loading');
YREG_ESTATE_STORAGE['viewmore_busy'] = false;
if (rez.error === '') {
var posts_container = jQuery('.content').eq(0);
if (posts_container.find('.isotope_wrap').length > 0) posts_container = posts_container.find('.isotope_wrap').eq(0);
if (posts_container.hasClass('isotope_wrap')) {
posts_container.data('last-width', 0).append(rez.data);
YREG_ESTATE_STORAGE['isotope_init_counter'] = 0;
yreg_estate_init_appended_isotope(posts_container, rez.filters);
} else
jQuery('#viewmore').before(rez.data);
YREG_ESTATE_STORAGE['viewmore_page']++;
if (rez.no_more_data==1) {
viewmore_link.addClass('viewmore_empty').parent().hide();
}
yreg_estate_init_post_formats();
yreg_estate_init_shortcodes(posts_container);
yreg_estate_scroll_actions();
}
});
}
e.preventDefault();
return false;
});
// WooCommerce
//----------------------------------------------
// Change display mode
jQuery('.woocommerce,.woocommerce-page').on('click', '.mode_buttons a', function(e) {
"use strict";
var mode = jQuery(this).hasClass('woocommerce_thumbs') ? 'thumbs' : 'list';
jQuery.cookie('yreg_estate_shop_mode', mode, {expires: 365, path: '/'});
jQuery(this).siblings('input').val(mode).parents('form').get(0).submit();
e.preventDefault();
return false;
});
// Added to cart
jQuery('body').on('added_to_cart', function() {
"use strict";
// Update amount on the cart button
var total = jQuery('.menu_user_cart .total .amount').text();
if (total != undefined) {
jQuery('.top_panel_cart_button .cart_summa').text(total);
}
// Update count items on the cart button
var cnt = 0;
jQuery('.menu_user_cart .cart_list li').each(function() {
"use strict";
var q = jQuery(this).find('.quantity').html().split(' ', 2);
if (!isNaN(q[0]))
cnt += Number(q[0]);
});
var cart_items=jQuery('.top_panel_cart_button .cart_items');
var items = cart_items.text().split(' ');
items[0] = cnt;
cart_items.text(items[0]+' '+items[1]);
// Update data-attr on button
jQuery('.top_panel_cart_button').data({
'items': cnt ? cnt : 0,
'summa': total ? total : 0
});
});
// Show cart
jQuery('.top_panel_middle .top_panel_cart_button').on('click', function(e) {
"use strict";
jQuery(this).siblings('.sidebar_cart').slideToggle();
e.preventDefault();
return false;
});
// Add buttons to quantity
jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append(' ');
jQuery('.woocommerce div.quantity').on('click', '>span', function(e) {
"use strict";
var f = jQuery(this).siblings('input');
if (jQuery(this).hasClass('q_inc')) {
f.val(Math.max(0, parseInt(f.val(), 10))+1);
} else {
f.val(Math.max(1, Math.max(0, parseInt(f.val(), 10))-1));
}
e.preventDefault();
return false;
});
// Add stretch behaviour to WooC tabs area
jQuery('.single-product .woocommerce-tabs')
.addClass('trx-stretch-width scheme_light')
.after('
');
yreg_estate_stretch_width();
// Popup login and register windows
//----------------------------------------------
jQuery('.popup_link').addClass('inited').on('click', function(e){
"use strict";
var popup = jQuery(jQuery(this).attr('href'));
if (popup.length === 1) {
yreg_estate_hide_popup(jQuery(popup.hasClass('popup_login') ? '.popup_registration' : '.popup_login' ));
yreg_estate_toggle_popup(popup);
}
e.preventDefault();
return false;
});
jQuery('.popup_wrap').on('click', '.popup_close', function(e){
"use strict";
var popup = jQuery(this).parent();
if (popup.length === 1) {
yreg_estate_hide_popup(popup);
}
e.preventDefault();
return false;
});
// Forms validation
//----------------------------------------------
// Login form
jQuery('.popup_form.login_form').submit(function(e){
"use strict";
var rez = yreg_estate_login_validate(jQuery(this));
if (!rez)
e.preventDefault();
return rez;
});
// Registration form
jQuery('.popup_form.registration_form').submit(function(e){
"use strict";
var rez = yreg_estate_registration_validate(jQuery(this));
if (!rez)
e.preventDefault();
return rez;
});
// Comment form
jQuery("form#commentform").submit(function(e) {
"use strict";
var rez = yreg_estate_comments_validate(jQuery(this));
if (!rez)
e.preventDefault();
return rez;
});
// Bookmarks
//----------------------------------------------
// Add bookmark
jQuery('.bookmarks_add').on('click', function(e) {
"use strict";
var title = window.document.title.split('|')[0];
var url = window.location.href;
var list = jQuery.cookie('yreg_estate_bookmarks');
var exists = false;
if (list) {
try {
list = JSON.parse(list);
} catch (e) {}
if (list.length) {
for (var i=0; i'+YREG_ESTATE_STORAGE['strings']['bookmark_title']+' ', YREG_ESTATE_STORAGE['strings']['bookmark_add'], null,
function(btn, popup) {
"use strict";
if (btn != 1) return;
title = message_popup.find('#bookmark_title').val();
list.push({title: title, url: url});
jQuery('.bookmarks_list').append(''+title+' ');
jQuery.cookie('yreg_estate_bookmarks', JSON.stringify(list), {expires: 365, path: '/'});
setTimeout(function () {yreg_estate_message_success(YREG_ESTATE_STORAGE['strings']['bookmark_added'], YREG_ESTATE_STORAGE['strings']['bookmark_add']);}, YREG_ESTATE_STORAGE['message_timeout']/4);
});
} else
yreg_estate_message_warning(YREG_ESTATE_STORAGE['strings']['bookmark_exists'], YREG_ESTATE_STORAGE['strings']['bookmark_add']);
e.preventDefault();
return false;
});
// Delete bookmark
jQuery('.bookmarks_list').on('click', '.bookmarks_delete', function(e) {
"use strict";
var idx = jQuery(this).parent().index();
var list = jQuery.cookie('yreg_estate_bookmarks');
if (list) {
try {
list = JSON.parse(list);
} catch (e) {}
if (list.length) {
list.splice(idx, 1);
jQuery.cookie('yreg_estate_bookmarks', JSON.stringify(list), {expires: 365, path: '/'});
}
}
jQuery(this).parent().remove();
e.preventDefault();
return false;
});
// Other settings
//------------------------------------
// Scroll to top button
jQuery('.scroll_to_top').on('click', function(e) {
"use strict";
jQuery('html,body').animate({
scrollTop: 0
}, 'slow');
e.preventDefault();
return false;
});
// Show system message
yreg_estate_show_system_message();
// Init post format specific scripts
yreg_estate_init_post_formats();
// Init shortcodes scripts
yreg_estate_init_shortcodes(jQuery('body').eq(0));
// Init hidden elements (if exists)
if (window.yreg_estate_init_hidden_elements) yreg_estate_init_hidden_elements(jQuery('body').eq(0));
} //end ready
// Scroll actions
//==============================================
// Do actions when page scrolled
function yreg_estate_scroll_actions() {
"use strict";
// Call skin specific action (if exists)
//----------------------------------------------
if (window.yreg_estate_skin_scroll_actions) yreg_estate_skin_scroll_actions();
// Call theme specific action (if exists)
//----------------------------------------------
if (window.yreg_estate_theme_scroll_actions) yreg_estate_theme_scroll_actions();
var scroll_offset = jQuery(window).scrollTop();
var scroll_to_top_button = jQuery('.scroll_to_top');
var adminbar_height = Math.max(0, jQuery('#wpadminbar').height());
if (YREG_ESTATE_STORAGE['top_panel_height'] == 0) YREG_ESTATE_STORAGE['top_panel_height'] = jQuery('.top_panel_wrap').height();
// Scroll to top button show/hide
if (scroll_offset > YREG_ESTATE_STORAGE['top_panel_height'])
scroll_to_top_button.addClass('show');
else
scroll_to_top_button.removeClass('show');
// Fix/unfix top panel
var body=jQuery('body');
if (!body.hasClass('responsive_menu') && YREG_ESTATE_STORAGE['menu_fixed']) {
var slider_height = 0;
if (jQuery('.top_panel_below .slider_wrap').length > 0) {
slider_height = jQuery('.top_panel_below .slider_wrap').height();
if (slider_height < 10) {
slider_height = jQuery('.slider_wrap').hasClass('.slider_fullscreen') ? jQuery(window).height() : YREG_ESTATE_STORAGE['slider_height'];
}
}
if (scroll_offset <= slider_height + YREG_ESTATE_STORAGE['top_panel_height']) {
if (body.hasClass('top_panel_fixed')) {
body.removeClass('top_panel_fixed');
}
} else if (scroll_offset > slider_height + YREG_ESTATE_STORAGE['top_panel_height']) {
if (!body.hasClass('top_panel_fixed') && jQuery(document).height() > jQuery(window).height()*1.5) {
jQuery('.top_panel_fixed_wrap').height(YREG_ESTATE_STORAGE['top_panel_height']);
jQuery('.top_panel_wrap').css('marginTop', '-150px').animate({'marginTop': 0}, 500);
body.addClass('top_panel_fixed');
}
}
}
// Fix/unfix side panel
var sidebar_outer=jQuery('.sidebar_outer');
if (sidebar_outer.length > 0) {
if (YREG_ESTATE_STORAGE['side_panel_height'] == 0)
YREG_ESTATE_STORAGE['side_panel_height'] = jQuery('.sidebar_outer_logo_wrap').outerHeight() + jQuery('.sidebar_outer_menu').outerHeight() + jQuery('.sidebar_outer_widgets').outerHeight();
if (scroll_offset + jQuery(window).height() > YREG_ESTATE_STORAGE['side_panel_height'] + 100) {
if (sidebar_outer.css('position')!=='fixed') {
sidebar_outer.css({
'position': 'fixed',
'top': Math.min(0, jQuery(window).height() - YREG_ESTATE_STORAGE['side_panel_height'] - 100) + 'px',
});
}
} else {
if (sidebar_outer.css('position')=='fixed') {
sidebar_outer.css({
'position': 'absolute',
'top': 0
});
}
}
}
// TOC current items
jQuery('#toc .toc_item').each(function() {
"use strict";
var id = jQuery(this).find('a').attr('href');
var pos = id.indexOf('#');
if (pos < 0 || id.length == 1) return;
var loc = window.location.href;
var pos2 = loc.indexOf('#');
if (pos2 > 0) loc = loc.substring(0, pos2);
var now = pos==0;
if (!now) now = loc == href.substring(0, pos);
if (!now) return;
var off = jQuery(id).offset().top;
var id_next = jQuery(this).next().find('a').attr('href');
var off_next = id_next ? jQuery(id_next).offset().top : 1000000;
if (off < scroll_offset + jQuery(window).height()*0.8 && scroll_offset + YREG_ESTATE_STORAGE['top_panel_height'] < off_next)
jQuery(this).addClass('current');
else
jQuery(this).removeClass('current');
});
// Infinite pagination
yreg_estate_infinite_scroll()
// Parallax scroll
yreg_estate_parallax_scroll();
// Scroll actions for shortcodes
yreg_estate_animation_shortcodes();
}
// Infinite Scroll
function yreg_estate_infinite_scroll() {
"use strict";
if (YREG_ESTATE_STORAGE['viewmore_busy']) return;
var infinite = jQuery('#viewmore.pagination_infinite');
if (infinite.length > 0) {
var viewmore = infinite.find('#viewmore_link:not(.viewmore_empty)');
if (viewmore.length > 0) {
if (jQuery(window).scrollTop() + jQuery(window).height() + 100 >= infinite.offset().top) {
viewmore.eq(0).trigger('click');
}
}
}
}
// Parallax scroll
function yreg_estate_parallax_scroll(){
jQuery('.sc_parallax').each(function(){
"use strict";
var windowHeight = jQuery(window).height();
var scrollTops = jQuery(window).scrollTop();
var offsetPrx = Math.max(jQuery(this).offset().top, windowHeight);
if ( offsetPrx <= scrollTops + windowHeight ) {
var speed = Number(jQuery(this).data('parallax-speed'));
var xpos = jQuery(this).data('parallax-x-pos');
var ypos = Math.round((offsetPrx - scrollTops - windowHeight) * speed + (speed < 0 ? windowHeight*speed : 0));
jQuery(this).find('.sc_parallax_content').css('backgroundPosition', xpos+' '+ypos+'px');
// Uncomment next line if you want parallax video (else - video position is static)
jQuery(this).find('div.sc_video_bg').css('top', ypos+'px');
}
});
}
// Resize actions
//==============================================
// Do actions when page scrolled
function yreg_estate_resize_actions() {
"use strict";
// Call skin specific action (if exists)
//----------------------------------------------
if (window.yreg_estate_skin_resize_actions) yreg_estate_skin_resize_actions();
// Call theme specific action (if exists)
//----------------------------------------------
if (window.yreg_estate_theme_resize_actions) yreg_estate_theme_resize_actions();
yreg_estate_responsive_menu();
yreg_estate_video_dimensions();
yreg_estate_resize_video_background();
yreg_estate_resize_fullscreen_slider();
yreg_estate_resize_alter_portfolio();
yreg_estate_stretch_width();
}
// Stretch area to full window width
function yreg_estate_stretch_width() {
jQuery('.trx-stretch-width').each(function() {
"use strict";
var $el = jQuery(this);
var $el_full = $el.next('.trx-stretch-width-original');
var el_margin_left = parseInt( $el.css( 'margin-left' ), 10 );
var el_margin_right = parseInt( $el.css( 'margin-right' ), 10 );
var offset = 0 - $el_full.offset().left - el_margin_left;
var width = jQuery( window ).width();
if (!$el.hasClass('inited')) {
$el.addClass('inited invisible');
$el.css({
'position': 'relative',
'box-sizing': 'border-box'
});
}
$el.css({
'left': offset,
'width': jQuery( window ).width()
});
if ( !$el.hasClass('trx-stretch-content') ) {
var padding = Math.max(0, -1*offset);
var paddingRight = Math.max(0, width - padding - $el_full.width() + el_margin_left + el_margin_right);
$el.css( { 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' } );
}
$el.removeClass('invisible');
});
}
// Check window size and do responsive menu
function yreg_estate_responsive_menu() {
"use strict";
YREG_ESTATE_STORAGE['menu_relayout'] = 960;
YREG_ESTATE_STORAGE['menu_responsive'] = 641;
var body=jQuery('body');
if (yreg_estate_is_responsive_need(YREG_ESTATE_STORAGE['menu_responsive'])) {
if (!body.hasClass('responsive_menu')) {
body.removeClass('top_panel_fixed').addClass('responsive_menu');
if (body.hasClass('menu_relayout'))
body.removeClass('menu_relayout');
var menu_main_nav=jQuery('ul.menu_main_nav');
if (menu_main_nav.hasClass('inited')) {
menu_main_nav.removeClass('inited').superfish('destroy');
}
var menu_side_nav=jQuery('ul.menu_side_nav');
if (menu_side_nav.hasClass('inited')) {
menu_side_nav.removeClass('inited').superfish('destroy');
}
}
} else {
if (body.hasClass('responsive_menu')) {
body.removeClass('responsive_menu');
jQuery('.menu_main_responsive').hide();
jQuery('.menu_side_responsive').hide();
yreg_estate_init_sfmenu('ul.menu_main_nav,ul.menu_side_nav');
jQuery('.menu_main_nav_area').show();
}
if (yreg_estate_is_responsive_need(YREG_ESTATE_STORAGE['menu_relayout']))
body.addClass('menu_relayout');
else if (body.hasClass('menu_relayout'))
body.removeClass('menu_relayout');
}
var top_panel_wrap=jQuery('.top_panel_wrap');
if (!top_panel_wrap.hasClass('menu_show')) top_panel_wrap.addClass('menu_show');
// Show widgets block on the sidebar outer (if sidebar not responsive and widgets are hidden)
var sidebar_outer=jQuery('.sidebar_outer');
if (sidebar_outer.length > 0 && sidebar_outer.css('position')=='absolute' && jQuery('.sidebar_outer_widgets:visible').length==0)
jQuery('.sidebar_outer_widgets').show();
// Switch popup menu / hierarchical list on product categories list
var sb = jQuery('body:not(.woocommerce) .sidebar');
var cat_menu = jQuery('body:not(.woocommerce) .sidebar .widget_product_categories ul.product-categories');
if (sb.length > 0 && cat_menu.length > 0) {
if (sb.css('float')=='none') {
if (cat_menu.hasClass('inited')) {
cat_menu.removeClass('inited').addClass('plain').superfish('destroy');
cat_menu.find('ul.animated').removeClass('animated').addClass('no_animated');
}
} else {
if (!cat_menu.hasClass('inited')) {
cat_menu.removeClass('plain').addClass('inited');
cat_menu.find('ul.no_animated').removeClass('no_animated').addClass('animated');
yreg_estate_init_sfmenu('body:not(.woocommerce) .sidebar .widget_product_categories ul.product-categories');
}
}
}
}
// Check if responsive menu need
function yreg_estate_is_responsive_need(max_width) {
"use strict";
var rez = false;
if (max_width > 0) {
var w = window.innerWidth;
if (w == undefined) {
w = jQuery(window).width()+(jQuery(window).height() < jQuery(document).height() || jQuery(window).scrollTop() > 0 ? 16 : 0);
}
rez = max_width > w;
}
return rez;
}
// Fit video frames to document width
function yreg_estate_video_dimensions() {
jQuery('.sc_video_frame').each(function() {
"use strict";
var frame = jQuery(this).eq(0);
var player = frame.parent();
var ratio = (frame.data('ratio') ? frame.data('ratio').split(':') : (frame.find('[data-ratio]').length>0 ? frame.find('[data-ratio]').data('ratio').split(':') : [16,9]));
ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];
var w_attr = frame.data('width');
var h_attr = frame.data('height');
if (!w_attr || !h_attr) return;
var percent = (''+w_attr).substr(-1)=='%';
w_attr = parseInt(w_attr, 10);
h_attr = parseInt(h_attr, 10);
var w_real = Math.min(percent || frame.parents('.columns_wrap').length>0 ? 10000 : w_attr, frame.parents('div,article').width()), //player.width();
h_real = Math.round(percent ? w_real/ratio : w_real/w_attr*h_attr);
if (parseInt(frame.attr('data-last-width'), 10)==w_real) return;
if (percent) {
frame.height(h_real);
} else {
frame.css({'width': w_real+'px', 'height': h_real+'px'});
}
frame.attr('data-last-width', w_real);
});
jQuery('video.sc_video,video.wp-video-shortcode').each(function() {
"use strict";
var video = jQuery(this).eq(0);
var ratio = (video.data('ratio')!=undefined ? video.data('ratio').split(':') : [16,9]);
ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];
var mejs_cont = video.parents('.mejs-video');
var frame = video.parents('.sc_video_frame');
var w_attr = frame.length>0 ? frame.data('width') : video.data('width');
var h_attr = frame.length>0 ? frame.data('height') : video.data('height');
if (!w_attr || !h_attr) {
w_attr = video.attr('width');
h_attr = video.attr('height');
if (!w_attr || !h_attr) return;
video.data({'width': w_attr, 'height': h_attr});
}
var percent = (''+w_attr).substr(-1)=='%';
w_attr = parseInt(w_attr, 10);
h_attr = parseInt(h_attr, 10);
var w_real = Math.round(mejs_cont.length > 0 ? Math.min(percent ? 10000 : w_attr, mejs_cont.parents('div,article').width()) : video.width()),
h_real = Math.round(percent ? w_real/ratio : w_real/w_attr*h_attr);
if (parseInt(video.attr('data-last-width'), 10)==w_real) return;
if (mejs_cont.length > 0 && mejs) {
yreg_estate_set_mejs_player_dimensions(video, w_real, h_real);
}
if (percent) {
video.height(h_real);
} else {
video.attr({'width': w_real, 'height': h_real}).css({'width': w_real+'px', 'height': h_real+'px'});
}
video.attr('data-last-width', w_real);
});
jQuery('video.sc_video_bg').each(function() {
"use strict";
var video = jQuery(this).eq(0);
var ratio = (video.data('ratio')!=undefined ? video.data('ratio').split(':') : [16,9]);
ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];
var mejs_cont = video.parents('.mejs-video');
var container = mejs_cont.length>0 ? mejs_cont.parent() : video.parent();
var w = container.width();
var h = container.height();
var w1 = Math.ceil(h*ratio);
var h1 = Math.ceil(w/ratio);
if (video.parents('.sc_parallax').length > 0) {
var windowHeight = jQuery(window).height();
var speed = Number(video.parents('.sc_parallax').data('parallax-speed'));
var h_add = Math.ceil(Math.abs((windowHeight-h)*speed));
if (h1 < h + h_add) {
h1 = h + h_add;
w1 = Math.ceil(h1 * ratio);
}
}
if (h1 < h) {
h1 = h;
w1 = Math.ceil(h1 * ratio);
}
if (w1 < w) {
w1 = w;
h1 = Math.ceil(w1 / ratio);
}
var l = Math.round((w1-w)/2);
var t = Math.round((h1-h)/2);
if (parseInt(video.attr('data-last-width'), 10)==w1) return;
if (mejs_cont.length > 0) {
yreg_estate_set_mejs_player_dimensions(video, w1, h1);
mejs_cont.css({
'top': -t+'px'
});
} else
video.css({
'top': -t+'px'
});
video.attr({'width': w1, 'height': h1, 'data-last-width':w1}).css({'width':w1+'px', 'height':h1+'px'});
if (video.css('opacity')==0) video.animate({'opacity': 1}, 3000);
});
jQuery('iframe').each(function() {
"use strict";
var iframe = jQuery(this).eq(0);
var ratio = (iframe.data('ratio')!=undefined ? iframe.data('ratio').split(':') : (iframe.find('[data-ratio]').length>0 ? iframe.find('[data-ratio]').data('ratio').split(':') : [16,9]));
ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];
var w_attr = iframe.attr('width');
var h_attr = iframe.attr('height');
var frame = iframe.parents('.sc_video_frame');
if (frame.length > 0) {
w_attr = frame.data('width');
h_attr = frame.data('height');
}
if (!w_attr || !h_attr) {
return;
}
var percent = (''+w_attr).substr(-1)=='%';
w_attr = parseInt(w_attr, 10);
h_attr = parseInt(h_attr, 10);
var w_real = frame.length > 0 ? frame.width() : iframe.width(),
h_real = Math.round(percent ? w_real/ratio : w_real/w_attr*h_attr);
if (parseInt(iframe.attr('data-last-width'), 10)==w_real) return;
iframe.css({'width': w_real+'px', 'height': h_real+'px'});
});
}
// Resize fullscreen video background
function yreg_estate_resize_video_background() {
"use strict";
var bg = jQuery('.video_bg');
if (bg.length < 1)
return;
if (YREG_ESTATE_STORAGE['media_elements_enabled'] && bg.find('.mejs-video').length == 0) {
setTimeout(yreg_estate_resize_video_background, 100);
return;
}
var video = bg.find('video');
var ratio = (video.data('ratio')!=undefined ? video.data('ratio').split(':') : [16,9]);
ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];
var w = bg.width();
var h = bg.height();
var w1 = Math.ceil(h*ratio);
var h1 = Math.ceil(w/ratio);
if (h1 < h) {
h1 = h;
w1 = Math.ceil(h1 * ratio);
}
if (w1 < w) {
w1 = w;
h1 = Math.ceil(w1 / ratio);
}
var l = Math.round((w1-w)/2);
var t = Math.round((h1-h)/2);
if (bg.find('.mejs-container').length > 0) {
yreg_estate_set_mejs_player_dimensions(bg.find('video'), w1, h1);
bg.find('.mejs-container').css({'left': -l+'px', 'top': -t+'px'});
} else
bg.find('video').css({'left': -l+'px', 'top': -t+'px'});
bg.find('video').attr({'width': w1, 'height': h1}).css({'width':w1+'px', 'height':h1+'px'});
}
// Set Media Elements player dimensions
function yreg_estate_set_mejs_player_dimensions(video, w, h) {
"use strict";
if (mejs) {
for (var pl in mejs.players) {
if (mejs.players[pl].media.src == video.attr('src')) {
if (mejs.players[pl].media.setVideoSize) {
mejs.players[pl].media.setVideoSize(w, h);
}
mejs.players[pl].setPlayerSize(w, h);
mejs.players[pl].setControlsSize();
}
}
}
}
// Resize Fullscreen Slider
function yreg_estate_resize_fullscreen_slider() {
"use strict";
var slider_wrap = jQuery('.slider_wrap.slider_fullscreen');
if (slider_wrap.length < 1)
return;
var slider = slider_wrap.find('.sc_slider_swiper');
if (slider.length < 1)
return;
var h = jQuery(window).height() - jQuery('#wpadminbar').height() - (jQuery('body').hasClass('top_panel_above') && !jQuery('body').hasClass('.top_panel_fixed') ? jQuery('.top_panel_wrap').height() : 0);
slider.height(h);
}
// Resize Alter portfolio elements
function yreg_estate_resize_alter_portfolio() {
"use strict";
var wrap = jQuery('.isotope_wrap.inited');
if (wrap.length==0) return;
wrap.each(function() {
"use strict";
var alter = jQuery(this).find('.post_item_alter');
if (alter.length==0) return;
var single = alter.find('.post_featured img[data-alter-items-w="1"]').eq(0);
if (single.length != 1) return;
var w_real = single.width();
var h_real = single.height();
var space = Number(single.data('alter-item-space'));
var relayout = false;
alter.find('.post_featured img').each(function() {
"use strict";
var items_w = Number(jQuery(this).data('alter-items-w'));
var items_h = Number(jQuery(this).data('alter-items-h'));
if (items_h > 1) {
jQuery(this).height(Math.round(items_h*h_real+(items_h-1)*(space+1)));
relayout = true;
} else if (items_w > 1) {
jQuery(this).height(h_real);
relayout = true;
}
});
if (relayout) {
jQuery(this).isotope('layout');
}
});
}
// Navigation
//==============================================
// Init Superfish menu
function yreg_estate_init_sfmenu(selector) {
jQuery(selector).show().each(function() {
"use strict";
if (yreg_estate_is_responsive_need() && (jQuery(this).attr('id')=='menu_main' || jQuery(this).attr('id')=='menu_side')) return;
jQuery(this).addClass('inited').superfish({
delay: 500,
animation: {
opacity: 'show'
},
animationOut: {
opacity: 'hide'
},
speed: YREG_ESTATE_STORAGE['css_animation'] ? 500 : (YREG_ESTATE_STORAGE['menu_slider'] ? 300 : 200),
speedOut: YREG_ESTATE_STORAGE['css_animation'] ? 500 : (YREG_ESTATE_STORAGE['menu_slider'] ? 300 : 200),
autoArrows: false,
dropShadows: false,
onBeforeShow: function(ul) {
"use strict";
if (jQuery(this).parents("ul").length > 1){
var w = jQuery(window).width();
var par_offset = jQuery(this).parents("ul").offset().left;
var par_width = jQuery(this).parents("ul").outerWidth();
var ul_width = jQuery(this).outerWidth();
if (par_offset+par_width+ul_width > w-20 && par_offset-ul_width > 0)
jQuery(this).addClass('submenu_left');
else
jQuery(this).removeClass('submenu_left');
}
if (YREG_ESTATE_STORAGE['css_animation']) {
jQuery(this).removeClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_out']);
jQuery(this).addClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_in']);
}
},
onBeforeHide: function(ul) {
"use strict";
if (YREG_ESTATE_STORAGE['css_animation']) {
jQuery(this).removeClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_in']);
jQuery(this).addClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_out']);
}
}
});
});
}
// Build page TOC from the tag's id
function yreg_estate_build_page_toc() {
"use strict";
var toc = '', toc_count = 0;
jQuery('[id^="toc_"],.sc_anchor').each(function(idx) {
"use strict";
var obj = jQuery(this);
var id = obj.attr('id');
var url = obj.data('url');
var icon = obj.data('icon');
if (!icon) icon = 'icon-circle-dot';
var title = obj.attr('title');
var description = obj.data('description');
var separator = obj.data('separator');
toc_count++;
toc += '';
});
if (toc_count > (YREG_ESTATE_STORAGE['toc_menu_home'] ? 1 : 0) + (YREG_ESTATE_STORAGE['toc_menu_top'] ? 1 : 0)) {
if (jQuery('#toc').length > 0)
jQuery('#toc .toc_inner').html(toc);
else
jQuery('body').append('');
}
}
// Show current page title on the responsive menu button
function yreg_estate_show_current_menu_item(menu, button) {
"use strict";
menu.find('a').each(function () {
var menu_link = jQuery(this);
if (menu_link.text() == "") {
return;
}
if (menu_link.attr('href') == window.location.href)
button.text(menu_link.text());
});
}
// Prepare menus (if menu cache is used)
function yreg_estate_prepare_menus() {
"use strict";
var menus = [
jQuery('ul#menu_main'),
jQuery('ul#menu_user'),
jQuery('ul#menu_side'),
jQuery('ul#menu_footer'),
jQuery('ul#menu_pushy')
];
var href = window.location.href;
for (var m in menus) {
if (menus[m].length==0) continue;
menus[m].find('li').removeClass('current-menu-ancestor current-menu-parent current-menu-item current_page_item');
menus[m].find('a[href="'+href+'"]').each(function(idx) {
"use strict";
var li = jQuery(this).parent();
li.addClass('current-menu-item');
if (li.hasClass('menu-item-object-page')) li.addClass('current_page_item');
var cnt = 0;
while ((li = li.parents('li')).length > 0) {
cnt++;
li.addClass('current-menu-ancestor'+(cnt==1 ? ' current-menu-parent' : ''));
}
});
}
}
// Isotope
//=====================================================
// First init isotope containers
function yreg_estate_init_isotope() {
"use strict";
var isotope_wrap_n=jQuery('.isotope_wrap:not(.inited)');
var all_images_complete = true;
// Check if all images in isotope wrapper are loaded
isotope_wrap_n.each(function () {
"use strict";
all_images_complete = all_images_complete && yreg_estate_check_images_complete(jQuery(this));
});
// Wait for images loading
if (!all_images_complete && YREG_ESTATE_STORAGE['isotope_init_counter']++ < 30) {
setTimeout(yreg_estate_init_isotope, 200);
return;
}
// Isotope filters handler
jQuery('.isotope_filters:not(.inited)').addClass('inited').on('click', 'a', function(e) {
"use strict";
jQuery(this).parents('.isotope_filters').find('a').removeClass('active');
jQuery(this).addClass('active');
var selector = jQuery(this).data('filter');
jQuery(this).parents('.isotope_filters').siblings('.isotope_wrap').eq(0).isotope({
filter: selector
});
var viewmore_link=jQuery('#viewmore_link');
if (selector == '*')
viewmore_link.fadeIn();
else
viewmore_link.fadeOut();
e.preventDefault();
return false;
});
// Init isotope script
isotope_wrap_n.each(function() {
"use strict";
var isotope_container = jQuery(this);
// Init shortcodes
yreg_estate_init_shortcodes(isotope_container);
// If in scroll container - no init isotope
if (isotope_container.parents('.sc_scroll').length > 0) {
isotope_container.addClass('inited').find('.isotope_item').animate({opacity: 1}, 200, function () { jQuery(this).addClass('isotope_item_show'); });
return;
}
// Init isotope with timeout
setTimeout(function() {
"use strict";
isotope_container.addClass('inited').isotope({
itemSelector: '.isotope_item',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
// Show elements
isotope_container.find('.isotope_item').animate({opacity: 1}, 200, function () {
"use strict";
jQuery(this).addClass('isotope_item_show');
});
// Resize Alter portfolio elements
yreg_estate_resize_alter_portfolio();
}, 500);
});
}
function yreg_estate_init_appended_isotope(posts_container, filters) {
"use strict";
if (posts_container.parents('.sc_scroll_horizontal').length > 0) return;
if (!yreg_estate_check_images_complete(posts_container) && YREG_ESTATE_STORAGE['isotope_init_counter']++ < 30) {
setTimeout(function() { yreg_estate_init_appended_isotope(posts_container, filters); }, 200);
return;
}
// Add filters
var flt = posts_container.siblings('.isotope_filter');
for (var i in filters) {
if (flt.find('a[data-filter=".flt_'+i+'"]').length == 0) {
flt.append(''+filters[i]+' ');
}
}
// Init shortcodes in added elements
yreg_estate_init_shortcodes(posts_container);
// Get added elements
var elems = posts_container.find('.isotope_item:not(.isotope_item_show)');
// Notify isotope about added elements with timeout
setTimeout(function() {
"use strict";
posts_container.isotope('appended', elems);
// Show appended elements
elems.animate({opacity: 1}, 200, function () { jQuery(this).addClass('isotope_item_show'); });
}, 500);
}
// Shortcodes init
//=====================================================
function yreg_estate_init_shortcodes(cont) {
"use strict";
// Call theme specific action (if exists)
if (window.yreg_estate_theme_sc_init) yreg_estate_theme_sc_init(cont);
// Call core shortcodes action (if exists)
if (window.yreg_estate_sc_init) yreg_estate_sc_init(cont);
}
function yreg_estate_animation_shortcodes() {
"use strict";
if (window.yreg_estate_sc_animation) yreg_estate_sc_animation();
}
// Post formats init
//=====================================================
function yreg_estate_init_post_formats() {
"use strict";
// Call theme specific action (if exists)
if (window.yreg_estate_theme_init_post_formats) yreg_estate_theme_init_post_formats();
// MediaElement init
yreg_estate_init_media_elements(jQuery('body'));
// Isotope first init
if (jQuery('.isotope_wrap:not(.inited)').length > 0) {
YREG_ESTATE_STORAGE['isotope_init_counter'] = 0;
yreg_estate_init_isotope();
}
// Hover Effect 'Dir'
var effect_dir=jQuery('.isotope_wrap .isotope_item_content.square.effect_dir:not(.inited)');
if (effect_dir.length > 0) {
effect_dir.each(function() {
jQuery(this).addClass('inited').hoverdir();
});
}
// Popup init
if (YREG_ESTATE_STORAGE['popup_engine'] == 'pretty') {
jQuery("a[href$='jpg'],a[href$='jpeg'],a[href$='png'],a[href$='gif']").attr('rel', 'prettyPhoto[slideshow]');
var images = jQuery("a[rel*='prettyPhoto']:not(.inited):not(.esgbox):not([data-rel*='pretty']):not([rel*='magnific']):not([data-rel*='magnific'])").addClass('inited');
try {
images.prettyPhoto({
social_tools: '',
theme: 'facebook',
deeplinking: false
});
} catch (e) {};
} else if (YREG_ESTATE_STORAGE['popup_engine']=='magnific') {
jQuery("a[href$='jpg'],a[href$='jpeg'],a[href$='png'],a[href$='gif']").attr('rel', 'magnific');
var images = jQuery("a[rel*='magnific']:not(.inited):not(.esgbox):not(.prettyphoto):not([rel*='pretty']):not([data-rel*='pretty'])").addClass('inited');
try {
images.magnificPopup({
type: 'image',
mainClass: 'mfp-img-mobile',
closeOnContentClick: true,
closeBtnInside: true,
fixedContentPos: true,
midClick: true,
preloader: true,
tLoading: YREG_ESTATE_STORAGE['strings']['magnific_loading'],
gallery:{
enabled: true
},
image: {
tError: YREG_ESTATE_STORAGE['strings']['magnific_error'],
verticalFit: true
}
});
} catch (e) {};
}
// Add hover icon to products thumbnails
jQuery(".post_item_product .product .images a.woocommerce-main-image:not(.hover_icon)").addClass('hover_icon hover_icon_view');
// Likes counter
var post_counters_likes_n=jQuery('.post_counters_likes:not(.inited)');
if (post_counters_likes_n.length > 0) {
post_counters_likes_n
.addClass('inited')
.on('click', function(e) {
"use strict";
var button = jQuery(this);
var inc = button.hasClass('enabled') ? 1 : -1;
var post_id = button.data('postid');
var likes = Number(button.data('likes'))+inc;
var cookie_likes = yreg_estate_get_cookie('yreg_estate_likes');
if (cookie_likes === undefined || cookie_likes===null) cookie_likes = '';
jQuery.post(YREG_ESTATE_STORAGE['ajax_url'], {
action: 'post_counter',
nonce: YREG_ESTATE_STORAGE['ajax_nonce'],
post_id: post_id,
likes: likes
}).done(function(response) {
"use strict";
var rez = {};
try {
rez = JSON.parse(response);
} catch (e) {
rez = { error: YREG_ESTATE_STORAGE['ajax_error'] };
console.log(response);
}
if (rez.error === '') {
if (inc == 1) {
var title = button.data('title-dislike');
button.removeClass('enabled').addClass('disabled');
cookie_likes += (cookie_likes.substr(-1)!=',' ? ',' : '') + post_id + ',';
} else {
var title = button.data('title-like');
button.removeClass('disabled').addClass('enabled');
cookie_likes = cookie_likes.replace(','+post_id+',', ',');
}
button.data('likes', likes).attr('title', title).find('.post_counters_number').html(likes);
yreg_estate_set_cookie('yreg_estate_likes', cookie_likes, 365);
} else {
yreg_estate_message_warning(YREG_ESTATE_STORAGE['strings']['error_like']);
}
});
e.preventDefault();
return false;
});
}
// Social share links
var social_items_n=jQuery('.sc_socials_share .social_items:not(.inited)');
if (social_items_n.length > 0) {
social_items_n.each(function() {
"use strict";
jQuery(this).addClass('inited').on('click', '.social_item_popup > a.social_icons', function(e) {
"use strict";
var url = jQuery(this).data('link');
window.open(url, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=480, height=400, toolbar=0, status=0');
e.preventDefault();
return false;
});
});
}
// Add video on thumb click
var sc_video_play_button_n=jQuery('.sc_video_play_button:not(.inited)');
if (sc_video_play_button_n.length > 0) {
sc_video_play_button_n.each(function() {
"use strict";
jQuery(this)
.addClass('inited')
.animate({opacity: 1}, 1000)
.on('click', function (e) {
"use strict";
if (!jQuery(this).hasClass('sc_video_play_button')) return;
var video = jQuery(this).removeClass('sc_video_play_button hover_icon_play').addClass('runvideo').data('video');
if (video!=='') {
jQuery(this).empty().html(video);
yreg_estate_video_dimensions();
var video_tag = jQuery(this).find('video');
var w = video_tag.width();
var h = video_tag.height();
yreg_estate_init_media_elements(jQuery(this));
// Restore WxH attributes, because Chrome broke it!
jQuery(this).find('video').css({'width':w, 'height': h}).attr({'width':w, 'height': h});
}
e.preventDefault();
return false;
});
});
}
// Tribe Events buttons
jQuery('a.tribe-events-read-more,.tribe-events-button,.tribe-events-nav-previous a,.tribe-events-nav-next a,.tribe-events-widget-link a,.tribe-events-viewmore a').addClass('sc_button sc_button_style_filled');
}
function yreg_estate_init_media_elements(cont) {
"use strict";
if (YREG_ESTATE_STORAGE['media_elements_enabled'] && cont.find('audio,video').length > 0) {
if (window.mejs) {
window.mejs.MepDefaults.enableAutosize = false;
window.mejs.MediaElementDefaults.enableAutosize = false;
cont.find('audio:not(.wp-audio-shortcode),video:not(.wp-video-shortcode)').each(function() {
"use strict";
if (jQuery(this).parents('.mejs-mediaelement').length == 0) {
var media_tag = jQuery(this);
var settings = {
enableAutosize: true,
videoWidth: -1, // if set, overrides
videoHeight: -1, // if set, overrides
audioWidth: '100%', // width of audio player
audioHeight: 30, // height of audio player
success: function(mejs) {
"use strict";
var autoplay, loop;
if ( 'flash' === mejs.pluginType ) {
autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop;
autoplay && mejs.addEventListener( 'canplay', function () {
mejs.play();
}, false );
loop && mejs.addEventListener( 'ended', function () {
mejs.play();
}, false );
}
media_tag.parents('.sc_audio,.sc_video').addClass('inited sc_show');
}
};
jQuery(this).mediaelementplayer(settings);
}
});
} else
setTimeout(function() { yreg_estate_init_media_elements(cont); }, 400);
}
}
// Popups and system messages
//==============================================
// Show system message (bubble from previous page)
function yreg_estate_show_system_message() {
"use strict";
if (YREG_ESTATE_STORAGE['system_message'] && YREG_ESTATE_STORAGE['system_message']['message']) {
if (YREG_ESTATE_STORAGE['system_message']['status'] == 'success')
yreg_estate_message_success(YREG_ESTATE_STORAGE['system_message']['message'], YREG_ESTATE_STORAGE['system_message']['header']);
else if (YREG_ESTATE_STORAGE['system_message']['status'] == 'info')
yreg_estate_message_info(YREG_ESTATE_STORAGE['system_message']['message'], YREG_ESTATE_STORAGE['system_message']['header']);
else if (YREG_ESTATE_STORAGE['system_message']['status'] == 'error' || YREG_ESTATE_STORAGE['system_message']['status'] == 'warning')
yreg_estate_message_warning(YREG_ESTATE_STORAGE['system_message']['message'], YREG_ESTATE_STORAGE['system_message']['header']);
}
}
// Toggle popups
function yreg_estate_toggle_popup(popup) {
"use strict";
if (popup.css('display')!='none')
yreg_estate_hide_popup(popup);
else
yreg_estate_show_popup(popup);
}
// Show popups
function yreg_estate_show_popup(popup) {
"use strict";
if (popup.css('display')=='none') {
if (YREG_ESTATE_STORAGE['css_animation'])
popup.show().removeClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_out']).addClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_in']);
else
popup.slideDown();
}
}
// Hide popups
function yreg_estate_hide_popup(popup) {
"use strict";
if (popup.css('display')!='none') {
if (YREG_ESTATE_STORAGE['css_animation'])
popup.removeClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_in']).addClass('animated fast '+YREG_ESTATE_STORAGE['menu_animation_out']).delay(500).hide();
else
popup.fadeOut();
}
}
// Forms validation
//-------------------------------------------------------
// Comments form
function yreg_estate_comments_validate(form) {
"use strict";
form.find('input').removeClass('error_fields_class');
var error = yreg_estate_form_validate(form, {
error_message_text: YREG_ESTATE_STORAGE['strings']['error_global'], // Global error message text (if don't write in checked field)
error_message_show: true, // Display or not error message
error_message_time: 4000, // Error message display time
error_message_class: 'sc_infobox sc_infobox_style_error', // Class appended to error message block
error_fields_class: 'error_fields_class', // Class appended to error fields
exit_after_first_error: false, // Cancel validation and exit after first error
rules: [
{
field: 'author',
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['name_empty']},
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['name_long']}
},
{
field: 'email',
min_length: { value: 7, message: YREG_ESTATE_STORAGE['strings']['email_empty']},
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['email_long']},
mask: { value: YREG_ESTATE_STORAGE['email_mask'], message: YREG_ESTATE_STORAGE['strings']['email_not_valid']}
},
{
field: 'comment',
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['text_empty'] },
max_length: { value: YREG_ESTATE_STORAGE['comments_maxlength'], message: YREG_ESTATE_STORAGE['strings']['text_long']}
}
]
});
return !error;
}
// Login form
function yreg_estate_login_validate(form) {
"use strict";
form.find('input').removeClass('error_fields_class');
var error = yreg_estate_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: 'sc_infobox sc_infobox_style_error',
error_fields_class: 'error_fields_class',
exit_after_first_error: true,
rules: [
{
field: "log",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['login_empty'] },
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['login_long'] }
},
{
field: "pwd",
min_length: { value: 4, message: YREG_ESTATE_STORAGE['strings']['password_empty'] },
max_length: { value: 30, message: YREG_ESTATE_STORAGE['strings']['password_long'] }
}
]
});
if (!error) {
jQuery.post(YREG_ESTATE_STORAGE['ajax_url'], {
action: 'login_user',
nonce: YREG_ESTATE_STORAGE['ajax_nonce'],
remember: form.find('#rememberme').val(),
user_log: form.find('#log').val(),
user_pwd: form.find('#password').val()
}).done(function(response) {
"use strict";
var rez = {};
try {
rez = JSON.parse(response);
} catch (e) {
rez = { error: YREG_ESTATE_STORAGE['ajax_error'] };
console.log(response);
}
var result_box = form.find('.result');
if (result_box.length==0) result_box = form.siblings('.result');
if (result_box.length==0) result_box = form.after('
').next('.result');
result_box.toggleClass('sc_infobox_style_error', false).toggleClass('sc_infobox_style_success', false);
if (rez.error === '') {
result_box.addClass('sc_infobox sc_infobox_style_success').html(YREG_ESTATE_STORAGE['strings']['login_success']);
setTimeout(function() {
location.reload();
}, 3000);
} else {
result_box.addClass('sc_infobox sc_infobox_style_error').html(YREG_ESTATE_STORAGE['strings']['login_failed'] + ' ' + rez.error);
}
result_box.fadeIn().delay(3000).fadeOut();
});
}
return false;
}
// Registration form
function yreg_estate_registration_validate(form) {
"use strict";
form.find('input').removeClass('error_fields_class');
var error = yreg_estate_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: true,
rules: [
{
field: "registration_username",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['login_empty'] },
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['login_long'] }
},
{
field: "registration_email",
min_length: { value: 7, message: YREG_ESTATE_STORAGE['strings']['email_empty'] },
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['email_long'] },
mask: { value: YREG_ESTATE_STORAGE['email_mask'], message: YREG_ESTATE_STORAGE['strings']['email_not_valid'] }
},
{
field: "registration_pwd",
min_length: { value: 4, message: YREG_ESTATE_STORAGE['strings']['password_empty'] },
max_length: { value: 30, message: YREG_ESTATE_STORAGE['strings']['password_long'] }
},
{
field: "registration_pwd2",
equal_to: { value: 'registration_pwd', message: YREG_ESTATE_STORAGE['strings']['password_not_equal'] }
}
]
});
if (!error) {
jQuery.post(YREG_ESTATE_STORAGE['ajax_url'], {
action: 'registration_user',
nonce: YREG_ESTATE_STORAGE['ajax_nonce'],
user_name: form.find('#registration_username').val(),
user_email: form.find('#registration_email').val(),
user_pwd: form.find('#registration_pwd').val()
}).done(function(response) {
"use strict";
var rez = {};
try {
rez = JSON.parse(response);
} catch (e) {
rez = { error: YREG_ESTATE_STORAGE['ajax_error'] };
console.log(response);
}
var result_box = form.find('.result');
if (result_box.length==0) result_box = form.siblings('.result');
if (result_box.length==0) result_box = form.after('
').next('.result');
result_box.toggleClass('sc_infobox_style_error', false).toggleClass('sc_infobox_style_success', false);
if (rez.error === '') {
result_box.addClass('sc_infobox sc_infobox_style_success').html(YREG_ESTATE_STORAGE['strings']['registration_success']);
setTimeout(function() {
jQuery('.popup_login_link').trigger('click');
}, 3000);
} else {
result_box.addClass('sc_infobox sc_infobox_style_error').html(YREG_ESTATE_STORAGE['strings']['registration_failed'] + ' ' + rez.error);
}
result_box.fadeIn().delay(3000).fadeOut();
});
}
return false;
}
// Contact form handlers
function yreg_estate_sc_form_validate_envienos(form){
"use strict";
var url = form.attr('action');
if (url == '') return false;
form.find('input').removeClass('error_fields_class');
var error = false;
var form_custom = form.data('formtype')=='form_custom';
if (!form_custom) {
error = yreg_estate_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: false,
rules: [
{
field: "nombre",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['name_empty'] },
max_length: { value: 20, message: YREG_ESTATE_STORAGE['strings']['name_long'] }
},
{
field: "telefono",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['name_empty'] },
},
{
field: "ciudad",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['name_empty'] },
},
{
field: "email",
mask: { value: YREG_ESTATE_STORAGE['email_mask'], message: YREG_ESTATE_STORAGE['strings']['email_not_valid'] }
},
{
field: "operacion",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['subject_empty'] },
},
{
field: "g-recaptcha-response",
min_length: { value: 1, message: "debe ingresar captcha" },
},
]
});
}
if (!error && url!='#') {
if(url == core.path+"api/sendMail"){
var form = new FormData(form[0]);
core.transport(url, form, function(r){
var result = modal.dom.find(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false);
if(r==="true"){
modal.resetForm()
result.addClass("sc_infobox_style_success").html("Se ha enviado su consulta");
}else{
modal.resetForm()
result.addClass("sc_infobox_style_error").html("error");
//alert("mal")
}
result.fadeIn().delay(3000).fadeOut()
setTimeout(function(){ $.magnificPopup.close() }, 3000);
},'postform', function() { console.log('error'); });
}else{
var form = new FormData(form[0]);
core.transport(url, form, function(r){
var result = $(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false);
if(r==="true"){
$("#contactenos")[0].reset();
result.addClass("sc_infobox_style_success").html("Se ha enviado su consulta");
}else{
$("#contactenos")[0].reset();
result.addClass("sc_infobox_style_error").html("error");
//alert("mal")
}
grecaptcha.reset();
result.fadeIn().delay(3000).fadeOut()
setTimeout(function(){ $.magnificPopup.close() }, 3000);
},'postform', function() { console.log('error'); });
}
}
return !error;
}
// Contact form handlers
function yreg_estate_sc_form_validate(form){
"use strict";
var url = form.attr('action');
if (url == '') return false;
form.find('input').removeClass('error_fields_class');
var error = false;
var form_custom = form.data('formtype')=='form_custom';
if (!form_custom) {
error = yreg_estate_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: false,
rules: [
{
field: "username",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['name_empty'] },
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['name_long'] }
},
{
field: "email",
min_length: { value: 7, message: YREG_ESTATE_STORAGE['strings']['email_empty'] },
max_length: { value: 60, message: YREG_ESTATE_STORAGE['strings']['email_long'] },
mask: { value: YREG_ESTATE_STORAGE['email_mask'], message: YREG_ESTATE_STORAGE['strings']['email_not_valid'] }
},
{
field: "subject",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['subject_empty'] },
max_length: { value: 100, message: YREG_ESTATE_STORAGE['strings']['subject_long'] }
},
{
field: "message",
min_length: { value: 1, message: YREG_ESTATE_STORAGE['strings']['text_empty'] },
max_length: { value: YREG_ESTATE_STORAGE['contacts_maxlength'], message: YREG_ESTATE_STORAGE['strings']['text_long'] }
}
]
});
}
if (!error && url!='#') {
jQuery.post(url, {
data: form.serialize()
}).done(function(response) {
"use strict";
var rez = {};
try {
rez = JSON.parse(response);
} catch (e) {
rez = { error: YREG_ESTATE_STORAGE['ajax_error'] };
console.log(response);
}
var result = form.find(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false);
if (rez.error === '') {
form.get(0).reset();
result.addClass("sc_infobox_style_success").html(YREG_ESTATE_STORAGE['strings']['send_complete']);
var return_url = form.find('input[name="return_url"]');
if (return_url.length > 0 && return_url.val()!='') {
setTimeout(function() {
"use strict";
window.location.href = return_url.val();
}, 3300);
}
} else {
result.addClass("sc_infobox_style_error").html(YREG_ESTATE_STORAGE['strings']['send_error'] + ' ' + rez.error);
}
result.fadeIn().delay(3000).fadeOut();
});
}
return !error;
}
// Theme-specific first load actions
//==============================================
function yreg_estate_theme_ready_actions() {
"use strict";
// Put here your init code for the theme-specific actions
// It will be called before core actions
date_time();
}
// Theme-specific scroll actions
//==============================================
function yreg_estate_theme_scroll_actions() {
"use strict";
// Put here your theme-specific code for scroll actions
// It will be called when page is scrolled (before core actions)
}
// Theme-specific resize actions
//==============================================
function yreg_estate_theme_resize_actions() {
"use strict";
// Put here your theme-specific code for resize actions
// It will be called when window is resized (before core actions)
estate_max_height();
maxh();
}
// Theme-specific shortcodes init
//=====================================================
function yreg_estate_theme_sc_init(cont) {
"use strict";
// Put here your theme-specific code for init shortcodes
// It will be called before core init shortcodes
// @param cont - jQuery-container with shortcodes (init only inside this container)
}
// Theme-specific post-formats init
//=====================================================
function yreg_estate_theme_init_post_formats() {
"use strict";
// Put here your theme-specific code for init post-formats
// It will be called before core init post_formats when page is loaded or after 'Load more' or 'Infonite scroll' actions
}
function estate_max_height() {
"use strict";
var eMaxH=jQuery('.eMaxHBox .eMaxH');
eMaxH.each(function(){
jQuery(this).css('height', 'inherit');
});
var maxH = 0;
eMaxH.each(function(){
if ( jQuery(this).height() > maxH ) {
maxH = jQuery(this).height();
}
});
eMaxH.height(maxH);
}
jQuery(document).ready(function(){
jQuery(".estateCheckBox").change(function(){
"use strict";
if(jQuery(this).is(":checked")){
jQuery(this).parent("label").addClass("estateLabelCheckBoxSelected");
}else{
jQuery(this).parent("label").removeClass("estateLabelCheckBoxSelected");
}
});
});
jQuery(function() {
"use strict";
var js_area_min = parseInt(jQuery( ".ps_area_min" ).val(), 10);
var js_area_max = parseInt(jQuery( ".ps_area_max" ).val(), 10);
var js_area_big = parseInt(jQuery( ".ps_area_big" ).val(), 10);
jQuery( "#slider-range-area" ).slider({
range: true,
min: 0,
max: js_area_big,
values: [ js_area_min, js_area_max ],
slide: function( event, ui ) {
"use strict";
jQuery( ".ps_area .ps_area_min" ).val(ui.values[0]);
jQuery( ".ps_area .ps_area_max" ).val(ui.values[1]);
if ( (ui.values[0]==0) && (ui.values[1]==js_area_big) ) {
jQuery( ".ps_area_info_value" ).html( 'Any' );
} else {
jQuery( ".ps_area_info_value" ).html( ui.values[0] + " - " + ui.values[1] + " SqFt" );
}
}
});
if ( (js_area_min==0) && (js_area_max==js_area_big) ) {
jQuery( ".ps_area_info_value" ).html( 'Any' );
} else {
jQuery( ".ps_area_info_value" ).html( js_area_min + " - " + js_area_max + " SqFt" );
}
});
jQuery(function() {
"use strict";
var js_price_min = parseInt(jQuery( ".ps_price_min" ).val(), 10);
var js_price_max = parseInt(jQuery( ".ps_price_max" ).val(), 10);
var js_price_big = parseInt(jQuery( ".ps_price_big" ).val(), 10);
jQuery( "#slider-range-price" ).slider({
range: true,
min: 0,
max: js_price_big,
values: [ js_price_min, js_price_max ],
slide: function( event, ui ) {
"use strict";
jQuery( ".ps_price .ps_price_min" ).val(ui.values[0]);
jQuery( ".ps_price .ps_price_max" ).val(ui.values[1]);
if ( (ui.values[0]==0) && (ui.values[1]==js_price_big) ) {
jQuery( ".ps_price_info_value" ).html( 'Any' );
} else {
jQuery( ".ps_price_info_value" ).html( "$" + ui.values[0] + " - $" + ui.values[1] );
}
}
});
if ( (js_price_min==0) && (js_price_max==js_price_big) ) {
jQuery( ".ps_price_info_value" ).html( 'Any' );
} else {
jQuery( ".ps_price_info_value" ).html( "$" + js_price_min + " - $" + js_price_max );
}
});
function maxh() {
"use strict";
var maxHBox=jQuery('.maxHBox');
if (maxHBox.length>0) {
maxHBox.each(function (){
"use strict";
var maxH = 0;
jQuery(this).find('.maxHBoxItem').each(function (){
"use strict";
if ( jQuery(this).height() > maxH ) {
maxH = jQuery(this).height();
}
console.log(maxH);
});
jQuery(this).find('.maxHBoxItem').height(maxH);
console.log('xXx');
});
}
}
function date_time() {
"use strict";
var cfs_date=jQuery('.custom_form_slider_item .cfs_date');
cfs_date.before('
');
cfs_date.appendTo('.custom_form_slider_item .cfs_date_time');
jQuery('.custom_form_slider_item .cfs_time').appendTo('.custom_form_slider_item .cfs_date_time');
}