/* Minification failed. Returning unminified contents.
(36,158409-158417): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: Sortable
 */
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */
/*
** Unobtrusive Ajax support library for jQuery
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
(function(a){var b="unobtrusiveAjaxClick",d="unobtrusiveAjaxClickTarget",h="unobtrusiveValidation";function c(d,b){var a=window,c=(d||"").split(".");while(a&&c.length)a=a[c.shift()];if(typeof a==="function")return a;b.push(d);return Function.constructor.apply(null,b)}function e(a){return a==="GET"||a==="POST"}function g(b,a){!e(a)&&b.setRequestHeader("X-HTTP-Method-Override",a)}function i(c,b,e){var d;if(e.indexOf("application/x-javascript")!==-1)return;d=(c.getAttribute("data-ajax-mode")||"").toUpperCase();a(c.getAttribute("data-ajax-update")).each(function(f,c){var e;switch(d){case"BEFORE":e=c.firstChild;a("<div />").html(b).contents().each(function(){c.insertBefore(this,e)});break;case"AFTER":a("<div />").html(b).contents().each(function(){c.appendChild(this)});break;case"REPLACE-WITH":a(c).replaceWith(b);break;default:a(c).html(b)}})}function f(b,d){var j,k,f,h;j=b.getAttribute("data-ajax-confirm");if(j&&!window.confirm(j))return;k=a(b.getAttribute("data-ajax-loading"));h=parseInt(b.getAttribute("data-ajax-loading-duration"),10)||0;a.extend(d,{type:b.getAttribute("data-ajax-method")||undefined,url:b.getAttribute("data-ajax-url")||undefined,cache:!!b.getAttribute("data-ajax-cache"),beforeSend:function(d){var a;g(d,f);a=c(b.getAttribute("data-ajax-begin"),["xhr"]).apply(b,arguments);a!==false&&k.show(h);return a},complete:function(){k.hide(h);c(b.getAttribute("data-ajax-complete"),["xhr","status"]).apply(b,arguments)},success:function(a,e,d){i(b,a,d.getResponseHeader("Content-Type")||"text/html");c(b.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(b,arguments)},error:function(){c(b.getAttribute("data-ajax-failure"),["xhr","status","error"]).apply(b,arguments)}});d.data.push({name:"X-Requested-With",value:"XMLHttpRequest"});f=d.type.toUpperCase();if(!e(f)){d.type="POST";d.data.push({name:"X-HTTP-Method-Override",value:f})}a.ajax(d)}function j(c){var b=a(c).data(h);return!b||!b.validate||b.validate()}a(document).on("click","a[data-ajax=true]",function(a){a.preventDefault();f(this,{url:this.href,type:"GET",data:[]})});a(document).on("click","form[data-ajax=true] input[type=image]",function(c){var g=c.target.name,e=a(c.target),f=a(e.parents("form")[0]),d=e.offset();f.data(b,[{name:g+".x",value:Math.round(c.pageX-d.left)},{name:g+".y",value:Math.round(c.pageY-d.top)}]);setTimeout(function(){f.removeData(b)},0)});a(document).on("click","form[data-ajax=true] :submit",function(e){var g=e.currentTarget.name,f=a(e.target),c=a(f.parents("form")[0]);c.data(b,g?[{name:g,value:e.currentTarget.value}]:[]);c.data(d,f);setTimeout(function(){c.removeData(b);c.removeData(d)},0)});a(document).on("submit","form[data-ajax=true]",function(h){var e=a(this).data(b)||[],c=a(this).data(d),g=c&&c.hasClass("cancel");h.preventDefault();if(!g&&!j(this))return;f(this,{url:this.action,type:this.method||"GET",data:e.concat(a(this).serializeArray())})})})(jQuery);;
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */
/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("<input type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in t)e++;return e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"<strong>Warning: No message defined for "+e.name+"</strong>")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery);;
!function (e) { "use strict"; if (void 0 !== e) { var t = [], i = function (i) { return t = e.grep(t, function (e) { return e !== i && e.$instance.closest("body").length > 0 }) }, n = { keyup: "onKeyUp", resize: "onResize" }, s = function (t) { e.each(r.opened().reverse(), function () { if (!t.isDefaultPrevented() && !1 === this[n[t.type]](t)) return t.preventDefault(), t.stopPropagation(), !1 }) }, o = function (t) { if (t !== r._globalHandlerInstalled) { r._globalHandlerInstalled = t; var i = e.map(n, function (e, t) { return t + "." + r.prototype.namespace }).join(" "); e(window)[t ? "on" : "off"](i, s) } }; r.prototype = { constructor: r, namespace: "featherlight", targetAttr: "data-featherlight", variant: null, resetCss: !1, background: null, openTrigger: "click", closeTrigger: "click", filter: null, root: "body", openSpeed: 250, closeSpeed: 250, closeOnClick: "background", closeOnEsc: !0, closeIcon: "&#10005;", loading: "", persist: !1, otherClose: null, beforeOpen: e.noop, beforeContent: e.noop, beforeClose: e.noop, afterOpen: e.noop, afterContent: e.noop, afterClose: e.noop, onKeyUp: e.noop, onResize: e.noop, type: null, contentFilters: ["jquery", "image", "html", "ajax", "iframe", "text"], setup: function (t, i) { "object" != typeof t || t instanceof e != !1 || i || (i = t, t = void 0); var n = e.extend(this, i, { target: t }), s = n.resetCss ? n.namespace + "-reset" : n.namespace, o = e(n.background || ['<div class="' + s + "-loading " + s + '">', '<div class="' + s + '-content">', '<span class="' + s + "-close-icon " + n.namespace + '-close">', n.closeIcon, "</span>", '<div class="' + n.namespace + '-inner">' + n.loading + "</div>", "</div>", "</div>"].join("")), r = "." + n.namespace + "-close" + (n.otherClose ? "," + n.otherClose : ""); return n.$instance = o.clone().addClass(n.variant), n.$instance.on(n.closeTrigger + "." + n.namespace, function (t) { var i = e(t.target); ("background" === n.closeOnClick && i.is("." + n.namespace) || "anywhere" === n.closeOnClick || i.closest(r).length) && (t.preventDefault(), n.close()) }), this }, getContent: function () { if (!1 !== this.persist && this.$content) return this.$content; var t = this, i = this.constructor.contentFilters, n = function (e) { return t.$currentTarget && t.$currentTarget.attr(e) }, s = n(t.targetAttr), o = t.target || s || "", r = i[t.type]; if (!r && o in i && (r = i[o], o = t.target && s), o = o || n("href") || "", !r) for (var a in i) t[a] && (r = i[a], o = t[a]); if (!r) { var l = o; if (o = null, e.each(t.contentFilters, function () { return (r = i[this]).test && (o = r.test(l)), !o && r.regex && l.match && l.match(r.regex) && (o = l), !o }), !o) return "console" in window && window.console.error("Featherlight: no content filter found " + (l ? ' for "' + l + '"' : " (no target specified)")), !1 } return r.process.call(t, o) }, setContent: function (t) { var i = this; return (t.is("iframe") || e("iframe", t).length > 0) && i.$instance.addClass(i.namespace + "-iframe"), i.$instance.removeClass(i.namespace + "-loading"), i.$instance.find("." + i.namespace + "-inner").not(t).slice(1).remove().end().replaceWith(e.contains(i.$instance[0], t[0]) ? "" : t), i.$content = t.addClass(i.namespace + "-inner"), i }, open: function (i) { var n = this; if (n.$instance.hide().appendTo(n.root), !(i && i.isDefaultPrevented() || !1 === n.beforeOpen(i))) { i && i.preventDefault(); var s = n.getContent(); if (s) return t.push(n), o(!0), n.$instance.fadeIn(n.openSpeed), n.beforeContent(i), e.when(s).always(function (e) { n.setContent(e), n.afterContent(i) }).then(n.$instance.promise()).done(function () { n.afterOpen(i) }) } return n.$instance.detach(), e.Deferred().reject().promise() }, close: function (t) { var n = this, s = e.Deferred(); return !1 === n.beforeClose(t) ? s.reject() : (0 === i(n).length && o(!1), n.$instance.fadeOut(n.closeSpeed, function () { n.$instance.detach(), n.afterClose(t), s.resolve() })), s.promise() }, chainCallbacks: function (t) { for (var i in t) this[i] = e.proxy(t[i], this, e.proxy(this[i], this)) } }, e.extend(r, { id: 0, autoBind: "[data-featherlight]", defaults: r.prototype, contentFilters: { jquery: { regex: /^[#.]\w/, test: function (t) { return t instanceof e && t }, process: function (t) { return !1 !== this.persist ? e(t) : e(t).clone(!0) } }, image: { regex: /\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i, process: function (t) { var i = e.Deferred(), n = new Image, s = e('<img src="' + t + '" alt="" class="' + this.namespace + '-image" />'); return n.onload = function () { s.naturalWidth = n.width, s.naturalHeight = n.height, i.resolve(s) }, n.onerror = function () { i.reject(s) }, n.src = t, i.promise() } }, html: { regex: /^\s*<[\w!][^<]*>/, process: function (t) { return e(t) } }, ajax: { regex: /./, process: function (t) { var i = e.Deferred(), n = e("<div></div>").load(t, function (e, t) { "error" !== t && i.resolve(n.contents()), i.fail() }); return i.promise() } }, iframe: { process: function (t) { var i = new e.Deferred, n = e("<iframe/>").hide().attr("src", t).css(function (e, t) { var i = {}, n = new RegExp("^" + t + "([A-Z])(.*)"); for (var s in e) { var o = s.match(n); o && (i[(o[1] + o[2].replace(/([A-Z])/g, "-$1")).toLowerCase()] = e[s]) } return i }(this, "iframe")).on("load", function () { i.resolve(n.show()) }).appendTo(this.$instance.find("." + this.namespace + "-content")); return i.promise() } }, text: { process: function (t) { return e("<div>", { text: t }) } } }, functionAttributes: ["beforeOpen", "afterOpen", "beforeContent", "afterContent", "beforeClose", "afterClose"], readElementConfig: function (t, i) { var n = this, s = new RegExp("^data-" + i + "-(.*)"), o = {}; return t && t.attributes && e.each(t.attributes, function () { var t = this.name.match(s); if (t) { var i = this.value, r = e.camelCase(t[1]); if (e.inArray(r, n.functionAttributes) >= 0) i = new Function(i); else try { i = e.parseJSON(i) } catch (e) { } o[r] = i } }), o }, extend: function (t, i) { var n = function () { this.constructor = t }; return n.prototype = this.prototype, t.prototype = new n, t.__super__ = this.prototype, e.extend(t, this, i), t.defaults = t.prototype, t }, attach: function (t, i, n) { var s = this; "object" != typeof i || i instanceof e != !1 || n || (n = i, i = void 0); var o, r = (n = e.extend({}, n)).namespace || s.defaults.namespace, a = e.extend({}, s.defaults, s.readElementConfig(t[0], r), n); return t.on(a.openTrigger + "." + a.namespace, a.filter, function (r) { var l = e.extend({ $source: t, $currentTarget: e(this) }, s.readElementConfig(t[0], a.namespace), s.readElementConfig(this, a.namespace), n), d = o || e(this).data("featherlight-persisted") || new s(i, l); "shared" === d.persist ? o = d : !1 !== d.persist && e(this).data("featherlight-persisted", d), d.open(r) }), t }, current: function () { var e = this.opened(); return e[e.length - 1] || null }, opened: function () { var n = this; return i(), e.grep(t, function (e) { return e instanceof n }) }, close: function () { var e = this.current(); if (e) return e.close() }, _onReady: function () { var t = this; t.autoBind && (t.attach(e(document), { filter: t.autoBind }), e(t.autoBind).filter("[data-featherlight-filter]").each(function () { t.attach(e(this)) })) }, _callbackChain: { onKeyUp: function (e, t) { return 27 === t.keyCode ? (this.closeOnEsc && this.$instance.find("." + this.namespace + "-close:first").click(), !1) : e(t) }, onResize: function (e, t) { if (this.$content.naturalWidth) { var i = this.$content.naturalWidth, n = this.$content.naturalHeight; this.$content.css("width", "").css("height", ""); var s = Math.max(i / parseInt(this.$content.parent().css("width"), 10), n / parseInt(this.$content.parent().css("height"), 10)); s > 1 && this.$content.css("width", i / s + "px").css("height", n / s + "px") } return e(t) }, afterContent: function (e, t) { var i = e(t); return this.onResize(t), i } } }), e.featherlight = r, e.fn.featherlight = function (e, t) { return r.attach(this, e, t) }, e(document).ready(function () { r._onReady() }) } else "console" in window && window.console.info("Too much lightness, Featherlight needs jQuery."); function r(e, t) { if (!(this instanceof r)) { var i = new r(e, t); return i.open(), i } this.id = r.id++, this.setup(e, t), this.chainCallbacks(r._callbackChain) } }(jQuery), function () { var e, t, i, n, s, o, r, a, l, d = [].slice; (e = jQuery).formance = {}, e.formance.fn = {}, e.fn.formance = function () { var t, i; return i = arguments[0], t = 2 <= arguments.length ? d.call(arguments, 1) : [], e.formance.fn[i].apply(this, t) }, a = function (t) { var i; return e(t.target), !(!t.metaKey && !t.ctrlKey) || 32 !== t.which && (0 === t.which || (t.which < 33 || (i = String.fromCharCode(t.which), !!/[\d\s]/.test(i)))) }, r = function (t) { var i; return e(t.target), !(!t.metaKey && !t.ctrlKey) || 32 !== t.which && (0 === t.which || (t.which < 33 || (i = String.fromCharCode(t.which), !!/[\d\sA-Za-z]/.test(i)))) }, s = function (e) { var t; return null != e.prop("selectionStart") && e.prop("selectionStart") !== e.prop("selectionEnd") || !("undefined" == typeof document || null === document || null == (t = document.selection) || "function" != typeof t.createRange || !t.createRange().text) }, e.formance.fn.restrictNumeric = function () { return this.on("keypress", a), this }, e.formance.fn.restrictAlphaNumeric = function () { return this.on("keypress", r), this }, e.formance.fn.hasTextSelected = s, e = jQuery, s = e.formance.fn.hasTextSelected, e.formance.fn.validate_number = function () { var t, i, n; if (n = (t = e(this)).val(), null != (i = t.data("formance_length")) && "number" == typeof i && n.length !== i) return !1; if (null != i && "string" == typeof i && "" !== i) { if (isNaN(parseInt(i, 10))) return !1; if (n.length !== parseInt(i, 10)) return !1 } return /^\d+$/.test(n) }, o = function (e) { var t, i, n, s, o; return (o = e.replace(/\D/g, "").match(/^(\d{0,3})?(\d{0,3})?(\d{0,4})?$/))[0], t = o[1], i = o[2], n = o[3], s = "", null != t && (s += "(" + t), 3 === (null != t ? t.length : void 0) && (s += ") "), null != i && (s += "" + i), 3 === (null != i ? i.length : void 0) && (s += "-"), null != n && (s += "" + n), s }, l = function (t) { var i, n; if (i = e(t.currentTarget), n = String.fromCharCode(t.which), /^\d+$/.test(n) && !s(i)) return !((i.val() + n).replace(/\D/g, "").length > 10) && void 0 }, n = function (t) { var i, n, s, r; if (n = String.fromCharCode(t.which), /^\d+$/.test(n)) return r = (i = e(t.currentTarget)).val() + n, s = o(r), t.preventDefault(), i.val(s) }, t = function (t) { var i, n; if (!t.meta && (n = (i = e(t.currentTarget)).val(), 8 === t.which && (null == i.prop("selectionStart") || i.prop("selectionStart") === n.length))) return /\(\d$/.test(n) ? (t.preventDefault(), i.val("")) : /\d\)(\s)+$/.test(n) ? (t.preventDefault(), i.val(n.replace(/\d\)(\s)*$/, ""))) : /\d(\s|\-)+$/.test(n) ? (t.preventDefault(), i.val(n.replace(/\d(\s|\-)+$/, ""))) : void 0 }, i = function (t) { return setTimeout(function () { var i, n, s; return s = (i = e(t.currentTarget)).val(), n = o(s), i.val(n) }) }, e.formance.fn.format_phone_number = function () { return this.formance("restrictNumeric"), this.on("keypress", l), this.on("keypress", n), this.on("keydown", t), this.on("paste", i), this }, e.formance.fn.validate_phone_number = function () { var t; return null != (t = e(this).val()) && (t = t.replace(/\(|\)|\s+|-/g, ""), !!/^\d+$/.test(t) && 10 === t.replace(/\D/g, "").length) } }.call(this), function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? e(require("jquery")) : e(jQuery) }(function (e) { var t, i = navigator.userAgent, n = /iphone/i.test(i), s = /chrome/i.test(i), o = /android/i.test(i); e.mask = { definitions: { 9: "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]" }, autoclear: !0, dataName: "rawMaskFn", placeholder: "_" }, e.fn.extend({ caret: function (e, t) { var i; if (0 !== this.length && !this.is(":hidden") && this.get(0) === document.activeElement) return "number" == typeof e ? (t = "number" == typeof t ? t : e, this.each(function () { this.setSelectionRange ? this.setSelectionRange(e, t) : this.createTextRange && ((i = this.createTextRange()).collapse(!0), i.moveEnd("character", t), i.moveStart("character", e), i.select()) })) : (this[0].setSelectionRange ? (e = this[0].selectionStart, t = this[0].selectionEnd) : document.selection && document.selection.createRange && (i = document.selection.createRange(), e = 0 - i.duplicate().moveStart("character", -1e5), t = e + i.text.length), { begin: e, end: t }) }, unmask: function () { return this.trigger("unmask") }, mask: function (i, r) { var a, l, d, c, u, p, h; if (!i && this.length > 0) { var f = e(this[0]).data(e.mask.dataName); return f ? f() : void 0 } return r = e.extend({ autoclear: e.mask.autoclear, placeholder: e.mask.placeholder, completed: null }, r), a = e.mask.definitions, l = [], d = p = i.length, c = null, i = String(i), e.each(i.split(""), function (e, t) { "?" == t ? (p--, d = e) : a[t] ? (l.push(new RegExp(a[t])), null === c && (c = l.length - 1), e < d && (u = l.length - 1)) : l.push(null) }), this.trigger("unmask").each(function () { var f = e(this), g = e.map(i.split(""), function (e, t) { if ("?" != e) return a[e] ? b(t) : e }), v = g.join(""), m = f.val(); function y() { if (r.completed) { for (var e = c; e <= u; e++) if (l[e] && g[e] === b(e)) return; r.completed.call(f) } } function b(e) { return e < r.placeholder.length ? r.placeholder.charAt(e) : r.placeholder.charAt(0) } function w(e) { for (; ++e < p && !l[e];); return e } function k(e, t) { var i, n; if (!(e < 0)) { for (i = e, n = w(t) ; i < p; i++) if (l[i]) { if (!(n < p && l[i].test(g[n]))) break; g[i] = g[n], g[n] = b(n), n = w(n) } $(), f.caret(Math.max(c, e)) } } function C(e) { T(), f.val() != m && f.change() } function S(e, t) { var i; for (i = e; i < t && i < p; i++) l[i] && (g[i] = b(i)) } function $() { f.val(g.join("")) } function T(e) { var t, i, n, s = f.val(), o = -1; for (t = 0, n = 0; t < p; t++) if (l[t]) { for (g[t] = b(t) ; n++ < s.length;) if (i = s.charAt(n - 1), l[t].test(i)) { g[t] = i, o = t; break } if (n > s.length) { S(t + 1, p); break } } else g[t] === s.charAt(n) && n++, t < d && (o = t); return e ? $() : o + 1 < d ? r.autoclear || g.join("") === v ? (f.val() && f.val(""), S(0, p)) : $() : ($(), f.val(f.val().substring(0, o + 1))), d ? t : c } f.data(e.mask.dataName, function () { return e.map(g, function (e, t) { return l[t] && e != b(t) ? e : null }).join("") }), f.one("unmask", function () { f.off(".mask").removeData(e.mask.dataName) }).on("focus.mask", function () { var e; f.prop("readonly") || (clearTimeout(t), m = f.val(), e = T(), t = setTimeout(function () { f.get(0) === document.activeElement && ($(), e == i.replace("?", "").length ? f.caret(0, e) : f.caret(e)) }, 10)) }).on("blur.mask", C).on("keydown.mask", function (e) { if (!f.prop("readonly")) { var t, i, s, o = e.which || e.keyCode; h = f.val(), 8 === o || 46 === o || n && 127 === o ? (i = (t = f.caret()).begin, (s = t.end) - i == 0 && (i = 46 !== o ? function (e) { for (; --e >= 0 && !l[e];); return e }(i) : s = w(i - 1), s = 46 === o ? w(s) : s), S(i, s), k(i, s - 1), e.preventDefault()) : 13 === o ? C.call(this, e) : 27 === o && (f.val(m), f.caret(0, T()), e.preventDefault()) } }).on("keypress.mask", function (t) { if (!f.prop("readonly")) { var i, n, s, r = t.which || t.keyCode, a = f.caret(); t.ctrlKey || t.altKey || t.metaKey || r < 32 || !r || 13 === r || (a.end - a.begin != 0 && (S(a.begin, a.end), k(a.begin, a.end - 1)), (i = w(a.begin - 1)) < p && (n = String.fromCharCode(r), l[i].test(n)) && (function (e) { var t, i, n, s; for (t = e, i = b(e) ; t < p; t++) if (l[t]) { if (n = w(t), s = g[t], g[t] = i, !(n < p && l[n].test(s))) break; i = s } }(i), g[i] = n, $(), s = w(i), o ? setTimeout(function () { e.proxy(e.fn.caret, f, s)() }, 0) : f.caret(s), a.begin <= u && y()), t.preventDefault()) } }).on("input.mask paste.mask", function () { f.prop("readonly") || setTimeout(function () { var e = T(!0); f.caret(e), y() }, 0) }), s && o && f.off("input.mask").on("input.mask", function (e) { var t = f.val(), i = f.caret(); if (h && h.length && h.length > t.length) { for (T(!0) ; i.begin > 0 && !l[i.begin - 1];) i.begin--; if (0 === i.begin) for (; i.begin < c && !l[i.begin];) i.begin++; f.caret(i.begin, i.begin) } else { T(!0); var n = t.charAt(i.begin); i.begin < p && (l[i.begin] ? l[i.begin].test(n) && i.begin++ : (i.begin++, l[i.begin].test(n) && i.begin++)), f.caret(i.begin, i.begin) } y() }), T() }) } }) }), function (e) { function t(e, t) { this.bearer = e, this.options = t, this.hideEvent, this.mouseOverMode = "hover" == this.options.trigger || "mouseover" == this.options.trigger || "onmouseover" == this.options.trigger } t.prototype = { show: function () { var e = this; this.options.modal && this.modalLayer.css("display", "block"), this.tooltip.css("display", "block"), e.mouseOverMode && (this.tooltip.mouseover(function () { clearTimeout(e.hideEvent) }), this.tooltip.mouseout(function () { clearTimeout(e.hideEvent), e.hide() })) }, hide: function () { var e = this; this.hideEvent = setTimeout(function () { e.tooltip.hide() }, 100), e.options.modal && e.modalLayer.hide(), this.options.onClose() }, toggle: function () { this.tooltip.is(":visible") ? this.hide() : this.show() }, addAnimation: function () { switch (this.options.animation) { case "none": break; case "fadeIn": this.tooltip.addClass("animated"), this.tooltip.addClass("fadeIn"); break; case "flipIn": this.tooltip.addClass("animated"), this.tooltip.addClass("flipIn") } }, setContent: function () { if (e(this.bearer).css("cursor", "pointer"), this.options.content) this.content = this.options.content; else { if (!this.bearer.attr("data-tooltip")) return; this.content = this.bearer.attr("data-tooltip") } if ("#" == this.content.charAt(0)) { if (this.options.delete_content) { var t = e(this.content).html(); e(this.content).html(""), this.content = t, delete t } else e(this.content).hide(), this.content = e(this.content).html(); this.contentType = "html" } else this.contentType = "text"; tooltipId = "", "" != this.bearer.attr("id") && (tooltipId = "id='darktooltip-" + this.bearer.attr("id") + "'"), this.modalLayer = e("<ins class='darktooltip-modal-layer'></ins>"), this.tooltip = e("<ins " + tooltipId + " class = 'dark-tooltip " + this.options.theme + " " + this.options.size + " " + this.options.gravity + "'><div>" + this.content + "</div><div class = 'tip'></div></ins>"), this.tip = this.tooltip.find(".tip"), e("body").append(this.modalLayer), e("body").append(this.tooltip), "html" == this.contentType && this.tooltip.css("max-width", "none"), this.tooltip.css("opacity", this.options.opacity), this.addAnimation(), this.options.confirm && this.addConfirm() }, setPositions: function () { var e = this.bearer.offset().left, t = this.bearer.offset().top; switch (this.options.gravity) { case "south": e += this.bearer.outerWidth() / 2 - this.tooltip.outerWidth() / 2, t += -this.tooltip.outerHeight() - this.tip.outerHeight() / 2; break; case "west": e += this.bearer.outerWidth() + this.tip.outerWidth() / 2, t += this.bearer.outerHeight() / 2 - this.tooltip.outerHeight() / 2; break; case "north": e += this.bearer.outerWidth() / 2 - this.tooltip.outerWidth() / 2, t += this.bearer.outerHeight() + this.tip.outerHeight() / 2; break; case "east": e += -this.tooltip.outerWidth() - this.tip.outerWidth() / 2, t += this.bearer.outerHeight() / 2 - this.tooltip.outerHeight() / 2 } this.options.autoLeft && this.tooltip.css("left", e), this.options.autoTop && this.tooltip.css("top", t) }, setEvents: function () { var t, i = this, n = i.options.hoverDelay; i.mouseOverMode ? this.bearer.mouseenter(function () { t = setTimeout(function () { i.setPositions(), i.show() }, n) }).mouseleave(function () { clearTimeout(t), i.hide() }) : "click" != this.options.trigger && "onclik" != this.options.trigger || (this.tooltip.click(function (e) { e.stopPropagation() }), this.bearer.click(function (e) { e.preventDefault(), i.setPositions(), i.toggle(), e.stopPropagation() }), e("html").click(function () { i.hide() })) }, activate: function () { this.setContent(), this.content && this.setEvents() }, addConfirm: function () { this.tooltip.append("<ul class = 'confirm'><li class = 'darktooltip-yes'>" + this.options.yes + "</li><li class = 'darktooltip-no'>" + this.options.no + "</li></ul>"), this.setConfirmEvents() }, setConfirmEvents: function () { var e = this; this.tooltip.find("li.darktooltip-yes").click(function (t) { e.onYes(), t.stopPropagation() }), this.tooltip.find("li.darktooltip-no").click(function (t) { e.onNo(), t.stopPropagation() }) }, finalMessage: function () { if (this.options.finalMessage) { var e = this; e.tooltip.find("div:first").html(this.options.finalMessage), e.tooltip.find("ul").remove(), e.setPositions(), setTimeout(function () { e.hide(), e.setContent() }, e.options.finalMessageDuration) } else this.hide() }, onYes: function () { this.options.onYes(this.bearer), this.finalMessage() }, onNo: function () { this.options.onNo(this.bearer), this.hide() } }, e.fn.darkTooltip = function (i) { return this.each(function () { i = e.extend({}, e.fn.darkTooltip.defaults, i), new t(e(this), i).activate() }) }, e.fn.darkTooltip.defaults = { animation: "none", confirm: !1, content: "", finalMessage: "", finalMessageDuration: 1e3, gravity: "south", hoverDelay: 0, modal: !1, no: "No", onNo: function () { }, onYes: function () { }, opacity: .9, size: "medium", theme: "dark", trigger: "hover", yes: "Yes", autoTop: !0, autoLeft: !0, onClose: function () { } } }(jQuery), function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery) }(function (e) { e.extend(e.fn, { validate: function (t) { if (this.length) { var i = e.data(this[0], "validator"); return i || (this.attr("novalidate", "novalidate"), i = new e.validator(t, this[0]), e.data(this[0], "validator", i), i.settings.onsubmit && (this.on("click.validate", ":submit", function (t) { i.settings.submitHandler && (i.submitButton = t.target), e(this).hasClass("cancel") && (i.cancelSubmit = !0), void 0 !== e(this).attr("formnovalidate") && (i.cancelSubmit = !0) }), this.on("submit.validate", function (t) { function n() { var n, s; return !i.settings.submitHandler || (i.submitButton && (n = e("<input type='hidden'/>").attr("name", i.submitButton.name).val(e(i.submitButton).val()).appendTo(i.currentForm)), s = i.settings.submitHandler.call(i, i.currentForm, t), i.submitButton && n.remove(), void 0 !== s && s) } return i.settings.debug && t.preventDefault(), i.cancelSubmit ? (i.cancelSubmit = !1, n()) : i.form() ? i.pendingRequest ? (i.formSubmitted = !0, !1) : n() : (i.focusInvalid(), !1) })), i) } t && t.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing.") }, valid: function () { var t, i, n; return e(this[0]).is("form") ? t = this.validate().form() : (n = [], t = !0, i = e(this[0].form).validate(), this.each(function () { t = i.element(this) && t, n = n.concat(i.errorList) }), i.errorList = n), t }, rules: function (t, i) { var n, s, o, r, a, l, d = this[0]; if (t) switch (s = (n = e.data(d.form, "validator").settings).rules, o = e.validator.staticRules(d), t) { case "add": e.extend(o, e.validator.normalizeRule(i)), delete o.messages, s[d.name] = o, i.messages && (n.messages[d.name] = e.extend(n.messages[d.name], i.messages)); break; case "remove": return i ? (l = {}, e.each(i.split(/\s/), function (t, i) { l[i] = o[i], delete o[i], "required" === i && e(d).removeAttr("aria-required") }), l) : (delete s[d.name], o) } return (r = e.validator.normalizeRules(e.extend({}, e.validator.classRules(d), e.validator.attributeRules(d), e.validator.dataRules(d), e.validator.staticRules(d)), d)).required && (a = r.required, delete r.required, r = e.extend({ required: a }, r), e(d).attr("aria-required", "true")), r.remote && (a = r.remote, delete r.remote, r = e.extend(r, { remote: a })), r } }), e.extend(e.expr[":"], { blank: function (t) { return !e.trim("" + e(t).val()) }, filled: function (t) { return !!e.trim("" + e(t).val()) }, unchecked: function (t) { return !e(t).prop("checked") } }), e.validator = function (t, i) { this.settings = e.extend(!0, {}, e.validator.defaults, t), this.currentForm = i, this.init() }, e.validator.format = function (t, i) { return 1 === arguments.length ? function () { var i = e.makeArray(arguments); return i.unshift(t), e.validator.format.apply(this, i) } : (arguments.length > 2 && i.constructor !== Array && (i = e.makeArray(arguments).slice(1)), i.constructor !== Array && (i = [i]), e.each(i, function (e, i) { t = t.replace(new RegExp("\\{" + e + "\\}", "g"), function () { return i }) }), t) }, e.extend(e.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusCleanup: !1, focusInvalid: !0, errorContainer: e([]), errorLabelContainer: e([]), onsubmit: !0, ignore: ":hidden", ignoreTitle: !1, onfocusin: function (e) { this.lastActive = e, this.settings.focusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, e, this.settings.errorClass, this.settings.validClass), this.hideThese(this.errorsFor(e))) }, onfocusout: function (e) { this.checkable(e) || !(e.name in this.submitted) && this.optional(e) || this.element(e) }, onkeyup: function (t, i) { 9 === i.which && "" === this.elementValue(t) || -1 !== e.inArray(i.keyCode, [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225]) || (t.name in this.submitted || t === this.lastElement) && this.element(t) }, onclick: function (e) { e.name in this.submitted ? this.element(e) : e.parentNode.name in this.submitted && this.element(e.parentNode) }, highlight: function (t, i, n) { "radio" === t.type ? this.findByName(t.name).addClass(i).removeClass(n) : e(t).addClass(i).removeClass(n) }, unhighlight: function (t, i, n) { "radio" === t.type ? this.findByName(t.name).removeClass(i).addClass(n) : e(t).removeClass(i).addClass(n) } }, setDefaults: function (t) { e.extend(e.validator.defaults, t) }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date ( ISO ).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", maxlength: e.validator.format("Please enter no more than {0} characters."), minlength: e.validator.format("Please enter at least {0} characters."), rangelength: e.validator.format("Please enter a value between {0} and {1} characters long."), range: e.validator.format("Please enter a value between {0} and {1}."), max: e.validator.format("Please enter a value less than or equal to {0}."), min: e.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: !1, prototype: { init: function () { this.labelContainer = e(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || e(this.currentForm), this.containers = e(this.settings.errorContainer).add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset(); var t, i = this.groups = {}; function n(t) { var i = e.data(this.form, "validator"), n = "on" + t.type.replace(/^validate/, ""), s = i.settings; s[n] && !e(this).is(s.ignore) && s[n].call(i, this, t) } e.each(this.settings.groups, function (t, n) { "string" == typeof n && (n = n.split(/\s/)), e.each(n, function (e, n) { i[n] = t }) }), t = this.settings.rules, e.each(t, function (i, n) { t[i] = e.validator.normalizeRule(n) }), e(this.currentForm).on("focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']", n).on("click.validate", "select, option, [type='radio'], [type='checkbox']", n), this.settings.invalidHandler && e(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler), e(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true") }, form: function () { return this.checkForm(), e.extend(this.submitted, this.errorMap), this.invalid = e.extend({}, this.errorMap), this.valid() || e(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid() }, checkForm: function () { this.prepareForm(); for (var e = 0, t = this.currentElements = this.elements() ; t[e]; e++) this.check(t[e]); return this.valid() }, element: function (t) { var i = this.clean(t), n = this.validationTargetFor(i), s = !0; return this.lastElement = n, void 0 === n ? delete this.invalid[i.name] : (this.prepareElement(n), this.currentElements = e(n), (s = !1 !== this.check(n)) ? delete this.invalid[n.name] : this.invalid[n.name] = !0), e(t).attr("aria-invalid", !s), this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), s }, showErrors: function (t) { if (t) { e.extend(this.errorMap, t), this.errorList = []; for (var i in t) this.errorList.push({ message: t[i], element: this.findByName(i)[0] }); this.successList = e.grep(this.successList, function (e) { return !(e.name in t) }) } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors() }, resetForm: function () { e.fn.resetForm && e(this.currentForm).resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(); var t, i = this.elements().removeData("previousValue").removeAttr("aria-invalid"); if (this.settings.unhighlight) for (t = 0; i[t]; t++) this.settings.unhighlight.call(this, i[t], this.settings.errorClass, ""); else i.removeClass(this.settings.errorClass) }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (e) { var t, i = 0; for (t in e) i++; return i }, hideErrors: function () { this.hideThese(this.toHide) }, hideThese: function (e) { e.not(this.containers).text(""), this.addWrapper(e).hide() }, valid: function () { return 0 === this.size() }, size: function () { return this.errorList.length }, focusInvalid: function () { if (this.settings.focusInvalid) try { e(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (e) { } }, findLastActive: function () { var t = this.lastActive; return t && 1 === e.grep(this.errorList, function (e) { return e.element.name === t.name }).length && t }, elements: function () { var t = this, i = {}; return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function () { return !this.name && t.settings.debug && window.console && console.error("%o has no name assigned", this), !(this.name in i || !t.objectLength(e(this).rules())) && (i[this.name] = !0, !0) }) }, clean: function (t) { return e(t)[0] }, errors: function () { var t = this.settings.errorClass.split(" ").join("."); return e(this.settings.errorElement + "." + t, this.errorContext) }, reset: function () { this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = e([]), this.toHide = e([]), this.currentElements = e([]) }, prepareForm: function () { this.reset(), this.toHide = this.errors().add(this.containers) }, prepareElement: function (e) { this.reset(), this.toHide = this.errorsFor(e) }, elementValue: function (t) { var i, n = e(t), s = t.type; return "radio" === s || "checkbox" === s ? this.findByName(t.name).filter(":checked").val() : "number" === s && void 0 !== t.validity ? !t.validity.badInput && n.val() : "string" == typeof (i = n.val()) ? i.replace(/\r/g, "") : i }, check: function (t) { t = this.validationTargetFor(this.clean(t)); var i, n, s, o = e(t).rules(), r = e.map(o, function (e, t) { return t }).length, a = !1, l = this.elementValue(t); for (n in o) { s = { method: n, parameters: o[n] }; try { if ("dependency-mismatch" === (i = e.validator.methods[n].call(this, l, t, s.parameters)) && 1 === r) { a = !0; continue } if (a = !1, "pending" === i) return void (this.toHide = this.toHide.not(this.errorsFor(t))); if (!i) return this.formatAndAdd(t, s), !1 } catch (e) { throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + t.id + ", check the '" + s.method + "' method.", e), e instanceof TypeError && (e.message += ".  Exception occurred when checking element " + t.id + ", check the '" + s.method + "' method."), e } } if (!a) return this.objectLength(o) && this.successList.push(t), !0 }, customDataMessage: function (t, i) { return e(t).data("msg" + i.charAt(0).toUpperCase() + i.substring(1).toLowerCase()) || e(t).data("msg") }, customMessage: function (e, t) { var i = this.settings.messages[e]; return i && (i.constructor === String ? i : i[t]) }, findDefined: function () { for (var e = 0; e < arguments.length; e++) if (void 0 !== arguments[e]) return arguments[e] }, defaultMessage: function (t, i) { return this.findDefined(this.customMessage(t.name, i), this.customDataMessage(t, i), !this.settings.ignoreTitle && t.title || void 0, e.validator.messages[i], "<strong>Warning: No message defined for " + t.name + "</strong>") }, formatAndAdd: function (t, i) { var n = this.defaultMessage(t, i.method), s = /\$?\{(\d+)\}/g; "function" == typeof n ? n = n.call(this, i.parameters, t) : s.test(n) && (n = e.validator.format(n.replace(s, "{$1}"), i.parameters)), this.errorList.push({ message: n, element: t, method: i.method }), this.errorMap[t.name] = n, this.submitted[t.name] = n }, addWrapper: function (e) { return this.settings.wrapper && (e = e.add(e.parent(this.settings.wrapper))), e }, defaultShowErrors: function () { var e, t, i; for (e = 0; this.errorList[e]; e++) i = this.errorList[e], this.settings.highlight && this.settings.highlight.call(this, i.element, this.settings.errorClass, this.settings.validClass), this.showLabel(i.element, i.message); if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success) for (e = 0; this.successList[e]; e++) this.showLabel(this.successList[e]); if (this.settings.unhighlight) for (e = 0, t = this.validElements() ; t[e]; e++) this.settings.unhighlight.call(this, t[e], this.settings.errorClass, this.settings.validClass); this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow).show() }, validElements: function () { return this.currentElements.not(this.invalidElements()) }, invalidElements: function () { return e(this.errorList).map(function () { return this.element }) }, showLabel: function (t, i) { var n, s, o, r = this.errorsFor(t), a = this.idOrName(t), l = e(t).attr("aria-describedby"); r.length ? (r.removeClass(this.settings.validClass).addClass(this.settings.errorClass), r.html(i)) : (n = r = e("<" + this.settings.errorElement + ">").attr("id", a + "-error").addClass(this.settings.errorClass).html(i || ""), this.settings.wrapper && (n = r.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.length ? this.labelContainer.append(n) : this.settings.errorPlacement ? this.settings.errorPlacement(n, e(t)) : n.insertAfter(t), r.is("label") ? r.attr("for", a) : 0 === r.parents("label[for='" + a + "']").length && (o = r.attr("id").replace(/(:|\.|\[|\]|\$)/g, "\\$1"), l ? l.match(new RegExp("\\b" + o + "\\b")) || (l += " " + o) : l = o, e(t).attr("aria-describedby", l), (s = this.groups[t.name]) && e.each(this.groups, function (t, i) { i === s && e("[name='" + t + "']", this.currentForm).attr("aria-describedby", r.attr("id")) }))), !i && this.settings.success && (r.text(""), "string" == typeof this.settings.success ? r.addClass(this.settings.success) : this.settings.success(r, t)), this.toShow = this.toShow.add(r) }, errorsFor: function (t) { var i = this.idOrName(t), n = e(t).attr("aria-describedby"), s = "label[for='" + i + "'], label[for='" + i + "'] *"; return n && (s = s + ", #" + n.replace(/\s+/g, ", #")), this.errors().filter(s) }, idOrName: function (e) { return this.groups[e.name] || (this.checkable(e) ? e.name : e.id || e.name) }, validationTargetFor: function (t) { return this.checkable(t) && (t = this.findByName(t.name)), e(t).not(this.settings.ignore)[0] }, checkable: function (e) { return /radio|checkbox/i.test(e.type) }, findByName: function (t) { return e(this.currentForm).find("[name='" + t + "']") }, getLength: function (t, i) { switch (i.nodeName.toLowerCase()) { case "select": return e("option:selected", i).length; case "input": if (this.checkable(i)) return this.findByName(i.name).filter(":checked").length } return t.length }, depend: function (e, t) { return !this.dependTypes[typeof e] || this.dependTypes[typeof e](e, t) }, dependTypes: { boolean: function (e) { return e }, string: function (t, i) { return !!e(t, i.form).length }, function: function (e, t) { return e(t) } }, optional: function (t) { var i = this.elementValue(t); return !e.validator.methods.required.call(this, i, t) && "dependency-mismatch" }, startRequest: function (e) { this.pending[e.name] || (this.pendingRequest++, this.pending[e.name] = !0) }, stopRequest: function (t, i) { this.pendingRequest--, this.pendingRequest < 0 && (this.pendingRequest = 0), delete this.pending[t.name], i && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (e(this.currentForm).submit(), this.formSubmitted = !1) : !i && 0 === this.pendingRequest && this.formSubmitted && (e(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1) }, previousValue: function (t) { return e.data(t, "previousValue") || e.data(t, "previousValue", { old: null, valid: !0, message: this.defaultMessage(t, "remote") }) }, destroy: function () { this.resetForm(), e(this.currentForm).off(".validate").removeData("validator") } }, classRuleSettings: { required: { required: !0 }, email: { email: !0 }, url: { url: !0 }, date: { date: !0 }, dateISO: { dateISO: !0 }, number: { number: !0 }, digits: { digits: !0 }, creditcard: { creditcard: !0 } }, addClassRules: function (t, i) { t.constructor === String ? this.classRuleSettings[t] = i : e.extend(this.classRuleSettings, t) }, classRules: function (t) { var i = {}, n = e(t).attr("class"); return n && e.each(n.split(" "), function () { this in e.validator.classRuleSettings && e.extend(i, e.validator.classRuleSettings[this]) }), i }, normalizeAttributeRule: function (e, t, i, n) { /min|max/.test(i) && (null === t || /number|range|text/.test(t)) && (n = Number(n), isNaN(n) && (n = void 0)), n || 0 === n ? e[i] = n : t === i && "range" !== t && (e[i] = !0) }, attributeRules: function (t) { var i, n, s = {}, o = e(t), r = t.getAttribute("type"); for (i in e.validator.methods) "required" === i ? ("" === (n = t.getAttribute(i)) && (n = !0), n = !!n) : n = o.attr(i), this.normalizeAttributeRule(s, r, i, n); return s.maxlength && /-1|2147483647|524288/.test(s.maxlength) && delete s.maxlength, s }, dataRules: function (t) { var i, n, s = {}, o = e(t), r = t.getAttribute("type"); for (i in e.validator.methods) n = o.data("rule" + i.charAt(0).toUpperCase() + i.substring(1).toLowerCase()), this.normalizeAttributeRule(s, r, i, n); return s }, staticRules: function (t) { var i = {}, n = e.data(t.form, "validator"); return n.settings.rules && (i = e.validator.normalizeRule(n.settings.rules[t.name]) || {}), i }, normalizeRules: function (t, i) { return e.each(t, function (n, s) { if (!1 !== s) { if (s.param || s.depends) { var o = !0; switch (typeof s.depends) { case "string": o = !!e(s.depends, i.form).length; break; case "function": o = s.depends.call(i, i) } o ? t[n] = void 0 === s.param || s.param : delete t[n] } } else delete t[n] }), e.each(t, function (n, s) { t[n] = e.isFunction(s) ? s(i) : s }), e.each(["minlength", "maxlength"], function () { t[this] && (t[this] = Number(t[this])) }), e.each(["rangelength", "range"], function () { var i; t[this] && (e.isArray(t[this]) ? t[this] = [Number(t[this][0]), Number(t[this][1])] : "string" == typeof t[this] && (i = t[this].replace(/[\[\]]/g, "").split(/[\s,]+/), t[this] = [Number(i[0]), Number(i[1])])) }), e.validator.autoCreateRanges && (null != t.min && null != t.max && (t.range = [t.min, t.max], delete t.min, delete t.max), null != t.minlength && null != t.maxlength && (t.rangelength = [t.minlength, t.maxlength], delete t.minlength, delete t.maxlength)), t }, normalizeRule: function (t) { if ("string" == typeof t) { var i = {}; e.each(t.split(/\s/), function () { i[this] = !0 }), t = i } return t }, addMethod: function (t, i, n) { e.validator.methods[t] = i, e.validator.messages[t] = void 0 !== n ? n : e.validator.messages[t], i.length < 3 && e.validator.addClassRules(t, e.validator.normalizeRule(t)) }, methods: { required: function (t, i, n) { if (!this.depend(n, i)) return "dependency-mismatch"; if ("select" === i.nodeName.toLowerCase()) { var s = e(i).val(); return s && s.length > 0 } return this.checkable(i) ? this.getLength(t, i) > 0 : t.length > 0 }, email: function (e, t) { return this.optional(t) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e) }, url: function (e, t) { return this.optional(t) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e) }, date: function (e, t) { return this.optional(t) || !/Invalid|NaN/.test(new Date(e).toString()) }, dateISO: function (e, t) { return this.optional(t) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(e) }, number: function (e, t) { return this.optional(t) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e) }, digits: function (e, t) { return this.optional(t) || /^\d+$/.test(e) }, creditcard: function (e, t) { if (this.optional(t)) return "dependency-mismatch"; if (/[^0-9 \-]+/.test(e)) return !1; var i, n, s = 0, o = 0, r = !1; if ((e = e.replace(/\D/g, "")).length < 13 || e.length > 19) return !1; for (i = e.length - 1; i >= 0; i--) n = e.charAt(i), o = parseInt(n, 10), r && (o *= 2) > 9 && (o -= 9), s += o, r = !r; return s % 10 == 0 }, minlength: function (t, i, n) { var s = e.isArray(t) ? t.length : this.getLength(t, i); return this.optional(i) || s >= n }, maxlength: function (t, i, n) { var s = e.isArray(t) ? t.length : this.getLength(t, i); return this.optional(i) || s <= n }, rangelength: function (t, i, n) { var s = e.isArray(t) ? t.length : this.getLength(t, i); return this.optional(i) || s >= n[0] && s <= n[1] }, min: function (e, t, i) { return this.optional(t) || e >= i }, max: function (e, t, i) { return this.optional(t) || e <= i }, range: function (e, t, i) { return this.optional(t) || e >= i[0] && e <= i[1] }, equalTo: function (t, i, n) { var s = e(n); return this.settings.onfocusout && s.off(".validate-equalTo").on("blur.validate-equalTo", function () { e(i).valid() }), t === s.val() }, remote: function (t, i, n) { if (this.optional(i)) return "dependency-mismatch"; var s, o, r = this.previousValue(i); return this.settings.messages[i.name] || (this.settings.messages[i.name] = {}), r.originalMessage = this.settings.messages[i.name].remote, this.settings.messages[i.name].remote = r.message, n = "string" == typeof n && { url: n } || n, r.old === t ? r.valid : (r.old = t, s = this, this.startRequest(i), (o = {})[i.name] = t, e.ajax(e.extend(!0, { mode: "abort", port: "validate" + i.name, dataType: "json", data: o, context: s.currentForm, success: function (n) { var o, a, l, d = !0 === n || "true" === n; s.settings.messages[i.name].remote = r.originalMessage, d ? (l = s.formSubmitted, s.prepareElement(i), s.formSubmitted = l, s.successList.push(i), delete s.invalid[i.name], s.showErrors()) : (o = {}, a = n || s.defaultMessage(i, "remote"), o[i.name] = r.message = e.isFunction(a) ? a(t) : a, s.invalid[i.name] = !0, s.showErrors(o)), r.valid = d, s.stopRequest(i, d) } }, n)), "pending") } } }); var t, i = {}; e.ajaxPrefilter ? e.ajaxPrefilter(function (e, t, n) { var s = e.port; "abort" === e.mode && (i[s] && i[s].abort(), i[s] = n) }) : (t = e.ajax, e.ajax = function (n) { var s = ("mode" in n ? n : e.ajaxSettings).mode, o = ("port" in n ? n : e.ajaxSettings).port; return "abort" === s ? (i[o] && i[o].abort(), i[o] = t.apply(this, arguments), i[o]) : t.apply(this, arguments) }) }), function (e) { var t = e(window); e.fn.visible = function (e, i, n) { if (!(this.length < 1)) { var s = this.length > 1 ? this.eq(0) : this, o = s.get(0), r = t.width(), a = t.height(), l = (n = n || "both", !0 !== i || o.offsetWidth * o.offsetHeight); if ("function" == typeof o.getBoundingClientRect) { var d = o.getBoundingClientRect(), c = d.top >= 0 && d.top < a, u = d.bottom > 0 && d.bottom <= a, p = d.left >= 0 && d.left < r, h = d.right > 0 && d.right <= r, f = e ? c || u : c && u, g = e ? p || h : p && h; if ("both" === n) return l && f && g; if ("vertical" === n) return l && f; if ("horizontal" === n) return l && g } else { var v = t.scrollTop(), m = v + a, y = t.scrollLeft(), b = y + r, w = s.offset(), k = w.top, C = k + s.height(), S = w.left, $ = S + s.width(), T = !0 === e ? C : k, x = !0 === e ? k : C, A = !0 === e ? $ : S, O = !0 === e ? S : $; if ("both" === n) return !!l && m >= x && T >= v && b >= O && A >= y; if ("vertical" === n) return !!l && m >= x && T >= v; if ("horizontal" === n) return !!l && b >= O && A >= y } } } }(jQuery), function (e) { if ("function" == typeof define && define.amd) define(e); else if ("object" == typeof exports) module.exports = e(); else { var t = window.Cookies, i = window.Cookies = e(); i.noConflict = function () { return window.Cookies = t, i } } }(function () { function e() { for (var e = 0, t = {}; e < arguments.length; e++) { var i = arguments[e]; for (var n in i) t[n] = i[n] } return t } return function t(i) { function n(t, s, o) { var r; if (arguments.length > 1) { if ("number" == typeof (o = e({ path: "/" }, n.defaults, o)).expires) { var a = new Date; a.setMilliseconds(a.getMilliseconds() + 864e5 * o.expires), o.expires = a } try { r = JSON.stringify(s), /^[\{\[]/.test(r) && (s = r) } catch (e) { } return s = (s = encodeURIComponent(String(s))).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), t = (t = (t = encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)).replace(/[\(\)]/g, escape), document.cookie = [t, "=", s, o.expires && "; expires=" + o.expires.toUTCString(), o.path && "; path=" + o.path, o.domain && "; domain=" + o.domain, o.secure ? "; secure" : ""].join("") } t || (r = {}); for (var l = document.cookie ? document.cookie.split("; ") : [], d = /(%[0-9A-Z]{2})+/g, c = 0; c < l.length; c++) { var u = l[c].split("="), p = u[0].replace(d, decodeURIComponent), h = u.slice(1).join("="); '"' === h.charAt(0) && (h = h.slice(1, -1)); try { if (h = i && i(h, p) || h.replace(d, decodeURIComponent), this.json) try { h = JSON.parse(h) } catch (e) { } if (t === p) { r = h; break } t || (r[p] = h) } catch (e) { } } return r } return n.get = n.set = n, n.getJSON = function () { return n.apply({ json: !0 }, [].slice.call(arguments)) }, n.defaults = {}, n.remove = function (t, i) { n(t, "", e(i, { expires: -1 })) }, n.withConverter = t, n }() }), function (e) { var t, i, n, s, o, r, a, l = navigator.userAgent; e.HTMLPictureElement && /ecko/.test(l) && l.match(/rv\:(\d+)/) && RegExp.$1 < 41 && addEventListener("resize", (i = document.createElement("source"), n = function (e) { var t, n, s = e.parentNode; "PICTURE" === s.nodeName.toUpperCase() ? (t = i.cloneNode(), s.insertBefore(t, s.firstElementChild), setTimeout(function () { s.removeChild(t) })) : (!e._pfLastSize || e.offsetWidth > e._pfLastSize) && (e._pfLastSize = e.offsetWidth, n = e.sizes, e.sizes += ",100vw", setTimeout(function () { e.sizes = n })) }, s = function () { var e, t = document.querySelectorAll("picture > img, img[srcset][sizes]"); for (e = 0; e < t.length; e++) n(t[e]) }, o = function () { clearTimeout(t), t = setTimeout(s, 99) }, r = e.matchMedia && matchMedia("(orientation: landscape)"), a = function () { o(), r && r.addListener && r.addListener(o) }, i.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", /^[c|i]|d$/.test(document.readyState || "") ? a() : document.addEventListener("DOMContentLoaded", a), o)) }(window), function (e, t, i) { "use strict"; var n, s, o; t.createElement("picture"); var r = {}, a = function () { }, l = t.createElement("img"), d = l.getAttribute, c = l.setAttribute, u = l.removeAttribute, p = t.documentElement, h = {}, f = { algorithm: "" }, g = "data-pfsrc", v = g + "set", m = navigator.userAgent, y = /rident/.test(m) || /ecko/.test(m) && m.match(/rv\:(\d+)/) && RegExp.$1 > 35, b = "currentSrc", w = /\s+\+?\d+(e\d+)?w/, k = /(\([^)]+\))?\s*(.+)/, C = e.picturefillCFG, S = "font-size:100%!important;", $ = !0, T = {}, x = {}, A = e.devicePixelRatio, O = { px: 1, in: 96 }, D = t.createElement("a"), E = !1, I = /^[ \t\n\r\u000c]+/, P = /^[, \t\n\r\u000c]+/, _ = /^[^ \t\n\r\u000c]+/, z = /[,]+$/, L = /^\d+$/, F = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/, R = function (e, t, i, n) { e.addEventListener ? e.addEventListener(t, i, n || !1) : e.attachEvent && e.attachEvent("on" + t, i) }, H = function (e) { var t = {}; return function (i) { return i in t || (t[i] = e(i)), t[i] } }; function j(e) { return " " === e || "\t" === e || "\n" === e || "\f" === e || "\r" === e } var M, N, q, W, B, U, V, K, X, Y, Q, G, Z, J, ee, te = (M = /^([\d\.]+)(em|vw|px)$/, N = H(function (e) { return "return " + function () { for (var e = arguments, t = 0, i = e[0]; ++t in e;) i = i.replace(e[t], e[++t]); return i }((e || "").toLowerCase(), /\band\b/g, "&&", /,/g, "||", /min-([a-z-\s]+):/g, "e.$1>=", /max-([a-z-\s]+):/g, "e.$1<=", /calc([^)]+)/g, "($1)", /(\d+[\.]*[\d]*)([a-z]+)/g, "($1 * e.$2)", /^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi, "") + ";" }), function (e, t) { var i; if (!(e in T)) if (T[e] = !1, t && (i = e.match(M))) T[e] = i[1] * O[i[2]]; else try { T[e] = new Function("e", N(e))(O) } catch (e) { } return T[e] }), ie = function (e, t) { return e.w ? (e.cWidth = r.calcListLength(t || "100vw"), e.res = e.w / e.cWidth) : e.res = e.d, e }, ne = function (e) { var i, n, s, o = e || {}; if (o.elements && 1 === o.elements.nodeType && ("IMG" === o.elements.nodeName.toUpperCase() ? o.elements = [o.elements] : (o.context = o.elements, o.elements = null)), s = (i = o.elements || r.qsa(o.context || t, o.reevaluate || o.reselect ? r.sel : r.selShort)).length) { for (r.setupRun(o), E = !0, n = 0; n < s; n++) r.fillImg(i[n], o); r.teardownRun(o) } }; function se(e, t) { return e.res - t.res } function oe(e, t) { var i, n, s; if (e && t) for (s = r.parseSet(t), e = r.makeUrl(e), i = 0; i < s.length; i++) if (e === r.makeUrl(s[i].url)) { n = s[i]; break } return n } e.console && console.warn, b in l || (b = "src"), h["image/jpeg"] = !0, h["image/gif"] = !0, h["image/png"] = !0, h["image/svg+xml"] = t.implementation.hasFeature("http://wwwindow.w3.org/TR/SVG11/feature#Image", "1.1"), r.ns = ("pf" + (new Date).getTime()).substr(0, 9), r.supSrcset = "srcset" in l, r.supSizes = "sizes" in l, r.selShort = "picture>img,img[srcset]", r.sel = r.selShort, r.cfg = f, r.supSrcset && (r.sel += ",img[" + v + "]"), r.DPR = A || 1, r.u = O, r.types = h, s = r.supSrcset && !r.supSizes, r.setSize = a, r.makeUrl = H(function (e) { return D.href = e, D.href }), r.qsa = function (e, t) { return e.querySelectorAll(t) }, r.matchesMedia = function () { return e.matchMedia && (matchMedia("(min-width: 0.1em)") || {}).matches ? r.matchesMedia = function (e) { return !e || matchMedia(e).matches } : r.matchesMedia = r.mMQ, r.matchesMedia.apply(this, arguments) }, r.mMQ = function (e) { return !e || te(e) }, r.calcLength = function (e) { var t = te(e, !0) || !1; return t < 0 && (t = !1), t }, r.supportsType = function (e) { return !e || h[e] }, r.parseSize = H(function (e) { var t = (e || "").match(k); return { media: t && t[1], length: t && t[2] } }), r.parseSet = function (e) { return e.cands || (e.cands = function (e, t) { function i(t) { var i, n = t.exec(e.substring(d)); if (n) return i = n[0], d += i.length, i } var n, s, o, r, a, l = e.length, d = 0, c = []; function u() { var e, i, o, r, a, l, d, u, p, h = !1, f = {}; for (r = 0; r < s.length; r++) l = (a = s[r])[a.length - 1], d = a.substring(0, a.length - 1), u = parseInt(d, 10), p = parseFloat(d), L.test(d) && "w" === l ? ((e || i) && (h = !0), 0 === u ? h = !0 : e = u) : F.test(d) && "x" === l ? ((e || i || o) && (h = !0), p < 0 ? h = !0 : i = p) : L.test(d) && "h" === l ? ((o || i) && (h = !0), 0 === u ? h = !0 : o = u) : h = !0; h || (f.url = n, e && (f.w = e), i && (f.d = i), o && (f.h = o), o || i || e || (f.d = 1), 1 === f.d && (t.has1x = !0), f.set = t, c.push(f)) } function p() { for (i(I), o = "", r = "in descriptor"; ;) { if (a = e.charAt(d), "in descriptor" === r) if (j(a)) o && (s.push(o), o = "", r = "after descriptor"); else { if ("," === a) return d += 1, o && s.push(o), void u(); if ("(" === a) o += a, r = "in parens"; else { if ("" === a) return o && s.push(o), void u(); o += a } } else if ("in parens" === r) if (")" === a) o += a, r = "in descriptor"; else { if ("" === a) return s.push(o), void u(); o += a } else if ("after descriptor" === r) if (j(a)); else { if ("" === a) return void u(); r = "in descriptor", d -= 1 } d += 1 } } for (; ;) { if (i(P), d >= l) return c; n = i(_), s = [], "," === n.slice(-1) ? (n = n.replace(z, ""), u()) : p() } }(e.srcset, e)), e.cands }, r.getEmValue = function () { var e; if (!n && (e = t.body)) { var i = t.createElement("div"), s = p.style.cssText, o = e.style.cssText; i.style.cssText = "position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)", p.style.cssText = S, e.style.cssText = S, e.appendChild(i), n = i.offsetWidth, e.removeChild(i), n = parseFloat(n, 10), p.style.cssText = s, e.style.cssText = o } return n || 16 }, r.calcListLength = function (e) { if (!(e in x) || f.uT) { var t = r.calcLength(function (e) { var t, n, s, o, a, l, d, c = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i, u = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i; for (s = (n = function (e) { var t, n = "", s = [], o = [], r = 0, a = 0, l = !1; function d() { n && (s.push(n), n = "") } function c() { s[0] && (o.push(s), s = []) } for (; ;) { if ((t = e[a]) === i) return d(), c(), o; if (l) { if ("*" === t && "/" === e[a + 1]) { l = !1, a += 2, d(); continue } a += 1 } else { if (j(t)) { if (e[a - 1] && j(e[a - 1]) || !n) { a += 1; continue } if (0 === r) { d(), a += 1; continue } t = " " } else if ("(" === t) r += 1; else if (")" === t) r -= 1; else { if ("," === t) { d(), c(), a += 1; continue } if ("/" === t && "*" === e[a + 1]) { l = !0, a += 2; continue } } n += t, a += 1 } } }(e)).length, t = 0; t < s; t++) if (a = (o = n[t])[o.length - 1], d = a, c.test(d) && parseFloat(d) >= 0 || u.test(d) || "0" === d || "-0" === d || "+0" === d) { if (l = a, o.pop(), 0 === o.length) return l; if (o = o.join(" "), r.matchesMedia(o)) return l } return "100vw" }(e)); x[e] = t || O.width } return x[e] }, r.setRes = function (e) { var t; if (e) for (var i = 0, n = (t = r.parseSet(e)).length; i < n; i++) ie(t[i], e.sizes); return t }, r.setRes.res = ie, r.applySetCandidate = function (e, t) { if (e.length) { var i, n, s, o, a, l, d, c, u, p, h, g, v, m, w, k, C, S, $, T, x = t[r.ns], A = r.DPR; if (l = x.curSrc || t[b], (d = x.curCan || (p = t, h = l, !(g = e[0].set) && h && (g = (g = p[r.ns].sets) && g[g.length - 1]), (v = oe(h, g)) && (h = r.makeUrl(h), p[r.ns].curSrc = h, p[r.ns].curCan = v, v.res || ie(v, v.set.sizes)), v)) && d.set === e[0].set && ((u = y && !t.complete && d.res - .1 > A) || (d.cached = !0)), !a) for (e.sort(se), a = e[(o = e.length) - 1], n = 0; n < o; n++) if ((i = e[n]).res >= A) { a = e[s = n - 1] && (u || l !== r.makeUrl(i.url)) && (m = e[s].res, w = i.res, k = A, C = e[s].cached, S = void 0, $ = void 0, T = void 0, "saveData" === f.algorithm ? m > 2.7 ? T = k + 1 : ($ = (w - k) * (S = Math.pow(m - .6, 1.5)), C && ($ += .1 * S), T = m + $) : T = k > 1 ? Math.sqrt(m * w) : m, T > k) ? e[s] : i; break } a && (c = r.makeUrl(a.url), x.curSrc = c, x.curCan = a, c !== l && r.setSrc(t, a), r.setSize(t)) } }, r.setSrc = function (e, t) { var i; e.src = t.url, "image/svg+xml" === t.set.type && (i = e.style.width, e.style.width = e.offsetWidth + 1 + "px", e.offsetWidth + 1 && (e.style.width = i)) }, r.getSet = function (e) { var t, i, n, s = !1, o = e[r.ns].sets; for (t = 0; t < o.length && !s; t++) if ((i = o[t]).srcset && r.matchesMedia(i.media) && (n = r.supportsType(i.type))) { "pending" === n && (i = n), s = i; break } return s }, r.parseSets = function (e, t, n) { var o, a, l, p, h = t && "PICTURE" === t.nodeName.toUpperCase(), f = e[r.ns]; (f.src === i || n.src) && (f.src = d.call(e, "src"), f.src ? c.call(e, g, f.src) : u.call(e, g)), (f.srcset === i || n.srcset || !r.supSrcset || e.srcset) && (o = d.call(e, "srcset"), f.srcset = o, p = !0), f.sets = [], h && (f.pic = !0, function (e, t) { var i, n, s, o, a = e.getElementsByTagName("source"); for (i = 0, n = a.length; i < n; i++) (s = a[i])[r.ns] = !0, (o = s.getAttribute("srcset")) && t.push({ srcset: o, media: s.getAttribute("media"), type: s.getAttribute("type"), sizes: s.getAttribute("sizes") }) }(t, f.sets)), f.srcset ? (a = { srcset: f.srcset, sizes: d.call(e, "sizes") }, f.sets.push(a), (l = (s || f.src) && w.test(f.srcset || "")) || !f.src || oe(f.src, a) || a.has1x || (a.srcset += ", " + f.src, a.cands.push({ url: f.src, d: 1, set: a }))) : f.src && f.sets.push({ srcset: f.src, sizes: null }), f.curCan = null, f.curSrc = i, f.supported = !(h || a && !r.supSrcset || l), p && r.supSrcset && !f.supported && (o ? (c.call(e, v, o), e.srcset = "") : u.call(e, v)), f.supported && !f.srcset && (!f.src && e.src || e.src !== r.makeUrl(f.src)) && (null === f.src ? e.removeAttribute("src") : e.src = f.src), f.parsed = !0 }, r.fillImg = function (e, t) { var i, n, s, a, l, d = t.reselect || t.reevaluate; (e[r.ns] || (e[r.ns] = {}), i = e[r.ns], d || i.evaled !== o) && (i.parsed && !t.reevaluate || r.parseSets(e, e.parentNode, t), i.supported ? i.evaled = o : (n = e, a = r.getSet(n), l = !1, "pending" !== a && (l = o, a && (s = r.setRes(a), r.applySetCandidate(s, n))), n[r.ns].evaled = l)) }, r.setupRun = function () { E && !$ && A === e.devicePixelRatio || ($ = !1, A = e.devicePixelRatio, T = {}, x = {}, r.DPR = A || 1, O.width = Math.max(e.innerWidth || 0, p.clientWidth), O.height = Math.max(e.innerHeight || 0, p.clientHeight), O.vw = O.width / 100, O.vh = O.height / 100, o = [O.height, O.width, A].join("-"), O.em = r.getEmValue(), O.rem = O.em) }, e.HTMLPictureElement ? (ne = a, r.fillImg = a) : (G = e.attachEvent ? /d$|^c/ : /d$|^c|^i/, Z = function () { var e = t.readyState || ""; J = setTimeout(Z, "loading" === e ? 200 : 999), t.body && (r.fillImgs(), (q = q || G.test(e)) && clearTimeout(J)) }, J = setTimeout(Z, t.body ? 9 : 99), ee = p.clientHeight, R(e, "resize", (W = function () { $ = Math.max(e.innerWidth || 0, p.clientWidth) !== O.width || p.clientHeight !== ee, ee = p.clientHeight, $ && r.fillImgs() }, B = 99, K = function () { var e = new Date - V; e < B ? U = setTimeout(K, B - e) : (U = null, W()) }, function () { V = new Date, U || (U = setTimeout(K, B)) })), R(t, "readystatechange", Z), h["image/webp"] = (X = "image/webp", Y = "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==", (Q = new e.Image).onerror = function () { h[X] = !1, ne() }, Q.onload = function () { h[X] = 1 === Q.width, ne() }, Q.src = Y, "pending")), r.picturefill = ne, r.fillImgs = ne, r.teardownRun = a, ne._ = r, e.picturefillCFG = { pf: r, push: function (e) { var t = e.shift(); "function" == typeof r[t] ? r[t].apply(r, e) : (f[t] = e[0], E && r.fillImgs({ reselect: !0 })) } }; for (; C && C.length;) e.picturefillCFG.push(C.shift()); e.picturefill = ne, "object" == typeof module && "object" == typeof module.exports ? module.exports = ne : "function" == typeof define && define.amd && define("picturefill", function () { return ne }) }(window, document), function (e) { "use strict"; function t() { } function i() { try { return document.activeElement } catch (e) { } } function n(e, t) { for (var i = 0, n = e.length; n > i; i++) if (e[i] === t) return !0; return !1 } function s(e, t, i) { return e.addEventListener ? e.addEventListener(t, i, !1) : e.attachEvent ? e.attachEvent("on" + t, i) : void 0 } function o(e, t) { var i; e.createTextRange ? ((i = e.createTextRange()).move("character", t), i.select()) : e.selectionStart && (e.focus(), e.setSelectionRange(t, t)) } function r(e, t) { try { return e.type = t, !0 } catch (e) { return !1 } } function a(e, t) { if (e && e.getAttribute(y)) t(e); else for (var i, n = e ? e.getElementsByTagName("input") : A, s = e ? e.getElementsByTagName("textarea") : O, o = n ? n.length : 0, r = s ? s.length : 0, a = o + r, l = 0; a > l; l++) i = o > l ? n[l] : s[l - o], t(i) } function l(e) { a(e, d) } function d(e, t) { var i = !!t && e.value !== t, n = e.value === e.getAttribute(y); if ((i || n) && "true" === e.getAttribute(b)) { e.removeAttribute(b), e.value = e.value.replace(e.getAttribute(y), ""), e.className = e.className.replace(m, ""); var s = e.getAttribute(S); parseInt(s, 10) >= 0 && (e.setAttribute("maxLength", s), e.removeAttribute(S)); var o = e.getAttribute(w); return o && (e.type = o), !0 } return !1 } function c(e) { var t = e.getAttribute(y); return !("" !== e.value || !t) && (e.setAttribute(b, "true"), e.value = t, e.className += " " + v, e.getAttribute(S) || (e.setAttribute(S, e.maxLength), e.removeAttribute("maxLength")), e.getAttribute(w) ? e.type = "text" : "password" === e.type && r(e, "text") && e.setAttribute(w, "password"), !0) } function u(e) { var t, r, a, u, p, f, v = e.form; v && "string" == typeof v && ((v = document.getElementById(v)).getAttribute(k) || (s(v, "submit", (f = v, function () { l(f) })), v.setAttribute(k, "true"))), s(e, "focus", (p = e, function () { D && p.value === p.getAttribute(y) && "true" === p.getAttribute(b) ? o(p, 0) : d(p) })), s(e, "blur", (u = e, function () { c(u) })), D && (s(e, "keydown", (a = e, function (e) { return h = a.value, "true" === a.getAttribute(b) && h === a.getAttribute(y) && n(g, e.keyCode) ? (e.preventDefault && e.preventDefault(), !1) : void 0 })), s(e, "keyup", (r = e, function () { d(r, h), "" === r.value && (r.blur(), o(r, 0)) })), s(e, "click", (t = e, function () { t === i() && t.value === t.getAttribute(y) && "true" === t.getAttribute(b) && o(t, 0) }))), e.setAttribute(C, "true"), e.setAttribute(y, _), (D || e !== i()) && c(e) } var p = void 0 !== document.createElement("input").placeholder; if (e.Placeholders = { nativeSupport: p, disable: p ? t : l, enable: p ? t : function (e) { a(e, c) } }, !p) { var h, f = ["text", "search", "url", "tel", "email", "password", "number", "textarea"], g = [27, 33, 34, 35, 36, 37, 38, 39, 40, 8, 46], v = "placeholdersjs", m = new RegExp("(?:^|\\s)" + v + "(?!\\S)"), y = "data-placeholder-value", b = "data-placeholder-active", w = "data-placeholder-type", k = "data-placeholder-submit", C = "data-placeholder-bound", S = "data-placeholder-maxlength", $ = document.getElementsByTagName("head")[0], T = document.documentElement, x = e.Placeholders, A = document.getElementsByTagName("input"), O = document.getElementsByTagName("textarea"), D = "false" === T.getAttribute("data-placeholder-focus"), E = "false" !== T.getAttribute("data-placeholder-live"), I = document.createElement("style"); I.type = "text/css"; var P = document.createTextNode("." + v + " {color:#ccc;}"); I.styleSheet ? I.styleSheet.cssText = P.nodeValue : I.appendChild(P), $.insertBefore(I, $.firstChild); for (var _, z, L = 0, F = A.length + O.length; F > L; L++) z = L < A.length ? A[L] : O[L - A.length], _ = z.attributes.placeholder, _ && (_ = _.nodeValue, _ && n(f, z.type) && u(z)); var R = setInterval(function () { for (var e = 0, t = A.length + O.length; t > e; e++) z = e < A.length ? A[e] : O[e - A.length], _ = z.attributes.placeholder, _ ? (_ = _.nodeValue, _ && n(f, z.type) && (z.getAttribute(C) || u(z), (_ !== z.getAttribute(y) || "password" === z.type && !z.getAttribute(w)) && ("password" === z.type && !z.getAttribute(w) && r(z, "text") && z.setAttribute(w, "password"), z.value === z.getAttribute(y) && (z.value = _), z.setAttribute(y, _)))) : z.getAttribute(b) && (d(z), z.removeAttribute(y)); E || clearInterval(R) }, 100); s(e, "beforeunload", function () { x.disable() }) } }(this), function (e, t) { "function" == typeof define && define.amd ? define("sifter", t) : "object" == typeof exports ? module.exports = t() : e.Sifter = t() }(this, function () { var e = function (e, t) { this.items = e, this.settings = t || { diacritics: !0 } }; e.prototype.tokenize = function (e) { if (!(e = n(String(e || "").toLowerCase())) || !e.length) return []; var t, i, o, a, l = [], d = e.split(/ +/); for (t = 0, i = d.length; i > t; t++) { if (o = s(d[t]), this.settings.diacritics) for (a in r) r.hasOwnProperty(a) && (o = o.replace(new RegExp(a, "g"), r[a])); l.push({ string: d[t], regex: new RegExp(o, "i") }) } return l }, e.prototype.iterator = function (e, t) { (o(e) ? Array.prototype.forEach || function (e) { for (var t = 0, i = this.length; i > t; t++) e(this[t], t, this) } : function (e) { for (var t in this) this.hasOwnProperty(t) && e(this[t], t, this) }).apply(e, [t]) }, e.prototype.getScoreFunction = function (e, t) { var i, n, s; e = this.prepareSearch(e, t), n = e.tokens, i = e.options.fields, s = n.length; var o, r = function (e, t) { var i, n; return e ? -1 === (n = (e = String(e || "")).search(t.regex)) ? 0 : (i = t.string.length / e.length, 0 === n && (i += .5), i) : 0 }, a = (o = i.length) ? 1 === o ? function (e, t) { return r(t[i[0]], e) } : function (e, t) { for (var n = 0, s = 0; o > n; n++) s += r(t[i[n]], e); return s / o } : function () { return 0 }; return s ? 1 === s ? function (e) { return a(n[0], e) } : "and" === e.options.conjunction ? function (e) { for (var t, i = 0, o = 0; s > i; i++) { if (0 >= (t = a(n[i], e))) return 0; o += t } return o / s } : function (e) { for (var t = 0, i = 0; s > t; t++) i += a(n[t], e); return i / s } : function () { return 0 } }, e.prototype.getSortFunction = function (e, i) { var n, s, o, r, a, l, d, c, u, p, h; if (h = !(e = (o = this).prepareSearch(e, i)).query && i.sort_empty || i.sort, u = function (e, t) { return "$score" === e ? t.score : o.items[t.id][e] }, a = [], h) for (n = 0, s = h.length; s > n; n++) (e.query || "$score" !== h[n].field) && a.push(h[n]); if (e.query) { for (p = !0, n = 0, s = a.length; s > n; n++) if ("$score" === a[n].field) { p = !1; break } p && a.unshift({ field: "$score", direction: "desc" }) } else for (n = 0, s = a.length; s > n; n++) if ("$score" === a[n].field) { a.splice(n, 1); break } for (c = [], n = 0, s = a.length; s > n; n++) c.push("desc" === a[n].direction ? -1 : 1); return (l = a.length) ? 1 === l ? (r = a[0].field, d = c[0], function (e, i) { return d * t(u(r, e), u(r, i)) }) : function (e, i) { var n, s, o; for (n = 0; l > n; n++) if (o = a[n].field, s = c[n] * t(u(o, e), u(o, i))) return s; return 0 } : null }, e.prototype.prepareSearch = function (e, t) { if ("object" == typeof e) return e; var n = (t = i({}, t)).fields, s = t.sort, r = t.sort_empty; return n && !o(n) && (t.fields = [n]), s && !o(s) && (t.sort = [s]), r && !o(r) && (t.sort_empty = [r]), { options: t, query: String(e || "").toLowerCase(), tokens: this.tokenize(e), total: 0, items: [] } }, e.prototype.search = function (e, t) { var i, n, s, o, r = this; return n = this.prepareSearch(e, t), t = n.options, e = n.query, o = t.score || r.getScoreFunction(n), e.length ? r.iterator(r.items, function (e, s) { i = o(e), (!1 === t.filter || i > 0) && n.items.push({ score: i, id: s }) }) : r.iterator(r.items, function (e, t) { n.items.push({ score: 1, id: t }) }), (s = r.getSortFunction(n, t)) && n.items.sort(s), n.total = n.items.length, "number" == typeof t.limit && (n.items = n.items.slice(0, t.limit)), n }; var t = function (e, t) { return "number" == typeof e && "number" == typeof t ? e > t ? 1 : t > e ? -1 : 0 : (e = a(String(e || ""))) > (t = a(String(t || ""))) ? 1 : t > e ? -1 : 0 }, i = function (e) { var t, i, n, s; for (t = 1, i = arguments.length; i > t; t++) if (s = arguments[t]) for (n in s) s.hasOwnProperty(n) && (e[n] = s[n]); return e }, n = function (e) { return (e + "").replace(/^\s+|\s+$|/g, "") }, s = function (e) { return (e + "").replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") }, o = Array.isArray || $ && $.isArray || function (e) { return "[object Array]" === Object.prototype.toString.call(e) }, r = { a: "[aÀÁÂÃÄÅàáâãäåĀāąĄ]", c: "[cÇçćĆčČ]", d: "[dđĐďĎ]", e: "[eÈÉÊËèéêëěĚĒēęĘ]", i: "[iÌÍÎÏìíîïĪī]", l: "[lłŁ]", n: "[nÑñňŇńŃ]", o: "[oÒÓÔÕÕÖØòóôõöøŌō]", r: "[rřŘ]", s: "[sŠšśŚ]", t: "[tťŤ]", u: "[uÙÚÛÜùúûüůŮŪū]", y: "[yŸÿýÝ]", z: "[zŽžżŻźŹ]" }, a = function () { var e, t, i, n, s = "", o = {}; for (i in r) if (r.hasOwnProperty(i)) for (n = r[i].substring(2, r[i].length - 1), s += n, e = 0, t = n.length; t > e; e++) o[n.charAt(e)] = i; var a = new RegExp("[" + s + "]", "g"); return function (e) { return e.replace(a, function (e) { return o[e] }).toLowerCase() } }(); return e }), function (e, t) { "function" == typeof define && define.amd ? define("microplugin", t) : "object" == typeof exports ? module.exports = t() : e.MicroPlugin = t() }(this, function () { var e = { mixin: function (e) { e.plugins = {}, e.prototype.initializePlugins = function (e) { var i, n, s, o = []; if (this.plugins = { names: [], settings: {}, requested: {}, loaded: {} }, t.isArray(e)) for (i = 0, n = e.length; n > i; i++) "string" == typeof e[i] ? o.push(e[i]) : (this.plugins.settings[e[i].name] = e[i].options, o.push(e[i].name)); else if (e) for (s in e) e.hasOwnProperty(s) && (this.plugins.settings[s] = e[s], o.push(s)); for (; o.length;) this.require(o.shift()) }, e.prototype.loadPlugin = function (t) { var i = this.plugins, n = e.plugins[t]; if (!e.plugins.hasOwnProperty(t)) throw new Error('Unable to find "' + t + '" plugin'); i.requested[t] = !0, i.loaded[t] = n.fn.apply(this, [this.plugins.settings[t] || {}]), i.names.push(t) }, e.prototype.require = function (e) { var t = this.plugins; if (!this.plugins.loaded.hasOwnProperty(e)) { if (t.requested[e]) throw new Error('Plugin has circular dependency ("' + e + '")'); this.loadPlugin(e) } return t.loaded[e] }, e.define = function (t, i) { e.plugins[t] = { name: t, fn: i } } } }, t = { isArray: Array.isArray || function (e) { return "[object Array]" === Object.prototype.toString.call(e) } }; return e }), function (e, t) { "function" == typeof define && define.amd ? define("selectize", ["jquery", "sifter", "microplugin"], t) : "object" == typeof exports ? module.exports = t(require("jquery"), require("sifter"), require("microplugin")) : e.Selectize = t(e.jQuery, e.Sifter, e.MicroPlugin) }(this, function (e, t, i) { "use strict"; var n = function (e, t) { if ("string" != typeof t || t.length) { var i = "string" == typeof t ? new RegExp(t, "i") : t, n = function (e) { var t = 0; if (3 === e.nodeType) { var s = e.data.search(i); if (s >= 0 && e.data.length > 0) { var o = e.data.match(i), r = document.createElement("span"); r.className = "highlight"; var a = e.splitText(s), l = (a.splitText(o[0].length), a.cloneNode(!0)); r.appendChild(l), a.parentNode.replaceChild(r, a), t = 1 } } else if (1 === e.nodeType && e.childNodes && !/(script|style)/i.test(e.tagName)) for (var d = 0; d < e.childNodes.length; ++d) d += n(e.childNodes[d]); return t }; return e.each(function () { n(this) }) } }, s = function () { }; s.prototype = { on: function (e, t) { this._events = this._events || {}, this._events[e] = this._events[e] || [], this._events[e].push(t) }, off: function (e, t) { var i = arguments.length; return 0 === i ? delete this._events : 1 === i ? delete this._events[e] : (this._events = this._events || {}, void (e in this._events != 0 && this._events[e].splice(this._events[e].indexOf(t), 1))) }, trigger: function (e) { if (this._events = this._events || {}, e in this._events != 0) for (var t = 0; t < this._events[e].length; t++) this._events[e][t].apply(this, Array.prototype.slice.call(arguments, 1)) } }, s.mixin = function (e) { for (var t = ["on", "off", "trigger"], i = 0; i < t.length; i++) e.prototype[t[i]] = s.prototype[t[i]] }; var o = /Mac/.test(navigator.userAgent), r = o ? 91 : 17, a = o ? 18 : 17, l = !/android/i.test(window.navigator.userAgent) && !!document.createElement("form").validity, d = function (e) { return void 0 !== e }, c = function (e) { return void 0 === e || null === e ? null : "boolean" == typeof e ? e ? "1" : "0" : e + "" }, u = function (e) { return (e + "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;") }, p = function (e) { return (e + "").replace(/\$/g, "$$$$") }, h = { before: function (e, t, i) { var n = e[t]; e[t] = function () { return i.apply(e, arguments), n.apply(e, arguments) } }, after: function (e, t, i) { var n = e[t]; e[t] = function () { var t = n.apply(e, arguments); return i.apply(e, arguments), t } } }, f = function (e, t, i) { var n, s = e.trigger, o = {}; e.trigger = function () { var i = arguments[0]; return -1 === t.indexOf(i) ? s.apply(e, arguments) : void (o[i] = arguments) }, i.apply(e, []), e.trigger = s; for (n in o) o.hasOwnProperty(n) && s.apply(e, o[n]) }, g = function (e) { var t = {}; if ("selectionStart" in e) t.start = e.selectionStart, t.length = e.selectionEnd - t.start; else if (document.selection) { e.focus(); var i = document.selection.createRange(), n = document.selection.createRange().text.length; i.moveStart("character", -e.value.length), t.start = i.text.length - n, t.length = n } return t }, v = function (t) { var i = null, n = function (n, s) { var o, r, a, l, d, c, u, p; n = n || window.event || {}, s = s || {}, n.metaKey || n.altKey || (s.force || !1 !== t.data("grow")) && (o = t.val(), n.type && "keydown" === n.type.toLowerCase() && (a = (r = n.keyCode) >= 97 && 122 >= r || r >= 65 && 90 >= r || r >= 48 && 57 >= r || 32 === r, 46 === r || 8 === r ? (p = g(t[0])).length ? o = o.substring(0, p.start) + o.substring(p.start + p.length) : 8 === r && p.start ? o = o.substring(0, p.start - 1) + o.substring(p.start + 1) : 46 === r && void 0 !== p.start && (o = o.substring(0, p.start) + o.substring(p.start + 1)) : a && (c = n.shiftKey, u = String.fromCharCode(n.keyCode), o += u = c ? u.toUpperCase() : u.toLowerCase())), l = t.attr("placeholder"), !o && l && (o = l), (d = function (t, i) { if (!t) return 0; var n = e("<test>").css({ position: "absolute", top: -99999, left: -99999, width: "auto", padding: 0, whiteSpace: "pre" }).text(t).appendTo("body"); !function (e, t, i) { var n, s, o = {}; if (i) for (n = 0, s = i.length; s > n; n++) o[i[n]] = e.css(i[n]); else o = e.css(); t.css(o) }(i, n, ["letterSpacing", "fontSize", "fontFamily", "fontWeight", "textTransform"]); var s = n.width(); return n.remove(), s }(o, t) + 4) !== i && (i = d, t.width(d), t.triggerHandler("resize"))) }; t.on("keydown keyup update blur", n), n() }, m = function (i, n) { var s, o, r, a, l = this; (a = i[0]).selectize = l; var d, c, u, p = window.getComputedStyle && window.getComputedStyle(a, null); if (r = (r = p ? p.getPropertyValue("direction") : a.currentStyle && a.currentStyle.direction) || i.parents("[dir]:first").attr("dir") || "", e.extend(l, { order: 0, settings: n, $input: i, tabIndex: i.attr("tabindex") || "", tagType: "select" === a.tagName.toLowerCase() ? 1 : 2, rtl: /rtl/i.test(r), eventNS: ".selectize" + ++m.count, highlightedValue: null, isOpen: !1, isDisabled: !1, isRequired: i.is("[required]"), isInvalid: !1, isLocked: !1, isFocused: !1, isInputHidden: !1, isSetup: !1, isShiftDown: !1, isCmdDown: !1, isCtrlDown: !1, ignoreFocus: !1, ignoreBlur: !1, ignoreHover: !1, hasOptions: !1, currentResults: null, lastValue: "", caretPos: 0, loading: 0, loadedSearches: {}, $activeOption: null, $activeItems: [], optgroups: {}, options: {}, userOptions: {}, items: [], renderCache: {}, onSearchChange: null === n.loadThrottle ? l.onSearchChange : (d = l.onSearchChange, c = n.loadThrottle, function () { var e = this, t = arguments; window.clearTimeout(u), u = window.setTimeout(function () { d.apply(e, t) }, c) }) }), l.sifter = new t(this.options, { diacritics: n.diacritics }), l.settings.options) { for (s = 0, o = l.settings.options.length; o > s; s++) l.registerOption(l.settings.options[s]); delete l.settings.options } if (l.settings.optgroups) { for (s = 0, o = l.settings.optgroups.length; o > s; s++) l.registerOptionGroup(l.settings.optgroups[s]); delete l.settings.optgroups } l.settings.mode = l.settings.mode || (1 === l.settings.maxItems ? "single" : "multi"), "boolean" != typeof l.settings.hideSelected && (l.settings.hideSelected = "multi" === l.settings.mode), l.initializePlugins(l.settings.plugins), l.setupCallbacks(), l.setupTemplates(), l.setup() }; return s.mixin(m), i.mixin(m), e.extend(m.prototype, { setup: function () { var t, i, n, s, d, c, u, p, h, f, g, m, y, b = this, w = b.settings, k = b.eventNS, C = e(window), S = e(document), $ = b.$input; if (u = b.settings.mode, p = $.attr("class") || "", t = e("<div>").addClass(w.wrapperClass).addClass(p).addClass(u), i = e("<div>").addClass(w.inputClass).addClass("items").appendTo(t), n = e('<input type="text" autocomplete="off" />').appendTo(i).attr("tabindex", $.is(":disabled") ? "-1" : b.tabIndex), c = e(w.dropdownParent || t), s = e("<div>").addClass(w.dropdownClass).addClass(u).hide().appendTo(c), d = e("<div>").addClass(w.dropdownContentClass).appendTo(s), b.settings.copyClassesToDropdown && s.addClass(p), t.css({ width: $[0].style.width }), b.plugins.names.length && (h = "plugin-" + b.plugins.names.join(" plugin-"), t.addClass(h), s.addClass(h)), (null === w.maxItems || w.maxItems > 1) && 1 === b.tagType && $.attr("multiple", "multiple"), b.settings.placeholder && n.attr("placeholder", w.placeholder), !b.settings.splitOn && b.settings.delimiter) { var T = b.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); b.settings.splitOn = new RegExp("\\s*" + T + "+\\s*") } $.attr("autocorrect") && n.attr("autocorrect", $.attr("autocorrect")), $.attr("autocapitalize") && n.attr("autocapitalize", $.attr("autocapitalize")), b.$wrapper = t, b.$control = i, b.$control_input = n, b.$dropdown = s, b.$dropdown_content = d, s.on("mouseenter", "[data-selectable]", function () { return b.onOptionHover.apply(b, arguments) }), s.on("mousedown click", "[data-selectable]", function () { return b.onOptionSelect.apply(b, arguments) }), g = "mousedown", m = "*:not(input)", y = function () { return b.onItemSelect.apply(b, arguments) }, (f = i).on(g, m, function (e) { for (var t = e.target; t && t.parentNode !== f[0];) t = t.parentNode; return e.currentTarget = t, y.apply(this, [e]) }), v(n), i.on({ mousedown: function () { return b.onMouseDown.apply(b, arguments) }, click: function () { return b.onClick.apply(b, arguments) } }), n.on({ mousedown: function (e) { e.stopPropagation() }, keydown: function () { return b.onKeyDown.apply(b, arguments) }, keyup: function () { return b.onKeyUp.apply(b, arguments) }, keypress: function () { return b.onKeyPress.apply(b, arguments) }, resize: function () { b.positionDropdown.apply(b, []) }, blur: function () { return b.onBlur.apply(b, arguments) }, focus: function () { return b.ignoreBlur = !1, b.onFocus.apply(b, arguments) }, paste: function () { return b.onPaste.apply(b, arguments) } }), S.on("keydown" + k, function (e) { b.isCmdDown = e[o ? "metaKey" : "ctrlKey"], b.isCtrlDown = e[o ? "altKey" : "ctrlKey"], b.isShiftDown = e.shiftKey }), S.on("keyup" + k, function (e) { e.keyCode === a && (b.isCtrlDown = !1), 16 === e.keyCode && (b.isShiftDown = !1), e.keyCode === r && (b.isCmdDown = !1) }), S.on("mousedown" + k, function (e) { if (b.isFocused) { if (e.target === b.$dropdown[0] || e.target.parentNode === b.$dropdown[0]) return !1; b.$control.has(e.target).length || e.target === b.$control[0] || b.blur(e.target) } }), C.on(["scroll" + k, "resize" + k].join(" "), function () { b.isOpen && b.positionDropdown.apply(b, arguments) }), C.on("mousemove" + k, function () { b.ignoreHover = !1 }), this.revertSettings = { $children: $.children().detach(), tabindex: $.attr("tabindex") }, $.attr("tabindex", -1).hide().after(b.$wrapper), e.isArray(w.items) && (b.setValue(w.items), delete w.items), l && $.on("invalid" + k, function (e) { e.preventDefault(), b.isInvalid = !0, b.refreshState() }), b.updateOriginalInput(), b.refreshItems(), b.refreshState(), b.updatePlaceholder(), b.isSetup = !0, $.is(":disabled") && b.disable(), b.on("change", this.onChange), $.data("selectize", b), $.addClass("selectized"), b.trigger("initialize"), !0 === w.preload && b.onSearchChange("") }, setupTemplates: function () { var t = this.settings.labelField, i = this.settings.optgroupLabelField, n = { optgroup: function (e) { return '<div class="optgroup">' + e.html + "</div>" }, optgroup_header: function (e, t) { return '<div class="optgroup-header">' + t(e[i]) + "</div>" }, option: function (e, i) { return '<div class="option">' + i(e[t]) + "</div>" }, item: function (e, i) { return '<div class="item">' + i(e[t]) + "</div>" }, option_create: function (e, t) { return '<div class="create">Add <strong>' + t(e.input) + "</strong>&hellip;</div>" } }; this.settings.render = e.extend({}, n, this.settings.render) }, setupCallbacks: function () { var e, t, i = { initialize: "onInitialize", change: "onChange", item_add: "onItemAdd", item_remove: "onItemRemove", clear: "onClear", option_add: "onOptionAdd", option_remove: "onOptionRemove", option_clear: "onOptionClear", optgroup_add: "onOptionGroupAdd", optgroup_remove: "onOptionGroupRemove", optgroup_clear: "onOptionGroupClear", dropdown_open: "onDropdownOpen", dropdown_close: "onDropdownClose", type: "onType", load: "onLoad", focus: "onFocus", blur: "onBlur" }; for (e in i) i.hasOwnProperty(e) && (t = this.settings[i[e]], t && this.on(e, t)) }, onClick: function (e) { this.isFocused || (this.focus(), e.preventDefault()) }, onMouseDown: function (t) { var i = this, n = t.isDefaultPrevented(); if (e(t.target), i.isFocused) { if (t.target !== i.$control_input[0]) return "single" === i.settings.mode ? i.isOpen ? i.close() : i.open() : n || i.setActiveItem(null), !1 } else n || window.setTimeout(function () { i.focus() }, 0) }, onChange: function () { this.$input.trigger("change") }, onPaste: function (t) { var i = this; i.isFull() || i.isInputHidden || i.isLocked ? t.preventDefault() : i.settings.splitOn && setTimeout(function () { for (var t = e.trim(i.$control_input.val() || "").split(i.settings.splitOn), n = 0, s = t.length; s > n; n++) i.createItem(t[n]) }, 0) }, onKeyPress: function (e) { if (this.isLocked) return e && e.preventDefault(); var t = String.fromCharCode(e.keyCode || e.which); return this.settings.create && "multi" === this.settings.mode && t === this.settings.delimiter ? (this.createItem(), e.preventDefault(), !1) : void 0 }, onKeyDown: function (e) { var t = (e.target, this.$control_input[0], this); if (!t.isLocked) { switch (e.keyCode) { case 65: if (t.isCmdDown) return void t.selectAll(); break; case 27: return void (t.isOpen && (e.preventDefault(), e.stopPropagation(), t.close())); case 78: if (!e.ctrlKey || e.altKey) break; case 40: if (!t.isOpen && t.hasOptions) t.open(); else if (t.$activeOption) { t.ignoreHover = !0; var i = t.getAdjacentOption(t.$activeOption, 1); i.length && t.setActiveOption(i, !0, !0) } return void e.preventDefault(); case 80: if (!e.ctrlKey || e.altKey) break; case 38: if (t.$activeOption) { t.ignoreHover = !0; var n = t.getAdjacentOption(t.$activeOption, -1); n.length && t.setActiveOption(n, !0, !0) } return void e.preventDefault(); case 13: return void (t.isOpen && t.$activeOption && (t.onOptionSelect({ currentTarget: t.$activeOption }), e.preventDefault())); case 37: return void t.advanceSelection(-1, e); case 39: return void t.advanceSelection(1, e); case 9: return t.settings.selectOnTab && t.isOpen && t.$activeOption && (t.onOptionSelect({ currentTarget: t.$activeOption }), t.isFull() || e.preventDefault()), void (t.settings.create && t.createItem() && e.preventDefault()); case 8: case 46: return void t.deleteSelection(e) } return !t.isFull() && !t.isInputHidden || (o ? e.metaKey : e.ctrlKey) ? void 0 : void e.preventDefault() } 9 !== e.keyCode && e.preventDefault() }, onKeyUp: function (e) { var t = this; if (t.isLocked) return e && e.preventDefault(); var i = t.$control_input.val() || ""; t.lastValue !== i && (t.lastValue = i, t.onSearchChange(i), t.refreshOptions(), t.trigger("type", i)) }, onSearchChange: function (e) { var t = this, i = t.settings.load; i && (t.loadedSearches.hasOwnProperty(e) || (t.loadedSearches[e] = !0, t.load(function (n) { i.apply(t, [e, n]) }))) }, onFocus: function (e) { var t = this, i = t.isFocused; return t.isDisabled ? (t.blur(), e && e.preventDefault(), !1) : void (t.ignoreFocus || (t.isFocused = !0, "focus" === t.settings.preload && t.onSearchChange(""), i || t.trigger("focus"), t.$activeItems.length || (t.showInput(), t.setActiveItem(null), t.refreshOptions(!!t.settings.openOnFocus)), t.refreshState())) }, onBlur: function (e, t) { var i = this; if (i.isFocused && (i.isFocused = !1, !i.ignoreFocus)) { if (!i.ignoreBlur && document.activeElement === i.$dropdown_content[0]) return i.ignoreBlur = !0, void i.onFocus(e); var n = function () { i.close(), i.setTextboxValue(""), i.setActiveItem(null), i.setActiveOption(null), i.setCaret(i.items.length), i.refreshState(), (t || document.body).focus(), i.ignoreFocus = !1, i.trigger("blur") }; i.ignoreFocus = !0, i.settings.create && i.settings.createOnBlur ? i.createItem(null, !1, n) : n() } }, onOptionHover: function (e) { this.ignoreHover || this.setActiveOption(e.currentTarget, !1) }, onOptionSelect: function (t) { var i, n, s = this; t.preventDefault && (t.preventDefault(), t.stopPropagation()), (n = e(t.currentTarget)).hasClass("create") ? s.createItem(null, function () { s.settings.closeAfterSelect && s.close() }) : void 0 !== (i = n.attr("data-value")) && (s.lastQuery = null, s.setTextboxValue(""), s.addItem(i), s.settings.closeAfterSelect ? s.close() : !s.settings.hideSelected && t.type && /mouse/.test(t.type) && s.setActiveOption(s.getOption(i))) }, onItemSelect: function (e) { this.isLocked || "multi" === this.settings.mode && (e.preventDefault(), this.setActiveItem(e.currentTarget, e)) }, load: function (e) { var t = this, i = t.$wrapper.addClass(t.settings.loadingClass); t.loading++, e.apply(t, [function (e) { t.loading = Math.max(t.loading - 1, 0), e && e.length && (t.addOption(e), t.refreshOptions(t.isFocused && !t.isInputHidden)), t.loading || i.removeClass(t.settings.loadingClass), t.trigger("load", e) }]) }, setTextboxValue: function (e) { var t = this.$control_input; t.val() !== e && (t.val(e).triggerHandler("update"), this.lastValue = e) }, getValue: function () { return 1 === this.tagType && this.$input.attr("multiple") ? this.items : this.items.join(this.settings.delimiter) }, setValue: function (e, t) { f(this, t ? [] : ["change"], function () { this.clear(t), this.addItems(e, t) }) }, setActiveItem: function (t, i) { var n, s, o, r, a, l, d, c, u = this; if ("single" !== u.settings.mode) { if (!(t = e(t)).length) return e(u.$activeItems).removeClass("active"), u.$activeItems = [], void (u.isFocused && u.showInput()); if ("mousedown" === (n = i && i.type.toLowerCase()) && u.isShiftDown && u.$activeItems.length) { for (c = u.$control.children(".active:last"), (r = Array.prototype.indexOf.apply(u.$control[0].childNodes, [c[0]])) > (a = Array.prototype.indexOf.apply(u.$control[0].childNodes, [t[0]])) && (d = r, r = a, a = d), s = r; a >= s; s++) l = u.$control[0].childNodes[s], -1 === u.$activeItems.indexOf(l) && (e(l).addClass("active"), u.$activeItems.push(l)); i.preventDefault() } else "mousedown" === n && u.isCtrlDown || "keydown" === n && this.isShiftDown ? t.hasClass("active") ? (o = u.$activeItems.indexOf(t[0]), u.$activeItems.splice(o, 1), t.removeClass("active")) : u.$activeItems.push(t.addClass("active")[0]) : (e(u.$activeItems).removeClass("active"), u.$activeItems = [t.addClass("active")[0]]); u.hideInput(), this.isFocused || u.focus() } }, setActiveOption: function (t, i, n) { var s, o, r, a, l, c = this; c.$activeOption && c.$activeOption.removeClass("active"), c.$activeOption = null, (t = e(t)).length && (c.$activeOption = t.addClass("active"), (i || !d(i)) && (s = c.$dropdown_content.height(), o = c.$activeOption.outerHeight(!0), i = c.$dropdown_content.scrollTop() || 0, a = r = c.$activeOption.offset().top - c.$dropdown_content.offset().top + i, l = r - s + o, r + o > s + i ? c.$dropdown_content.stop().animate({ scrollTop: l }, n ? c.settings.scrollDuration : 0) : i > r && c.$dropdown_content.stop().animate({ scrollTop: a }, n ? c.settings.scrollDuration : 0))) }, selectAll: function () { var e = this; "single" !== e.settings.mode && (e.$activeItems = Array.prototype.slice.apply(e.$control.children(":not(input)").addClass("active")), e.$activeItems.length && (e.hideInput(), e.close()), e.focus()) }, hideInput: function () { this.setTextboxValue(""), this.$control_input.css({ opacity: 0, position: "absolute", left: this.rtl ? 1e4 : -1e4 }), this.isInputHidden = !0 }, showInput: function () { this.$control_input.css({ opacity: 1, position: "relative", left: 0 }), this.isInputHidden = !1 }, focus: function () { var e = this; e.isDisabled || (e.ignoreFocus = !0, e.$control_input[0].focus(), window.setTimeout(function () { e.ignoreFocus = !1, e.onFocus() }, 0)) }, blur: function (e) { this.$control_input[0].blur(), this.onBlur(null, e) }, getScoreFunction: function (e) { return this.sifter.getScoreFunction(e, this.getSearchOptions()) }, getSearchOptions: function () { var e = this.settings, t = e.sortField; return "string" == typeof t && (t = [{ field: t }]), { fields: e.searchField, conjunction: e.searchConjunction, sort: t } }, search: function (t) { var i, n, s, o = this, r = o.settings, a = this.getSearchOptions(); if (r.score && "function" != typeof (s = o.settings.score.apply(this, [t]))) throw new Error('Selectize "score" setting must be a function that returns a function'); if (t !== o.lastQuery ? (o.lastQuery = t, n = o.sifter.search(t, e.extend(a, { score: s })), o.currentResults = n) : n = e.extend(!0, {}, o.currentResults), r.hideSelected) for (i = n.items.length - 1; i >= 0; i--) -1 !== o.items.indexOf(c(n.items[i].id)) && n.items.splice(i, 1); return n }, refreshOptions: function (t) { var i, s, o, r, a, l, d, u, p, h, f, g, v, m, y, b; void 0 === t && (t = !0); var w = this, k = e.trim(w.$control_input.val()), C = w.search(k), S = w.$dropdown_content, $ = w.$activeOption && c(w.$activeOption.attr("data-value")); for (r = C.items.length, "number" == typeof w.settings.maxOptions && (r = Math.min(r, w.settings.maxOptions)), a = {}, l = [], i = 0; r > i; i++) for (d = w.options[C.items[i].id], u = w.render("option", d), p = d[w.settings.optgroupField] || "", h = e.isArray(p) ? p : [p], s = 0, o = h && h.length; o > s; s++) p = h[s], w.optgroups.hasOwnProperty(p) || (p = ""), a.hasOwnProperty(p) || (a[p] = [], l.push(p)), a[p].push(u); for (this.settings.lockOptgroupOrder && l.sort(function (e, t) { return (w.optgroups[e].$order || 0) - (w.optgroups[t].$order || 0) }), f = [], i = 0, r = l.length; r > i; i++) p = l[i], w.optgroups.hasOwnProperty(p) && a[p].length ? (g = w.render("optgroup_header", w.optgroups[p]) || "", g += a[p].join(""), f.push(w.render("optgroup", e.extend({}, w.optgroups[p], { html: g })))) : f.push(a[p].join("")); if (S.html(f.join("")), w.settings.highlight && C.query.length && C.tokens.length) for (i = 0, r = C.tokens.length; r > i; i++) n(S, C.tokens[i].regex); if (!w.settings.hideSelected) for (i = 0, r = w.items.length; r > i; i++) w.getOption(w.items[i]).addClass("selected"); (v = w.canCreate(k)) && (S.prepend(w.render("option_create", { input: k })), b = e(S[0].childNodes[0])), w.hasOptions = C.items.length > 0 || v, w.hasOptions ? (C.items.length > 0 ? ((y = $ && w.getOption($)) && y.length ? m = y : "single" === w.settings.mode && w.items.length && (m = w.getOption(w.items[0])), m && m.length || (m = b && !w.settings.addPrecedence ? w.getAdjacentOption(b, 1) : S.find("[data-selectable]:first"))) : m = b, w.setActiveOption(m), t && !w.isOpen && w.open()) : (w.setActiveOption(null), t && w.isOpen && w.close()) }, addOption: function (t) { var i, n, s, o = this; if (e.isArray(t)) for (i = 0, n = t.length; n > i; i++) o.addOption(t[i]); else (s = o.registerOption(t)) && (o.userOptions[s] = !0, o.lastQuery = null, o.trigger("option_add", s, t)) }, registerOption: function (e) { var t = c(e[this.settings.valueField]); return !(!t || this.options.hasOwnProperty(t)) && (e.$order = e.$order || ++this.order, this.options[t] = e, t) }, registerOptionGroup: function (e) { var t = c(e[this.settings.optgroupValueField]); return !!t && (e.$order = e.$order || ++this.order, this.optgroups[t] = e, t) }, addOptionGroup: function (e, t) { t[this.settings.optgroupValueField] = e, (e = this.registerOptionGroup(t)) && this.trigger("optgroup_add", e, t) }, removeOptionGroup: function (e) { this.optgroups.hasOwnProperty(e) && (delete this.optgroups[e], this.renderCache = {}, this.trigger("optgroup_remove", e)) }, clearOptionGroups: function () { this.optgroups = {}, this.renderCache = {}, this.trigger("optgroup_clear") }, updateOption: function (t, i) { var n, s, o, r, a, l, d, u = this; if (t = c(t), o = c(i[u.settings.valueField]), null !== t && u.options.hasOwnProperty(t)) { if ("string" != typeof o) throw new Error("Value must be set in option data"); d = u.options[t].$order, o !== t && (delete u.options[t], -1 !== (r = u.items.indexOf(t)) && u.items.splice(r, 1, o)), i.$order = i.$order || d, u.options[o] = i, a = u.renderCache.item, l = u.renderCache.option, a && (delete a[t], delete a[o]), l && (delete l[t], delete l[o]), -1 !== u.items.indexOf(o) && (n = u.getItem(t), s = e(u.render("item", i)), n.hasClass("active") && s.addClass("active"), n.replaceWith(s)), u.lastQuery = null, u.isOpen && u.refreshOptions(!1) } }, removeOption: function (e, t) { var i = this; e = c(e); var n = i.renderCache.item, s = i.renderCache.option; n && delete n[e], s && delete s[e], delete i.userOptions[e], delete i.options[e], i.lastQuery = null, i.trigger("option_remove", e), i.removeItem(e, t) }, clearOptions: function () { var e = this; e.loadedSearches = {}, e.userOptions = {}, e.renderCache = {}, e.options = e.sifter.items = {}, e.lastQuery = null, e.trigger("option_clear"), e.clear() }, getOption: function (e) { return this.getElementWithValue(e, this.$dropdown_content.find("[data-selectable]")) }, getAdjacentOption: function (t, i) { var n = this.$dropdown.find("[data-selectable]"), s = n.index(t) + i; return s >= 0 && s < n.length ? n.eq(s) : e() }, getElementWithValue: function (t, i) { if (void 0 !== (t = c(t)) && null !== t) for (var n = 0, s = i.length; s > n; n++) if (i[n].getAttribute("data-value") === t) return e(i[n]); return e() }, getItem: function (e) { return this.getElementWithValue(e, this.$control.children()) }, addItems: function (t, i) { for (var n = e.isArray(t) ? t : [t], s = 0, o = n.length; o > s; s++) this.isPending = o - 1 > s, this.addItem(n[s], i) }, addItem: function (t, i) { f(this, i ? [] : ["change"], function () { var n, s, o, r, a, l = this, d = l.settings.mode; return t = c(t), -1 !== l.items.indexOf(t) ? void ("single" === d && l.close()) : void (l.options.hasOwnProperty(t) && ("single" === d && l.clear(i), "multi" === d && l.isFull() || (n = e(l.render("item", l.options[t])), a = l.isFull(), l.items.splice(l.caretPos, 0, t), l.insertAtCaret(n), (!l.isPending || !a && l.isFull()) && l.refreshState(), l.isSetup && (o = l.$dropdown_content.find("[data-selectable]"), l.isPending || (s = l.getOption(t), r = l.getAdjacentOption(s, 1).attr("data-value"), l.refreshOptions(l.isFocused && "single" !== d), r && l.setActiveOption(l.getOption(r))), !o.length || l.isFull() ? l.close() : l.positionDropdown(), l.updatePlaceholder(), l.trigger("item_add", t, n), l.updateOriginalInput({ silent: i }))))) }) }, removeItem: function (e, t) { var i, n, s, o = this; i = "object" == typeof e ? e : o.getItem(e), e = c(i.attr("data-value")), -1 !== (n = o.items.indexOf(e)) && (i.remove(), i.hasClass("active") && (s = o.$activeItems.indexOf(i[0]), o.$activeItems.splice(s, 1)), o.items.splice(n, 1), o.lastQuery = null, !o.settings.persist && o.userOptions.hasOwnProperty(e) && o.removeOption(e, t), n < o.caretPos && o.setCaret(o.caretPos - 1), o.refreshState(), o.updatePlaceholder(), o.updateOriginalInput({ silent: t }), o.positionDropdown(), o.trigger("item_remove", e, i)) }, createItem: function (t, i) { var n = this, s = n.caretPos; t = t || e.trim(n.$control_input.val() || ""); var o = arguments[arguments.length - 1]; if ("function" != typeof o && (o = function () { }), "boolean" != typeof i && (i = !0), !n.canCreate(t)) return o(), !1; n.lock(); var r, a, l = "function" == typeof n.settings.create ? this.settings.create : function (e) { var t = {}; return t[n.settings.labelField] = e, t[n.settings.valueField] = e, t }, d = (r = function (e) { if (n.unlock(), !e || "object" != typeof e) return o(); var t = c(e[n.settings.valueField]); return "string" != typeof t ? o() : (n.setTextboxValue(""), n.addOption(e), n.setCaret(s), n.addItem(t), n.refreshOptions(i && "single" !== n.settings.mode), void o(e)) }, a = !1, function () { a || (a = !0, r.apply(this, arguments)) }), u = l.apply(this, [t, d]); return void 0 !== u && d(u), !0 }, refreshItems: function () { this.lastQuery = null, this.isSetup && this.addItem(this.items), this.refreshState(), this.updateOriginalInput() }, refreshState: function () { var e = this; e.isRequired && (e.items.length && (e.isInvalid = !1), e.$control_input.prop("required", void 0)), e.refreshClasses() }, refreshClasses: function () { var t = this, i = t.isFull(), n = t.isLocked; t.$wrapper.toggleClass("rtl", t.rtl), t.$control.toggleClass("focus", t.isFocused).toggleClass("disabled", t.isDisabled).toggleClass("required", t.isRequired).toggleClass("invalid", t.isInvalid).toggleClass("locked", n).toggleClass("full", i).toggleClass("not-full", !i).toggleClass("input-active", t.isFocused && !t.isInputHidden).toggleClass("dropdown-active", t.isOpen).toggleClass("has-options", !e.isEmptyObject(t.options)).toggleClass("has-items", t.items.length > 0), t.$control_input.data("grow", !i && !n) }, isFull: function () { return null !== this.settings.maxItems && this.items.length >= this.settings.maxItems }, updateOriginalInput: function (e) { var t, i, n, s, o = this; if (e = e || {}, 1 === o.tagType) { for (n = [], t = 0, i = o.items.length; i > t; t++) s = o.options[o.items[t]][o.settings.labelField] || "", n.push('<option value="' + u(o.items[t]) + '" selected="selected">' + u(s) + "</option>"); n.length || this.$input.attr("multiple") || n.push('<option value="" selected="selected"></option>'), o.$input.html(n.join("")) } else o.$input.val(o.getValue()), o.$input.attr("value", o.$input.val()); o.isSetup && (e.silent || o.trigger("change", o.$input.val())) }, updatePlaceholder: function () { if (this.settings.placeholder) { var e = this.$control_input; this.items.length ? e.removeAttr("placeholder") : e.attr("placeholder", this.settings.placeholder), e.triggerHandler("update", { force: !0 }) } }, open: function () { var e = this; e.isLocked || e.isOpen || "multi" === e.settings.mode && e.isFull() || (e.focus(), e.isOpen = !0, e.refreshState(), e.$dropdown.css({ visibility: "hidden", display: "block" }), e.positionDropdown(), e.$dropdown.css({ visibility: "visible" }), e.trigger("dropdown_open", e.$dropdown)) }, close: function () { var e = this, t = e.isOpen; "single" === e.settings.mode && e.items.length && e.hideInput(), e.isOpen = !1, e.$dropdown.hide(), e.setActiveOption(null), e.refreshState(), t && e.trigger("dropdown_close", e.$dropdown) }, positionDropdown: function () { var e = this.$control, t = "body" === this.settings.dropdownParent ? e.offset() : e.position(); t.top += e.outerHeight(!0), this.$dropdown.css({ width: e.outerWidth(), top: t.top, left: t.left }) }, clear: function (e) { var t = this; t.items.length && (t.$control.children(":not(input)").remove(), t.items = [], t.lastQuery = null, t.setCaret(0), t.setActiveItem(null), t.updatePlaceholder(), t.updateOriginalInput({ silent: e }), t.refreshState(), t.showInput(), t.trigger("clear")) }, insertAtCaret: function (t) { var i = Math.min(this.caretPos, this.items.length); 0 === i ? this.$control.prepend(t) : e(this.$control[0].childNodes[i]).before(t), this.setCaret(i + 1) }, deleteSelection: function (t) { var i, n, s, o, r, a, l, d, c, u = this; if (s = t && 8 === t.keyCode ? -1 : 1, o = g(u.$control_input[0]), u.$activeOption && !u.settings.hideSelected && (l = u.getAdjacentOption(u.$activeOption, -1).attr("data-value")), r = [], u.$activeItems.length) { for (c = u.$control.children(".active:" + (s > 0 ? "last" : "first")), a = u.$control.children(":not(input)").index(c), s > 0 && a++, i = 0, n = u.$activeItems.length; n > i; i++) r.push(e(u.$activeItems[i]).attr("data-value")); t && (t.preventDefault(), t.stopPropagation()) } else (u.isFocused || "single" === u.settings.mode) && u.items.length && (0 > s && 0 === o.start && 0 === o.length ? r.push(u.items[u.caretPos - 1]) : s > 0 && o.start === u.$control_input.val().length && r.push(u.items[u.caretPos])); if (!r.length || "function" == typeof u.settings.onDelete && !1 === u.settings.onDelete.apply(u, [r])) return !1; for (void 0 !== a && u.setCaret(a) ; r.length;) u.removeItem(r.pop()); return u.showInput(), u.positionDropdown(), u.refreshOptions(!0), l && ((d = u.getOption(l)).length && u.setActiveOption(d)), !0 }, advanceSelection: function (e, t) { var i, n, s, o, r, a = this; 0 !== e && (a.rtl && (e *= -1), i = e > 0 ? "last" : "first", n = g(a.$control_input[0]), a.isFocused && !a.isInputHidden ? (o = a.$control_input.val().length, (0 > e ? 0 === n.start && 0 === n.length : n.start === o) && !o && a.advanceCaret(e, t)) : (r = a.$control.children(".active:" + i)).length && (s = a.$control.children(":not(input)").index(r), a.setActiveItem(null), a.setCaret(e > 0 ? s + 1 : s))) }, advanceCaret: function (e, t) { var i, n, s = this; 0 !== e && (i = e > 0 ? "next" : "prev", s.isShiftDown ? (n = s.$control_input[i]()).length && (s.hideInput(), s.setActiveItem(n), t && t.preventDefault()) : s.setCaret(s.caretPos + e)) }, setCaret: function (t) { var i, n, s, o, r = this; if (t = "single" === r.settings.mode ? r.items.length : Math.max(0, Math.min(r.items.length, t)), !r.isPending) for (i = 0, n = (s = r.$control.children(":not(input)")).length; n > i; i++) o = e(s[i]).detach(), t > i ? r.$control_input.before(o) : r.$control.append(o); r.caretPos = t }, lock: function () { this.close(), this.isLocked = !0, this.refreshState() }, unlock: function () { this.isLocked = !1, this.refreshState() }, disable: function () { this.$input.prop("disabled", !0), this.$control_input.prop("disabled", !0).prop("tabindex", -1), this.isDisabled = !0, this.lock() }, enable: function () { var e = this; e.$input.prop("disabled", !1), e.$control_input.prop("disabled", !1).prop("tabindex", e.tabIndex), e.isDisabled = !1, e.unlock() }, destroy: function () { var t = this, i = t.eventNS, n = t.revertSettings; t.trigger("destroy"), t.off(), t.$wrapper.remove(), t.$dropdown.remove(), t.$input.html("").append(n.$children).removeAttr("tabindex").removeClass("selectized").attr({ tabindex: n.tabindex }).show(), t.$control_input.removeData("grow"), t.$input.removeData("selectize"), e(window).off(i), e(document).off(i), e(document.body).off(i), delete t.$input[0].selectize }, render: function (e, t) { var i, n, s = "", o = !1, r = this, a = /^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i; return ("option" === e || "item" === e) && (o = !!(i = c(t[r.settings.valueField]))), o && (d(r.renderCache[e]) || (r.renderCache[e] = {}), r.renderCache[e].hasOwnProperty(i)) ? r.renderCache[e][i] : (s = r.settings.render[e].apply(this, [t, u]), ("option" === e || "option_create" === e) && (s = s.replace(a, "<$1 data-selectable")), "optgroup" === e && (n = t[r.settings.optgroupValueField] || "", s = s.replace(a, '<$1 data-group="' + p(u(n)) + '"')), ("option" === e || "item" === e) && (s = s.replace(a, '<$1 data-value="' + p(u(i || "")) + '"')), o && (r.renderCache[e][i] = s), s) }, clearCache: function (e) { void 0 === e ? this.renderCache = {} : delete this.renderCache[e] }, canCreate: function (e) { if (!this.settings.create) return !1; var t = this.settings.createFilter; return !(!e.length || "function" == typeof t && !t.apply(this, [e]) || "string" == typeof t && !new RegExp(t).test(e) || t instanceof RegExp && !t.test(e)) } }), m.count = 0, m.defaults = { options: [], optgroups: [], plugins: [], delimiter: ",", splitOn: null, persist: !0, diacritics: !0, create: !1, createOnBlur: !1, createFilter: null, highlight: !0, openOnFocus: !0, maxOptions: 1e3, maxItems: null, hideSelected: null, addPrecedence: !1, selectOnTab: !1, preload: !1, allowEmptyOption: !1, closeAfterSelect: !1, scrollDuration: 60, loadThrottle: 300, loadingClass: "loading", dataAttr: "data-data", optgroupField: "optgroup", valueField: "value", labelField: "text", optgroupLabelField: "label", optgroupValueField: "value", lockOptgroupOrder: !1, sortField: "$order", searchField: ["text"], searchConjunction: "and", mode: null, wrapperClass: "selectize-control", inputClass: "selectize-input", dropdownClass: "selectize-dropdown", dropdownContentClass: "selectize-dropdown-content", dropdownParent: null, copyClassesToDropdown: !0, render: {} }, e.fn.selectize = function (t) { var i = e.fn.selectize.defaults, n = e.extend({}, i, t), s = n.dataAttr, o = n.labelField, r = n.valueField, a = n.optgroupField, l = n.optgroupLabelField, d = n.optgroupValueField; return this.each(function () { if (!this.selectize) { var u = e(this), p = this.tagName.toLowerCase(), h = u.attr("placeholder") || u.attr("data-placeholder"); h || n.allowEmptyOption || (h = u.children('option[value=""]').text()); var f = { placeholder: h, options: [], optgroups: [], items: [] }; "select" === p ? function (t, i) { var u, p, h, f, g = i.options, v = {}, m = function (e) { var t = s && e.attr(s); return "string" == typeof t && t.length ? JSON.parse(t) : null }, y = function (t, s) { t = e(t); var l = c(t.attr("value")); if (l || n.allowEmptyOption) if (v.hasOwnProperty(l)) { if (s) { var d = v[l][a]; d ? e.isArray(d) ? d.push(s) : v[l][a] = [d, s] : v[l][a] = s } } else { var u = m(t) || {}; u[o] = u[o] || t.text(), u[r] = u[r] || l, u[a] = u[a] || s, v[l] = u, g.push(u), t.is(":selected") && i.items.push(l) } }, b = function (t) { var n, s, o, r, a; for ((o = (t = e(t)).attr("label")) && ((r = m(t) || {})[l] = o, r[d] = o, i.optgroups.push(r)), n = 0, s = (a = e("option", t)).length; s > n; n++) y(a[n], o) }; for (i.maxItems = t.attr("multiple") ? null : 1, u = 0, p = (f = t.children()).length; p > u; u++) h = f[u].tagName.toLowerCase(), "optgroup" === h ? b(f[u]) : "option" === h && y(f[u]) }(u, f) : function (t, i) { var a, l, d, c, u = t.attr(s); if (u) for (i.options = JSON.parse(u), a = 0, l = i.options.length; l > a; a++) i.items.push(i.options[a][r]); else { var p = e.trim(t.val() || ""); if (!n.allowEmptyOption && !p.length) return; for (a = 0, l = (d = p.split(n.delimiter)).length; l > a; a++) c = {}, c[o] = d[a], c[r] = d[a], i.options.push(c); i.items = d } }(u, f), new m(u, e.extend(!0, {}, i, f, t)) } }) }, e.fn.selectize.defaults = m.defaults, e.fn.selectize.support = { validity: l }, m.define("drag_drop", function () { if (!e.fn.sortable) throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".'); if ("multi" === this.settings.mode) { var t = this; t.lock = (s = t.lock, function () { var e = t.$control.data("sortable"); return e && e.disable(), s.apply(t, arguments) }), t.unlock = (n = t.unlock, function () { var e = t.$control.data("sortable"); return e && e.enable(), n.apply(t, arguments) }), t.setup = (i = t.setup, function () { i.apply(this, arguments); var n = t.$control.sortable({ items: "[data-value]", forcePlaceholderSize: !0, disabled: t.isLocked, start: function (e, t) { t.placeholder.css("width", t.helper.css("width")), n.css({ overflow: "visible" }) }, stop: function () { n.css({ overflow: "hidden" }); var i = t.$activeItems ? t.$activeItems.slice() : null, s = []; n.children("[data-value]").each(function () { s.push(e(this).attr("data-value")) }), t.setValue(s), t.setActiveItem(i) } }) }) } var i, n, s }), m.define("dropdown_header", function (t) { var i, n = this; t = e.extend({ title: "Untitled", headerClass: "selectize-dropdown-header", titleRowClass: "selectize-dropdown-header-title", labelClass: "selectize-dropdown-header-label", closeClass: "selectize-dropdown-header-close", html: function (e) { return '<div class="' + e.headerClass + '"><div class="' + e.titleRowClass + '"><span class="' + e.labelClass + '">' + e.title + '</span><a href="javascript:void(0)" class="' + e.closeClass + '">&times;</a></div></div>' } }, t), n.setup = (i = n.setup, function () { i.apply(n, arguments), n.$dropdown_header = e(t.html(t)), n.$dropdown.prepend(n.$dropdown_header) }) }), m.define("optgroup_columns", function (t) { var i, n = this; t = e.extend({ equalizeWidth: !0, equalizeHeight: !0 }, t), this.getAdjacentOption = function (t, i) { var n = t.closest("[data-group]").find("[data-selectable]"), s = n.index(t) + i; return s >= 0 && s < n.length ? n.eq(s) : e() }, this.onKeyDown = (i = n.onKeyDown, function (e) { var t, s, o, r; return !this.isOpen || 37 !== e.keyCode && 39 !== e.keyCode ? i.apply(this, arguments) : (n.ignoreHover = !0, t = (r = this.$activeOption.closest("[data-group]")).find("[data-selectable]").index(this.$activeOption), void ((s = (o = (r = 37 === e.keyCode ? r.prev("[data-group]") : r.next("[data-group]")).find("[data-selectable]")).eq(Math.min(o.length - 1, t))).length && this.setActiveOption(s))) }); var s = function () { var e, t = s.width, i = document; return void 0 === t && ((e = i.createElement("div")).innerHTML = '<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>', e = e.firstChild, i.body.appendChild(e), t = s.width = e.offsetWidth - e.clientWidth, i.body.removeChild(e)), t }, o = function () { var i, o, r, a, l, d, c; if ((o = (c = e("[data-group]", n.$dropdown_content)).length) && n.$dropdown_content.width()) { if (t.equalizeHeight) { for (r = 0, i = 0; o > i; i++) r = Math.max(r, c.eq(i).height()); c.css({ height: r }) } t.equalizeWidth && (d = n.$dropdown_content.innerWidth() - s(), a = Math.round(d / o), c.css({ width: a }), o > 1 && (l = d - a * (o - 1), c.eq(o - 1).css({ width: l }))) } }; (t.equalizeHeight || t.equalizeWidth) && (h.after(this, "positionDropdown", o), h.after(this, "refreshOptions", o)) }), m.define("remove_button", function (t) { if ("single" !== this.settings.mode) { var i = this, n = '<a href="javascript:void(0)" class="' + (t = e.extend({ label: "&times;", title: "Remove", className: "remove", append: !0 }, t)).className + '" tabindex="-1" title="' + u(t.title) + '">' + t.label + "</a>"; this.setup = (s = i.setup, function () { if (t.append) { var o = i.settings.render.item; i.settings.render.item = function () { return e = o.apply(this, arguments), t = n, i = e.search(/(<\/[^>]+>\s*)$/), e.substring(0, i) + t + e.substring(i); var e, t, i } } s.apply(this, arguments), this.$control.on("click", "." + t.className, function (t) { if (t.preventDefault(), !i.isLocked) { var n = e(t.currentTarget).parent(); i.setActiveItem(n), i.deleteSelection() && i.setCaret(i.items.length) } }) }) } var s }), m.define("restore_on_backspace", function (e) { var t, i = this; e.text = e.text || function (e) { return e[this.settings.labelField] }, this.onKeyDown = (t = i.onKeyDown, function (i) { var n, s; return 8 === i.keyCode && "" === this.$control_input.val() && !this.$activeItems.length && (n = this.caretPos - 1) >= 0 && n < this.items.length ? (s = this.options[this.items[n]], this.deleteSelection(i) && (this.setTextboxValue(e.text.apply(this, [s])), this.refreshOptions(!0)), void i.preventDefault()) : t.apply(this, arguments) }) }), m }), function (e) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], e) : "undefined" != typeof exports ? module.exports = e(require("jquery")) : e(jQuery) }(function (e) { "use strict"; var t = window.Slick || {}; (t = function () { var t = 0; return function (i, n) { var s, o = this; o.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: e(i), appendDots: e(i), arrows: !0, asNavFor: null, prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>', nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: "50px", cssEase: "ease", customPaging: function (e, t) { return '<button type="button" data-role="none" role="button" aria-required="false" tabindex="0">' + (t + 1) + "</button>" }, dots: !1, dotsClass: "slick-dots", draggable: !0, easing: "linear", edgeFriction: .35, fade: !1, focusOnSelect: !1, infinite: !0, initialSlide: 0, lazyLoad: "ondemand", mobileFirst: !1, pauseOnHover: !0, pauseOnDotsHover: !1, respondTo: "window", responsive: null, rows: 1, rtl: !1, slide: "", slidesPerRow: 1, slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: !0, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, variableWidth: !1, vertical: !1, verticalSwiping: !1, waitForAnimate: !0, zIndex: 1e3 }, o.initials = { animating: !1, dragging: !1, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: !1, slideOffset: 0, swipeLeft: null, $list: null, touchObject: {}, transformsEnabled: !1, unslicked: !1 }, e.extend(o, o.initials), o.activeBreakpoint = null, o.animType = null, o.animProp = null, o.breakpoints = [], o.breakpointSettings = [], o.cssTransitions = !1, o.hidden = "hidden", o.paused = !1, o.positionProp = null, o.respondTo = null, o.rowCount = 1, o.shouldClick = !0, o.$slider = e(i), o.$slidesCache = null, o.transformType = null, o.transitionType = null, o.visibilityChange = "visibilitychange", o.windowWidth = 0, o.windowTimer = null, s = e(i).data("slick") || {}, o.options = e.extend({}, o.defaults, s, n), o.currentSlide = o.options.initialSlide, o.originalSettings = o.options, void 0 !== document.mozHidden ? (o.hidden = "mozHidden", o.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (o.hidden = "webkitHidden", o.visibilityChange = "webkitvisibilitychange"), o.autoPlay = e.proxy(o.autoPlay, o), o.autoPlayClear = e.proxy(o.autoPlayClear, o), o.changeSlide = e.proxy(o.changeSlide, o), o.clickHandler = e.proxy(o.clickHandler, o), o.selectHandler = e.proxy(o.selectHandler, o), o.setPosition = e.proxy(o.setPosition, o), o.swipeHandler = e.proxy(o.swipeHandler, o), o.dragHandler = e.proxy(o.dragHandler, o), o.keyHandler = e.proxy(o.keyHandler, o), o.autoPlayIterator = e.proxy(o.autoPlayIterator, o), o.instanceUid = t++, o.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, o.registerBreakpoints(), o.init(!0), o.checkResponsive(!0) } }()).prototype.addSlide = t.prototype.slickAdd = function (t, i, n) { var s = this; if ("boolean" == typeof i) n = i, i = null; else if (0 > i || i >= s.slideCount) return !1; s.unload(), "number" == typeof i ? 0 === i && 0 === s.$slides.length ? e(t).appendTo(s.$slideTrack) : n ? e(t).insertBefore(s.$slides.eq(i)) : e(t).insertAfter(s.$slides.eq(i)) : !0 === n ? e(t).prependTo(s.$slideTrack) : e(t).appendTo(s.$slideTrack), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slides.each(function (t, i) { e(i).attr("data-slick-index", t) }), s.$slidesCache = s.$slides, s.reinit() }, t.prototype.animateHeight = function () { var e = this; if (1 === e.options.slidesToShow && !0 === e.options.adaptiveHeight && !1 === e.options.vertical) { var t = e.$slides.eq(e.currentSlide).outerHeight(!0); e.$list.animate({ height: t }, e.options.speed) } }, t.prototype.animateSlide = function (t, i) { var n = {}, s = this; s.animateHeight(), !0 === s.options.rtl && !1 === s.options.vertical && (t = -t), !1 === s.transformsEnabled ? !1 === s.options.vertical ? s.$slideTrack.animate({ left: t }, s.options.speed, s.options.easing, i) : s.$slideTrack.animate({ top: t }, s.options.speed, s.options.easing, i) : !1 === s.cssTransitions ? (!0 === s.options.rtl && (s.currentLeft = -s.currentLeft), e({ animStart: s.currentLeft }).animate({ animStart: t }, { duration: s.options.speed, easing: s.options.easing, step: function (e) { e = Math.ceil(e), !1 === s.options.vertical ? (n[s.animType] = "translate(" + e + "px, 0px)", s.$slideTrack.css(n)) : (n[s.animType] = "translate(0px," + e + "px)", s.$slideTrack.css(n)) }, complete: function () { i && i.call() } })) : (s.applyTransition(), t = Math.ceil(t), n[s.animType] = !1 === s.options.vertical ? "translate3d(" + t + "px, 0px, 0px)" : "translate3d(0px," + t + "px, 0px)", s.$slideTrack.css(n), i && setTimeout(function () { s.disableTransition(), i.call() }, s.options.speed)) }, t.prototype.asNavFor = function (t) { var i = this.options.asNavFor; i && null !== i && (i = e(i).not(this.$slider)), null !== i && "object" == typeof i && i.each(function () { var i = e(this).slick("getSlick"); i.unslicked || i.slideHandler(t, !0) }) }, t.prototype.applyTransition = function (e) { var t = this, i = {}; i[t.transitionType] = !1 === t.options.fade ? t.transformType + " " + t.options.speed + "ms " + t.options.cssEase : "opacity " + t.options.speed + "ms " + t.options.cssEase, !1 === t.options.fade ? t.$slideTrack.css(i) : t.$slides.eq(e).css(i) }, t.prototype.autoPlay = function () { var e = this; e.autoPlayTimer && clearInterval(e.autoPlayTimer), e.slideCount > e.options.slidesToShow && !0 !== e.paused && (e.autoPlayTimer = setInterval(e.autoPlayIterator, e.options.autoplaySpeed)) }, t.prototype.autoPlayClear = function () { this.autoPlayTimer && clearInterval(this.autoPlayTimer) }, t.prototype.autoPlayIterator = function () { var e = this; !1 === e.options.infinite ? 1 === e.direction ? (e.currentSlide + 1 === e.slideCount - 1 && (e.direction = 0), e.slideHandler(e.currentSlide + e.options.slidesToScroll)) : (0 == e.currentSlide - 1 && (e.direction = 1), e.slideHandler(e.currentSlide - e.options.slidesToScroll)) : e.slideHandler(e.currentSlide + e.options.slidesToScroll) }, t.prototype.buildArrows = function () { var t = this; !0 === t.options.arrows && (t.$prevArrow = e(t.options.prevArrow).addClass("slick-arrow"), t.$nextArrow = e(t.options.nextArrow).addClass("slick-arrow"), t.slideCount > t.options.slidesToShow ? (t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.prependTo(t.options.appendArrows), t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.appendTo(t.options.appendArrows), !0 !== t.options.infinite && t.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({ "aria-disabled": "true", tabindex: "-1" })) }, t.prototype.buildDots = function () { var t, i, n = this; if (!0 === n.options.dots && n.slideCount > n.options.slidesToShow) { for (i = '<ul class="' + n.options.dotsClass + '">', t = 0; t <= n.getDotCount() ; t += 1) i += "<li>" + n.options.customPaging.call(this, n, t) + "</li>"; i += "</ul>", n.$dots = e(i).appendTo(n.options.appendDots), n.$dots.find("li").first().addClass("slick-active").attr("aria-hidden", "false") } }, t.prototype.buildOut = function () { var t = this; t.$slides = t.$slider.children(t.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), t.slideCount = t.$slides.length, t.$slides.each(function (t, i) { e(i).attr("data-slick-index", t).data("originalStyling", e(i).attr("style") || "") }), t.$slidesCache = t.$slides, t.$slider.addClass("slick-slider"), t.$slideTrack = 0 === t.slideCount ? e('<div class="slick-track"/>').appendTo(t.$slider) : t.$slides.wrapAll('<div class="slick-track"/>').parent(), t.$list = t.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(), t.$slideTrack.css("opacity", 0), (!0 === t.options.centerMode || !0 === t.options.swipeToSlide) && (t.options.slidesToScroll = 1), e("img[data-lazy]", t.$slider).not("[src]").addClass("slick-loading"), t.setupInfinite(), t.buildArrows(), t.buildDots(), t.updateDots(), t.setSlideClasses("number" == typeof t.currentSlide ? t.currentSlide : 0), !0 === t.options.draggable && t.$list.addClass("draggable") }, t.prototype.buildRows = function () { var e, t, i, n, s, o, r, a = this; if (n = document.createDocumentFragment(), o = a.$slider.children(), a.options.rows > 1) { for (r = a.options.slidesPerRow * a.options.rows, s = Math.ceil(o.length / r), e = 0; s > e; e++) { var l = document.createElement("div"); for (t = 0; t < a.options.rows; t++) { var d = document.createElement("div"); for (i = 0; i < a.options.slidesPerRow; i++) { var c = e * r + (t * a.options.slidesPerRow + i); o.get(c) && d.appendChild(o.get(c)) } l.appendChild(d) } n.appendChild(l) } a.$slider.html(n), a.$slider.children().children().children().css({ width: 100 / a.options.slidesPerRow + "%", display: "inline-block" }) } }, t.prototype.checkResponsive = function (t, i) { var n, s, o, r = this, a = !1, l = r.$slider.width(), d = window.innerWidth || e(window).width(); if ("window" === r.respondTo ? o = d : "slider" === r.respondTo ? o = l : "min" === r.respondTo && (o = Math.min(d, l)), r.options.responsive && r.options.responsive.length && null !== r.options.responsive) { s = null; for (n in r.breakpoints) r.breakpoints.hasOwnProperty(n) && (!1 === r.originalSettings.mobileFirst ? o < r.breakpoints[n] && (s = r.breakpoints[n]) : o > r.breakpoints[n] && (s = r.breakpoints[n])); null !== s ? null !== r.activeBreakpoint ? (s !== r.activeBreakpoint || i) && (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = e.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === t && (r.currentSlide = r.options.initialSlide), r.refresh(t)), a = s) : (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = e.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === t && (r.currentSlide = r.options.initialSlide), r.refresh(t)), a = s) : null !== r.activeBreakpoint && (r.activeBreakpoint = null, r.options = r.originalSettings, !0 === t && (r.currentSlide = r.options.initialSlide), r.refresh(t), a = s), t || !1 === a || r.$slider.trigger("breakpoint", [r, a]) } }, t.prototype.changeSlide = function (t, i) { var n, s, o = this, r = e(t.target); switch (r.is("a") && t.preventDefault(), r.is("li") || (r = r.closest("li")), n = 0 != o.slideCount % o.options.slidesToScroll ? 0 : (o.slideCount - o.currentSlide) % o.options.slidesToScroll, t.data.message) { case "previous": s = 0 === n ? o.options.slidesToScroll : o.options.slidesToShow - n, o.slideCount > o.options.slidesToShow && o.slideHandler(o.currentSlide - s, !1, i); break; case "next": s = 0 === n ? o.options.slidesToScroll : n, o.slideCount > o.options.slidesToShow && o.slideHandler(o.currentSlide + s, !1, i); break; case "index": var a = 0 === t.data.index ? 0 : t.data.index || r.index() * o.options.slidesToScroll; o.slideHandler(o.checkNavigable(a), !1, i), r.children().trigger("focus"); break; default: return } }, t.prototype.checkNavigable = function (e) { var t, i; if (i = 0, e > (t = this.getNavigableIndexes())[t.length - 1]) e = t[t.length - 1]; else for (var n in t) { if (e < t[n]) { e = i; break } i = t[n] } return e }, t.prototype.cleanUpEvents = function () { var t = this; t.options.dots && null !== t.$dots && (e("li", t.$dots).off("click.slick", t.changeSlide), !0 === t.options.pauseOnDotsHover && !0 === t.options.autoplay && e("li", t.$dots).off("mouseenter.slick", e.proxy(t.setPaused, t, !0)).off("mouseleave.slick", e.proxy(t.setPaused, t, !1))), !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow && t.$prevArrow.off("click.slick", t.changeSlide), t.$nextArrow && t.$nextArrow.off("click.slick", t.changeSlide)), t.$list.off("touchstart.slick mousedown.slick", t.swipeHandler), t.$list.off("touchmove.slick mousemove.slick", t.swipeHandler), t.$list.off("touchend.slick mouseup.slick", t.swipeHandler), t.$list.off("touchcancel.slick mouseleave.slick", t.swipeHandler), t.$list.off("click.slick", t.clickHandler), e(document).off(t.visibilityChange, t.visibility), t.$list.off("mouseenter.slick", e.proxy(t.setPaused, t, !0)), t.$list.off("mouseleave.slick", e.proxy(t.setPaused, t, !1)), !0 === t.options.accessibility && t.$list.off("keydown.slick", t.keyHandler), !0 === t.options.focusOnSelect && e(t.$slideTrack).children().off("click.slick", t.selectHandler), e(window).off("orientationchange.slick.slick-" + t.instanceUid, t.orientationChange), e(window).off("resize.slick.slick-" + t.instanceUid, t.resize), e("[draggable!=true]", t.$slideTrack).off("dragstart", t.preventDefault), e(window).off("load.slick.slick-" + t.instanceUid, t.setPosition), e(document).off("ready.slick.slick-" + t.instanceUid, t.setPosition) }, t.prototype.cleanUpRows = function () { var e; this.options.rows > 1 && ((e = this.$slides.children().children()).removeAttr("style"), this.$slider.html(e)) }, t.prototype.clickHandler = function (e) { !1 === this.shouldClick && (e.stopImmediatePropagation(), e.stopPropagation(), e.preventDefault()) }, t.prototype.destroy = function (t) { var i = this; i.autoPlayClear(), i.touchObject = {}, i.cleanUpEvents(), e(".slick-cloned", i.$slider).detach(), i.$dots && i.$dots.remove(), i.$prevArrow && i.$prevArrow.length && (i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), i.htmlExpr.test(i.options.prevArrow) && i.$prevArrow.remove()), i.$nextArrow && i.$nextArrow.length && (i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), i.htmlExpr.test(i.options.nextArrow) && i.$nextArrow.remove()), i.$slides && (i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function () { e(this).attr("style", e(this).data("originalStyling")) }), i.$slideTrack.children(this.options.slide).detach(), i.$slideTrack.detach(), i.$list.detach(), i.$slider.append(i.$slides)), i.cleanUpRows(), i.$slider.removeClass("slick-slider"), i.$slider.removeClass("slick-initialized"), i.unslicked = !0, t || i.$slider.trigger("destroy", [i]) }, t.prototype.disableTransition = function (e) { var t = {}; t[this.transitionType] = "", !1 === this.options.fade ? this.$slideTrack.css(t) : this.$slides.eq(e).css(t) }, t.prototype.fadeSlide = function (e, t) { var i = this; !1 === i.cssTransitions ? (i.$slides.eq(e).css({ zIndex: i.options.zIndex }), i.$slides.eq(e).animate({ opacity: 1 }, i.options.speed, i.options.easing, t)) : (i.applyTransition(e), i.$slides.eq(e).css({ opacity: 1, zIndex: i.options.zIndex }), t && setTimeout(function () { i.disableTransition(e), t.call() }, i.options.speed)) }, t.prototype.fadeSlideOut = function (e) { var t = this; !1 === t.cssTransitions ? t.$slides.eq(e).animate({ opacity: 0, zIndex: t.options.zIndex - 2 }, t.options.speed, t.options.easing) : (t.applyTransition(e), t.$slides.eq(e).css({ opacity: 0, zIndex: t.options.zIndex - 2 })) }, t.prototype.filterSlides = t.prototype.slickFilter = function (e) { var t = this; null !== e && (t.unload(), t.$slideTrack.children(this.options.slide).detach(), t.$slidesCache.filter(e).appendTo(t.$slideTrack), t.reinit()) }, t.prototype.getCurrent = t.prototype.slickCurrentSlide = function () { return this.currentSlide }, t.prototype.getDotCount = function () { var e = this, t = 0, i = 0, n = 0; if (!0 === e.options.infinite) for (; t < e.slideCount;)++n, t = i + e.options.slidesToShow, i += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; else if (!0 === e.options.centerMode) n = e.slideCount; else for (; t < e.slideCount;)++n, t = i + e.options.slidesToShow, i += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; return n - 1 }, t.prototype.getLeft = function (e) { var t, i, n, s = this, o = 0; return s.slideOffset = 0, i = s.$slides.first().outerHeight(!0), !0 === s.options.infinite ? (s.slideCount > s.options.slidesToShow && (s.slideOffset = -1 * s.slideWidth * s.options.slidesToShow, o = -1 * i * s.options.slidesToShow), 0 != s.slideCount % s.options.slidesToScroll && e + s.options.slidesToScroll > s.slideCount && s.slideCount > s.options.slidesToShow && (e > s.slideCount ? (s.slideOffset = -1 * (s.options.slidesToShow - (e - s.slideCount)) * s.slideWidth, o = -1 * (s.options.slidesToShow - (e - s.slideCount)) * i) : (s.slideOffset = -1 * s.slideCount % s.options.slidesToScroll * s.slideWidth, o = -1 * s.slideCount % s.options.slidesToScroll * i))) : e + s.options.slidesToShow > s.slideCount && (s.slideOffset = (e + s.options.slidesToShow - s.slideCount) * s.slideWidth, o = (e + s.options.slidesToShow - s.slideCount) * i), s.slideCount <= s.options.slidesToShow && (s.slideOffset = 0, o = 0), !0 === s.options.centerMode && !0 === s.options.infinite ? s.slideOffset += s.slideWidth * Math.floor(s.options.slidesToShow / 2) - s.slideWidth : !0 === s.options.centerMode && (s.slideOffset = 0, s.slideOffset += s.slideWidth * Math.floor(s.options.slidesToShow / 2)), t = !1 === s.options.vertical ? -1 * e * s.slideWidth + s.slideOffset : -1 * e * i + o, !0 === s.options.variableWidth && (t = (n = s.slideCount <= s.options.slidesToShow || !1 === s.options.infinite ? s.$slideTrack.children(".slick-slide").eq(e) : s.$slideTrack.children(".slick-slide").eq(e + s.options.slidesToShow))[0] ? -1 * n[0].offsetLeft : 0, !0 === s.options.centerMode && (t = (n = !1 === s.options.infinite ? s.$slideTrack.children(".slick-slide").eq(e) : s.$slideTrack.children(".slick-slide").eq(e + s.options.slidesToShow + 1))[0] ? -1 * n[0].offsetLeft : 0, t += (s.$list.width() - n.outerWidth()) / 2)), t }, t.prototype.getOption = t.prototype.slickGetOption = function (e) { return this.options[e] }, t.prototype.getNavigableIndexes = function () { var e, t = this, i = 0, n = 0, s = []; for (!1 === t.options.infinite ? e = t.slideCount : (i = -1 * t.options.slidesToScroll, n = -1 * t.options.slidesToScroll, e = 2 * t.slideCount) ; e > i;) s.push(i), i = n + t.options.slidesToScroll, n += t.options.slidesToScroll <= t.options.slidesToShow ? t.options.slidesToScroll : t.options.slidesToShow; return s }, t.prototype.getSlick = function () { return this }, t.prototype.getSlideCount = function () { var t, i, n = this; return i = !0 === n.options.centerMode ? n.slideWidth * Math.floor(n.options.slidesToShow / 2) : 0, !0 === n.options.swipeToSlide ? (n.$slideTrack.find(".slick-slide").each(function (s, o) { return o.offsetLeft - i + e(o).outerWidth() / 2 > -1 * n.swipeLeft ? (t = o, !1) : void 0 }), Math.abs(e(t).attr("data-slick-index") - n.currentSlide) || 1) : n.options.slidesToScroll }, t.prototype.goTo = t.prototype.slickGoTo = function (e, t) { this.changeSlide({ data: { message: "index", index: parseInt(e) } }, t) }, t.prototype.init = function (t) { var i = this; e(i.$slider).hasClass("slick-initialized") || (e(i.$slider).addClass("slick-initialized"), i.buildRows(), i.buildOut(), i.setProps(), i.startLoad(), i.loadSlider(), i.initializeEvents(), i.updateArrows(), i.updateDots()), t && i.$slider.trigger("init", [i]), !0 === i.options.accessibility && i.initADA() }, t.prototype.initArrowEvents = function () { var e = this; !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow.on("click.slick", { message: "previous" }, e.changeSlide), e.$nextArrow.on("click.slick", { message: "next" }, e.changeSlide)) }, t.prototype.initDotEvents = function () { var t = this; !0 === t.options.dots && t.slideCount > t.options.slidesToShow && e("li", t.$dots).on("click.slick", { message: "index" }, t.changeSlide), !0 === t.options.dots && !0 === t.options.pauseOnDotsHover && !0 === t.options.autoplay && e("li", t.$dots).on("mouseenter.slick", e.proxy(t.setPaused, t, !0)).on("mouseleave.slick", e.proxy(t.setPaused, t, !1)) }, t.prototype.initializeEvents = function () { var t = this; t.initArrowEvents(), t.initDotEvents(), t.$list.on("touchstart.slick mousedown.slick", { action: "start" }, t.swipeHandler), t.$list.on("touchmove.slick mousemove.slick", { action: "move" }, t.swipeHandler), t.$list.on("touchend.slick mouseup.slick", { action: "end" }, t.swipeHandler), t.$list.on("touchcancel.slick mouseleave.slick", { action: "end" }, t.swipeHandler), t.$list.on("click.slick", t.clickHandler), e(document).on(t.visibilityChange, e.proxy(t.visibility, t)), t.$list.on("mouseenter.slick", e.proxy(t.setPaused, t, !0)), t.$list.on("mouseleave.slick", e.proxy(t.setPaused, t, !1)), !0 === t.options.accessibility && t.$list.on("keydown.slick", t.keyHandler), !0 === t.options.focusOnSelect && e(t.$slideTrack).children().on("click.slick", t.selectHandler), e(window).on("orientationchange.slick.slick-" + t.instanceUid, e.proxy(t.orientationChange, t)), e(window).on("resize.slick.slick-" + t.instanceUid, e.proxy(t.resize, t)), e("[draggable!=true]", t.$slideTrack).on("dragstart", t.preventDefault), e(window).on("load.slick.slick-" + t.instanceUid, t.setPosition), e(document).on("ready.slick.slick-" + t.instanceUid, t.setPosition) }, t.prototype.initUI = function () { var e = this; !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow.show(), e.$nextArrow.show()), !0 === e.options.dots && e.slideCount > e.options.slidesToShow && e.$dots.show(), !0 === e.options.autoplay && e.autoPlay() }, t.prototype.keyHandler = function (e) { e.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === e.keyCode && !0 === this.options.accessibility ? this.changeSlide({ data: { message: "previous" } }) : 39 === e.keyCode && !0 === this.options.accessibility && this.changeSlide({ data: { message: "next" } })) }, t.prototype.lazyLoad = function () { function t(t) { e("img[data-lazy]", t).each(function () { var t = e(this), i = e(this).attr("data-lazy"), n = document.createElement("img"); n.onload = function () { t.animate({ opacity: 0 }, 100, function () { t.attr("src", i).animate({ opacity: 1 }, 200, function () { t.removeAttr("data-lazy").removeClass("slick-loading") }) }) }, n.src = i }) } var i, n, s = this; !0 === s.options.centerMode ? !0 === s.options.infinite ? n = (i = s.currentSlide + (s.options.slidesToShow / 2 + 1)) + s.options.slidesToShow + 2 : (i = Math.max(0, s.currentSlide - (s.options.slidesToShow / 2 + 1)), n = s.options.slidesToShow / 2 + 1 + 2 + s.currentSlide) : (n = (i = s.options.infinite ? s.options.slidesToShow + s.currentSlide : s.currentSlide) + s.options.slidesToShow, !0 === s.options.fade && (i > 0 && i--, n <= s.slideCount && n++)), t(s.$slider.find(".slick-slide").slice(i, n)), s.slideCount <= s.options.slidesToShow ? t(s.$slider.find(".slick-slide")) : s.currentSlide >= s.slideCount - s.options.slidesToShow ? t(s.$slider.find(".slick-cloned").slice(0, s.options.slidesToShow)) : 0 === s.currentSlide && t(s.$slider.find(".slick-cloned").slice(-1 * s.options.slidesToShow)) }, t.prototype.loadSlider = function () { var e = this; e.setPosition(), e.$slideTrack.css({ opacity: 1 }), e.$slider.removeClass("slick-loading"), e.initUI(), "progressive" === e.options.lazyLoad && e.progressiveLazyLoad() }, t.prototype.next = t.prototype.slickNext = function () { this.changeSlide({ data: { message: "next" } }) }, t.prototype.orientationChange = function () { this.checkResponsive(), this.setPosition() }, t.prototype.pause = t.prototype.slickPause = function () { this.autoPlayClear(), this.paused = !0 }, t.prototype.play = t.prototype.slickPlay = function () { this.paused = !1, this.autoPlay() }, t.prototype.postSlide = function (e) { var t = this; t.$slider.trigger("afterChange", [t, e]), t.animating = !1, t.setPosition(), t.swipeLeft = null, !0 === t.options.autoplay && !1 === t.paused && t.autoPlay(), !0 === t.options.accessibility && t.initADA() }, t.prototype.prev = t.prototype.slickPrev = function () { this.changeSlide({ data: { message: "previous" } }) }, t.prototype.preventDefault = function (e) { e.preventDefault() }, t.prototype.progressiveLazyLoad = function () { var t, i = this; e("img[data-lazy]", i.$slider).length > 0 && (t = e("img[data-lazy]", i.$slider).first()).attr("src", t.attr("data-lazy")).removeClass("slick-loading").load(function () { t.removeAttr("data-lazy"), i.progressiveLazyLoad(), !0 === i.options.adaptiveHeight && i.setPosition() }).error(function () { t.removeAttr("data-lazy"), i.progressiveLazyLoad() }) }, t.prototype.refresh = function (t) { var i = this, n = i.currentSlide; i.destroy(!0), e.extend(i, i.initials, { currentSlide: n }), i.init(), t || i.changeSlide({ data: { message: "index", index: n } }, !1) }, t.prototype.registerBreakpoints = function () { var t, i, n, s = this, o = s.options.responsive || null; if ("array" === e.type(o) && o.length) { s.respondTo = s.options.respondTo || "window"; for (t in o) if (n = s.breakpoints.length - 1, i = o[t].breakpoint, o.hasOwnProperty(t)) { for (; n >= 0;) s.breakpoints[n] && s.breakpoints[n] === i && s.breakpoints.splice(n, 1), n--; s.breakpoints.push(i), s.breakpointSettings[i] = o[t].settings } s.breakpoints.sort(function (e, t) { return s.options.mobileFirst ? e - t : t - e }) } }, t.prototype.reinit = function () { var t = this; t.$slides = t.$slideTrack.children(t.options.slide).addClass("slick-slide"), t.slideCount = t.$slides.length, t.currentSlide >= t.slideCount && 0 !== t.currentSlide && (t.currentSlide = t.currentSlide - t.options.slidesToScroll), t.slideCount <= t.options.slidesToShow && (t.currentSlide = 0), t.registerBreakpoints(), t.setProps(), t.setupInfinite(), t.buildArrows(), t.updateArrows(), t.initArrowEvents(), t.buildDots(), t.updateDots(), t.initDotEvents(), t.checkResponsive(!1, !0), !0 === t.options.focusOnSelect && e(t.$slideTrack).children().on("click.slick", t.selectHandler), t.setSlideClasses(0), t.setPosition(), t.$slider.trigger("reInit", [t]), !0 === t.options.autoplay && t.focusHandler() }, t.prototype.resize = function () { var t = this; e(window).width() !== t.windowWidth && (clearTimeout(t.windowDelay), t.windowDelay = window.setTimeout(function () { t.windowWidth = e(window).width(), t.checkResponsive(), t.unslicked || t.setPosition() }, 50)) }, t.prototype.removeSlide = t.prototype.slickRemove = function (e, t, i) { var n = this; return "boolean" == typeof e ? e = !0 === (t = e) ? 0 : n.slideCount - 1 : e = !0 === t ? --e : e, !(n.slideCount < 1 || 0 > e || e > n.slideCount - 1) && (n.unload(), !0 === i ? n.$slideTrack.children().remove() : n.$slideTrack.children(this.options.slide).eq(e).remove(), n.$slides = n.$slideTrack.children(this.options.slide), n.$slideTrack.children(this.options.slide).detach(), n.$slideTrack.append(n.$slides), n.$slidesCache = n.$slides, void n.reinit()) }, t.prototype.setCSS = function (e) { var t, i, n = this, s = {}; !0 === n.options.rtl && (e = -e), t = "left" == n.positionProp ? Math.ceil(e) + "px" : "0px", i = "top" == n.positionProp ? Math.ceil(e) + "px" : "0px", s[n.positionProp] = e, !1 === n.transformsEnabled ? n.$slideTrack.css(s) : (s = {}, !1 === n.cssTransitions ? (s[n.animType] = "translate(" + t + ", " + i + ")", n.$slideTrack.css(s)) : (s[n.animType] = "translate3d(" + t + ", " + i + ", 0px)", n.$slideTrack.css(s))) }, t.prototype.setDimensions = function () { var e = this; !1 === e.options.vertical ? !0 === e.options.centerMode && e.$list.css({ padding: "0px " + e.options.centerPadding }) : (e.$list.height(e.$slides.first().outerHeight(!0) * e.options.slidesToShow), !0 === e.options.centerMode && e.$list.css({ padding: e.options.centerPadding + " 0px" })), e.listWidth = e.$list.width(), e.listHeight = e.$list.height(), !1 === e.options.vertical && !1 === e.options.variableWidth ? (e.slideWidth = Math.ceil(e.listWidth / e.options.slidesToShow), e.$slideTrack.width(Math.ceil(e.slideWidth * e.$slideTrack.children(".slick-slide").length))) : !0 === e.options.variableWidth ? e.$slideTrack.width(5e3 * e.slideCount) : (e.slideWidth = Math.ceil(e.listWidth), e.$slideTrack.height(Math.ceil(e.$slides.first().outerHeight(!0) * e.$slideTrack.children(".slick-slide").length))); var t = e.$slides.first().outerWidth(!0) - e.$slides.first().width(); !1 === e.options.variableWidth && e.$slideTrack.children(".slick-slide").width(e.slideWidth - t) }, t.prototype.setFade = function () { var t, i = this; i.$slides.each(function (n, s) { t = -1 * i.slideWidth * n, !0 === i.options.rtl ? e(s).css({ position: "relative", right: t, top: 0, zIndex: i.options.zIndex - 2, opacity: 0 }) : e(s).css({ position: "relative", left: t, top: 0, zIndex: i.options.zIndex - 2, opacity: 0 }) }), i.$slides.eq(i.currentSlide).css({ zIndex: i.options.zIndex - 1, opacity: 1 }) }, t.prototype.setHeight = function () { var e = this; if (1 === e.options.slidesToShow && !0 === e.options.adaptiveHeight && !1 === e.options.vertical) { var t = e.$slides.eq(e.currentSlide).outerHeight(!0); e.$list.css("height", t) } }, t.prototype.setOption = t.prototype.slickSetOption = function (t, i, n) { var s, o, r = this; if ("responsive" === t && "array" === e.type(i)) for (o in i) if ("array" !== e.type(r.options.responsive)) r.options.responsive = [i[o]]; else { for (s = r.options.responsive.length - 1; s >= 0;) r.options.responsive[s].breakpoint === i[o].breakpoint && r.options.responsive.splice(s, 1), s--; r.options.responsive.push(i[o]) } else r.options[t] = i; !0 === n && (r.unload(), r.reinit()) }, t.prototype.setPosition = function () { var e = this; e.setDimensions(), e.setHeight(), !1 === e.options.fade ? e.setCSS(e.getLeft(e.currentSlide)) : e.setFade(), e.$slider.trigger("setPosition", [e]) }, t.prototype.setProps = function () { var e = this, t = document.body.style; e.positionProp = !0 === e.options.vertical ? "top" : "left", "top" === e.positionProp ? e.$slider.addClass("slick-vertical") : e.$slider.removeClass("slick-vertical"), (void 0 !== t.WebkitTransition || void 0 !== t.MozTransition || void 0 !== t.msTransition) && !0 === e.options.useCSS && (e.cssTransitions = !0), e.options.fade && ("number" == typeof e.options.zIndex ? e.options.zIndex < 3 && (e.options.zIndex = 3) : e.options.zIndex = e.defaults.zIndex), void 0 !== t.OTransform && (e.animType = "OTransform", e.transformType = "-o-transform", e.transitionType = "OTransition", void 0 === t.perspectiveProperty && void 0 === t.webkitPerspective && (e.animType = !1)), void 0 !== t.MozTransform && (e.animType = "MozTransform", e.transformType = "-moz-transform", e.transitionType = "MozTransition", void 0 === t.perspectiveProperty && void 0 === t.MozPerspective && (e.animType = !1)), void 0 !== t.webkitTransform && (e.animType = "webkitTransform", e.transformType = "-webkit-transform", e.transitionType = "webkitTransition", void 0 === t.perspectiveProperty && void 0 === t.webkitPerspective && (e.animType = !1)), void 0 !== t.msTransform && (e.animType = "msTransform", e.transformType = "-ms-transform", e.transitionType = "msTransition", void 0 === t.msTransform && (e.animType = !1)), void 0 !== t.transform && !1 !== e.animType && (e.animType = "transform", e.transformType = "transform", e.transitionType = "transition"), e.transformsEnabled = null !== e.animType && !1 !== e.animType }, t.prototype.setSlideClasses = function (e) { var t, i, n, s, o = this; i = o.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), o.$slides.eq(e).addClass("slick-current"), !0 === o.options.centerMode ? (t = Math.floor(o.options.slidesToShow / 2), !0 === o.options.infinite && (e >= t && e <= o.slideCount - 1 - t ? o.$slides.slice(e - t, e + t + 1).addClass("slick-active").attr("aria-hidden", "false") : (n = o.options.slidesToShow + e, i.slice(n - t + 1, n + t + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === e ? i.eq(i.length - 1 - o.options.slidesToShow).addClass("slick-center") : e === o.slideCount - 1 && i.eq(o.options.slidesToShow).addClass("slick-center")), o.$slides.eq(e).addClass("slick-center")) : e >= 0 && e <= o.slideCount - o.options.slidesToShow ? o.$slides.slice(e, e + o.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : i.length <= o.options.slidesToShow ? i.addClass("slick-active").attr("aria-hidden", "false") : (s = o.slideCount % o.options.slidesToShow, n = !0 === o.options.infinite ? o.options.slidesToShow + e : e, o.options.slidesToShow == o.options.slidesToScroll && o.slideCount - e < o.options.slidesToShow ? i.slice(n - (o.options.slidesToShow - s), n + s).addClass("slick-active").attr("aria-hidden", "false") : i.slice(n, n + o.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")), "ondemand" === o.options.lazyLoad && o.lazyLoad() }, t.prototype.setupInfinite = function () { var t, i, n, s = this; if (!0 === s.options.fade && (s.options.centerMode = !1), !0 === s.options.infinite && !1 === s.options.fade && (i = null, s.slideCount > s.options.slidesToShow)) { for (n = !0 === s.options.centerMode ? s.options.slidesToShow + 1 : s.options.slidesToShow, t = s.slideCount; t > s.slideCount - n; t -= 1) i = t - 1, e(s.$slides[i]).clone(!0).attr("id", "").attr("data-slick-index", i - s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned"); for (t = 0; n > t; t += 1) i = t, e(s.$slides[i]).clone(!0).attr("id", "").attr("data-slick-index", i + s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned"); s.$slideTrack.find(".slick-cloned").find("[id]").each(function () { e(this).attr("id", "") }) } }, t.prototype.setPaused = function (e) { var t = this; !0 === t.options.autoplay && !0 === t.options.pauseOnHover && (t.paused = e, e ? t.autoPlayClear() : t.autoPlay()) }, t.prototype.selectHandler = function (t) { var i = this, n = e(t.target).is(".slick-slide") ? e(t.target) : e(t.target).parents(".slick-slide"), s = parseInt(n.attr("data-slick-index")); return s || (s = 0), i.slideCount <= i.options.slidesToShow ? (i.setSlideClasses(s), void i.asNavFor(s)) : void i.slideHandler(s) }, t.prototype.slideHandler = function (e, t, i) { var n, s, o, r, a = null, l = this; return t = t || !1, !0 === l.animating && !0 === l.options.waitForAnimate || !0 === l.options.fade && l.currentSlide === e || l.slideCount <= l.options.slidesToShow ? void 0 : (!1 === t && l.asNavFor(e), n = e, a = l.getLeft(n), r = l.getLeft(l.currentSlide), l.currentLeft = null === l.swipeLeft ? r : l.swipeLeft, !1 === l.options.infinite && !1 === l.options.centerMode && (0 > e || e > l.getDotCount() * l.options.slidesToScroll) ? void (!1 === l.options.fade && (n = l.currentSlide, !0 !== i ? l.animateSlide(r, function () { l.postSlide(n) }) : l.postSlide(n))) : !1 === l.options.infinite && !0 === l.options.centerMode && (0 > e || e > l.slideCount - l.options.slidesToScroll) ? void (!1 === l.options.fade && (n = l.currentSlide, !0 !== i ? l.animateSlide(r, function () { l.postSlide(n) }) : l.postSlide(n))) : (!0 === l.options.autoplay && clearInterval(l.autoPlayTimer), s = 0 > n ? 0 != l.slideCount % l.options.slidesToScroll ? l.slideCount - l.slideCount % l.options.slidesToScroll : l.slideCount + n : n >= l.slideCount ? 0 != l.slideCount % l.options.slidesToScroll ? 0 : n - l.slideCount : n, l.animating = !0, l.$slider.trigger("beforeChange", [l, l.currentSlide, s]), o = l.currentSlide, l.currentSlide = s, l.setSlideClasses(l.currentSlide), l.updateDots(), l.updateArrows(), !0 === l.options.fade ? (!0 !== i ? (l.fadeSlideOut(o), l.fadeSlide(s, function () { l.postSlide(s) })) : l.postSlide(s), void l.animateHeight()) : void (!0 !== i ? l.animateSlide(a, function () { l.postSlide(s) }) : l.postSlide(s)))) }, t.prototype.startLoad = function () { var e = this; !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow.hide(), e.$nextArrow.hide()), !0 === e.options.dots && e.slideCount > e.options.slidesToShow && e.$dots.hide(), e.$slider.addClass("slick-loading") }, t.prototype.swipeDirection = function () { var e, t, i, n, s = this; return e = s.touchObject.startX - s.touchObject.curX, t = s.touchObject.startY - s.touchObject.curY, i = Math.atan2(t, e), 0 > (n = Math.round(180 * i / Math.PI)) && (n = 360 - Math.abs(n)), 45 >= n && n >= 0 ? !1 === s.options.rtl ? "left" : "right" : 360 >= n && n >= 315 ? !1 === s.options.rtl ? "left" : "right" : n >= 135 && 225 >= n ? !1 === s.options.rtl ? "right" : "left" : !0 === s.options.verticalSwiping ? n >= 35 && 135 >= n ? "left" : "right" : "vertical" }, t.prototype.swipeEnd = function () { var e, t = this; if (t.dragging = !1, t.shouldClick = !(t.touchObject.swipeLength > 10), void 0 === t.touchObject.curX) return !1; if (!0 === t.touchObject.edgeHit && t.$slider.trigger("edge", [t, t.swipeDirection()]), t.touchObject.swipeLength >= t.touchObject.minSwipe) switch (t.swipeDirection()) { case "left": e = t.options.swipeToSlide ? t.checkNavigable(t.currentSlide + t.getSlideCount()) : t.currentSlide + t.getSlideCount(), t.slideHandler(e), t.currentDirection = 0, t.touchObject = {}, t.$slider.trigger("swipe", [t, "left"]); break; case "right": e = t.options.swipeToSlide ? t.checkNavigable(t.currentSlide - t.getSlideCount()) : t.currentSlide - t.getSlideCount(), t.slideHandler(e), t.currentDirection = 1, t.touchObject = {}, t.$slider.trigger("swipe", [t, "right"]) } else t.touchObject.startX !== t.touchObject.curX && (t.slideHandler(t.currentSlide), t.touchObject = {}) }, t.prototype.swipeHandler = function (e) { var t = this; if (!(!1 === t.options.swipe || "ontouchend" in document && !1 === t.options.swipe || !1 === t.options.draggable && -1 !== e.type.indexOf("mouse"))) switch (t.touchObject.fingerCount = e.originalEvent && void 0 !== e.originalEvent.touches ? e.originalEvent.touches.length : 1, t.touchObject.minSwipe = t.listWidth / t.options.touchThreshold, !0 === t.options.verticalSwiping && (t.touchObject.minSwipe = t.listHeight / t.options.touchThreshold), e.data.action) { case "start": t.swipeStart(e); break; case "move": t.swipeMove(e); break; case "end": t.swipeEnd(e) } }, t.prototype.swipeMove = function (e) { var t, i, n, s, o, r = this; return o = void 0 !== e.originalEvent ? e.originalEvent.touches : null, !(!r.dragging || o && 1 !== o.length) && (t = r.getLeft(r.currentSlide), r.touchObject.curX = void 0 !== o ? o[0].pageX : e.clientX, r.touchObject.curY = void 0 !== o ? o[0].pageY : e.clientY, r.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(r.touchObject.curX - r.touchObject.startX, 2))), !0 === r.options.verticalSwiping && (r.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(r.touchObject.curY - r.touchObject.startY, 2)))), "vertical" !== (i = r.swipeDirection()) ? (void 0 !== e.originalEvent && r.touchObject.swipeLength > 4 && e.preventDefault(), s = (!1 === r.options.rtl ? 1 : -1) * (r.touchObject.curX > r.touchObject.startX ? 1 : -1), !0 === r.options.verticalSwiping && (s = r.touchObject.curY > r.touchObject.startY ? 1 : -1), n = r.touchObject.swipeLength, r.touchObject.edgeHit = !1, !1 === r.options.infinite && (0 === r.currentSlide && "right" === i || r.currentSlide >= r.getDotCount() && "left" === i) && (n = r.touchObject.swipeLength * r.options.edgeFriction, r.touchObject.edgeHit = !0), r.swipeLeft = !1 === r.options.vertical ? t + n * s : t + n * (r.$list.height() / r.listWidth) * s, !0 === r.options.verticalSwiping && (r.swipeLeft = t + n * s), !0 !== r.options.fade && !1 !== r.options.touchMove && (!0 === r.animating ? (r.swipeLeft = null, !1) : void r.setCSS(r.swipeLeft))) : void 0) }, t.prototype.swipeStart = function (e) { var t, i = this; return 1 !== i.touchObject.fingerCount || i.slideCount <= i.options.slidesToShow ? (i.touchObject = {}, !1) : (void 0 !== e.originalEvent && void 0 !== e.originalEvent.touches && (t = e.originalEvent.touches[0]), i.touchObject.startX = i.touchObject.curX = void 0 !== t ? t.pageX : e.clientX, i.touchObject.startY = i.touchObject.curY = void 0 !== t ? t.pageY : e.clientY, void (i.dragging = !0)) }, t.prototype.unfilterSlides = t.prototype.slickUnfilter = function () { var e = this; null !== e.$slidesCache && (e.unload(), e.$slideTrack.children(this.options.slide).detach(), e.$slidesCache.appendTo(e.$slideTrack), e.reinit()) }, t.prototype.unload = function () { var t = this; e(".slick-cloned", t.$slider).remove(), t.$dots && t.$dots.remove(), t.$prevArrow && t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.remove(), t.$nextArrow && t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.remove(), t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "") }, t.prototype.unslick = function (e) { this.$slider.trigger("unslick", [this, e]), this.destroy() }, t.prototype.updateArrows = function () { var e = this; Math.floor(e.options.slidesToShow / 2), !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && !e.options.infinite && (e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === e.currentSlide ? (e.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : e.currentSlide >= e.slideCount - e.options.slidesToShow && !1 === e.options.centerMode ? (e.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : e.currentSlide >= e.slideCount - 1 && !0 === e.options.centerMode && (e.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))) }, t.prototype.updateDots = function () { var e = this; null !== e.$dots && (e.$dots.find("li").removeClass("slick-active").attr("aria-hidden", "true"), e.$dots.find("li").eq(Math.floor(e.currentSlide / e.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden", "false")) }, t.prototype.visibility = function () { var e = this; document[e.hidden] ? (e.paused = !0, e.autoPlayClear()) : !0 === e.options.autoplay && (e.paused = !1, e.autoPlay()) }, t.prototype.initADA = function () { var t = this; t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({ "aria-hidden": "true", tabindex: "-1" }).find("a, input, button, select").attr({ tabindex: "-1" }), t.$slideTrack.attr("role", "listbox"), t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function (i) { e(this).attr({ role: "option", "aria-describedby": "slick-slide" + t.instanceUid + i }) }), null !== t.$dots && t.$dots.attr("role", "tablist").find("li").each(function (i) { e(this).attr({ role: "presentation", "aria-selected": "false", "aria-controls": "navigation" + t.instanceUid + i, id: "slick-slide" + t.instanceUid + i }) }).first().attr("aria-selected", "true").end().find("button").attr("role", "button").end().closest("div").attr("role", "toolbar"), t.activateADA() }, t.prototype.activateADA = function () { var e = this.$slider.find("*").is(":focus"); this.$slideTrack.find(".slick-active").attr({ "aria-hidden": "false", tabindex: "0" }).find("a, input, button, select").attr({ tabindex: "0" }), e && this.$slideTrack.find(".slick-active").focus() }, t.prototype.focusHandler = function () { var t = this; t.$slider.on("focus.slick blur.slick", "*", function (i) { i.stopImmediatePropagation(); var n = e(this); setTimeout(function () { t.isPlay && (n.is(":focus") ? (t.autoPlayClear(), t.paused = !0) : (t.paused = !1, t.autoPlay())) }, 0) }) }, e.fn.slick = function () { for (var e, i = this, n = arguments[0], s = Array.prototype.slice.call(arguments, 1), o = i.length, r = 0; o > r; r++) if ("object" == typeof n || void 0 === n ? i[r].slick = new t(i[r], n) : e = i[r].slick[n].apply(i[r].slick, s), void 0 !== e) return e; return i } }), function (e) { "use strict"; "function" == typeof define && define.amd ? define(e) : "undefined" != typeof module && void 0 !== module.exports ? module.exports = e() : "undefined" != typeof Package ? Sortable = e() : window.Sortable = e() }(function () { "use strict"; var e, t, i, n, s, o, r, a, l, d, c, u, p, h, f, g, v, m, y = {}, b = /\s+/g, w = "Sortable" + (new Date).getTime(), k = window, C = k.document, S = k.parseInt, $ = !!("draggable" in C.createElement("div")), T = ((m = C.createElement("x")).style.cssText = "pointer-events:auto", "auto" === m.style.pointerEvents), x = !1, A = Math.abs, O = [], D = U(function (e, t, i) { if (i && t.scroll) { var n, s, o, l, d = t.scrollSensitivity, c = t.scrollSpeed, u = e.clientX, p = e.clientY, h = window.innerWidth, f = window.innerHeight; if (a !== i && (r = t.scroll, a = i, !0 === r)) { r = i; do { if (r.offsetWidth < r.scrollWidth || r.offsetHeight < r.scrollHeight) break } while (r = r.parentNode) } r && (n = r, s = r.getBoundingClientRect(), o = (A(s.right - u) <= d) - (A(s.left - u) <= d), l = (A(s.bottom - p) <= d) - (A(s.top - p) <= d)), o || l || (l = (f - p <= d) - (p <= d), ((o = (h - u <= d) - (u <= d)) || l) && (n = k)), y.vx === o && y.vy === l && y.el === n || (y.el = n, y.vx = o, y.vy = l, clearInterval(y.pid), n && (y.pid = setInterval(function () { n === k ? k.scrollTo(k.pageXOffset + o * c, k.pageYOffset + l * c) : (l && (n.scrollTop += l * c), o && (n.scrollLeft += o * c)) }, 24))) } }, 30), E = function (e) { var t = e.group; t && "object" == typeof t || (t = e.group = { name: t }), ["pull", "put"].forEach(function (e) { e in t || (t[e] = !0) }), e.groups = " " + t.name + (t.put.join ? " " + t.put.join(" ") : "") + " " }; function I(e, t) { this.el = e, this.options = t = V({}, t), e[w] = this; var i = { group: Math.random(), sort: !0, disabled: !1, store: null, handle: null, scroll: !0, scrollSensitivity: 30, scrollSpeed: 10, draggable: /[uo]l/i.test(e.nodeName) ? "li" : ">*", ghostClass: "sortable-ghost", chosenClass: "sortable-chosen", ignore: "a, img", filter: null, animation: 0, setData: function (e, t) { e.setData("Text", t.textContent) }, dropBubble: !1, dragoverBubble: !1, dataIdAttr: "data-id", delay: 0, forceFallback: !1, fallbackClass: "sortable-fallback", fallbackOnBody: !1 }; for (var n in i) !(n in t) && (t[n] = i[n]); E(t); for (var s in this) "_" === s.charAt(0) && (this[s] = this[s].bind(this)); this.nativeDraggable = !t.forceFallback && $, z(e, "mousedown", this._onTapStart), z(e, "touchstart", this._onTapStart), this.nativeDraggable && (z(e, "dragover", this), z(e, "dragenter", this)), O.push(this._onDragOver), t.store && this.sort(t.store.get(this)) } function P(t) { n && n.state !== t && (R(n, "display", t ? "none" : ""), !t && n.state && s.insertBefore(n, e), n.state = t) } function _(e, t, i) { if (e) { i = i || C; var n = (t = t.split(".")).shift().toUpperCase(), s = new RegExp("\\s(" + t.join("|") + ")(?=\\s)", "g"); do { if (">*" === n && e.parentNode === i || ("" === n || e.nodeName.toUpperCase() == n) && (!t.length || ((" " + e.className + " ").match(s) || []).length == t.length)) return e } while (e !== i && (e = e.parentNode)) } return null } function z(e, t, i) { e.addEventListener(t, i, !1) } function L(e, t, i) { e.removeEventListener(t, i, !1) } function F(e, t, i) { if (e) if (e.classList) e.classList[i ? "add" : "remove"](t); else { var n = (" " + e.className + " ").replace(b, " ").replace(" " + t + " ", " "); e.className = (n + (i ? " " + t : "")).replace(b, " ") } } function R(e, t, i) { var n = e && e.style; if (n) { if (void 0 === i) return C.defaultView && C.defaultView.getComputedStyle ? i = C.defaultView.getComputedStyle(e, "") : e.currentStyle && (i = e.currentStyle), void 0 === t ? i : i[t]; t in n || (t = "-webkit-" + t), n[t] = i + ("string" == typeof i ? "" : "px") } } function H(e, t, i) { if (e) { var n = e.getElementsByTagName(t), s = 0, o = n.length; if (i) for (; s < o; s++) i(n[s], s); return n } return [] } function j(e, t, i, s, o, r, a) { var l = C.createEvent("Event"), d = (e || t[w]).options, c = "on" + i.charAt(0).toUpperCase() + i.substr(1); l.initEvent(i, !0, !0), l.to = t, l.from = o || t, l.item = s || t, l.clone = n, l.oldIndex = r, l.newIndex = a, t.dispatchEvent(l), d[c] && d[c].call(e, l) } function M(e, t, i, n, s, o) { var r, a, l = e[w], d = l.options.onMove; return (r = C.createEvent("Event")).initEvent("move", !0, !0), r.to = t, r.from = e, r.dragged = i, r.draggedRect = n, r.related = s || t, r.relatedRect = o || t.getBoundingClientRect(), e.dispatchEvent(r), d && (a = d.call(l, r)), a } function N(e) { e.draggable = !1 } function q() { x = !1 } function W(e) { for (var t = e.tagName + e.className + e.src + e.href + e.textContent, i = t.length, n = 0; i--;) n += t.charCodeAt(i); return n.toString(36) } function B(e) { if (!e || !e.parentNode) return -1; for (var t = 0; e && (e = e.previousElementSibling) ;) "TEMPLATE" !== e.nodeName.toUpperCase() && t++; return t } function U(e, t) { var i, n; return function () { void 0 === i && (i = arguments, n = this, setTimeout(function () { 1 === i.length ? e.call(n, i[0]) : e.apply(n, i), i = void 0 }, t)) } } function V(e, t) { if (e && t) for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]); return e } return I.prototype = { constructor: I, _onTapStart: function (e) { var t = this, i = this.el, n = this.options, s = e.type, o = e.touches && e.touches[0], r = (o || e).target, a = r, l = n.filter; if (!("mousedown" === s && 0 !== e.button || n.disabled) && (r = _(r, n.draggable, i))) { if (u = B(r), "function" == typeof l) { if (l.call(this, e, r, this)) return j(t, a, "filter", r, i, u), void e.preventDefault() } else if (l && (l = l.split(",").some(function (e) { if (e = _(a, e.trim(), i)) return j(t, e, "filter", r, i, u), !0 }))) return void e.preventDefault(); n.handle && !_(a, n.handle, i) || this._prepareDragStart(e, o, r) } }, _prepareDragStart: function (i, n, r) { var a, l = this, d = l.el, c = l.options, u = d.ownerDocument; r && !e && r.parentNode === d && (f = i, s = d, t = (e = r).parentNode, o = e.nextSibling, h = c.group, a = function () { l._disableDelayedDrag(), e.draggable = !0, F(e, l.options.chosenClass, !0), l._triggerDragStart(n) }, c.ignore.split(",").forEach(function (t) { H(e, t.trim(), N) }), z(u, "mouseup", l._onDrop), z(u, "touchend", l._onDrop), z(u, "touchcancel", l._onDrop), c.delay ? (z(u, "mouseup", l._disableDelayedDrag), z(u, "touchend", l._disableDelayedDrag), z(u, "touchcancel", l._disableDelayedDrag), z(u, "mousemove", l._disableDelayedDrag), z(u, "touchmove", l._disableDelayedDrag), l._dragStartTimer = setTimeout(a, c.delay)) : a()) }, _disableDelayedDrag: function () { var e = this.el.ownerDocument; clearTimeout(this._dragStartTimer), L(e, "mouseup", this._disableDelayedDrag), L(e, "touchend", this._disableDelayedDrag), L(e, "touchcancel", this._disableDelayedDrag), L(e, "mousemove", this._disableDelayedDrag), L(e, "touchmove", this._disableDelayedDrag) }, _triggerDragStart: function (t) { t ? (f = { target: e, clientX: t.clientX, clientY: t.clientY }, this._onDragStart(f, "touch")) : this.nativeDraggable ? (z(e, "dragend", this), z(s, "dragstart", this._onDragStart)) : this._onDragStart(f, !0); try { C.selection ? C.selection.empty() : window.getSelection().removeAllRanges() } catch (e) { } }, _dragStarted: function () { s && e && (F(e, this.options.ghostClass, !0), I.active = this, j(this, s, "start", e, s, u)) }, _emulateDragOver: function () { if (g) { if (this._lastX === g.clientX && this._lastY === g.clientY) return; this._lastX = g.clientX, this._lastY = g.clientY, T || R(i, "display", "none"); var e = C.elementFromPoint(g.clientX, g.clientY), t = e, n = " " + this.options.group.name, s = O.length; if (t) do { if (t[w] && t[w].options.groups.indexOf(n) > -1) { for (; s--;) O[s]({ clientX: g.clientX, clientY: g.clientY, target: e, rootEl: t }); break } e = t } while (t = t.parentNode); T || R(i, "display", "") } }, _onTouchMove: function (e) { if (f) { I.active || this._dragStarted(), this._appendGhost(); var t = e.touches ? e.touches[0] : e, n = t.clientX - f.clientX, s = t.clientY - f.clientY, o = e.touches ? "translate3d(" + n + "px," + s + "px,0)" : "translate(" + n + "px," + s + "px)"; v = !0, g = t, R(i, "webkitTransform", o), R(i, "mozTransform", o), R(i, "msTransform", o), R(i, "transform", o), e.preventDefault() } }, _appendGhost: function () { if (!i) { var t, n = e.getBoundingClientRect(), o = R(e); F(i = e.cloneNode(!0), this.options.ghostClass, !1), F(i, this.options.fallbackClass, !0), R(i, "top", n.top - S(o.marginTop, 10)), R(i, "left", n.left - S(o.marginLeft, 10)), R(i, "width", n.width), R(i, "height", n.height), R(i, "opacity", "0.8"), R(i, "position", "fixed"), R(i, "zIndex", "100000"), R(i, "pointerEvents", "none"), this.options.fallbackOnBody && C.body.appendChild(i) || s.appendChild(i), t = i.getBoundingClientRect(), R(i, "width", 2 * n.width - t.width), R(i, "height", 2 * n.height - t.height) } }, _onDragStart: function (t, i) { var o = t.dataTransfer, r = this.options; this._offUpEvents(), "clone" == h.pull && (R(n = e.cloneNode(!0), "display", "none"), s.insertBefore(n, e)), i ? ("touch" === i ? (z(C, "touchmove", this._onTouchMove), z(C, "touchend", this._onDrop), z(C, "touchcancel", this._onDrop)) : (z(C, "mousemove", this._onTouchMove), z(C, "mouseup", this._onDrop)), this._loopId = setInterval(this._emulateDragOver, 50)) : (o && (o.effectAllowed = "move", r.setData && r.setData.call(this, o, e)), z(C, "drop", this), setTimeout(this._dragStarted, 0)) }, _onDragOver: function (r) { var a, u, p, f, g, m, y = this.el, b = this.options, k = b.group, C = k.put, S = h === k, $ = b.sort; if (void 0 !== r.preventDefault && (r.preventDefault(), !b.dragoverBubble && r.stopPropagation()), v = !0, h && !b.disabled && (S ? $ || (p = !s.contains(e)) : h.pull && C && (h.name === k.name || C.indexOf && ~C.indexOf(h.name))) && (void 0 === r.rootEl || r.rootEl === this.el)) { if (D(r, b, this.el), x) return; if (a = _(r.target, b.draggable, y), u = e.getBoundingClientRect(), p) return P(!0), void (n || o ? s.insertBefore(e, n || o) : $ || s.appendChild(e)); if (0 === y.children.length || y.children[0] === i || y === r.target && (f = r, g = y.lastElementChild, m = g.getBoundingClientRect(), a = (f.clientY - (m.top + m.height) > 5 || f.clientX - (m.right + m.width) > 5) && g)) { if (a) { if (a.animated) return; A = a.getBoundingClientRect() } P(S), !1 !== M(s, y, e, u, a, A) && (e.contains(y) || (y.appendChild(e), t = y), this._animate(u, e), a && this._animate(A, a)) } else if (a && !a.animated && a !== e && void 0 !== a.parentNode[w]) { l !== a && (l = a, d = R(a), c = R(a.parentNode)); var T, A = a.getBoundingClientRect(), O = A.right - A.left, E = A.bottom - A.top, I = /left|right|inline/.test(d.cssFloat + d.display) || "flex" == c.display && 0 === c["flex-direction"].indexOf("row"), z = a.offsetWidth > e.offsetWidth, L = a.offsetHeight > e.offsetHeight, F = (I ? (r.clientX - A.left) / O : (r.clientY - A.top) / E) > .5, H = a.nextElementSibling, j = M(s, y, e, u, a, A); if (!1 !== j) { if (x = !0, setTimeout(q, 30), P(S), 1 === j || -1 === j) T = 1 === j; else if (I) { var N = e.offsetTop, W = a.offsetTop; T = N === W ? a.previousElementSibling === e && !z || F && z : W > N } else T = H !== e && !L || F && L; e.contains(y) || (T && !H ? y.appendChild(e) : a.parentNode.insertBefore(e, T ? H : a)), t = e.parentNode, this._animate(u, e), this._animate(A, a) } } } }, _animate: function (e, t) { var i = this.options.animation; if (i) { var n = t.getBoundingClientRect(); R(t, "transition", "none"), R(t, "transform", "translate3d(" + (e.left - n.left) + "px," + (e.top - n.top) + "px,0)"), t.offsetWidth, R(t, "transition", "all " + i + "ms"), R(t, "transform", "translate3d(0,0,0)"), clearTimeout(t.animated), t.animated = setTimeout(function () { R(t, "transition", ""), R(t, "transform", ""), t.animated = !1 }, i) } }, _offUpEvents: function () { var e = this.el.ownerDocument; L(C, "touchmove", this._onTouchMove), L(e, "mouseup", this._onDrop), L(e, "touchend", this._onDrop), L(e, "touchcancel", this._onDrop) }, _onDrop: function (c) { var m = this.el, b = this.options; clearInterval(this._loopId), clearInterval(y.pid), clearTimeout(this._dragStartTimer), L(C, "mousemove", this._onTouchMove), this.nativeDraggable && (L(C, "drop", this), L(m, "dragstart", this._onDragStart)), this._offUpEvents(), c && (v && (c.preventDefault(), !b.dropBubble && c.stopPropagation()), i && i.parentNode.removeChild(i), e && (this.nativeDraggable && L(e, "dragend", this), N(e), F(e, this.options.ghostClass, !1), F(e, this.options.chosenClass, !1), s !== t ? -1 != (p = B(e)) && (j(null, t, "sort", e, s, u, p), j(this, s, "sort", e, s, u, p), j(null, t, "add", e, s, u, p), j(this, s, "remove", e, s, u, p)) : (n && n.parentNode.removeChild(n), e.nextSibling !== o && -1 != (p = B(e)) && (j(this, s, "update", e, s, u, p), j(this, s, "sort", e, s, u, p))), I.active && (j(this, s, "end", e, s, u, p), this.save())), s = e = t = i = o = n = r = a = f = g = v = p = l = d = h = I.active = null) }, handleEvent: function (t) { var i = t.type; "dragover" === i || "dragenter" === i ? e && (this._onDragOver(t), function (e) { e.dataTransfer && (e.dataTransfer.dropEffect = "move"); e.preventDefault() }(t)) : "drop" !== i && "dragend" !== i || this._onDrop(t) }, toArray: function () { for (var e, t = [], i = this.el.children, n = 0, s = i.length, o = this.options; n < s; n++) _(e = i[n], o.draggable, this.el) && t.push(e.getAttribute(o.dataIdAttr) || W(e)); return t }, sort: function (e) { var t = {}, i = this.el; this.toArray().forEach(function (e, n) { var s = i.children[n]; _(s, this.options.draggable, i) && (t[e] = s) }, this), e.forEach(function (e) { t[e] && (i.removeChild(t[e]), i.appendChild(t[e])) }) }, save: function () { var e = this.options.store; e && e.set(this) }, closest: function (e, t) { return _(e, t || this.options.draggable, this.el) }, option: function (e, t) { var i = this.options; if (void 0 === t) return i[e]; i[e] = t, "group" === e && E(i) }, destroy: function () { var e = this.el; e[w] = null, L(e, "mousedown", this._onTapStart), L(e, "touchstart", this._onTapStart), this.nativeDraggable && (L(e, "dragover", this), L(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function (e) { e.removeAttribute("draggable") }), O.splice(O.indexOf(this._onDragOver), 1), this._onDrop(), this.el = e = null } }, I.utils = { on: z, off: L, css: R, find: H, is: function (e, t) { return !!_(e, t, e) }, extend: V, throttle: U, closest: _, toggleClass: F, index: B }, I.create = function (e, t) { return new I(e, t) }, I.version = "1.3.0-rc1", I });;
var HtmlImporter = function () {
    'use strict';

    return {
        initialize: initialize,
        loadHtml: loadHtml
    };

    function loadHtml(el) {
        var $el = $(el);
        var href = $el.attr('href');

        var $container = $('<div></div>')
            .addClass('partial-view')
            .attr('data-src-href', href);

        $el.replaceWith($container);
        $container.load(href);
    }

    function initialize(el) {
        $(el).find('a[href][data-role="partial-view"]').each(function (idx, el, src) {
            loadHtml(el);
        });
    }
}();

$(function () {
    HtmlImporter.initialize(document.body)
});;
(function ($) {
    'use strict';

    /**
     * Sets up tabs in document
     */
    function setupTabs() {
        var $section = $('.m-tab-section');
        var $navs = $section.find('.m-tab-nav [data-tab]');
        var $contents = $section.find('.tab.m-content');

        // setup click event for navigation
        $navs.on('click', function () {
            var self = this;
            var tabString = $(self).data('tab') || '0';
            var selectedIndex = parseInt(tabString, 10);

            // set active on current nav and remove from others
            $navs.each(function (i, it, src) {
                $(it).toggleClass('active', it === self);
            });

            // set active on current content and remove from others
            $contents.each(function (i, it, src) {
                $(it).toggleClass('active', i === selectedIndex)
            });
        });
    }

    // setup tabs on document ready
    $(document).ready(setupTabs);

})(jQuery);;
var Hearts;
(function(exports) {
    function init(el) {
        // select heart icons
        var $hearts = $(el).find('.icon-heart,.icon-heart3,.header-fav');

        $.ajax({
            method: 'GET',
            url: '/api/favorite/all'
        })
        .then(function (items) {
            // set favorited class for all communities in the list
            $hearts.each(function (i, it, src) {
                // get heart and favoriteid
                var $heart = $(it);
                var favoriteId = String($heart.data('favorite-id'));

                // return if favorite id is not set
                if (!favoriteId) {
                    return;
                }

                // set favorited if items contains the key
                var containsId = items.indexOf(favoriteId) !== -1;
                $heart.toggleClass('favorited', containsId);
            });
            
        });
        // sets up click events to toggle hearts
        $hearts.on('click', function () {
            //get heart, favorite id, and favorite type
            var $heart = $(this);
            var favoriteId = $heart.data('favoriteId');
            var favoriteTypeId = $heart.data('favoriteTypeId');

            // return if favorite id or type is not set
            if (!favoriteId || favoriteTypeId !== 0 && !favoriteTypeId) {
                return;
            }

            function onSuccess(response) {
                $heart.toggleClass('favorited', response);
            }

            function onError() {
                // perform login on error and pass favorite information with it
                window.location = '/account/login'
                    + '?redirectUrl=' + window.location
                    + '&favoriteId=' + favoriteId
                    + '&favoriteTypeId=' + favoriteTypeId;
            }

            // toggle favorite off or on
            $.ajax({
                method: 'POST',
                url: '/api/favorite/toggle',
                data: {
                    favoriteId: favoriteId,
                    favoriteTypeId: favoriteTypeId,
                    sourceUrl: window.location.href
                }
            })
            .then(onSuccess, onError);
        });
    }

    exports.init = init;
})(Hearts = {});

$(document).ready(function () {
    Hearts.init(document.body);
});
;
var DropDownMenu;
(function (exports) {
    'use strict';

    function initStackedList(root) {
        $(root).find('.m-dropdown.stacked-list').each(function (idx, dropdown) {
            var $dropdown = $(dropdown);
            var $dropdownButton = $dropdown.find('.dropdown-toggle');

            $dropdownButton.on('click', function () {
                if ($('.home-filter').length) {
                    $(this).toggleClass('open').next().toggle();

                    $(dropdown).find('.selectize-input').on('click', function () {
                        $dropdownButton.removeClass('open').next().hide();
                    });
                }
                else {
                    $(this).toggleClass('open').next().slideToggle();
                }
            });
        });
    }

    function init(root) {
        $(root).find('.m-dropdown.dropdownmenu').each(function (idx, dropdown) {
            var $dropdown = $(dropdown);
            var placeholderText = $dropdown.data('placeholder');
            var $placeholder = $dropdown.find('.dropdown-placeholder');
            var $input = $dropdown.find('input[type="hidden"]');
            var $items = $dropdown.find('a[data-value]');

            function updateText() {
                var currentValue = $input.val();

                var text;
                $.each($items, function (idx2, item) {
                    var $item = $(item);
                    var itemValue = $item.data('value');
                    if (itemValue === currentValue) {
                        text = $item.text();
                        return false;
                    }
                });

                if (text) {
                    $placeholder.text(text);
                } else {
                    $placeholder.text(placeholderText);
                }
            }

            $items.click(function (evt) {
                var item = evt.target;
                var value = $(item).data('value');
                $input.val(value);
                $input.trigger('change');
                updateText();
            });

            updateText();
        });
    }

    exports.init = init;
    exports.initStackedList = initStackedList;

})(DropDownMenu = {});

$(document).ready(function() {
    DropDownMenu.init(document.body);
});
var SortableFavorites = function () {
    'use strict';

    return {
        deleteItem: deleteItem,
        updateOrder: updateOrder
    };

    function updateOrder(el, items) {
        var updateUrl = $(el).data('updateUrl');
        $.ajax({
            url: updateUrl,
            method: 'POST',
            dataType: 'json',
            contentType: 'application/json',
            data: JSON.stringify(items)
        });
    }

    function deleteItem(el) {
        var deleteUrl = $(el).data('deleteUrl');
        
        //alert('click');
        $.ajax({
            url: deleteUrl,
            method: 'DELETE'
        })
        .then(function (response) {
            if (response === true) {
                var pn = el.parentNode;
                pn.className += ' checkit';
                pn.removeChild(el); // remove sortable item
                $(document).trigger('favoriteCountChanged');
            }
        });
    }
}();;
/**
 * UAParser.js v0.7.10
 * Lightweight JavaScript-based User-Agent string parser
 * https://github.com/faisalman/ua-parser-js
 *
 * Copyright © 2012-2015 Faisal Salman <fyzlman@gmail.com>
 * Dual licensed under GPLv2 & MIT
 */(function (e, t) { "use strict"; var n = "0.7.10", r = "", i = "?", s = "function", o = "undefined", u = "object", a = "string", f = "major", l = "model", c = "name", h = "type", p = "vendor", d = "version", v = "architecture", m = "console", g = "mobile", y = "tablet", b = "smarttv", w = "wearable", E = "embedded", S = { extend: function (e, t) { for (var n in t) "browser cpu device engine os".indexOf(n) !== -1 && t[n].length % 2 === 0 && (e[n] = t[n].concat(e[n])); return e }, has: function (e, t) { return typeof e == "string" ? t.toLowerCase().indexOf(e.toLowerCase()) !== -1 : !1 }, lowerize: function (e) { return e.toLowerCase() }, major: function (e) { return typeof e === a ? e.split(".")[0] : t } }, x = { rgx: function () { var e, n = 0, r, i, a, f, l, c, h = arguments; while (n < h.length && !l) { var p = h[n], d = h[n + 1]; if (typeof e === o) { e = {}; for (a in d) d.hasOwnProperty(a) && (f = d[a], typeof f === u ? e[f[0]] = t : e[f] = t) } r = i = 0; while (r < p.length && !l) { l = p[r++].exec(this.getUA()); if (!!l) for (a = 0; a < d.length; a++) c = l[++i], f = d[a], typeof f === u && f.length > 0 ? f.length == 2 ? typeof f[1] == s ? e[f[0]] = f[1].call(this, c) : e[f[0]] = f[1] : f.length == 3 ? typeof f[1] === s && (!f[1].exec || !f[1].test) ? e[f[0]] = c ? f[1].call(this, c, f[2]) : t : e[f[0]] = c ? c.replace(f[1], f[2]) : t : f.length == 4 && (e[f[0]] = c ? f[3].call(this, c.replace(f[1], f[2])) : t) : e[f] = c ? c : t } n += 2 } return e }, str: function (e, n) { for (var r in n) if (typeof n[r] === u && n[r].length > 0) { for (var s = 0; s < n[r].length; s++) if (S.has(n[r][s], e)) return r === i ? t : r } else if (S.has(n[r], e)) return r === i ? t : r; return e } }, T = { browser: { oldsafari: { version: { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" } } }, device: { amazon: { model: { "Fire Phone": ["SD", "KF"] } }, sprint: { model: { "Evo Shift 4G": "7373KT" }, vendor: { HTC: "APA", Sprint: "Sprint" } } }, os: { windows: { version: { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" } } } }, N = { browser: [[/(opera\smini)\/([\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, /(opera).+version\/([\w\.]+)/i, /(opera)[\/\s]+([\w\.]+)/i], [c, d], [/\s(opr)\/([\w\.]+)/i], [[c, "Opera"], d], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, /(?:ms|\()(ie)\s([\w\.]+)/i, /(rekonq)\/([\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i], [c, d], [/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i], [[c, "IE"], d], [/(edge)\/((\d+)?[\w\.]+)/i], [c, d], [/(yabrowser)\/([\w\.]+)/i], [[c, "Yandex"], d], [/(comodo_dragon)\/([\w\.]+)/i], [[c, /_/g, " "], d], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i, /(qqbrowser)[\/\s]?([\w\.]+)/i], [c, d], [/(uc\s?browser)[\/\s]?([\w\.]+)/i, /ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i, /JUC.+(ucweb)[\/\s]?([\w\.]+)/i], [[c, "UCBrowser"], d], [/(dolfin)\/([\w\.]+)/i], [[c, "Dolphin"], d], [/((?:android.+)crmo|crios)\/([\w\.]+)/i], [[c, "Chrome"], d], [/XiaoMi\/MiuiBrowser\/([\w\.]+)/i], [d, [c, "MIUI Browser"]], [/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i], [d, [c, "Android Browser"]], [/FBAV\/([\w\.]+);/i], [d, [c, "Facebook"]], [/fxios\/([\w\.-]+)/i], [d, [c, "Firefox"]], [/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i], [d, [c, "Mobile Safari"]], [/version\/([\w\.]+).+?(mobile\s?safari|safari)/i], [d, c], [/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i], [c, [d, x.str, T.browser.oldsafari.version]], [/(konqueror)\/([\w\.]+)/i, /(webkit|khtml)\/([\w\.]+)/i], [c, d], [/(navigator|netscape)\/([\w\.-]+)/i], [[c, "Netscape"], d], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, /(links)\s\(([\w\.]+)/i, /(gobrowser)\/?([\w\.]+)*/i, /(ice\s?browser)\/v?([\w\._]+)/i, /(mosaic)[\/\s]([\w\.]+)/i], [c, d]], cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[v, "amd64"]], [/(ia32(?=;))/i], [[v, S.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[v, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[v, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[v, /ower/, "", S.lowerize]], [/(sun4\w)[;\)]/i], [[v, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [[v, S.lowerize]]], device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [l, p, [h, y]], [/applecoremedia\/[\w\.]+ \((ipad)/], [l, [p, "Apple"], [h, y]], [/(apple\s{0,1}tv)/i], [[l, "Apple TV"], [p, "Apple"]], [/(archos)\s(gamepad2?)/i, /(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, l, [h, y]], [/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i], [l, [p, "Amazon"], [h, y]], [/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i], [[l, x.str, T.device.amazon.model], [p, "Amazon"], [h, g]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [l, p, [h, g]], [/\((ip[honed|\s\w*]+);/i], [l, [p, "Apple"], [h, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, l, [h, g]], [/\(bb10;\s(\w+)/i], [l, [p, "BlackBerry"], [h, g]], [/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i], [l, [p, "Asus"], [h, y]], [/(sony)\s(tablet\s[ps])\sbuild\//i, /(sony)?(?:sgp.+)\sbuild\//i], [[p, "Sony"], [l, "Xperia Tablet"], [h, y]], [/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i], [[p, "Sony"], [l, "Xperia Phone"], [h, g]], [/\s(ouya)\s/i, /(nintendo)\s([wids3u]+)/i], [p, l, [h, m]], [/android.+;\s(shield)\sbuild/i], [l, [p, "Nvidia"], [h, m]], [/(playstation\s[34portablevi]+)/i], [l, [p, "Sony"], [h, m]], [/(sprint\s(\w+))/i], [[p, x.str, T.device.sprint.vendor], [l, x.str, T.device.sprint.model], [h, g]], [/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i], [p, l, [h, y]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [l, /_/g, " "], [h, g]], [/(nexus\s9)/i], [l, [p, "HTC"], [h, y]], [/[\s\(;](xbox(?:\sone)?)[\s\);]/i], [l, [p, "Microsoft"], [h, m]], [/(kin\.[onetw]{3})/i], [[l, /\./g, " "], [p, "Microsoft"], [h, g]], [/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i, /mot[\s-]?(\w+)*/i, /(XT\d{3,4}) build\//i, /(nexus\s[6])/i], [l, [p, "Motorola"], [h, g]], [/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i], [l, [p, "Motorola"], [h, y]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i, /((SM-T\w+))/i], [[p, "Samsung"], l, [h, y]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], l, [h, g]], [/(SM-G900[F|H|K|L|S|M|A|T|W8])/i], [[p, "Samsung"], [l, "Galaxy S5"], [h, g]], [/(SM-G920[F|H|K|L|S|M|A|T|W8])/i], [[p, "Samsung"], [l, "Galaxy S6"], [h, g]], [/(samsung);smarttv/i], [p, l, [h, b]], [/\(dtv[\);].+(aquos)/i], [l, [p, "Sharp"], [h, b]], [/sie-(\w+)*/i], [l, [p, "Siemens"], [h, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], l, [h, g]], [/android\s3\.[\s\w;-]{10}(a\d{3})/i], [l, [p, "Acer"], [h, y]], [/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], l, [h, y]], [/(lg) netcast\.tv/i], [p, l, [h, b]], [/(nexus\s[45])/i, /lg[e;\s\/-]+(\w+)*/i], [l, [p, "LG"], [h, g]], [/android.+(ideatab[a-z0-9\-\s]+)/i], [l, [p, "Lenovo"], [h, y]], [/linux;.+((jolla));/i], [p, l, [h, g]], [/((pebble))app\/[\d\.]+\s/i], [p, l, [h, w]], [/android.+;\s(glass)\s\d/i], [l, [p, "Google"], [h, w]], [/android.+(\w+)\s+build\/hm\1/i, /android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, /android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i], [[l, /_/g, " "], [p, "Xiaomi"], [h, g]], [/\s(tablet)[;\/\s]/i, /\s(mobile)[;\/\s]/i], [[h, S.lowerize], p, l]], engine: [[/windows.+\sedge\/([\w\.]+)/i], [d, [c, "EdgeHTML"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [c, d], [/rv\:([\w\.]+).*(gecko)/i], [d, c]], os: [[/microsoft\s(windows)\s(vista|xp)/i], [c, d], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [c, [d, x.str, T.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[c, "Windows"], [d, x.str, T.os.windows.version]], [/\((bb)(10);/i], [[c, "BlackBerry"], d], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)[\/\s]([\w\.]+)/i, /(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, /linux;.+(sailfish);/i], [c, d], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[c, "Symbian"], d], [/\((series40);/i], [c], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[c, "Firefox OS"], d], [/(nintendo|playstation)\s([wids34portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(mageia|vectorlinux)[;\s]/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [c, d], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[c, "Chromium OS"], d], [/(sunos)\s?([\w\.]+\d)*/i], [[c, "Solaris"], d], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [c, d], [/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i], [[c, "iOS"], [d, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i, /(macintosh|mac(?=_powerpc)\s)/i], [[c, "Mac OS"], [d, /_/g, "."]], [/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, /(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, /(unix)\s?([\w\.]+)*/i], [c, d]] }, C = function (t, n) { if (this instanceof C) { var i = t || (e && e.navigator && e.navigator.userAgent ? e.navigator.userAgent : r), s = n ? S.extend(N, n) : N; return this.getBrowser = function () { var e = x.rgx.apply(this, s.browser); return e.major = S.major(e.version), e }, this.getCPU = function () { return x.rgx.apply(this, s.cpu) }, this.getDevice = function () { return x.rgx.apply(this, s.device) }, this.getEngine = function () { return x.rgx.apply(this, s.engine) }, this.getOS = function () { return x.rgx.apply(this, s.os) }, this.getResult = function () { return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() } }, this.getUA = function () { return i }, this.setUA = function (e) { return i = e, this }, this.setUA(i), this } return (new C(t, n)).getResult() }; C.VERSION = n, C.BROWSER = { NAME: c, MAJOR: f, VERSION: d }, C.CPU = { ARCHITECTURE: v }, C.DEVICE = { MODEL: l, VENDOR: p, TYPE: h, CONSOLE: m, MOBILE: g, SMARTTV: b, TABLET: y, WEARABLE: w, EMBEDDED: E }, C.ENGINE = { NAME: c, VERSION: d }, C.OS = { NAME: c, VERSION: d }, typeof exports !== o ? (typeof module !== o && module.exports && (exports = module.exports = C), exports.UAParser = C) : typeof define === s && define.amd ? define(function () { return C }) : e.UAParser = C; var k = e.jQuery || e.Zepto; if (typeof k !== o) { var L = new C; k.ua = L.getResult(), k.ua.get = function () { return L.getUA() }, k.ua.set = function (e) { L.setUA(e); var t = L.getResult(); for (var n in t) k.ua[n] = t[n] } } })(typeof window == "object" ? window : this);;
function scrollIt(n,t){if(n.length){n.addClass("removeTabIndex").attr("tabindex","-1");var i=0;t!==undefined&&(i=t);$("html,body").animate({scrollTop:n.offset().top-i},500,"swing",function(){n.focus()})}return!1}function scrollItNoFocus(n){n.length&&$("html,body").animate({scrollTop:n.offset().top},500)}function cardsHeight(n){n.find(".m-card-info").removeAttr("style");var t=0,i=[],r=[];n.each(function(){var u=$(this),n=u.height(),f=u.find(".m-card-info").height();i.push(n);r.push(f);n>t&&(t=n)});n.promise().done(function(){for(var f,e,u=0;u<n.length;u++)i[u]<t&&(f=t-i[u],e=f+r[u],n.eq(u).find(".m-card-info").height(e))})}function createSelectize(n){var t=n.selectize({allowEmptyOption:!0,create:!1,dropdownParent:"body",plugins:{selectable_placeholder:{}},openOnFocus:!0,onFocus:function(){n.attr("data-focus")!=="focus"&&(selectizeInitialize(n),selectizeOnFocus(n));n.attr("data-focus","focus")}})}function selectizeInitialize(n){n.next(".selectize-control").find(".selectize-input").attr("tabindex",0).on("keypress",function(t){t.keyCode==13&&$(this).trigger("click");selectizeOnFocus(n)})}function selectizeOnFocus(n){setTimeout(function(){var t=n.next(".selectize-control").find(".selectize-dropdown").find(".selectize-dropdown-content").find("div");t.attr("tabindex",0);t.eq(0).focus();t.on("keydown",function(n){var i=$(":focus"),t,r;n.keyCode==13?(t=$(this),r=t.closest(".selectize-dropdown").prev(".selectize-input"),t.trigger("click"),r.focus()):n.keyCode==37||n.keyCode==38?i.prev("div").focus():(n.keyCode==39||n.keyCode==40)&&i.next("div").focus()})},250,n)}function unslickcardsEqHeight(){var n=$(".m-card",$(".m-tab-section.active .active"));n.find(".m-card-info").removeAttr("style");var t=0,i=[],r=[];n.each(function(){var u=$(this),n=u.height(),f=u.find(".m-card-info").height();i.push(n);r.push(f);n>t&&(t=n)});n.promise().done(function(){for(var f,e,u=0;u<n.length;u++)i[u]<t&&(f=t-i[u],e=f+r[u],n.eq(u).find(".m-card-info").height(e))})}function cardsEqHeight(){var n=$(".m-card",$(".m-tab-section.active .slick-active"));n.find(".m-card-info").removeAttr("style");var t=0,i=[],r=[];n.each(function(){var u=$(this),n=u.height(),f=u.find(".m-card-info").height();i.push(n);r.push(f);n>t&&(t=n)});n.promise().done(function(){for(var f,e,u=0;u<n.length;u++)i[u]<t&&(f=t-i[u],e=f+r[u],n.eq(u).find(".m-card-info").height(e))})}function setModelPageContactUsCookies(){Cookies.set("ShowModelPageContactUsForm","true",{path:"/",expires:7})}function setCommuntiyPageContactUsCookies(){Cookies.set("ShowCommuntiyPageContactUsForm","true",{path:"/",expires:7})}function setCommuntiyModelPageContactUsCookies(){Cookies.set("ShowCommuntiyModelPageContactUsForm","true",{path:"/",expires:7})}function setScheduleVisitCookies(){Cookies.set("ShowScheduleVisitForm","true",{path:"/",expires:1})}function onScroll(){var n=$(document).scrollTop()+72;$(".section-nav a").each(function(){var i=$(this),t=$(i.attr("href"));t.length&&(t.position().top<=n&&t.position().top+t.height()>n?($(".section-nav a").removeClass("active"),i.addClass("active")):i.removeClass("active"))})}function onScrollCommunity(){var n=$(document).scrollTop();$("body").hasClass("stickySectionNav")===!0&&(n+=60);$('.m-sub-nav-communities a.inpage:not([href="#contact"])').each(function(){var t=$(this),i=$(t.attr("href"));i.length&&(i.position().top<=n&&i.position().top+i.height()>n?($(".section-nav a, .m-sub-nav-communities a.inpage").removeClass("active"),t.addClass("active"),$(".scrollBack").removeClass("scrollBack"),t.addClass("scrollBack"),$(".m-sub-nav-button .title").text(t.text())):t.removeClass("active"))})}var sortedd,videos,autoPlay,scrollToVideo,tag,firstScriptTag;Selectize.define("selectable_placeholder",function(n){var t=this;n=$.extend({placeholder:t.settings.placeholder,html:function(n){return'<div class="selectize-dropdown-content placeholder-container"><div data-selectable class="option">'+n.placeholder+"<\/div><\/div>"}},n);t.setup=function(){var i=t.setup;return function(){i.apply(this,arguments);t.$placeholder_container=$(n.html(n));t.$dropdown.prepend(t.$placeholder_container);t.$dropdown.find(".placeholder-container").on("mousedown",function(){return t.clear(),t.close(),t.blur(),!1})}}()});$(function(){function ht(n){var t=n,i=$(".tab",$(".tab-container"));i.removeClass("active");i.each(function(){$(this).attr("data-value")===t&&$(this).addClass("active")});$(".panel-"+t,$(".tab-content")).addClass("active").siblings().removeClass("active")}function ct(){t.scroll(function(){var i=$(window).scrollTop(),r=t.width();hi>0&&(i>=ci?n.addClass("sticky"):n.removeClass("sticky"));(pi>0||yi)&&(i>=li?n.addClass("stickySectionNav"):n.removeClass("stickySectionNav"));$(".m-sub-nav.about").length&&(i>=ai?r<690&&$("#aboutus").css("display","none"):$(".subnavbar-open").length&&$("#aboutus").css("display","block"))})}function lt(){n.removeClass("stickySectionNav sticky")}function pt(){var n=$(".accordion-item");n.removeClass("active");n.find(".m-content").slideUp(300).removeClass("accordion-open")}function oi(){r.closest("article").removeClass("active");r.slideUp(300).removeClass("modal-open")}var t=$(window),i=$("html"),n=$("body"),p=$(".page-header .search-toggle"),w=$(".change-toggle"),b=$(".m-sub-nav, .m-sub-nav-communities").find("ul"),rt=$(".section-nav"),hi=rt.length,ci=$(".page-header").outerHeight()+$(".m-hero").outerHeight(),li=$(".page-header").outerHeight()+$(".m-property-details").outerHeight(),ai=$(".page-header").outerHeight()+$(".m-sub-nav.about").outerHeight(),ut=$(".m-sub-nav-communities"),vi=$(".m-sub-nav"),yi=vi.length,pi=ut.length,wi=$(".m-community-cta"),ar=wi.length,o=640,ft=768,bi=1024,u=!1,ki=function(){lt();u===!0&&typeof c!="undefined"&&c()},di=function(){lt();u===!0&&typeof c!="undefined"&&c()},gi=function(){ct();u===!1&&typeof st!="undefined"&&st()},k=function(t){n.removeClass("view_mobile view_tablet view_desktop").addClass(t)},d=function(){var n=t.width();n<o?(k("view_mobile"),ki()):n>=o&&n<=ft?(k("view_tablet"),di()):n>=bi&&(k("view_desktop"),gi())},f,s,nt,at,vt,yt,l,a,wt,bt,kt,v,tt,gt,ti,ii,ri,ui,fi,ei,y,r,si;d();t.resize(function(){this.resizeTO&&clearTimeout(this.resizeTO);this.resizeTO=setTimeout(function(){$(this).trigger("resizeEnd")},500)}).bind("resizeEnd",function(){d()}).load(function(){d()});$("#SearchText, #ByHome").on("keypress",function(n){if(n.which===13)return $(this).closest(".form-row").find("button").trigger("click"),!1});$('.content a[href="#contact"]').addClass("contact-trigger");$("body").find("select.styled").each(function(){var n=$(this);createSelectize(n)});f=$(".m-card",$(".bg-highlight"));f.length&&(cardsHeight(f),setTimeout(function(){cardsHeight(f)},5e3),setTimeout(function(){cardsHeight(f)},1e4),t.resize(function(){this.resizeTO&&clearTimeout(this.resizeTO);this.resizeTO=setTimeout(function(){$(this).trigger("resizeEnd")},500)}).bind("resizeEnd",function(){cardsHeight(f)}).load(function(){cardsHeight(f)}));$(".m-button").on("mouseover","a",function(){$(this).text()==="Chat Now"&&$(this).attr("target","_blank")});if(setTimeout(function(){$("a[onclick]").each(function(){$(this).text()==="Chat Now"&&$(this).attr("target","_blank")})},1500),s=document.getElementsByClassName("draggable"),s.length>0){var h=[],et=!1,g=function(){var n=$(".checkit"),t=$(".m-card"),i=$(".m-card",n);i.length===0&&n.closest(".favorites-cards").remove();t.length===0&&$(".favorites-placeholder.hide").removeClass("hide")},nr=function(n){u=!0;removeSmallActive=!1;sortedd=Sortable.create(n,{animation:250,filter:".remove",onFilter:function(n){var t=n.item,i=n.target;Sortable.utils.is(i,".remove")&&(typeof SortableFavorites!="undefined"&&SortableFavorites.deleteItem(t),g())},store:{get:function(n){var t=localStorage.getItem(n.options.group);return t?t.split("|"):[]},set:function(n){var t=n.toArray();localStorage.setItem(n.options.group,t.join("|"));typeof SortableFavorites!="undefined"&&SortableFavorites.updateOrder(n.el,t)}}});h.push(sortedd);i.hasClass("ie9")&&$(".sortable-fallback").css("left","auto !important")},tr=function(){for(var n=0;n<s.length;n++)nr(s[n]);et=!0},ot=function(n){for(var i,t=0;t<h.length;t++)h[t].option("disabled",n),i=n?"sortable":"",$(h[t].el).toggleClass(i)},c=function(){u=!1;ot(!0);removeSmallActive===!1&&ir()},ir=function(){if(removeSmallActive===!1){removeSmallActive=!0;$(".favorites-cards").on("click",".remove",function(n){if(u===!1){var i=n.target,t=$(n.target).closest(".m-card")[0];typeof SortableFavorites!="undefined"&&SortableFavorites.deleteItem(t);g()}})}},st=function(){if(i.hasClass("touch"))return!1;u=!0;et||tr();ot(!1)};$(".m-card-functions").on("click",".trigger",function(){$(this).next(".actions").toggle()});$(".m-card-functions").on("click",".no-remove",function(){$(this).closest(".actions").hide()});$(".m-card-functions").on("click",".remove",function(n){if($("html").hasClass("touch")===!0){var i=n.target,t=$(n.target).closest(".m-card")[0];typeof SortableFavorites!="undefined"&&SortableFavorites.deleteItem(t);g()}})}if(rt.length)$(document).on("scroll",onScroll);if(ut.length)$(document).on("scroll",onScrollCommunity);ct();$(".skip-main").on("click",function(){var n=$(this).attr("href");return scrollIt($(n)),!1});$(".section-nav a").on("click",function(){var i=$(this).attr("href"),r=70;return(t.width()<1024||i==="#our-promise")&&(r=0),scrollIt($(i),r),i==="#find-your-home"&&n.hasClass("sticky")===!1&&t.width()>1023&&setTimeout(function(){scrollIt($(i),r)},200),!1});$(".m-sub-nav.about a").on("click",function(){var n=$(this).attr("href");return $("html, body").animate({scrollTop:$(n).offset().top},1e3),!1});nt=function(i){var e=i.attr("href"),o=$(e),u=0,f=50,r;if(i.parent().hasClass("contact-us")===!0||i.hasClass("contact-trigger")===!0){$("#scrollBack").removeAttr("id");$(".scrollBack").eq(0).attr("id","scrollBack");r=$(".m-contact-block");r.slideDown();r.on("click","button",function(){if($(".cookie-contact").length){var t=$("#currentCardItem");t.length&&(scrollIt(t,250),setTimeout(function(){t.removeAttr("id")},2e3))}r.removeClass("cookie-contact");r.slideUp("normal",function(){$("#directionsInfo").removeAttr("class","directionsILS");$("#directionsInfo").attr("class","directionsILS-nomargin");var r=$("#scrollBack"),t=$("#currentCardItem"),i;r.length&&t.length===0?(i=$(r.attr("href")),n.width()>640&&(u=f)):r.length===0&&t.length===0?(n.attr("id")===undefined&&n.attr("id","body"),i=$("#"+n.attr("id"))):t.length&&(i=t);scrollIt(i,u);setTimeout(function(){t.removeAttr("id")},3e3)})})}(n.hasClass("stickySectionNav")===!0||$(".m-sub-nav-communities").length||$(this).hasClass("addSticky")===!0)&&(u+=n.width()>640?f:38);i.hasClass("wait")===!1&&i.closest("nav").hasClass("m-sub-nav-communities")===!0&&t.width()<=640&&i.closest("ul").hide().closest("nav").find(".circle").toggleClass("icon-minus");scrollIt(o,u)};$("body").on("click",".inpage, .contact-trigger",function(n){var t=$(this).data("community");t!=null&&($("#CommunityId").val(t),$("#hiddenContactType").val(12));$("#CommunityId").val()||$("#CommunityId").val(0);nt($(this));n.preventDefault()});at=window.location.toString().split("#");at[1]==="contact"&&setTimeout(function(){$('a[href="#contact"]').first().trigger("click")},2e3);vt=window.location.toString().split("#");vt[1]==="signup"&&setTimeout(function(){$('a[href="#signup"]').length>0?$('a[href="#signup"]').first().trigger("click"):scrollIt($("#vip-form"),50)},2e3);$(".navbar-toggle").on("click",function(){$(".search-open").length&&(p.removeClass("open"),i.removeClass("search-open"),$(".header-search").slideUp());i.toggleClass("menu-open");$(".mobile-toggle").slideToggle()});$("#signupNav, #signUpNow, #signUpNow2").on("click",function(){yt()});yt=function(){$("#firstname").addClass("sign-up");$("#email").addClass("sign-up");$("#detailContactUsComingsoon").addClass("btn-nothanks")};$("#sub-nav-links").find("li").on("click",function(){});$(".m-sub-nav-button").on("click",function(){b.slideToggle();$(this).find(".circle").toggleClass("icon-minus");$(".mobile-contact a").addClass("background")});$(".signUpNav").on("click",function(){$("#sub-nav-links").length&&b.slideUp()});$(".contact-us").on("click",function(){$("#sub-nav-links").length&&b.slideUp()});$("#sub-nav-links li .inpage").on("click",function(){i.toggleClass("subnavbar-open")});$(".signUpNav").on("click",function(){$("#sub-nav-links").is(":visible")&&i.toggleClass("subnavbar-open")});$(".contact-us").on("click",function(){$("#sub-nav-links").is(":visible")&&i.toggleClass("subnavbar-open")});$(".subnavbar-toggle").on("click",function(){i.toggleClass("subnavbar-open")});p.on("click",function(){$(".menu-open").length&&(i.removeClass("menu-open"),$(".mobile-toggle").slideUp());i.toggleClass("search-open");p.toggleClass("open");$(".header-search").slideToggle()});$("body").on("click",".dropdown-toggle",function(){if($(".home-filter").length){$(this).toggleClass("open").next().toggle();$(".selectize-input").on("click",function(){$(".dropdown-toggle").removeClass("open").next().hide()})}else $(this).toggleClass("open").next().slideToggle()});$(".send-icon-lg").hover(function(){$("#sendIcon").attr("src","/assets/Images/mail.png");e.preventDefault()},function(){$("#sendIcon").attr("src","/assets/Images/mail-white.png")});$(".send-icon").click(function(){$("#directionsInfo").attr("class","directionsILS")});$(".m-accordion").length&&$(".accordion-item button").click(function(){$(this).parent().is(".active")?pt():(pt(),$(this).parent().addClass("active"),$(this).next(".m-content").slideDown(300).addClass("accordion-open"))});$(".js-feedback").on("click",function(){var r=$(this).data("option"),n=$(".further-information").eq(0),t=n.find("button"),i=0;return $("body").hasClass("stickySectionNav")===!0&&(i+=50),t.hasClass("active")===!0?scrollIt(n,i):t.trigger("click"),footerInterest[0].selectize.setValue(r),!1});$(".m-expander").on("click","button",function(){var n=0;$("body").hasClass("stickySectionNav")===!0&&(n+=50);$(this).toggleClass("active");$(".expander-content").slideToggle();$(this).hasClass("active")===!0&&scrollIt($(this).closest("section"),n)});if($(".home-filter").length)$(".filter-toggle").on("click",function(){$(this).toggleClass("active");$(".filters").slideToggle()});l=$(".change-password");w.on("click",function(){w.toggleClass("open");l.slideToggle()});l.on("click",".cancel",function(){l.slideUp().find("input").val("");w.removeClass("open")});$.validator.setDefaults({ignore:":hidden:not([class~=styled]),:hidden > .styled, .selectize-control .selectize-input input"});$("#password-reset-form, #login-form, #create-account-form, #update-account-form").validate();$("#footer-contact-us-phone").mask("(999) 999-9999");$(".community-survey .page-footer .copyright .aux-nav .Terms a").attr("target","_blank");a=$(".success-msg");a.on("click","button",function(){$(this).closest(".success-msg").slideUp()});if(a.hasClass("active")&&setTimeout(function(){a.slideUp()},2e3),wt=$(".m-tabs"),wt.length){bt=$(".tab");kt=$(".tab.active",$("#main")).data("value");ht(kt);bt.on("click",function(){ht($(this).data("value"))})}if(v=$(".m-tab-slider"),v.length&&(tt=function(){v.slick({dots:!0,customPaging:function(n,t){var i=$(n.$slides[t]).data("title");return'<a class="slide'+t+'">'+i+"<\/a>"},arrows:!1,infinite:!0,speed:300,slidesToShow:1,slidesToScroll:1});n.data("slick",!0)},t.width()>o&&tt(),t.bind("resizeEnd",function(){var i=t.width();i<o?n.data("slick")===!0&&(v.slick("unslick"),n.data("slick",!1)):n.data("slick")===!1&&tt()})),$(".design-slider").length){var rr=$(".design-slider"),ur=$(".slick-next-com"),fr=$(".slick-prev-com");rr.slick({autoplay:!0,autoplaySpeed:1e4,dots:!0,arrows:!0,appendArrows:$(".slide-arrows"),infinite:!0,nextArrow:ur,prevArrow:fr,speed:400,slidesToShow:1,slidesToScroll:1})}if($(".design-protect-slider").length){var er=$(".design-protect-slider"),or=$(".slick-next-protect-com"),sr=$(".slick-prev-protect-com");er.slick({autoplay:!0,autoplaySpeed:1e4,dots:!0,arrows:!0,appendArrows:$(".slide-arrows"),infinite:!0,nextArrow:or,prevArrow:sr,speed:400,slidesToShow:1,slidesToScroll:1})}if($(".m-home-slider").length){var hr=$(".current-slide"),cr=$(".home-name"),lr=$(".home-type"),dt=$(".m-home-slider .m-slider");dt.on("init reInit afterChange",function(n,t,i){var r=(i?i:0)+1,u=$(t.$slides[r-1]).data("title"),f=$(t.$slides[r-1]).data("title-url"),e=$(t.$slides[r-1]).data("style"),o=$(t.$slides[r-1]).data("style-url");hr.text(r+" of "+t.slideCount);cr.html('<a href="'+f+'">'+u+"<\/a>");lr.html('<a href="'+o+'">'+e+"<\/a>")});dt.slick({autoplay:!0,autoplaySpeed:1e4,dots:!1,arrows:!0,appendArrows:$(".slide-arrows"),infinite:!0,speed:400,slidesToShow:1,slidesToScroll:1})}if(gt=$(".iframe-floor-plan"),gt.length){var vr=$(window).height(),ni=$(".page-header").height(),it=$(window).height()-ni;$("#floorplan_iframe").css("height",it);t.bind("resizeEnd",function(){it=$(window).height()-ni;$("#floorplan_iframe").css("height",it)})}if(ti=$(".m-property-details"),ti.length){ii=$(".print-directions");ii.one("click",function(){(Cookies.get("ShowScheduleVisitForm")!="true"||Cookies.get("ShowScheduleVisitForm")===null)&&(setScheduleVisitCookies(),$('[href="#appointment"]',$(".m-sub-nav-communities")).trigger("click"),setTimeout(function(){$('[href="#appointment"]',$(".m-sub-nav-communities")).addClass("active")},2e3))})}if(ri=$("#homes"),ri.length){ui=$(".icon-map-o, .icon-file-pdf-o, .icon-home2, #sitePlan");ui.one("click",function(){(Cookies.get("ShowModelPageContactUsForm")!="true"||Cookies.get("ShowModelPageContactUsForm")===null)&&(setModelPageContactUsCookies(),$(this).closest(".m-card").attr("id","currentCardItem"),$(".contact-us .inpage").trigger("click"),$(".m-contact-block").show().addClass("cookie-contact"),$("#viewEventType").val("PDF Floorplan View"),$(this).attr("id")=="sitePlan"&&($("#welcome-back-content").html("site plan"),$("#viewEventType").val("Site Plan View")),$(this).hasClass("icon-home2")&&($("#welcome-back-content").html("virtual tour"),$("#viewEventType").val("Virtual Tour View")),$(this).hasClass("icon-map-o")&&($("#welcome-back-content").html("interactive floor plan"),$("#viewEventType").val("Interactive Floorplan View")))})}if(fi=$(".interactive-floor-plan"),fi.length){ei=$(".main-nav a");y=$(".m-contact-block");ei.on("click",function(n){y.slideDown();n.preventDefault()});y.on("click","button",function(){($(this).hasClass("btn-return")===!0||$(this).hasClass("icon-close")===!0)&&y.slideUp()})}if(r=$(".m-modal"),si=$(".has-modal"),si.length){$(".has-modal.trigger").click(function(n){var r=t.width(),i;r<ft?($(this).closest("article").is(".active")?oi():(oi(),$(this).closest("article").addClass("active"),$(this).closest("article").children(".m-modal").slideDown(300).addClass("modal-open")),i=$(this).closest("article"),setTimeout(function(){$("html, body").animate({scrollTop:i.offset().top},250)},750),n.preventDefault()):($(this).closest("article").is(".active")?$("article").removeClass("active"):($("article").removeClass("active"),$(this).closest("article").addClass("active")),$("article .m-modal").removeClass("modal-open"),$(this).closest("article").children(".m-modal").addClass("modal-open"))});$(".icon-close",r).on("click",function(){$(this).closest("article").removeClass("active");r.fadeOut(220,function(){setTimeout(function(){r.removeClass("modal-open").removeAttr("style")},500)})});$(".inpage",r).on("click",function(){$(this).closest("article").removeClass("active");nt($(this));r.slideUp(1,function(){setTimeout(function(){r.removeClass("modal-open").removeAttr("style")},500)})})}});$(function(){var r=$(window),n,t,i;if($(".m-community-slider").length){n=$(".slick-next-com");t=$(".slick-prev-com");$(".m-community-slider a").addClass("inpage");$('.m-community-slider a[href="#qmi"]').removeClass("inpage");$('.m-community-slider a[href="#qmi"]').attr("target","_self");$('.m-community-slider a[href="#contact"]').addClass("contact-trigger");$(".m-community-slides-large").slick({slidesToShow:1,slidesToScroll:1,arrows:!0,fade:!0,focusOnSelect:!0,asNavFor:".m-community-slides",lazyLoad:"ondemand"}).on("beforeChange",function(n,t,i,r){$(".slick-next-com.hide").length&&$(".m-community-slides").find("li").eq(r).addClass("slick-current").siblings().removeClass("slick-current")});r.resize(function(){this.resizeTO&&clearTimeout(this.resizeTO);this.resizeTO=setTimeout(function(){$(this).trigger("resizeEnd")},500)}).bind("resizeEnd",function(){i()}).load(function(){i()});i=function(){var i=r.width(),u=$(".m-community-slides").find("li").length;i>900&&u<=12||i<=900&&i>=641&&u<=9||u===3?(n.addClass("hide"),t.addClass("hide")):(n.removeClass("hide"),t.removeClass("hide"))};$(".m-community-slides").on("init",function(){$(this).closest(".slide-container").addClass("smallSlides");setTimeout(function(){$(".smallSlides").addClass("initialized")},1500)}).slick({dots:!1,infinite:!0,speed:300,slidesToShow:12,slidesToScroll:1,asNavFor:".m-community-slides-large",centerMode:!1,focusOnSelect:!0,nextArrow:n,prevArrow:t,lazyLoad:"progressive",responsive:[{breakpoint:900,settings:{slidesToShow:9,slidesToScroll:1,infinite:!0,focusOnSelect:!0,centerMode:!1,lazyLoad:"progressive"}},{breakpoint:640,settings:{slidesToShow:3,slidesToScroll:1,infinite:!0}}]})}});$(function(){var r=$(".m-type-tab").find(".m-tabs"),t,n;if(r.length){t=$(".m-tab-button").find("button");n=$(".m-tab-section",$(".m-home-types"));n.on("init",function(){for(var t,i=function(n,t){setTimeout(function(){cardsEqHeight()},t)},n=0;n<10;n++)t=n*1e3,i(n,t)});$(window).on("hashchange",function(n){i(n)});$(window).load(function(n){i(n)});function i(t){var r=window.location.hash,u=$(".m-type-tab").find(".m-tabs"),i;u.length&&(i=$(".m-tab-button").find("button"),r=="#qmi"&&(i.removeClass("active"),i.eq(1).addClass("active"),n.removeClass("active"),n.eq(1).addClass("active"),n.slick("slickUnfilter"),t.preventDefault(),$("html, body").animate({scrollTop:$("#qmi").offset().top},300,"linear")),r=="#mhi"&&(i.length==3?(i.removeClass("active"),i.eq(2).addClass("active"),n.removeClass("active"),n.eq(2).addClass("active")):(i.removeClass("active"),i.eq(1).addClass("active"),n.removeClass("active"),n.eq(1).addClass("active")),n.slick("slickUnfilter"),t.preventDefault(),$("html, body").animate({scrollTop:$("#mhi-btn").offset().top},300,"linear")))}n.slick({dots:!1,infinite:!0,speed:300,slidesToShow:1,focusOnSelect:!0,arrows:!0,lazyLoad:!0,adaptiveHeight:!1,accessibility:!1}).on("reInit",function(){cardsEqHeight()}).on("beforeChange",function(){cardsEqHeight()}).on("afterChange",function(){cardsEqHeight()});$(".m-home-types .slick-list.draggable").css("overflow","visible !important;");t.on("click",function(){var i=$(this).prevAll().length;t.removeClass("active");$(this).addClass("active");n.removeClass("active");n.eq(i).addClass("active");n.slick("slickUnfilter");cardsEqHeight()});$("#quickMoveInLink").click(function(){return t.removeClass("active"),t.eq(1).addClass("active"),n.removeClass("active"),n.eq(1).addClass("active"),n.slick("slickUnfilter"),cardsEqHeight(),window.location="#homeTypeCards",!1})}});$(function(){var n=$.ua.browser.name,t=$.ua.device.vendor+" | "+$.ua.device.model+" | "+$.ua.device.type,i=$(window).width();$("input[name=BrowserName]").val(n);$("input[name=DeviceName]").val(t);$("input[name=ScreenWidthPix]").val(i)});$(function(){var t=$(".m-offers"),i=$(".m-modal"),u=$(".m-offers").find(".has-modal"),r=!1,n=t.find(".slide-wrap");if(u.length){$(".has-modal.trigger").click(function(){r=!0;n.slick&&n.slick("unslick")});$(".icon-close",i).on("click",function(){i.removeClass("modal-open").removeAttr("style");t.length&&n.slick({dots:!0,infinite:!0,speed:300,slidesToShow:1,focusOnSelect:!0,accessibility:!1,arrows:!0,adaptiveHeight:!0})});r||t.length&&n.slick({dots:!0,infinite:!0,speed:300,slidesToShow:1,focusOnSelect:!0,accessibility:!1,arrows:!0,adaptiveHeight:!0})}else t.length&&n.slick({dots:!0,infinite:!0,speed:300,slidesToShow:1,focusOnSelect:!0,accessibility:!1,arrows:!0,adaptiveHeight:!0})});$(function(){$("body").on("click",".m-locations button",function(){var n=$(this).closest(".m-location");return n.hasClass("open")===!1?($(".m-location").find("ul").slideUp("fast",function(){$(".m-location").removeClass("open").find("button").find("span.icon-toggle").removeClass("icon-minus").addClass("icon-plus")}),n.find("ul").slideDown("fast",function(){n.addClass("open").find("button").find("span.icon-toggle").addClass("icon-minus").removeClass("icon-plus")})):n.find("ul").slideUp("fast",function(){n.removeClass("open").find("button").find("span.icon-toggle").removeClass("icon-minus").addClass("icon-plus")}),!1});$("body").on("click","[data-cookie]",function(){var n=$(this).data("cookie");(n==="Market"||n==="County"||n==="City")&&Cookies.set("MarketCounty",n,{expires:1,path:"/"})});$("body").on("click","[data-tab]",function(){var t=$(this),u=t.closest("li").prevAll().length,i=$(".tab",$(".m-tab-section")),r=$("button",$(".m-tab-nav")),n;return r.removeClass("active"),$(this).addClass("active"),i.removeClass("active"),i.eq(u).addClass("active"),r.length>1&&(n=t.text(),(n==="Market"||n==="County"||n==="City")&&Cookies.set("MarketCounty",n,{expires:1,path:"/"})),!1});var n=Cookies.get("MarketCounty");n!==undefined&&$("button",$(".m-tab-nav")).each(function(){$(this).text()===n&&$(this).trigger("click")})});$(function(){var n=$(".more-toggle");if(n.length)n.on("click",function(){var n=$(this);n.hasClass("icon-plus")===!0?(n.removeClass("icon-plus").addClass("icon-minus"),n.next(".m-more").slideDown(),n.text("Show Less")):(n.removeClass("icon-minus").addClass("icon-plus"),n.next(".m-more").slideUp(),n.text("Show More"))})});$(function(){var n=$(".toggle-content-button");if(n.length)n.on("click",function(){$(this).hasClass("open")===!1?($(this).closest(".m-community-article").addClass("open"),$(this).addClass("open").closest(".title").next(".toggle-content").addClass("open")):($(this).removeClass("open").closest(".title").next(".toggle-content").removeClass("open"),$(this).closest(".m-community-article").removeClass("open"))})});$(function(){var n=$(".accordion__button");if(n.length)n.on("click",function(){var n=$(this);n.find("span").hasClass("icon-plus")===!0?n.find("span").addClass("icon-minus").removeClass("icon-plus").closest(".accordion").find(".accordion__content").slideDown():n.find("span").removeClass("icon-minus").addClass("icon-plus").closest(".accordion").find(".accordion__content").slideUp()})});$(function(){var n,t;if($("#Phone").formance("format_phone_number"),$("#appointment-phone").formance("format_phone_number"),$("#rsvp-phone").formance("format_phone_number"),$("#comingSoon-phone").formance("format_phone_number"),$("#contact-us-phone").formance("format_phone_number"),$(".format-phone").formance("format_phone_number"),$("#schedule-phone").formance("format_phone_number"),$("#f4-phone").formance("format_phone_number"),n=$(".email-trigger"),n.length){t=$(".m-email-block");n.on("click",function(n){n.preventDefault();t.slideDown()});$("main").on("click",".icon-close, .btn-return",function(){$(this).closest(".m-email-block").length===1&&$(".m-email-block").slideUp()})}});$(function(){var u=$(".m-contact-block"),r=$("p.questions",u),f=r.next("p"),t=!1,i=!1,n={c1:{t:"Do you have questions about our community, amenities, or homes?",p:"I’m here to help! Just fill out the form below and I’ll get back to you quickly with the answers you need."},c2:{t:"Did you find the home you’re looking for?",p:"Have questions about all our options and features? I’m here to help! Just fill out the form below and I’ll get back to you quickly with the answers you need."},c3:{t:"",p:"If you have questions about our location, community or home models, I’m here to help. Just fill out the form below and I’ll get back to you quickly with the answers you need."},c4:{t:"Like what you see?",p:"If you have any questions about our community and homes—or would like to schedule a visit and see them in person&mdash;let me know. I’m here to help!"},c5:{t:"Our community’s close to everything and easy to find!",p:"Just fill out the contact form below and I’ll get back to you right away with directions, plus answers to any questions you have."},c6:{t:"",p:"I’m happy to help you get the answers you need to your mortgage and down payment questions—as well as answer any other questions about our community or schedule an appointment. Just fill out the form below and I’ll get back to you right away."},c7:{t:"",p:"I know our community is sold out—but I can still help you find one that fits your needs. Just fill out the form below and let me know what you’re looking for, and I can point you to one of our other nearby communities."},c8:{t:"Save On Our Quick Move-In Homes",p:"Our community’s Move-In Ready homes offer terrific features and value—which is why they’re moving fast! If you’re interested in learning more, just fill out the form below and I’ll get back to you right away."},c9:{t:"Want to know more about our financing options?",p:"I can help! Plus, I can answer any other questions you have about our community, homes and location. Just fill out the form below and I’ll get back to you right away."},c10:{t:"Interested in attending one of our events?",p:"I’m happy to tell you more about it—or answer any other questions you have. Just fill out the form below and I’ll get back to you right away."},c11:{t:"Interested in our featured homesite?",p:"I’m happy to tell you more about it—and answer any other questions you have. Just fill out the form below and I’ll get back to you quickly with the answers you need!"},c12:{t:"Want to know more about our community—including what’s close and convenient?",p:"I’m here to help! Just fill out the form below and I’ll get back to you quickly with the answers you need."},c13:{t:"Have questions about our exact pricing, as well as our community, home types and amenities?",p:"I’m here to help! Just fill out the form below and I’ll get back to you quickly with the answers you need."},c14:{t:"Need quick answers about our limited time offer—as well as our community and homes?",p:"I’m here to help! Just fill out the form below and I’ll get back to you right away with the answers you need."},c15:{t:"Want to know why our homeowners love us?",p:"It’s because we’re here for them. I’m also here for you, to answer your questions, provide more information or schedule an appointment. All you need to do is fill out the form below."},c16:{t:"",p:":I’m happy to tell you more about our First Floor Owner homes—as well as answer your questions, provide more information about our community or schedule an appointment. Just fill out the form below and I’ll get back to you right away."},c17:{t:"",p:"I’m happy to tell you more about our Ranch-Style homes—as well as answer your questions, provide more information about our community or schedule an appointment. Just fill out the form below and I’ll get back to you right away."},c18:{t:"",p:"With only a few homes left in our community, you can be sure that I’ll get back to you right away with answers to your questions or to schedule an appointment. All you need to do is fill out the form below."},c19:{t:"Thanks for your interest in joining our VIP list!",p:"Just fill out the form below and you’ll be in the know. I can also answer any questions you have about our community, home types and location."},c20:{t:"Move Into a New Home in 90 Days? Yes, You Can!",p:"I'm happy to tell you more about how we can help you move into a new home in as little as 90 days. I can also answer any other questions you have about our homes and community. Just fill out the form below and I'll get back to you right away."},c21:{t:"Move Into a New Home in 120 Days? Yes, You Can!",p:"I'm happy to tell you more about how we can help you move into a new home in as little as 120 days. I can also answer any other questions you have about our homes and community. Just fill out the form below and I'll get back to you right away."},c22:{t:"Ready to start building your dream home?",p:"Still have questions? Want to schedule a visit? I’m here to help! Just fill out the form below and I’ll get back to you quickly with the answers you need."},c23:{t:"Our Homeowners Say...",p:'"I love the quality of the home. I love the customer service. I recommend Ryan Homes to everyone I know."-Raven'},c24:{t:"Our Homeowners Say...",p:'"We are just about settled in from moving into our first home build…. WE LOVE our new home!" -Heather & Justin'},c25:{t:"Our Homeowners Say...",p:'"Ryan Homes exceeded our expectations. Many thanks from two very satisfied customers.” – Shaun & Kelly'},c26:{t:"Sign up for our Priority List!"},changeText:function(n){if(!r.parent().hasClass("welcome-back-contact")){var t=n;r.html(t.t);f.html(t.p)}}};$('a[href="#visit"]').on("click",function(n){$(this).hasClass("inpage")===!1&&(scrollIt($("#visit")),n.preventDefault())});$("body").on("click",'a[href="#vip-form"]',function(n){var t=$("#vip-form");scrollIt(t);n.preventDefault()});$(".m-community-slider .slick-arrow, .m-community-slider .slick-track").on("click",function(){t=!0;i=!1});$('a[href="#homes"]').on("click",function(){i=!0;t=!1});$("a[data-contact]").on("click",function(){var r=$(this).data("contact").split(".c"),u="c"+parseInt(r[1]);t===!0?n.changeText(n.c4):i===!0?n.changeText(n.c2):n.changeText(n[u]);t=!1;i=!1})});$(".icon-heart").on("click",function(){$(this).toggleClass("favorited")});$(".icon-heart3").on("click",function(){$(".icon-heart3").hasClass("favorited")?$(".icon-heart3").removeClass("favorited"):$(".icon-heart3").addClass("favorited")});$(".header-fav").on("click",function(){$(".icon-heart3").hasClass("favorited")?$(".icon-heart3").removeClass("favorited"):$(".icon-heart3").addClass("favorited")});videos=$(".video");scrollToVideo=localStorage.getItem("scrollToVideo");$("body").on("click","a[data-video-name]",function(){localStorage.setItem("scrollToVideo","true")});if(scrollToVideo==="true"&&(autoPlay=!0,setTimeout(function(){scrollItNoFocus($("#info"))},1e3),localStorage.setItem("scrollToVideo","false")),videos.length){tag=document.createElement("script");firstScriptTag=document.getElementsByTagName("script")[0];tag.src="https://www.youtube.com/iframe_api";firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);var videoArray=[],videoCount=0,onPlayerStateChange=function(n){if(n.data!==-1)if(n.data===0){$(".community-product").length>0&&(Cookies.get("ShowCommuntiyModelPageContactUsForm")!=="true"||Cookies.get("ShowCommuntiyModelPageContactUsForm")===null)&&(setCommuntiyModelPageContactUsCookies(),$(".contact-us .inpage").trigger("click"),$(".communtiy-product").show().addClass("cookie-contact"),$("#viewEventType").val("Community Product Video View"));$(".communtiy-video").length>0&&(Cookies.get("ShowCommuntiyPageContactUsForm")!=="true"||Cookies.get("ShowCommuntiyPageContactUsForm")===null)&&(setCommuntiyPageContactUsCookies(),$(".contact-us .inpage").trigger("click"),$(".communtiy-video").show().addClass("cookie-contact"),$("#viewEventType").val("Community Video View"));$("#welcome-back-content").html("community video");var t=$(".m-contact-block");t.slideDown();e.preventDefault();t.on("click","button",function(){($(this).hasClass("btn-return")===!0||$(this).hasClass("icon-close")===!0)&&t.slideUp()});resetVideo(n.target.m.id)}else n.data===2||n.data===3||n.data===5},onPlayerReady=function(){$("body").addClass("videos-ready");videos.on("click",function(){var n=$(this).data("yt").split("player"),t=n[1];stopAllVideos();$(this).addClass("player");$("html").hasClass("touch")===!1&&videoArray[t].playVideo()});$("html").hasClass("no-touch")&&autoPlay===!0&&videos.eq(0).trigger("click")},resetVideo=function(n){var i=n.split("player"),t=i[1];videoArray[t].seekTo(0);setTimeout(function(){videoArray[t].stopVideo()},100);showOverlay()},onYouTubeIframeAPIReady=function(){videos.each(function(){var f=$(this),h=f.find(".video-container"),i=f.data("video"),r=i.split("//youtu.be/"),e=i.split("//www.youtube.com/watch?v="),o=i.split("//www.youtube.com/embed/"),c=i.split("//www.youtube.com/v/"),s=i.split("watch?v="),t,n,u;r.length===2||e.length===2||o.length===2||c.length===2?r.length===2?(n=r[1].split("&"),t=n[0]):e.length===2?(n=e[1].split("&"),t=n[0]):o.length===2&&(n=o[1].split("&"),t=n[0]):s.length===2?(n=s[1].split("&"),t=n[0]):t=r[0];u="player"+videoCount;f.attr("data-YT",u);h.append('<div id="'+u+'" class="video-player"/>');player_video=new YT.Player(u,{height:"529",width:"940",videoId:t,playerVars:{rel:0,loop:1},events:{onStateChange:onPlayerStateChange,onReady:onPlayerReady}});videoArray.push(player_video);videoCount++})},stopAllVideos=function(){showOverlay();for(var n=0;n<videoArray.length;n++)videoArray[n].stopVideo()},showOverlay=function(){videos.removeClass("player")}}if($(".lightbox-video").length){$(".m-video-block").on("click","a",function(){var i=$(this).data("featherlight"),t=$(i).find("iframe"),n=t.attr("src"),r=n.split("?");t.data("src",n);n+=r.length==1?"?autoplay=1":"&autplay=1";t.attr("src",n)});$.featherlight.defaults.afterClose=function(){var n=$(this.$content.prevObject.selector).find("iframe"),t=n.data("src");$(n[0]).attr("src",t)};$.featherlight.defaults.afterOpen=function(){var n=$(this.$content.prevObject.selector).find("iframe"),t=n.data("src");$(n[0]).attr("src",t);stopAllVideos()}}window.onload=function(){$(document).on("click",".collection-check",function(){var r=event.target.id.split("_"),n=r[0],u=r[1],t="#hiddenCollections_"+u,i=$(t).val();i.indexOf(n)>=0?$(t).val(i.replace(n+",","")):$(t).val(i+n+",")})};$(document).click(function(n){var i,r,t,u;$(n.target).hasClass("multicheckbox")||$(n.target).parents(".multicheckbox").length>0?$(n.target).is("input")&&(i="Select Available Days",$(n.target).parents(".time-select").length>0&&(i="Select Available Times"),r=[],$(n.target).parent().parent().find("input:checkbox:checked").each(function(){r.push($(this).parent().data("value"))}),r.length>0&&(i=r.join(", ")),$(n.target).parent().parent().parent().find(".selectBox select option").text(i)):$(n.target).hasClass("selectBox")||$(n.target).parents(".selectBox").length>0?(t=$(n.target).parent().find(".multicheckbox"),$(n.target).parents(".selectBox").length>0&&(t=$(n.target).parent().parent().find(".multicheckbox")),u=t.hasClass("expanded"),$(".multicheckbox").each(function(){$(this).hide();$(this).removeClass("expanded")}),u||(t.show(),t.addClass("expanded"))):($(".multicheckbox.expanded").hide(),$(".multicheckbox.expanded").toggleClass("expanded"))});$(function(){$("#send-info-checkbox").on("click",function(){$("#hdn-SendMoreInformation").val($("#send-info-checkbox").is(":checked"))});$("#sendInfoAlertUpdate").on("click",function(){window.location.href="/update-account?sendInfo=true#edit-form"});$("#sendInfoAlertYes").on("click",function(){$("#hdn-SendMoreInformation").val(!0);$("#sendFavoriteInformationIgnore").submit()});$("#sendInfoAlertNo").on("click",function(){$("#hdn-SendMoreInformation").val(!1);$("#sendFavoriteInformationIgnore").submit()});$("#sendFavoriteInformationIgnore").on("submit",function(n){$.post("/update-account",$(this).serialize(),function(){$("#sendInfoAlert").slideUp("slow")});n.preventDefault()})});;
/**
* Maplace.js 0.1.33
*
* Copyright (c) 2013 Daniele Moraschi
* Licensed under the MIT license
* For all details and documentation:
* http://maplacejs.com
*/
(function(g,t,f,m){var q,n,p;q={activateCurrent:function(e){this.html_element.find("select").val(e)},getHtml:function(){var e=this,a="",b;if(1<this.ln){a+='<select class="dropdown controls '+this.o.controls_cssclass+'">';this.ShowOnMenu(this.view_all_key)&&(a+='<option value="'+this.view_all_key+'">'+this.o.view_all_text+"</option>");for(b=0;b<this.ln;b+=1)this.ShowOnMenu(b)&&(a+='<option value="'+(b+1)+'">'+(this.o.locations[b].title||"#"+(b+1))+"</option>");a=g(a+"</select>").bind("change",function(){e.ViewOnMap(this.value)})}(b=
this.o.controls_title)&&(b=g('<div class="controls_title"></div>').css(this.o.controls_applycss?{fontWeight:"bold",fontSize:this.o.controls_on_map?"12px":"inherit",padding:"3px 10px 5px 0"}:{}).append(this.o.controls_title));return this.html_element=g('<div class="wrap_controls"></div>').append(b).append(a)}};n={html_a:function(e,a,b){var c=this;a=a||e+1;b=b||this.o.locations[e].title;e=g('<a data-load="'+a+'" id="ullist_a_'+a+'" href="#'+a+'" title="'+b+'"><span>'+(b||"#"+(e+1))+"</span></a>");e.css(this.o.controls_applycss?
{color:"#666",display:"block",padding:"5px",fontSize:this.o.controls_on_map?"12px":"inherit",textDecoration:"none"}:{});e.on("click",function(a){a.preventDefault();a=g(this).attr("data-load");c.ViewOnMap(a)});return e},activateCurrent:function(e){this.html_element.find("li").removeClass("active");this.html_element.find("#ullist_a_"+e).parent().addClass("active")},getHtml:function(){var e=g("<ul class='ullist controls "+this.o.controls_cssclass+"'></ul>").css(this.o.controls_applycss?{margin:0,padding:0,
listStyleType:"none"}:{}),a;this.ShowOnMenu(this.view_all_key)&&e.append(g("<li></li>").append(n.html_a.call(this,!1,this.view_all_key,this.o.view_all_text)));for(a=0;a<this.ln;a++)this.ShowOnMenu(a)&&e.append(g("<li></li>").append(n.html_a.call(this,a)));(a=this.o.controls_title)&&(a=g('<div class="controls_title"></div>').css(this.o.controls_applycss?{fontWeight:"bold",padding:"3px 10px 5px 0",fontSize:this.o.controls_on_map?"12px":"inherit"}:{}).append(this.o.controls_title));return this.html_element=
g('<div class="wrap_controls"></div>').append(a).append(e)}};p=function(){function e(a){this.VERSION="0.1.33";this.loaded=!1;this.markers=[];this.circles=[];this.oMap=!1;this.view_all_key="all";this.infowindow=null;this.ln=this.maxZIndex=0;this.oMap=!1;this.directionsDisplay=this.directionsService=this.Fusion=this.Polygon=this.Polyline=this.current_index=this.current_control=this.controls_wrapper=this.canvas_map=this.map_div=this.oBounds=null;this.o={debug:!1,map_div:"#gmap",controls_div:"#controls",
generate_controls:!0,controls_type:"dropdown",controls_cssclass:"",controls_title:"",controls_on_map:!0,controls_applycss:!0,controls_position:f.maps.ControlPosition.RIGHT_TOP,type:"marker",view_all:!0,view_all_text:"View All",pan_on_click:!0,start:0,locations:[],shared:{},map_options:{mapTypeId:f.maps.MapTypeId.ROADMAP},stroke_options:{strokeColor:"#0000FF",strokeOpacity:.8,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.4},directions_options:{travelMode:f.maps.TravelMode.DRIVING,unitSystem:f.maps.UnitSystem.METRIC,
optimizeWaypoints:!1,provideRouteAlternatives:!1,avoidHighways:!1,avoidTolls:!1},circle_options:{radius:100,visible:!0},styles:{},fusion_options:{},directions_panel:null,draggable:!1,editable:!1,show_infowindows:!0,show_markers:!0,infowindow_type:"bubble",listeners:{},beforeViewAll:function(){},afterViewAll:function(){},beforeShow:function(a,c,d){},afterShow:function(a,c,d){},afterCreateMarker:function(a,c,d){},beforeCloseInfowindow:function(a,c){},afterCloseInfowindow:function(a,c){},beforeOpenInfowindow:function(a,
c,d){},afterOpenInfowindow:function(a,c,d){},afterRoute:function(a,c,d){},onPolylineClick:function(a){},onPolygonClick:function(a){},circleRadiusChanged:function(a,c,d){},circleCenterChanged:function(a,c,d){},drag:function(a,c,d){},dragEnd:function(a,c,d){},dragStart:function(a,c,d){}};this.AddControl("dropdown",q);this.AddControl("list",n);a&&"directions"===a.type&&(!a.show_markers&&(a.show_markers=!1),!a.show_infowindows&&(a.show_infowindows=!1));g.extend(!0,this.o,a)}e.prototype.controls={};e.prototype.create_objMap=
function(){var a=0,b;for(b in this.o.styles)this.o.styles.hasOwnProperty(b)&&(0===a&&(this.o.map_options.mapTypeControlOptions={mapTypeIds:[f.maps.MapTypeId.ROADMAP]}),a++,this.o.map_options.mapTypeControlOptions.mapTypeIds.push("map_style_"+a));if(this.loaded)this.oMap.setOptions(this.o.map_options);else try{this.map_div.css({position:"relative",overflow:"hidden"}),this.canvas_map=g("<div>").addClass("canvas_map").css({width:"100%",height:"100%"}).appendTo(this.map_div),this.oMap=new f.maps.Map(this.canvas_map.get(0),
this.o.map_options)}catch(c){this.debug("create_objMap::"+this.map_div.selector,c.toString())}a=0;for(b in this.o.styles)this.o.styles.hasOwnProperty(b)&&(a++,this.oMap.mapTypes.set("map_style_"+a,new f.maps.StyledMapType(this.o.styles[b],{name:b})),this.oMap.setMapTypeId("map_style_"+a))};e.prototype.add_markers_to_objMap=function(){var a,b;a=this.o.type||"marker";switch(a){case "marker":for(a=0;a<this.ln;a++)b=this.create_objPoint(a),this.create.marker.call(this,a,b);break;default:this.create[a].apply(this)}};
e.prototype.create_objPoint=function(a){a=g.extend({},this.o.locations[a]);var b=a.visible===m?m:a.visible;!a.type&&(a.type=this.o.type);a.map=this.oMap;a.position=new f.maps.LatLng(a.lat,a.lon);a.zIndex=a.zIndex===m?1E4:a.zIndex+100;a.visible=b===m?this.o.show_markers:b;this.o.maxZIndex=a.zIndex>this.maxZIndex?a.zIndex:this.maxZIndex;a.image&&(a.icon=new f.maps.MarkerImage(a.image,new f.maps.Size(a.image_w||32,a.image_h||32),new f.maps.Point(0,0),new f.maps.Point((a.image_w||32)/2,(a.image_h||32)/
2)));return a};e.prototype.create_objCircle=function(a){var b,c,d;d=g.extend({},a);b=g.extend({},this.o.stroke_options);c=g.extend({},this.o.circle_options);g.extend(b,a.stroke_options||{});g.extend(d,b);g.extend(c,a.circle_options||{});g.extend(d,c);d.center=a.position;d.draggable=!1;d.zIndex=0<a.zIndex?a.zIndex-10:1;return d};e.prototype.add_markerEv=function(a,b,c){var d=this;f.maps.event.addListener(c,"click",function(e){d.o.beforeShow(a,b,c);d.o.show_infowindows&&!1!==b.show_infowindow&&d.open_infowindow(a,
c,e);d.o.pan_on_click&&!1!==b.pan_on_click&&(d.oMap.panTo(b.position),b.zoom&&d.oMap.setZoom(b.zoom));d.current_control&&d.o.generate_controls&&d.current_control.activateCurrent&&d.current_control.activateCurrent.call(d,a+1);d.current_index=a;d.o.afterShow(a,b,c)});b.draggable&&this.add_dragEv(a,b,c)};e.prototype.add_circleEv=function(a,b,c){var d=this;f.maps.event.addListener(c,"click",function(){d.ViewOnMap(a+1)});f.maps.event.addListener(c,"center_changed",function(){d.o.circleCenterChanged(a,
b,c)});f.maps.event.addListener(c,"radius_changed",function(){d.o.circleRadiusChanged(a,b,c)});b.draggable&&this.add_dragEv(a,b,c)};e.prototype.add_dragEv=function(a,b,c){var d=this;f.maps.event.addListener(c,"drag",function(e){var g;if(c.getPosition)e=c.getPosition();else if(c.getCenter)e=c.getCenter();else return;d.circles[a]&&d.circles[a].setCenter(e);d.Polyline?g="Polyline":d.Polygon&&(g="Polygon");if(g){for(var k=d[g].getPath().getArray(),h=[],l=0;l<k.length;++l)h[l]=a===l?new f.maps.LatLng(e.lat(),
e.lng()):new f.maps.LatLng(k[l].lat(),k[l].lng());d[g].setPath(new f.maps.MVCArray(h));d.add_polyEv(g)}d.o.drag(a,b,c)});f.maps.event.addListener(c,"dragend",function(){d.o.dragEnd(a,b,c)});f.maps.event.addListener(c,"dragstart",function(){d.o.dragStart(a,b,c)});f.maps.event.addListener(c,"center_changed",function(){d.markers[a]&&c.getCenter&&d.markers[a].setPosition(c.getCenter());d.o.drag(a,b,c)})};e.prototype.add_polyEv=function(a){var b=this;f.maps.event.addListener(this[a].getPath(),"set_at",
function(c,d){var e=b[a].getPath().getAt(c),e=new f.maps.LatLng(e.lat(),e.lng());b.markers[c]&&b.markers[c].setPosition(e);b.circles[c]&&b.circles[c].setCenter(e);b.o["on"+a+"Changed"](c,d,b[a].getPath().getArray())})};e.prototype.create={marker:function(a,b,c){var d;"circle"!=b.type||c||(d=this.create_objCircle(b),b.visible||(d.draggable=b.draggable),c=new f.maps.Circle(d),this.add_circleEv(a,d,c),this.circles[a]=c);b.type="marker";c=new f.maps.Marker(b);this.add_markerEv(a,b,c);this.oBounds.extend(b.position);
this.markers[a]=c;this.o.afterCreateMarker(a,b,c);return c},circle:function(){var a,b,c,d;for(a=0;a<this.ln;a++)b=this.create_objPoint(a),"circle"==b.type&&(c=this.create_objCircle(b),b.visible||(c.draggable=b.draggable),d=new f.maps.Circle(c),this.add_circleEv(a,c,d),this.circles[a]=d),b.type="marker",this.create.marker.call(this,a,b,d)},polyline:function(){var a,b,c=g.extend({},this.o.stroke_options);c.path=[];c.draggable=this.o.draggable;c.editable=this.o.editable;c.map=this.oMap;c.zIndex=this.o.maxZIndex+
100;for(a=0;a<this.ln;a++)b=this.create_objPoint(a),this.create.marker.call(this,a,b),c.path.push(b.position);this.Polyline?this.Polyline.setOptions(c):this.Polyline=new f.maps.Polyline(c);this.add_polyEv("Polyline")},polygon:function(){var a=this,b,c,d=g.extend({},this.o.stroke_options);d.path=[];d.draggable=this.o.draggable;d.editable=this.o.editable;d.map=this.oMap;d.zIndex=this.o.maxZIndex+100;for(b=0;b<this.ln;b++)c=this.create_objPoint(b),this.create.marker.call(this,b,c),d.path.push(c.position);
this.Polygon?this.Polygon.setOptions(d):this.Polygon=new f.maps.Polygon(d);f.maps.event.addListener(this.Polygon,"click",function(b){a.o.onPolygonClick(b)});this.add_polyEv("Polygon")},fusion:function(){this.o.fusion_options.styles=[this.o.stroke_options];this.o.fusion_options.map=this.oMap;this.Fusion?this.Fusion.setOptions(this.o.fusion_options):this.Fusion=new f.maps.FusionTablesLayer(this.o.fusion_options)},directions:function(){var a=this,b,c,d,e,r,k=[],h=0;for(b=0;b<this.ln;b++)c=this.create_objPoint(b),
0===b?e=c.position:b===this.ln-1?r=c.position:(d=!0===this.o.locations[b].stopover?!0:!1,k.push({location:c.position,stopover:d})),this.create.marker.call(this,b,c);this.o.directions_options.origin=e;this.o.directions_options.destination=r;this.o.directions_options.waypoints=k;this.directionsService||(this.directionsService=new f.maps.DirectionsService);this.directionsDisplay?this.directionsDisplay.setOptions({draggable:this.o.draggable}):this.directionsDisplay=new f.maps.DirectionsRenderer({draggable:this.o.draggable});
this.directionsDisplay.setMap(this.oMap);this.o.directions_panel&&(this.o.directions_panel=g(this.o.directions_panel),this.directionsDisplay.setPanel(this.o.directions_panel.get(0)));this.o.draggable&&f.maps.event.addListener(this.directionsDisplay,"directions_changed",function(){h=a.compute_distance(a.directionsDisplay.directions);a.o.afterRoute(h)});this.directionsService.route(this.o.directions_options,function(b,c){c===f.maps.DirectionsStatus.OK&&(h=a.compute_distance(b),a.directionsDisplay.setDirections(b));
a.o.afterRoute(h,c,b)})}};e.prototype.compute_distance=function(a){var b=0,c=a.routes[0],d=c.legs.length;for(a=0;a<d;a++)b+=c.legs[a].distance.value;return b};e.prototype.type_to_open={bubble:function(a){this.infowindow=new f.maps.InfoWindow({content:a.html||""})}};e.prototype.open_infowindow=function(a,b,c){this.CloseInfoWindow();c=this.o.locations[a];var d=this.o.infowindow_type;c.html&&this.type_to_open[d]&&(this.o.beforeOpenInfowindow(a,c,b),this.type_to_open[d].call(this,c),this.infowindow.open(this.oMap,
b),this.o.afterOpenInfowindow(a,c,b))};e.prototype.get_html_controls=function(){return this.controls[this.o.controls_type]&&this.controls[this.o.controls_type].getHtml?(this.current_control=this.controls[this.o.controls_type],this.current_control.getHtml.apply(this)):""};e.prototype.generate_controls=function(){if(this.o.controls_on_map){var a=g('<div class="on_gmap '+this.o.controls_type+' gmap_controls"></div>').css(this.o.controls_applycss?{margin:"5px"}:{}),b=g(this.get_html_controls()).css(this.o.controls_applycss?
{background:"#fff",padding:"5px",border:"1px solid rgb(113,123,135)",boxShadow:"rgba(0, 0, 0, 0.4) 0px 2px 4px",maxHeight:this.map_div.find(".canvas_map").outerHeight()-80,minWidth:100,overflowY:"auto",overflowX:"hidden"}:{});a.append(b);this.oMap.controls[this.o.controls_position].push(a.get(0))}else this.controls_wrapper.empty(),this.controls_wrapper.append(this.get_html_controls())};e.prototype.init_map=function(){var a=this;this.Polyline&&this.Polyline.setMap(null);this.Polygon&&this.Polygon.setMap(null);
this.Fusion&&this.Fusion.setMap(null);this.directionsDisplay&&this.directionsDisplay.setMap(null);for(var b=this.markers.length-1;0<=b;--b)try{this.markers[b]&&this.markers[b].setMap(null)}catch(c){a.debug("init_map::markers::setMap",c.stack)}this.markers.length=0;this.markers=[];for(b=this.circles.length-1;0<=b;--b)try{this.circles[b]&&this.circles[b].setMap(null)}catch(d){a.debug("init_map::circles::setMap",d.stack)}this.circles.length=0;this.circles=[];this.o.controls_on_map&&this.oMap.controls&&
this.oMap.controls[this.o.controls_position].forEach(function(b,c){try{a.oMap.controls[this.o.controls_position].removeAt(c)}catch(d){a.debug("init_map::removeAt",d.stack)}});this.oBounds=new f.maps.LatLngBounds};e.prototype.perform_load=function(){1===this.ln?(this.o.map_options.set_center?this.oMap.setCenter(new f.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):(this.oMap.fitBounds(this.oBounds),this.ViewOnMap(1)),this.o.map_options.zoom&&this.oMap.setZoom(this.o.map_options.zoom)):
0===this.ln?(this.o.map_options.set_center?this.oMap.setCenter(new f.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):this.oMap.fitBounds(this.oBounds),this.oMap.setZoom(this.o.map_options.zoom||1)):(this.oMap.fitBounds(this.oBounds),"number"===typeof(this.o.start-0)&&0<this.o.start&&this.o.start<=this.ln?this.ViewOnMap(this.o.start):this.o.map_options.set_center?this.oMap.setCenter(new f.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):
this.ViewOnMap(this.view_all_key),this.o.map_options.zoom&&this.oMap.setZoom(this.o.map_options.zoom))};e.prototype.debug=function(a,b){this.o.debug&&console.log(a,b);return this};e.prototype.AddControl=function(a,b){if(!a||!b)return self.debug("AddControl",'Missing "name" and "func" callback.'),!1;this.controls[a]=b;return this};e.prototype.CloseInfoWindow=function(){this.infowindow&&(this.current_index||0===this.current_index)&&(this.o.beforeCloseInfowindow(this.current_index,this.o.locations[this.current_index]),
this.infowindow.close(),this.infowindow=null,this.o.afterCloseInfowindow(this.current_index,this.o.locations[this.current_index]));return this};e.prototype.ShowOnMenu=function(a){if(a===this.view_all_key&&this.o.view_all&&1<this.ln)return!0;a=parseInt(a,10);return"number"===typeof(a-0)&&0<=a&&a<this.ln&&!1!==this.o.locations[a].on_menu?!0:!1};e.prototype.ViewOnMap=function(a){if(a===this.view_all_key)this.o.beforeViewAll(),this.current_index=a,0<this.o.locations.length&&this.o.generate_controls&&
this.current_control&&this.current_control.activateCurrent&&this.current_control.activateCurrent.apply(this,[a]),this.oMap.fitBounds(this.oBounds),this.CloseInfoWindow(),this.o.afterViewAll();else if(a=parseInt(a,10),"number"===typeof(a-0)&&0<a&&a<=this.ln)try{f.maps.event.trigger(this.markers[a-1],"click")}catch(b){this.debug("ViewOnMap::trigger",b.stack)}return this};e.prototype.SetLocations=function(a,b){this.o.locations=a;b&&this.Load();return this};e.prototype.AddLocations=function(a,b){var c=
this;g.isArray(a)&&g.each(a,function(a,b){c.o.locations.push(b)});g.isPlainObject(a)&&this.o.locations.push(a);b&&this.Load();return this};e.prototype.AddLocation=function(a,b,c){g.isPlainObject(a)&&this.o.locations.splice(b,0,a);c&&this.Load();return this};e.prototype.RemoveLocations=function(a,b){var c=this,d=0;g.isArray(a)?g.each(a,function(a,b){b-d<c.ln&&c.o.locations.splice(b-d,1);d++}):a<this.ln&&this.o.locations.splice(a,1);b&&this.Load();return this};e.prototype.Loaded=function(){return this.loaded};
e.prototype._init=function(){this.ln=this.o.locations.length;for(var a=0;a<this.ln;a++){var b=g.extend({},this.o.shared);this.o.locations[a]=g.extend(b,this.o.locations[a]);this.o.locations[a].html&&(this.o.locations[a].html=this.o.locations[a].html.replace("%index",a+1),this.o.locations[a].html=this.o.locations[a].html.replace("%title",this.o.locations[a].title||""))}this.map_div=g(this.o.map_div);this.controls_wrapper=g(this.o.controls_div);return this};e.prototype.Load=function(a){g.extend(!0,
this.o,a);a&&a.locations&&(this.o.locations=a.locations);this._init();!1===this.o.visualRefresh?f.maps.visualRefresh=!1:f.maps.visualRefresh=!0;this.init_map();this.create_objMap();this.add_markers_to_objMap();1<this.ln&&this.o.generate_controls||this.o.force_generate_controls?(this.o.generate_controls=!0,this.generate_controls()):this.o.generate_controls=!1;var b=this;if(this.loaded)this.perform_load();else{f.maps.event.addListenerOnce(this.oMap,"idle",function(){b.perform_load()});f.maps.event.addListener(this.oMap,
"resize",function(){b.canvas_map.css({width:b.map_div.width(),height:b.map_div.height()})});for(var c in this.o.listeners){var d=this.oMap,e=this.o.listeners[c];this.o.listeners.hasOwnProperty(c)&&f.maps.event.addListener(this.oMap,c,function(a){e(d,a)})}}this.loaded=!0;return this};return e}();"function"==typeof define&&define.amd?define(function(){return p}):t.Maplace=p})(jQuery,this,google);
;
function ContactUsSliderOnBegin() {
    $("#detailContactUsSlider").attr("disabled", true);
    $("#detailContactUsSlider-prioritylist").attr("disabled", true);
}
function ContactUsOnBegin() {
    $("#detailContactUs").attr("disabled", true);
    $("#detailContactUsComingsoon").attr("disabled", true);
    $('#Phone').formance('format_phone_number');
}
function ContactUsFormOnBegin() {
    $("#ContactUs").attr("disabled", true);
}

function FooterContactUsOnBegin() {
    $("#footer-contactus").attr("disabled", true);
}

function FooterContactUsOnSuccess(response) {
    _satellite.track("Footer-ContactUs-Submit"); // for triggering GA event in DTM
    if (response.isRedirect) {
        window.location.href = response.redirectUrl;
    }
}

function FooterContactUsOnFailure(response) {
    if (response.status !== 404) {
        $("#footer-contact-us-container").html(response.responseText);
        $("#footer-contact-us-location").selectize();
        $("#footer-interest").selectize();
        ShowHideFields($('select[id="footer-interest"]').val());
    } else {
        window.location.href = response.redirectUrl;
    }
}

function ContactUsSecondaryOnSuccess(response) {
  
    if (response.isCommunityModel)
     {   window._satellite.track("Community-Model-ContactUs-Submit");} // for triggering GA event in DTM
    else
      {  window._satellite.track("Region-ContactUs-Submit");} // for triggering GA event in DTM

    if (response.isRedirect) {
        window.location.href = response.redirectUrl;
    }
    else {
        $("#contact").html(response.view);
    }
}

function ContactUsSecondaryOnFailure(response) {
    $('#Phone').formance('format_phone_number');
    if (response.status !== 404) {
        $("#contact").html(response.responseText);
        $("#contact-us-location").selectize();
        if ($('#detailContactUsComingsoon').length > 0) {
            $('#firstname').addClass('sign-up');
            $('#email').addClass('sign-up');
            $('#detailContactUsComingsoon').addClass('btn-nothanks');
        }
        
    } else {
        window.location.href = response.redirectUrl;
    }
}

function ContactUsSSliderOnFailure(response) {
    if (response.status !== 404) {
        $("#contact-Slider").html(response.responseText);
        $("#footer-contact-us-location").selectize();
        $("#footer-interest").selectize();
        $('#Phone').formance('format_phone_number');
    } else {
        window.location.href = response.redirectUrl;
    }
}

function ContactUsSliderOnSuccess(response) {
    window._vis_opt_queue = window._vis_opt_queue || [];
    window._vis_opt_queue.push(function () {
        _vis_opt_register_conversion(1, 34);
    });

    if (response.isCommunityModel)
        window._satellite.track("Community-Model-ContactUs-Submit"); // for triggering GA event in DTM
    else
        window._satellite.track("Region-ContactUs-Submit"); // for triggering GA event in DTM
    if (response.isRedirect) {
        window.location.href = response.redirectUrl;
    }
    else {
        $("#contact-Slider").html(response.view);
    }
}

$(document).on('change', 'select[id="footer-interest"]', function () {
    ShowHideFields($(this).val());
});

function ShowHideFields(value) {
    var aoi = document.getElementById("LocOfInterestID").value;
    var $select = $("#footer-contact-us-location").selectize();
    var selectize = $select[0].selectize;
    $("#footer-contact-us-comments").show();
    $("#footer-contact-us-location-container").show();
    $("#footer-contact-us-email-container").show();
    $("#footer-contact-us-phone-container").show();
    $("#footer-Name").show();
    $("#footer-button").show();
    $("#footer-comment").text("Let me know what you need");

    if (value === "Website Feedback") {
        selectize.setValue(aoi);
        $("footer-contact-us-location option:first-child").attr("selected", "Selected")
        $("#help-phone-container").hide();
        $("#footer-contact-us-location-container").hide();
        $("#help-email-container").removeClass('half');
    }
    else if (value === "I'm not interested in any of the above") {
        selectize.setValue("4");
        $("footer-contact-us-location option:first-child").attr("selected", "Selected");
        $("#footer-contact-us-location-container").hide();
        $("#help-email-container").attr('class', 'half');
        $("#help-email-container").attr('class', 'half');
        $("#help-phone-container").show();
    }
    else if (value === "I currently own a Ryan Home") {
        selectize.setValue("5");
        $("footer-contact-us-location option:first-child").attr("selected", "Selected");
        $("#footer-contact-us-comments").hide();
        $("#footer-contact-us-location-container").hide();
        $("#footer-contact-us-email-container").hide();
        $("#footer-contact-us-phone-container").hide();
        $("#footer-Name").hide();
        $("#footer-button").hide();
        $("#footer-comment").text("If you need to report an  issue about your home, please put in a warranty request at ").append('<a href="http://www.myryanhome.com/" target="_blank">' + "www.myryanhome.com" + '</a>').append(' or call <a href="tel:1-877-550-7926" class="footer-comment-phone-link">877-550-RYAN (7926)</a>.');
        $("#footer-comment").attr('style', 'line-height: 1.4!important');
    } else if (value === "I want to work with Ryan Homes as a Vendor") {
        selectize.setValue("5");
        $("footer-contact-us-location option:first-child").attr("selected", "Selected");
        $("#footer-contact-us-comments").hide();
        $("#footer-contact-us-location-container").hide();
        $("#footer-contact-us-email-container").hide();
        $("#footer-contact-us-phone-container").hide();
        $("#footer-Name").hide();
        $("#footer-button").hide();
        $("#footer-comment").text("Great! We'd love to learn more about your services. Please submit an application at ").append('<a href="http://vendors.nvrinc.com/" target="_blank">' + "vendors.nvrinc.com" + '</a>');
        $("#footer-comment").attr('style', 'line-height: 1.4!important');
    } else if (value === "I have land to sell") {
        selectize.setValue("5");
        $("footer-contact-us-location option:first-child").attr("selected", "Selected");
        $("#footer-contact-us-comments").hide();
        $("#footer-contact-us-location-container").hide();
        $("#footer-contact-us-email-container").hide();
        $("#footer-contact-us-phone-container").hide();
        $("#footer-Name").hide();
        $("#footer-button").hide();
        $("#footer-comment").text("We're always interested in learning about new land opportunities. Please visit ").append('<a href="http://land.nvrinc.com/" target="_blank">' + "land.nvrinc.com" + '</a>' + " to tell us more.");
        $("#footer-comment").attr('style', 'line-height: 1.4!important');
    } else {
        selectize.setValue(aoi);
        $("#help-phone-container").show();
        $("#footer-contact-us-location-container").show();
        $("#footer-contact-us-comments").show();
        $("#footer-contact-us-location-container").show();
        $("#footer-contact-us-email-container").show();
        $("#footer-contact-us-phone-container").show();
        $("#footer-Name").show();
        $("#footer-button").show();
        $("#help-email-container").attr('class', 'half');
        $("#help-email-container").attr('class', 'half');
    }
}

$(document).on('change', 'select[id="footer-contact-us-location"]', function () {
    setAreaOfInterest($(this).val());
});

function setAreaOfInterest(value) {
    document.getElementById("LocOfInterestID").value = value;
};
function SendDirectionsOnSuccess(response) {
    _satellite.track("Share-Directions"); // for triggering GA event in DTM
    if (response.isRedirect) {
        window.location.href = response.redirectUrl;
    }
    else {
        $("#contact").html(response.view);
    }
}

function SendDirectionsOnFailure(response) {
    if (response.status !== 404) {
        $("#contact").html(response.responseText);
    }
    else {
        window.location.href = response.redirectUrl;
    }

};
function CommunitySurveyOnSuccess(response) {
    if(window.location.search.indexOf("thank_you_message_click") >= 0) {
        // user came from thank-you message link
     
        _satellite.track("survey-thank-you-submit");// for triggering GA event in DTM
    }

    // trigger to track conversion in vwo
    $('#vwo-wizard-tracking').click();
  
    $("#SubmitButton-survey").attr('disabled', 'disabled');
    $("#survey-form").html(response);
    $('.community-survey .header-rsvp .p-survey').attr("style", "display:none !important;");
    $('.community-survey .usp-wrap-survey').attr("style", "background:white !important;");
    $('.community-survey .usp-wrap .container-survey').attr("style", "padding-top:0 !important;");
    $('.community-survey .ils-name-med .visible-sm-med').attr("style", "display:none;");
    $('.community-survey .page-footer').addClass("page-footer-thankyou");
    scrollIt($("#survey"));
}

function MatchURLParameter(name, value) {
    var params = window.location.search.substring(1);
    var paramList = params.split('&');
    for (var i = 0; i < paramList.length; i++) {
        var param = paramList[i].split('=');
        if (param[0] == name) {
            return param[1] == value;
        }
    }
}

function CommunitySurveyOnFailure(response) {
 
    if (response.status !== 404) {     
        $("#survey-form").html(response.responseText);
        $('.format-phone').formance('format_phone_number');
       var groups = $('.surveyDiv');
        $.each(groups, function (index, item) {
            var group = $(this);
            var inputdropdowns = group.find('.styled');
            var inputFreeText = group.find('#test');
            inputdropdowns.selectize();
            var strVal = $.trim(inputFreeText.val());
            var lastChar = strVal.slice(-1);
           if (lastChar === ',') {
                strVal = strVal.slice(0, -1);
            }
            inputFreeText.val(strVal);
           var required = group.find('#answer-required');
           if ((required.val() === "True") && (inputdropdowns.filter(function () { return $(this).val().length > 0; }).length === 0) && (inputFreeText.filter(function () { return $(this).val().length > 0; }).length === 0)) {
               inputdropdowns.addClass('input-validation-error');
               inputFreeText.addClass('input-validation-error');
               group.find('span:last').append($('<span></span>').text('Answer is required')).addClass('input-validation-error').removeClass('field-validation-valid');
             
            }
        });

    }
    else {
        window.location.href = response.redirectUrl;
    }

}

$('#survey-form').submit(function () {
    $('#FormValid').val(true);
    var result = [];
    var groups = $('.surveyDiv');
    $.each(groups, function (index, item) {
        var group = $(this);
        var inputdropdowns = group.find('.styled');
        var inputFreeText = group.find('#test');
        var required = group.find('#answer-required');
        if ((required.val() === "True") && (inputdropdowns.filter(function () { return $(this).val().length > 0; }).length === 0) && (inputFreeText.filter(function () { return $(this).val().length > 0; }).length === 0)) {
        result.push("true");
          inputdropdowns.addClass('input-validation-error');
        }
        if ((required.val() === "False") && (inputdropdowns.filter(function () { return $(this).val().length > 0; }).length === 0) && (inputFreeText.filter(function () { return $(this).val().length > 0; }).length === 0)) {
            result.push("false");
        }
        if ((required.val() === "True") && (inputdropdowns.filter(function () { return $(this).val().length > 0; }).length > 0) && (inputFreeText.filter(function () { return $(this).val().length > 0; }).length === 0)) {
           result.push("false");
        }
    });
    if ($.inArray("true", result) > -1) {
        $('#FormValid').val(false);
    }
    else
    {
        $('#FormValid').val(true);
        $('#SubmitButton-survey').attr('disabled', 'disabled');
    }
    result = [];

});

$(document).ready(function () {
    if ($('.usp-wrap-survey').length === 0)
    {
        $('.community-survey .page-footer').attr("style", "height: 100% !important;background: #001147 !important;");
    }

    if (window.location.search.indexOf("thank_you_message_click") >= 0) {
        var pageName = $('meta[property="PageName"]').attr('content');
        _satellite.setVar("PageName", "ryanhomes:" + pageName);
        // user came from thank-you message link

        _satellite.track("survey-thank-you-visit");// for triggering GA event in DTM
    }
});

$(document).on('change', 'select[id="price-range"]', function () {
  //  $(this).selectize();

});;
var communitySurveyQuestionAnswers = [];
var CommunitySurveyQuestions = [];
var surveyQuestions = [];
var SurveyQuestionAnswer = [];
$('#surveyWizard .wizardControls .next').click(function () {
    var div = $(this).parent().parent();
    var answer = div.find('.form-row .answerText');
    var submit = false;
    if (answer.val() == '') {
        if ($(this).hasClass('required')) {
            div.find('.wizard-alert').show();
        } else {
            div.hide();
            div.next().show();
            submit = true;
        }
    } else {
        submit = true;
        if ($(this).hasClass('required')) {
            div.find('.wizard-alert').hide();
        }
    }
    if (submit) {
        var answerChanged = false;
        communitySurveyQuestionAnswers = $.grep(communitySurveyQuestionAnswers,
            function (a) {
                if (a.CommunitySurveyQuestionId === answer.data("questionid")) {
                    a.AnswerText = answer.val();
                    answerChanged = true;
                }
                return a;
            });
        if (!answerChanged) {
            var communitySurveyQuestionAnswer = {
                CommunityId: $('#hdnCommunityId').val(),
                CustomerId: $('#hdnCustomerId').val(),
                CommunitySurveyQuestionId: answer.data("questionid"),
                AnswerText: answer.val()
            }
            communitySurveyQuestionAnswers.push(communitySurveyQuestionAnswer);
        }
        CommunitySurveyQuestions = $.grep(CommunitySurveyQuestions,
            function (a) {
                if (a.Id === answer.data("questionid")) {
                    a.SurveyQuestionAnswerText = answer.val();
                    answerChanged = true;
                }
                return a;
            });
        if (!answerChanged) {
            var communitySurveyQuestion =
            {
                Id: answer.data("questionid"),
                SurveyQuestion: {
                    Id: answer.data("questionid"),
                    QuestionText: answer.data("questiontext"),
                    IsAnswerRequired: answer.data("isanswerrequired")
                },
                SurveyQuestionAnswerText: answer.val()
            };
            CommunitySurveyQuestions.push(communitySurveyQuestion);
        }

        if ($(this).hasClass("finish")) {
            var surveyQuestionAnswer = {
                CommunityId: $('#hdnCommunityId').val(),
                CustomerId: $('#hdnCustomerId').val(),
                CommunitySurveyQuestion: CommunitySurveyQuestions,
                CommunitySurveyQuestionAnswers: communitySurveyQuestionAnswers
            };
            $.ajax({
                method: 'POST',
                url: '/find-your-home/CommunitySurveyQuestionResult',
                data: JSON.stringify(surveyQuestionAnswer),
                dataType: "html",
                contentType: "application/json",
                success: function (response) {
                    //VWO tracking
                       window._vis_opt_queue = window._vis_opt_queue || [];
                       window._vis_opt_queue.push(function() {_vis_opt_register_conversion(1,31);});

                   // thank you message
                        $("#surveyWizard").html(response);
                        $('.community-survey .header-rsvp .p-survey').attr("style", "display:none !important;");
                        $('.community-survey .usp-wrap-survey').attr("style", "background:white !important;");
                        $('.community-survey .usp-wrap .container-survey').attr("style", "padding-top:0 !important;");
                        $('.community-survey .ils-name-med .visible-sm-med').attr("style", "display:none;");
                        $('.community-survey .page-footer').addClass("page-footer-thankyou");
                  
                    // error page redirect
                    if (response.isRedirect) {
                        window.location = response.redirectUrl;
                    }
                },
                error: function (response) {
                    if (response.isRedirect) {
                        window.location = response.redirectUrl;
                    }
                }
            });
        } else {

            // move to next question
            div.hide();
            div.next().show();
        }

    }
});

$('#surveyWizard .wizardControls .prev').click(function () {
    var div = $(this).parent().parent();

    if ($(this).next().hasClass('required')) {
        div.find('.wizard-alert').hide();
    }

    // move to prev question
    div.hide();
    div.prev().show();
});

$('#surveyWizard .form-row .answerText').on('input keyup change', function () {
    var div = $(this).parent().parent();
    var next = div.find('.wizardControls .next');

    if (next.hasClass('required')) {
        if ($(this).val() != '') {
            div.find('.wizard-alert').hide();
        }
    }
});;

function SurveyVIPOnBegin() {
    $("#btnPriorityListSubmit").attr('disabled', 'disabled');
}

function SurveyVIPOnSuccess(response) {
    //_satellite.track("Community-Model-ContactUs-Submit");// for triggering GA event in DTM
    $("#vip-form").html(response);
   window.location = response.redirectUrl;
}

function SurveyVIPOnFailure(response) {
    if (response.status !== 404) {
        $("#vip-form").html(response.responseText);
        $('#comingSoon-phone').formance('format_phone_number');
    }
    else {
        window.location.href = response.redirectUrl;
    }
}
;
