!(function (n) { "function" == typeof define && define.amd ? define(["jquery"], n) : n(jQuery); })(function (n) { n.extend(n.fn, { validate: function (t) { if (!this.length) return void ( t && t.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing.") ); var i = n.data(this[0], "validator"); return i ? i : (this.attr("novalidate", "novalidate"), (i = new n.validator(t, this[0])), n.data(this[0], "validator", i), i.settings.onsubmit && (this.validateDelegate(":submit", "click", function (t) { i.settings.submitHandler && (i.submitButton = t.target); n(t.target).hasClass("cancel") && (i.cancelSubmit = !0); void 0 !== n(t.target).attr("formnovalidate") && (i.cancelSubmit = !0); }), this.submit(function (t) { function r() { var u, r; return i.settings.submitHandler ? (i.submitButton && (u = n("") .attr("name", i.submitButton.name) .val(n(i.submitButton).val()) .appendTo(i.currentForm)), (r = i.settings.submitHandler.call(i, i.currentForm, t)), i.submitButton && u.remove(), void 0 !== r ? r : !1) : !0; } return ( i.settings.debug && t.preventDefault(), i.cancelSubmit ? ((i.cancelSubmit = !1), r()) : i.form() ? i.pendingRequest ? ((i.formSubmitted = !0), !1) : r() : (i.focusInvalid(), !1) ); })), i); }, valid: function () { var t, i; return ( n(this[0]).is("form") ? (t = this.validate().form()) : ((t = !0), (i = n(this[0].form).validate()), this.each(function () { t = i.element(this) && t; })), t ); }, removeAttrs: function (t) { var i = {}, r = this; return ( n.each(t.split(/\s/), function (n, t) { i[t] = r.attr(t); r.removeAttr(t); }), i ); }, rules: function (t, i) { var e, s, f, u, o, h, r = this[0]; if (t) switch ( ((e = n.data(r.form, "validator").settings), (s = e.rules), (f = n.validator.staticRules(r)), t) ) { case "add": n.extend(f, n.validator.normalizeRule(i)); delete f.messages; s[r.name] = f; i.messages && (e.messages[r.name] = n.extend(e.messages[r.name], i.messages)); break; case "remove": return i ? ((h = {}), n.each(i.split(/\s/), function (t, i) { h[i] = f[i]; delete f[i]; "required" === i && n(r).removeAttr("aria-required"); }), h) : (delete s[r.name], f); } return ( (u = n.validator.normalizeRules( n.extend( {}, n.validator.classRules(r), n.validator.attributeRules(r), n.validator.dataRules(r), n.validator.staticRules(r) ), r )), u.required && ((o = u.required), delete u.required, (u = n.extend({ required: o }, u)), n(r).attr("aria-required", "true")), u.remote && ((o = u.remote), delete u.remote, (u = n.extend(u, { remote: o }))), u ); }, }); n.extend(n.expr[":"], { blank: function (t) { return !n.trim("" + n(t).val()); }, filled: function (t) { return !!n.trim("" + n(t).val()); }, unchecked: function (t) { return !n(t).prop("checked"); }, }); n.validator = function (t, i) { this.settings = n.extend(!0, {}, n.validator.defaults, t); this.currentForm = i; this.init(); }; n.validator.format = function (t, i) { return 1 === arguments.length ? function () { var i = n.makeArray(arguments); return i.unshift(t), n.validator.format.apply(this, i); } : (arguments.length > 2 && i.constructor !== Array && (i = n.makeArray(arguments).slice(1)), i.constructor !== Array && (i = [i]), n.each(i, function (n, i) { t = t.replace(new RegExp("\\{" + n + "\\}", "g"), function () { return i; }); }), t); }; n.extend(n.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusCleanup: !1, focusInvalid: !0, errorContainer: n([]), errorLabelContainer: n([]), onsubmit: !0, ignore: ":hidden", ignoreTitle: !1, onfocusin: function (n) { this.lastActive = n; this.settings.focusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call( this, n, this.settings.errorClass, this.settings.validClass ), this.hideThese(this.errorsFor(n))); }, onfocusout: function (n) { !this.checkable(n) && (n.name in this.submitted || !this.optional(n)) && this.element(n); }, onkeyup: function (n, t) { (9 !== t.which || "" !== this.elementValue(n)) && (n.name in this.submitted || n === this.lastElement) && this.element(n); }, onclick: function (n) { n.name in this.submitted ? this.element(n) : n.parentNode.name in this.submitted && this.element(n.parentNode); }, highlight: function (t, i, r) { "radio" === t.type ? this.findByName(t.name).addClass(i).removeClass(r) : n(t).addClass(i).removeClass(r); }, unhighlight: function (t, i, r) { "radio" === t.type ? this.findByName(t.name).removeClass(i).addClass(r) : n(t).removeClass(i).addClass(r); }, }, setDefaults: function (t) { n.extend(n.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: n.validator.format( "Please enter no more than {0} characters." ), minlength: n.validator.format("Please enter at least {0} characters."), rangelength: n.validator.format( "Please enter a value between {0} and {1} characters long." ), range: n.validator.format("Please enter a value between {0} and {1}."), max: n.validator.format( "Please enter a value less than or equal to {0}." ), min: n.validator.format( "Please enter a value greater than or equal to {0}." ), }, autoCreateRanges: !1, prototype: { init: function () { function i(t) { var r = n.data(this[0].form, "validator"), u = "on" + t.type.replace(/^validate/, ""), i = r.settings; i[u] && !this.is(i.ignore) && i[u].call(r, this[0], t); } this.labelContainer = n(this.settings.errorLabelContainer); this.errorContext = (this.labelContainer.length && this.labelContainer) || n(this.currentForm); this.containers = n(this.settings.errorContainer).add( this.settings.errorLabelContainer ); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var t, r = (this.groups = {}); n.each(this.settings.groups, function (t, i) { "string" == typeof i && (i = i.split(/\s/)); n.each(i, function (n, i) { r[i] = t; }); }); t = this.settings.rules; n.each(t, function (i, r) { t[i] = n.validator.normalizeRule(r); }); n(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'], [type='radio'], [type='checkbox']", "focusin focusout keyup", i ) .validateDelegate( "select, option, [type='radio'], [type='checkbox']", "click", i ); this.settings.invalidHandler && n(this.currentForm).bind( "invalid-form.validate", this.settings.invalidHandler ); n(this.currentForm) .find("[required], [data-rule-required], .required") .attr("aria-required", "true"); }, form: function () { return ( this.checkForm(), n.extend(this.submitted, this.errorMap), (this.invalid = n.extend({}, this.errorMap)), this.valid() || n(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid() ); }, checkForm: function () { this.prepareForm(); for (var n = 0, t = (this.currentElements = this.elements()); t[n]; n++) this.check(t[n]); return this.valid(); }, element: function (t) { var u = this.clean(t), i = this.validationTargetFor(u), r = !0; return ( (this.lastElement = i), void 0 === i ? delete this.invalid[u.name] : (this.prepareElement(i), (this.currentElements = n(i)), (r = this.check(i) !== !1), r ? delete this.invalid[i.displayName] : (this.invalid[i.displayName] = !0)), n(t).attr("aria-invalid", !r), this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), r ); }, showErrors: function (t) { if (t) { n.extend(this.errorMap, t); this.errorList = []; for (var i in t) this.errorList.push({ message: t[i], element: this.findByName(i)[0], }); this.successList = n.grep(this.successList, function (n) { return !(n.name in t); }); } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors(); }, resetForm: function () { n.fn.resetForm && n(this.currentForm).resetForm(); this.submitted = {}; this.lastElement = null; this.prepareForm(); this.hideErrors(); this.elements() .removeClass(this.settings.errorClass) .removeData("previousValue") .removeAttr("aria-invalid"); }, numberOfInvalids: function () { return this.objectLength(this.invalid); }, objectLength: function (n) { var i, t = 0; for (i in n) t++; return t; }, hideErrors: function () { this.hideThese(this.toHide); }, hideThese: function (n) { n.not(this.containers).text(""); this.addWrapper(n).hide(); }, valid: function () { return 0 === this.size(); }, size: function () { return this.errorList.length; }, focusInvalid: function () { if (this.settings.focusInvalid) try { n( this.findLastActive() || (this.errorList.length && this.errorList[0].element) || [] ) .filter(":visible") .focus() .trigger("focusin"); } catch (t) { } }, findLastActive: function () { var t = this.lastActive; return ( t && 1 === n.grep(this.errorList, function (n) { return n.element.name === t.name; }).length && t ); }, elements: function () { var t = this, i = {}; return n(this.currentForm) .find("input, select, textarea") .not(":submit, :reset, :image, [disabled], [readonly]") .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(n(this).rules()) ? !1 : ((i[this.name] = !0), !0) ); }); }, clean: function (t) { return n(t)[0]; }, errors: function () { var t = this.settings.errorClass.split(" ").join("."); return n(this.settings.errorElement + "." + t, this.errorContext); }, reset: function () { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = n([]); this.toHide = n([]); this.currentElements = n([]); }, prepareForm: function () { this.reset(); this.toHide = this.errors().add(this.containers); }, prepareElement: function (n) { this.reset(); this.toHide = this.errorsFor(n); }, elementValue: function (t) { var i, u = n(t), r = t.type; return "radio" === r || "checkbox" === r ? n("input[name='" + t.name + "']:checked").val() : "number" === r && "undefined" != typeof t.validity ? t.validity.badInput ? !1 : u.val() : ((i = u.val()), "string" == typeof i ? i.replace(/\r/g, "") : i); }, check: function (t) { t = this.validationTargetFor(this.clean(t)); var i, r, u, f = n(t).rules(), s = n.map(f, function (n, t) { return t; }).length, e = !1, h = this.elementValue(t); for (r in f) { u = { method: r, parameters: f[r] }; try { if ( ((i = n.validator.methods[r].call(this, h, t, u.parameters)), "dependency-mismatch" === i && 1 === s) ) { e = !0; continue; } if (((e = !1), "pending" === i)) return void (this.toHide = this.toHide.not(this.errorsFor(t))); if (!i) return this.formatAndAdd(t, u), !1; } catch (o) { throw ( (this.settings.debug && window.console && console.log( "Exception occurred when checking element " + t.id + ", check the '" + u.method + "' method.", o ), o) ); } } if (!e) return this.objectLength(f) && this.successList.push(t), !0; }, customDataMessage: function (t, i) { return ( n(t).data( "msg" + i.charAt(0).toUpperCase() + i.substring(1).toLowerCase() ) || n(t).data("msg") ); }, customMessage: function (n, t) { var i = this.settings.messages[n]; return i && (i.constructor === String ? i : i[t]); }, findDefined: function () { for (var n = 0; n < arguments.length; n++) if (void 0 !== arguments[n]) return arguments[n]; return void 0; }, defaultMessage: function (t, i) { return this.findDefined( this.customMessage(t.name, i), this.customDataMessage(t, i), (!this.settings.ignoreTitle && t.title) || void 0, n.validator.messages[i], "Warning: No message defined for " + t.name + "" ); }, formatAndAdd: function (t, i) { var r = this.defaultMessage(t, i.method), u = /\$?\{(\d+)\}/g; "function" == typeof r ? (r = r.call(this, i.parameters, t)) : u.test(r) && (r = n.validator.format(r.replace(u, "{$1}"), i.parameters)); this.errorList.push({ message: r, element: t, method: i.method }); this.errorMap[t.name] = r; this.submitted[t.name] = r; }, addWrapper: function (n) { return ( this.settings.wrapper && (n = n.add(n.parent(this.settings.wrapper))), n ); }, defaultShowErrors: function () { for (var i, t, n = 0; this.errorList[n]; n++) (t = this.errorList[n]), this.settings.highlight && this.settings.highlight.call( this, t.element, this.settings.errorClass, this.settings.validClass ), this.showLabel(t.element, t.message); if ( (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success) ) for (n = 0; this.successList[n]; n++) this.showLabel(this.successList[n]); if (this.settings.unhighlight) for (n = 0, i = this.validElements(); i[n]; n++) this.settings.unhighlight.call( this, i[n], 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 n(this.errorList).map(function () { return this.element; }); }, showLabel: function (t, i) { var u, o, e, r = this.errorsFor(t), s = this.idOrName(t), f = n(t).attr("aria-describedby"); r.length ? (r .removeClass(this.settings.validClass) .addClass(this.settings.errorClass), r.html(i)) : ((r = n("<" + this.settings.errorElement + ">") .attr("id", s + "-error") .addClass(this.settings.errorClass) .html(i || "")), (u = r), this.settings.wrapper && (u = r .hide() .show() .wrap("<" + this.settings.wrapper + "/>") .parent()), this.labelContainer.length ? this.labelContainer.append(u) : this.settings.errorPlacement ? this.settings.errorPlacement(u, n(t)) : u.insertAfter(t), r.is("label") ? r.attr("for", s) : 0 === r.parents("label[for='" + s + "']").length && ((e = r.attr("id").replace(/(:|\.|\[|\])/g, "\\$1")), f ? f.match(new RegExp("\\b" + e + "\\b")) || (f += " " + e) : (f = e), n(t).attr("aria-describedby", f), (o = this.groups[t.name]), o && n.each(this.groups, function (t, i) { i === o && n("[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 r = this.idOrName(t), u = n(t).attr("aria-describedby"), i = "label[for='" + r + "'], label[for='" + r + "'] *"; return ( u && (i = i + ", #" + u.replace(/\s+/g, ", #")), this.errors().filter(i) ); }, idOrName: function (n) { return ( this.groups[n.name] || (this.checkable(n) ? n.name : n.id || n.name) ); }, validationTargetFor: function (t) { return ( this.checkable(t) && (t = this.findByName(t.name)), n(t).not(this.settings.ignore)[0] ); }, checkable: function (n) { return /radio|checkbox/i.test(n.type); }, findByName: function (t) { return n(this.currentForm).find("[name='" + t + "']"); }, getLength: function (t, i) { switch (i.nodeName.toLowerCase()) { case "select": return n("option:selected", i).length; case "input": if (this.checkable(i)) return this.findByName(i.displayName).filter(":checked").length; } return t.length; }, depend: function (n, t) { return this.dependTypes[typeof n] ? this.dependTypes[typeof n](n, t) : !0; }, dependTypes: { boolean: function (n) { return n; }, string: function (t, i) { return !!n(t, i.form).length; }, function: function (n, t) { return n(t); }, }, optional: function (t) { var i = this.elementValue(t); return ( !n.validator.methods.required.call(this, i, t) && "dependency-mismatch" ); }, startRequest: function (n) { this.pending[n.name] || (this.pendingRequest++, (this.pending[n.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() ? (n(this.currentForm).submit(), (this.formSubmitted = !1)) : !i && 0 === this.pendingRequest && this.formSubmitted && (n(this.currentForm).triggerHandler("invalid-form", [this]), (this.formSubmitted = !1)); }, previousValue: function (t) { return ( n.data(t, "previousValue") || n.data(t, "previousValue", { old: null, valid: !0, message: this.defaultMessage(t, "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 (t, i) { t.constructor === String ? (this.classRuleSettings[t] = i) : n.extend(this.classRuleSettings, t); }, classRules: function (t) { var i = {}, r = n(t).attr("class"); return ( r && n.each(r.split(" "), function () { this in n.validator.classRuleSettings && n.extend(i, n.validator.classRuleSettings[this]); }), i ); }, attributeRules: function (t) { var r, i, u = {}, e = n(t), f = t.getAttribute("type"); for (r in n.validator.methods) "required" === r ? ((i = t.getAttribute(r)), "" === i && (i = !0), (i = !!i)) : (i = e.attr(r)), /min|max/.test(r) && (null === f || /number|range|text/.test(f)) && (i = Number(i)), i || 0 === i ? (u[r] = i) : f === r && "range" !== f && (u[r] = !0); return ( u.maxlength && /-1|2147483647|524288/.test(u.maxlength) && delete u.maxlength, u ); }, dataRules: function (t) { var i, r, u = {}, f = n(t); for (i in n.validator.methods) (r = f.data( "rule" + i.charAt(0).toUpperCase() + i.substring(1).toLowerCase() )), void 0 !== r && (u[i] = r); return u; }, staticRules: function (t) { var i = {}, r = n.data(t.form, "validator"); return ( r.settings.rules && (i = n.validator.normalizeRule(r.settings.rules[t.name]) || {}), i ); }, normalizeRules: function (t, i) { return ( n.each(t, function (r, u) { if (u === !1) return void delete t[r]; if (u.param || u.depends) { var f = !0; switch (typeof u.depends) { case "string": f = !!n(u.depends, i.form).length; break; case "function": f = u.depends.call(i, i); } f ? (t[r] = void 0 !== u.param ? u.param : !0) : delete t[r]; } }), n.each(t, function (r, u) { t[r] = n.isFunction(u) ? u(i) : u; }), n.each(["minlength", "maxlength"], function () { t[this] && (t[this] = Number(t[this])); }), n.each(["rangelength", "range"], function () { var i; t[this] && (n.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])]))); }), n.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 = {}; n.each(t.split(/\s/), function () { i[this] = !0; }); t = i; } return t; }, addMethod: function (t, i, r) { n.validator.methods[t] = i; n.validator.messages[t] = void 0 !== r ? r : n.validator.messages[t]; i.length < 3 && n.validator.addClassRules(t, n.validator.normalizeRule(t)); }, methods: { required: function (t, i, r) { if (!this.depend(r, i)) return "dependency-mismatch"; if ("select" === i.nodeName.toLowerCase()) { var u = n(i).val(); return u && u.length > 0; } return this.checkable(i) ? this.getLength(t, i) > 0 : n.trim(t).length > 0; }, email: function (n, 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( n ) ); }, url: function (n, t) { return ( this.optional(t) || /^(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( n ) ); }, date: function (n, t) { return this.optional(t) || !/Invalid|NaN/.test(new Date(n).toString()); }, dateISO: function (n, t) { return ( this.optional(t) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(n) ); }, number: function (n, t) { return ( this.optional(t) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n) ); }, digits: function (n, t) { return this.optional(t) || /^\d+$/.test(n); }, creditcard: function (n, t) { if (this.optional(t)) return "dependency-mismatch"; if (/[^0-9 \-]+/.test(n)) return !1; var i, f, e = 0, r = 0, u = !1; if (((n = n.replace(/\D/g, "")), n.length < 13 || n.length > 19)) return !1; for (i = n.length - 1; i >= 0; i--) (f = n.charAt(i)), (r = parseInt(f, 10)), u && (r *= 2) > 9 && (r -= 9), (e += r), (u = !u); return e % 10 == 0; }, minlength: function (t, i, r) { var u = n.isArray(t) ? t.length : this.getLength(t, i); return this.optional(i) || u >= r; }, maxlength: function (t, i, r) { var u = n.isArray(t) ? t.length : this.getLength(t, i); return this.optional(i) || r >= u; }, rangelength: function (t, i, r) { var u = n.isArray(t) ? t.length : this.getLength(t, i); return this.optional(i) || (u >= r[0] && u <= r[1]); }, min: function (n, t, i) { return this.optional(t) || n >= i; }, max: function (n, t, i) { return this.optional(t) || i >= n; }, range: function (n, t, i) { return this.optional(t) || (n >= i[0] && n <= i[1]); }, equalTo: function (t, i, r) { var u = n(r); return ( this.settings.onfocusout && u .unbind(".validate-equalTo") .bind("blur.validate-equalTo", function () { n(i).valid(); }), t === u.val() ); }, remote: function (t, i, r) { if (this.optional(i)) return "dependency-mismatch"; var u, e, f = this.previousValue(i); return ( this.settings.messages[i.displayName] || (this.settings.messages[i.displayName] = {}), (f.originalMessage = this.settings.messages[i.displayName].remote), (this.settings.messages[i.displayName].remote = f.message), (r = ("string" == typeof r && { url: r }) || r), f.old === t ? f.valid : ((f.old = t), (u = this), this.startRequest(i), (e = {}), (e[i.displayName] = t), n.ajax( n.extend( !0, { url: r, mode: "abort", port: "validate" + i.displayName, dataType: "json", data: e, context: u.currentForm, success: function (r) { var o, e, h, s = r === !0 || "true" === r; u.settings.messages[i.displayName].remote = f.originalMessage; s ? ((h = u.formSubmitted), u.prepareElement(i), (u.formSubmitted = h), u.successList.push(i), delete u.invalid[i.displayName], u.showErrors()) : ((o = {}), (e = r || u.defaultMessage(i, "remote")), (o[i.displayName] = f.message = n.isFunction(e) ? e(t) : e), (u.invalid[i.displayName] = !0), u.showErrors(o)); f.valid = s; u.stopRequest(i, s); }, }, r ) ), "pending") ); }, }, }); n.format = function () { throw "$.format has been deprecated. Please use $.validator.format instead."; }; var i, t = {}; n.ajaxPrefilter ? n.ajaxPrefilter(function (n, i, r) { var u = n.port; "abort" === n.mode && (t[u] && t[u].abort(), (t[u] = r)); }) : ((i = n.ajax), (n.ajax = function (r) { var f = ("mode" in r ? r : n.ajaxSettings).mode, u = ("port" in r ? r : n.ajaxSettings).port; return "abort" === f ? (t[u] && t[u].abort(), (t[u] = i.apply(this, arguments)), t[u]) : i.apply(this, arguments); })); n.extend(n.fn, { validateDelegate: function (t, i, r) { return this.bind(i, function (i) { var u = n(i.target); if (u.is(t)) return r.apply(u, arguments); }); }, }); }), (function (n, t) { function i(n) { var t, r = n.lastIndexOf("/"); if (-1 === r) throw Error('Module "' + n + '" not found'); return (t = n.substr(r + 1)), i.modules[t] || (i.modules[t] = {}); } i.modules = {}; (n.di = i("./ng-di")), (function (n) { "use strict"; function f(n) { return n && "number" == typeof n.length ? "function" != typeof n.hasOwnProperty && "function" != typeof n.constructor ? !0 : "[object Object]" !== Object.prototype.toString.call(n) || "function" == typeof n.callee : !1; } function i(n, t, u) { var e; if (n) if (r(n)) for (e in n) "prototype" != e && "length" != e && "name" != e && n.hasOwnProperty(e) && t.call(u, n[e], e); else if (n.forEach && n.forEach !== i) n.forEach(t, u); else if (f(n)) for (e = 0; n.length > e; e++) t.call(u, n[e], e); else for (e in n) n.hasOwnProperty(e) && t.call(u, n[e], e); return n; } function e(n) { return ( i(arguments, function (t) { t !== n && i(t, function (t, i) { n[i] = t; }); }), n ); } function o(n) { return function (t, i) { n(i, t); }; } function s() { for (var i, n = t.length; n;) { if ((n--, (i = t[n].charCodeAt(0)), 57 == i)) return (t[n] = "A"), t.join(""); if (90 != i) return (t[n] = String.fromCharCode(i + 1)), t.join(""); t[n] = "0"; } return t.unshift("0"), t.join(""); } function h(n) { return function () { return n; }; } function c(n) { return null != n && "object" == typeof n; } function l(n) { return "string" == typeof n; } function u(n) { return "[object Array]" == Object.prototype.toString.apply(n); } function r(n) { return "function" == typeof n; } function a(n, t, i) { if (!n) throw Error( "Argument '" + (t || "?") + "' is " + (i || "required") ); return n; } function v(n, t, i) { return ( i && u(n) && (n = n[n.length - 1]), a( r(n), t, "not a function, got " + (n && "object" == typeof n ? n.constructor.name || "Object" : typeof n) ), n ); } var t = ["0", "0", "0"]; n.forEach = i; n.reverseParams = o; n.extend = e; n.nextUid = s; n.assertArgFn = v; n.valueFn = h; n.isString = l; n.isArray = u; n.isFunction = r; n.isObject = c; })("undefined" == typeof exports ? i("./utils") : exports), (function (n) { "use strict"; n.setupModuleLoader = function (n) { function t(n, t, i) { return n[t] || (n[t] = i()); } return t(n, "module", function () { var n = {}; return function (i, r, u) { return ( r && n.hasOwnProperty(i) && (n[i] = null), t(n, i, function () { function n(n, i, r) { return function () { return t[r || "push"]([n, i, arguments]), o; }; } if (!r) throw Error("No module: " + i); var t = [], f = [], e = n("$injector", "invoke"), o = { _invokeQueue: t, _runBlocks: f, requires: r, name: i, provider: n("$provide", "provider"), factory: n("$provide", "factory"), service: n("$provide", "service"), value: n("$provide", "value"), constant: n("$provide", "constant", "unshift"), config: e, run: function (n) { return f.push(n), this; }, }; return u && e(u), o; }) ); }; }); }; })("undefined" == typeof exports ? i("./module") : exports), (function (n) { "use strict"; var u = i("./utils"), r = function (n) { var i, r = typeof n; return ( "object" === r && null !== n ? "function" == typeof (i = n.$$hashKey) ? (i = n.$$hashKey()) : i === t && (i = n.$$hashKey = u.nextUid()) : (i = n), r + ":" + i ); }; n.HashMap = function (n) { u.forEach(n, this.put, this); }; n.HashMap.prototype = { put: function (n, t) { this[r(n)] = t; }, get: function (n) { return this[r(n)]; }, remove: function (n) { var t = this[(n = r(n))]; return delete this[n], t; }, }; })("undefined" == typeof exports ? i("./hashmap") : exports), (function (n) { "use strict"; var f = i("./hashmap"), r = i("./utils"), e = i("./ng-di"), o = /^function\s*[^\(]*\(\s*([^\)]*)\)/m, s = /,/, h = /^\s*(_?)(\S+?)\1\s*$/, c = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm, u = (n.annotate = function (n) { var t, u, f, i; return ( "function" == typeof n ? (t = n.$inject) || ((t = []), (u = ("" + n).replace(c, "")), (f = u.match(o)), r.forEach(f[1].split(s), function (n) { n.replace(h, function (n, i, r) { t.push(r); }); }), (n.$inject = t)) : r.isArray(n) ? ((i = n.length - 1), r.assertArgFn(n[i], "fn"), (t = n.slice(0, i))) : r.assertArgFn(n, "fn", !0), t ); }); n.createInjector = function (n) { function o(n) { return function (i, u) { return r.isObject(i) ? (r.forEach(i, r.reverseParams(n)), t) : n(i, u); }; } function y(n, t) { if ( ((r.isFunction(t) || r.isArray(t)) && (t = i.instantiate(t)), !t.$get) ) throw Error( "Provider " + n + " must define $get factory method." ); return (c[n + a] = t); } function l(n, t) { return y(n, { $get: t }); } function d(n, t) { return l(n, [ "$injector", function (n) { return n.instantiate(t); }, ]); } function g(n, t) { return l(n, r.valueFn(t)); } function nt(n, t) { c[n] = t; v[n] = t; } function tt(n, t) { var r = i.get(n + a), u = r.$get; r.$get = function () { var n = s.invoke(u, r); return s.invoke(t, null, { $delegate: n }); }; } function p(n) { var t = []; return ( r.forEach(n, function (n) { var f, o, h; if (!k.get(n)) if ((k.put(n, !0), r.isString(n))) { f = e.module(n); t = t.concat(p(f.requires)).concat(f._runBlocks); try { for ( var c = f._invokeQueue, s = 0, l = c.length; l > s; s++ ) (o = c[s]), (h = i.get(o[0])), h[o[1]].apply(h, o[2]); } catch (u) { throw (u.message && (u.message += " from " + n), u); } } else if (r.isFunction(n)) try { t.push(i.invoke(n)); } catch (u) { throw (u.message && (u.message += " from " + n), u); } else if (r.isArray(n)) try { t.push(i.invoke(n)); } catch (u) { throw ( (u.message && (u.message += " from " + (n[n.length - 1] + "")), u) ); } else r.assertArgFn(n, "module"); }), t ); } function w(n, t) { function i(i) { if ("string" != typeof i) throw Error("Service name expected"); if (n.hasOwnProperty(i)) { if (n[i] === b) throw Error("Circular dependency: " + h.join(" <- ")); return n[i]; } try { return h.unshift(i), (n[i] = b), (n[i] = t(i)); } finally { h.shift(); } } function f(n, t, r) { for (var o, f = [], h = u(n), e = 0, s = h.length; s > e; e++) (o = h[e]), f.push(r && r.hasOwnProperty(o) ? r[o] : i(o)); switch ((n.$inject || (n = n[s]), t ? -1 : f.length)) { case 0: return n(); case 1: return n(f[0]); case 2: return n(f[0], f[1]); case 3: return n(f[0], f[1], f[2]); case 4: return n(f[0], f[1], f[2], f[3]); case 5: return n(f[0], f[1], f[2], f[3], f[4]); case 6: return n(f[0], f[1], f[2], f[3], f[4], f[5]); case 7: return n(f[0], f[1], f[2], f[3], f[4], f[5], f[6]); case 8: return n(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]); case 9: return n( f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8] ); case 10: return n( f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9] ); default: return n.apply(t, f); } } function e(n, t) { var i, u, e = function () { }; return ( (e.prototype = (r.isArray(n) ? n[n.length - 1] : n).prototype), (i = new e()), (u = f(n, i, t)), r.isObject(u) ? u : i ); } return { invoke: f, instantiate: e, get: i, annotate: u }; } var b = {}, a = "Provider", h = [], k = new f.HashMap(), c = { $provide: { provider: o(y), factory: o(l), service: o(d), value: o(g), constant: o(nt), decorator: tt, }, }, i = (c.$injector = w(c, function () { throw Error("Unknown provider: " + h.join(" <- ")); })), v = {}, s = (v.$injector = w(v, function (n) { var t = i.get(n + a); return s.invoke(t.$get, t); })); return ( r.forEach(p(n), function (n) { s.invoke(n || function () { }); }), s ); }; })("undefined" == typeof exports ? i("./injector") : exports), (function (n) { "use strict"; n.module = i("./module").setupModuleLoader(n); n.injector = i("./injector").createInjector; })("undefined" == typeof exports ? i("./ng-di") : exports); })(this), (function (n, t) { typeof module != "undefined" && module.exports ? (module.exports = t()) : typeof define == "function" && define.amd ? define(t) : (this[n] = t()); })("$script", function () { function f(n, t) { for (var i = 0, r = n.length; i < r; ++i) if (!t(n[i])) return p; return 1; } function e(n, t) { f(n, function (n) { return !t(n); }); } function n(s, c, l) { function p(n) { return n.call ? n() : r[n]; } function v() { if (!--k) { r[a] = 1; b && b(); for (var n in t) f(n.split("|"), p) && !e(t[n], p) && (t[n] = []); } } s = s[i] ? s : [s]; var w = c && c.call, b = w ? c : l, a = w ? s.join("") : c, k = s.length; return ( setTimeout(function () { e(s, function n(t, i) { if (t === null) return v(); if ( ((t = !i && t.indexOf(".js") === -1 && !/^https?:\/\//.test(t) && o ? o + t + ".js" : t), u[t]) ) return ( a && (y[a] = 1), u[t] == 2 ? v() : setTimeout(function () { n(t, !0); }, 0) ); u[t] = 1; a && (y[a] = 1); h(t, v); }); }, 0), n ); } function h(n, t) { var i = c.createElement("script"), r; i.onload = i.onerror = i[v] = function () { (i[a] && !/^c|loade/.test(i[a])) || r || ((i.onload = i[v] = null), (r = 1), (u[n] = 2), t()); }; i.async = 1; i.src = s ? n + (n.indexOf("?") === -1 ? "?" : "&") + s : n; l.insertBefore(i, l.lastChild); } var c = document, l = c.getElementsByTagName("head")[0], p = !1, i = "push", a = "readyState", v = "onreadystatechange", r = {}, y = {}, t = {}, u = {}, o, s; return ( (n.get = h), (n.order = function (t, i, r) { (function u(f) { f = t.shift(); t.length ? n(f, u) : n(f, i, r); })(); }), (n.path = function (n) { o = n; }), (n.urlArgs = function (n) { s = n; }), (n.ready = function (u, o, s) { u = u[i] ? u : [u]; var h = []; return ( !e(u, function (n) { r[n] || h[i](n); }) && f(u, function (n) { return r[n]; }) ? o() : !(function (n) { t[n] = t[n] || []; t[n][i](o); s && s(h); })(u.join("|")), n ); }), (n.done = function (t) { n([null], t); }), n ); }), (function (n) { if (typeof define == "function" && define.amd) define(n); else if (typeof exports == "object") module.exports = n(); else { var i = window.Cookies, t = (window.Cookies = n(window.jQuery)); t.noConflict = function () { return (window.Cookies = i), t; }; } })(function () { function n() { for (var n = 0, r = {}, t, i; n < arguments.length; n++) { t = arguments[n]; for (i in t) r[i] = t[i]; } return r; } function t(i) { function r(t, u, f) { var o, s; if (arguments.length > 1) { f = n({ path: "/" }, r.defaults, f); typeof f.expires == "number" && ((s = new Date()), s.setMilliseconds(s.getMilliseconds() + f.expires * 864e5), (f.expires = s)); try { o = JSON.stringify(u); /^[\{\[]/.test(o) && (u = o); } catch (y) { } return ( (u = encodeURIComponent(String(u))), (u = u.replace( /%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent )), (t = encodeURIComponent(String(t))), (t = t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)), (t = t.replace(/[\(\)]/g, escape)), (document.cookie = [ t, "=", u, f.expires && "; expires=" + f.expires.toUTCString(), f.path && "; path=" + f.path, f.domain && "; domain=" + f.domain, f.secure && "; secure", ].join("")) ); } t || (o = {}); for ( var l = document.cookie ? document.cookie.split("; ") : [], a = /(%[0-9A-Z]{2})+/g, h = 0; h < l.length; h++ ) { var v = l[h].split("="), c = v[0].replace(a, decodeURIComponent), e = v.slice(1).join("="); if ( (e.charAt(0) === '"' && (e = e.slice(1, -1)), (e = (i && i(e, c)) || e.replace(a, decodeURIComponent)), this.json) ) try { e = JSON.parse(e); } catch (y) { } if (t === c) { o = e; break; } t || (o[c] = e); } return o; } return ( (r.get = r.set = r), (r.getJSON = function () { return r.apply({ json: !0 }, [].slice.call(arguments)); }), (r.defaults = {}), (r.remove = function (t, i) { r(t, "", n(i, { expires: -1 })); }), (r.withConverter = t), r ); } return t(); }), (function (n) { n.fn.columnize = function (t) { function i(n, t) { try { n.append(t); } catch (i) { n[0].appendChild(t[0]); } } this.cols = []; this.offset = 0; this.before = []; this.lastOther = 0; this.prevMax = 0; this.debug = 0; this.setColumnStart = null; this.elipsisText = ""; var r = { width: 400, columns: !1, buildOnce: !1, overflow: !1, doneFunc: function () { }, target: !1, ignoreImageLoading: !0, columnFloat: "left", lastNeverTallest: !1, accuracy: !1, precise: !1, manualBreaks: !1, cssClassPrefix: "", elipsisText: "...", debug: 0, }; return ( (t = n.extend(r, t)), typeof t.width == "string" && ((t.width = parseInt(t.width, 10)), isNaN(t.width) && (t.width = r.width)), typeof t.setColumnStart == "function" && (this.setColumnStart = t.setColumnStart), typeof t.elipsisText == "string" && (this.elipsisText = t.elipsisText), t.debug && (this.debug = t.debug), t.setWidth || (t.setWidth = t.precise ? function (n) { return 100 / n; } : function (n) { return Math.floor(100 / n); }), this.each(function () { function f(n, t) { var i = t ? "." : ""; return h.length ? i + h + "-" + n : i + n; } function a(r, u, e, o) { for ( var v, p, w, c, h, y, b, l, a; (s || e.height() < o) && u[0].childNodes.length; ) { if ( ((v = u[0].childNodes[0]), n(v).find(f("columnbreak", !0)).length) ) return; if (n(v).hasClass(f("columnbreak"))) return; i(r, n(v)); } if (r[0].childNodes.length !== 0) { if ( ((p = r[0].childNodes), (w = p[p.length - 1]), r[0].removeChild(w), (c = n(w)), c[0].nodeType == 3) ) { for ( h = c[0].nodeValue, y = t.width / 18, t.accuracy && (y = t.accuracy), l = null; e.height() < o && h.length; ) (a = h.indexOf(" ", y)), (b = a != -1 ? h.substring(0, a) : h), (l = document.createTextNode(b)), i(r, n(l)), (h = h.length > y && a != -1 ? h.substring(a) : ""); if ( (e.height() >= o && l !== null && (r[0].removeChild(l), (h = l.nodeValue + h)), h.length) ) c[0].nodeValue = h; else return !1; } return ( u.contents().length ? u.prepend(c) : i(u, c), c[0].nodeType == 3 ); } } function v(n, t, r, u) { var e, o, c, h, l, y; if ( !n.contents(":last").find(f("columnbreak", !0)).length && !n.contents(":last").hasClass(f("columnbreak")) && t.contents().length ) { if ( ((e = t.contents(":first")), typeof e.get(0) == "undefined" || e.get(0).nodeType != 1) ) return; o = e.clone(!0); e.hasClass(f("columnbreak")) ? (i(n, o), e.remove()) : s ? (i(n, o), e.remove()) : o.get(0).nodeType != 1 || o.hasClass(f("dontend")) || (i(n, o), o.is("img") && r.height() < u + 20 ? e.remove() : e.hasClass(f("dontsplit")) && r.height() < u + 20 ? e.remove() : o.is("img") || e.hasClass(f("dontsplit")) ? o.remove() : (o.empty(), a(o, e, r, u) ? e.addClass(f("split")) : (e.addClass(f("split")), e.get(0).tagName == "OL" && ((c = o.get(0).childElementCount + o.get(0).start), e.attr("start", c + 1)), e.children().length && v(o, e, r, u)), o.get(0).childNodes.length === 0 ? (o.remove(), e.removeClass(f("split"))) : o.get(0).childNodes.length == 1 && ((h = o.get(0).childNodes[0]), h.nodeType == 3 && ((l = /\s/), (y = h.nodeValue), l.test(y) && (o.remove(), e.removeClass(f("split"))))))); } } function b() { var c, l, h, r, s, y; if (!u.data("columnized") || u.children().length != 1) { if ( (u.data("columnized", !0), u.data("columnizing", !0), u.empty(), u.append( n( "
" ) ), ($col = u.children().eq(u.children().length - 1)), ($destroyable = e.clone(!0)), t.overflow) ) { for ( targetHeight = t.overflow.height, a($col, $destroyable, $col, targetHeight), $destroyable .contents() .find(":first-child") .hasClass(f("dontend")) || v($col, $destroyable, $col, targetHeight); $col.contents(":last").length && o($col.contents(":last").get(0)); ) (c = $col.contents(":last")), c.remove(), $destroyable.prepend(c); for ( l = "", h = document.createElement("DIV"); $destroyable[0].childNodes.length > 0; ) { if (((r = $destroyable[0].childNodes[0]), r.attributes)) for (s = 0; s < r.attributes.length; s++) r.attributes[s].nodeName.indexOf("jQuery") === 0 && r.removeAttribute(r.attributes[s].nodeName); h.innerHTML = ""; h.appendChild($destroyable[0].childNodes[0]); l += h.innerHTML; } y = n(t.overflow.id)[0]; y.innerHTML = l; } else i($col, $destroyable.contents()); u.data("columnizing", !1); t.overflow && t.overflow.doneFunc && t.overflow.doneFunc(); t.doneFunc(); } } function o(t) { return t.nodeType == 3 ? /^\s+$/.test(t.nodeValue) ? t.previousSibling ? o(t.previousSibling) : !1 : !1 : t.nodeType != 1 ? !1 : n(t).hasClass(f("dontend")) ? !0 : t.childNodes.length === 0 ? !1 : o(t.childNodes[t.childNodes.length - 1]); } function w() { var g, l, nt, r, et, h, vt, yt, ot, ut, rt, pt, ft; if (((c = 0), p != u.width())) { p = u.width(); var w = Math.round(u.width() / t.width), tt = t.width, at = t.height; if ( (t.columns && (w = t.columns), s && ((w = e.find(f("columnbreak", !0)).length + 1), (tt = !1)), w <= 1) ) return b(); if (!u.data("columnizing")) { u.data("columnized", !0); u.data("columnizing", !0); u.empty(); u.append( n( "
" ) ); r = u.children(":last"); i(r, e.clone()); y = r.height(); u.empty(); var k = y / w, d = 3, it = !1; for ( t.overflow ? ((d = 1), (k = t.overflow.height)) : at && tt && ((d = 1), (k = at), (it = !0)), g = 0; g < d && g < 20; g++ ) { u.empty(); try { l = e.clone(!0); } catch (kt) { l = e.clone(); } for (l.css("visibility", "hidden"), h = 0; h < w; h++) (nt = h === 0 ? f("first") : ""), (nt += " " + f("column")), (nt = h == w - 1 ? f("last") + " " + nt : nt), u.append( n( "
" ) ); for ( h = 0; h < w - (t.overflow ? 0 : 1) || (it && l.contents().length); ) { for ( u.children().length <= h && u.append( n( "
" ) ), r = u.children().eq(h), it && r.width(tt + "px"), a(r, l, r, k), v(r, l, r, k); r.contents(":last").length && o(r.contents(":last").get(0)); ) (et = r.contents(":last")), et.remove(), l.prepend(et); h++; r.contents().length === 0 && l.contents().length ? r.append(l.contents(":first")) : h != w - (t.overflow ? 0 : 1) || t.overflow || (l.find(f("columnbreak", !0)).length && w++); } if (t.overflow && !it) if ( ((vt = !1), (yt = document.all && navigator.appVersion.indexOf("MSIE 7.") != -1), vt || yt) ) { for ( ot = "", ut = document.createElement("DIV"); l[0].childNodes.length > 0; ) { for ( rt = l[0].childNodes[0], h = 0; h < rt.attributes.length; h++ ) rt.attributes[h].nodeName.indexOf("jQuery") === 0 && rt.removeAttribute(rt.attributes[h].nodeName); ut.innerHTML = ""; ut.appendChild(l[0].childNodes[0]); ot += ut.innerHTML; } pt = n(t.overflow.id)[0]; pt.innerHTML = ot; } else n(t.overflow.id).empty().append(l.contents().clone(!0)); else if (it) u.children().each(function (n) { r = u.children().eq(n); r.width(tt + "px"); n === 0 ? r.addClass(f("first")) : n == u.children().length - 1 ? r.addClass(f("last")) : (r.removeClass(f("first")), r.removeClass(f("last"))); }), u.width(u.children().length * tt + "px"); else { r = u.children().eq(u.children().length - 1); l.contents().each(function () { r.append(n(this)); }); var bt = r.height(), dt = bt - k, st = 0, ht = 1e7, ct = 0, lt = !1, wt = 0; u.children().each( (function (n) { return function (t) { var r = n.children().eq(t), u = r .children(":last") .find(f("columnbreak", !0)).length, i; u || ((i = r.height()), (lt = !1), (st += i), i > ct && ((ct = i), (lt = !0)), i < ht && (ht = i), wt++); }; })(u) ); ft = st / wt; st === 0 ? (g = d) : t.lastNeverTallest && lt ? ((c += 5), (k = k + 30), g == d - 1 && d++) : ct - ht > 30 ? (k = ft + 30) : Math.abs(ft - k) > 20 ? (k = ft) : (g = d); } u.append(n("
")); } u.find(f("column", !0)) .find(":first" + f("removeiffirst", !0)) .remove(); u.find(f("column", !0)) .find(":last" + f("removeiflast", !0)) .remove(); u.find(f("split", !0)) .find(":first" + f("removeiffirst", !0)) .remove(); u.find(f("split", !0)) .find(":last" + f("removeiflast", !0)) .remove(); u.data("columnizing", !1); t.overflow && t.overflow.doneFunc(); t.doneFunc(); } } } var u = t.target ? n(t.target) : n(this), y = n(this).height(), e = n("
"), p = 0, s = t.manualBreaks, h = r.cssClassPrefix, c, l; if ( (typeof t.cssClassPrefix == "string" && (h = t.cssClassPrefix), (c = 0), i(e, n(this).contents().clone(!0)), !t.ignoreImageLoading && !t.target && !u.data("imageLoaded") && (u.data("imageLoaded", !0), n(this).find("img").length > 0)) ) { l = (function (n, r) { return function () { n.data("firstImageLoaded") || (n.data("firstImageLoaded", "true"), i(n.empty(), r.children().clone(!0)), n.columnize(t)); }; })(n(this), e); n(this).find("img").one("load", l); n(this).find("img").one("abort", l); return; } u.empty(); w(); t.buildOnce || n(window).resize(function () { t.buildOnce || (u.data("timeout") && clearTimeout(u.data("timeout")), u.data("timeout", setTimeout(w, 200))); }); }) ); }; n.fn.renumberByJS = function (t, i, r, u) { var s, f, h, e, c, o, l, a; if ( ((this.setList = function (t, i, r) { var c = this.before.parents(), o, u, h, f, s, e; return ((o = n(t[this.offset - 1]).find(">*")), o.last()[0].tagName != r.toUpperCase()) ? (this.debug && console.log("Last item in previous column, isn't a list..."), 0) : ((o = o.length), (u = 1), (u = this.lastOther <= 0 ? this.before.children().length + 1 : n(c[this.lastOther]).children().length + 1), n(t[this.offset]).find(r + ":first li.split").length && ((h = n(t[this.offset - 1]).find(r + ":last li:last")), this.elipsisText === "" || n(t[this.offset - 1]).find(r + ":last ~ div").length || n(t[this.offset - 1]).find(r + ":last ~ p").length || (n(h).find("ul, ol, dl").length == 0 && ((f = h.last().text()), (s = f.length), f.substring(s - 1) == ";" ? f.substring(s - 4) != this.elipsisText + ";" && (f = f.substring(0, s - 1) + this.elipsisText + ";") : f.substring(s - 3) != this.elipsisText && (f += this.elipsisText), h.last().text(f))), n(t[this.offset]).find(r + ":first >li.split >" + r).length == 0 && u--), o == 1 && (u += this.prevMax), this.nest > 1 ? (this.debug && console.log("Supposed to be a nested list...decr"), u--, (e = n(t[this.offset - 1]).find(r + ":first li.split:first")), e.length > 0 && (this.debug && console.log( "Previous column started with a split item, so that count is one less than expected" ), u--), (e = n(t[this.offset]) .find(r + ":first li:first") .clone()), e.children().remove(), n.trim(e.text()).length > 0 && (this.debug && console.log( "If that was a complete list in the previous column, don't decr." ), u++, n(t[this.offset - 1]) .find(">" + r + ":last ") .children().length == 0 && (this.debug && console.log( "unless that was empty, in which case revert" ), u--))) : ((e = n(t[this.offset]).find( r + ":first li:first " + r + ".split li.split" )), e.length > 0 && (this.debug && console.log( "[Nested] Column started with a split item, so that count is one less than expected" ), u--)), this.debug && console.log( "Setting the start value to " + u + " (" + this.prevMax + ")" ), u > 0 && (typeof this.setColumnStart == "function" ? this.setColumnStart(i, u) : i.attr("start", u)), 0); }), typeof r == "undefined" && (r = !1), typeof u == "undefined" && (u = !1), !r && !u) ) throw "renumberByJS(): Bad param, must pass an id or a class"; for ( s = "", this.prevMax = 1, s = u ? "." + u : "#" + r, f = t.toLowerCase(), h = t.toUpperCase(), this.cols = n(s), this.debug && console.log( "There are " + this.cols.length + " items, looking for " + f ), this.before = n(this.cols[0]).find(f + ":last"), this.prevMax = this.before.children().length, this.offset = 1; this.offset < this.cols.length; this.offset++ ) { if ( (this.debug && console.log( "iterating " + this.offset + "...[of " + this.cols.length + "]" ), this.offset % i == 0) ) { this.debug && console.log("First column (in theory..)"); this.prevMax = 1; continue; } if ( ((this.before = n(this.cols[this.offset - 1]).find(f + ":last")), this.before.length) ) { if ( (this.debug && console.log( "Have some " + t + " elements in the previous column" ), (e = n(this.cols[this.offset]).find(f + ":first")), (c = n(this.cols[this.offset]).find("*:first")), c[0] !== e[0]) ) continue; for ( o = this.before.parents(), this.lastOther = 0, l = !1; this.lastOther < o.length; this.lastOther++ ) if ( o[this.lastOther].tagName != h && o[this.lastOther].tagName != "LI" ) { l = !0; this.lastOther--; break; } this.nest = 1; n(this.cols[this.offset]).find(">" + f + ":first li " + f + ":first") .length && (this.nest = 2); this.setList(this.cols, e, f); this.lastOther--; e = n(this.cols[this.offset]).find(f + ":first li " + f + ":first"); e.length && ((this.before = n(this.cols[this.offset - 1]).find( ">" + f + ":last li " + f + ":last" )), (this.prevMax = 0), (this.nest = 1), this.setList(this.cols, e, f)); a = n(this.cols[this.offset - 1]).find(">" + f + ":last"); this.prevMax = a.children().length; } } return 0; }; })(jQuery); !(function (n, t, i) { "use strict"; di.module("pp", ["pp.jquery"]) .value("document", t) .value("window", n) .value("$", jQuery) .value("Cookies", Cookies) .value("$script", $script) .factory("Global", [ "$", "window", function (n, t) { t._PP_ = t._PP_ || { Global: {} }; return n.extend({}, { domain: "localhost" }, t._PP_.Global); }, ]) .factory("isMobile", [ "window", function (n) { return /iphone|ipad|ipod|android/i.test( n.navigator.userAgent.toLowerCase() ); }, ]) .factory("Preloader", [ "$", function (n) { function t(t) { this.imageLocations = t; this.imageCount = this.imageLocations.length; this.images = []; this.loadCount = 0; this.errorCount = 0; this.totalCount = 0; this.states = { PENDING: 1, LOADING: 2, RESOLVED: 3, REJECTED: 4 }; this.state = this.states.PENDING; this.deferred = n.Deferred(); this.promise = this.deferred.promise(); } return ( (t.prototype = { constructor: t, isInitiated: function () { return this.state !== this.states.PENDING; }, isRejected: function () { return this.state === this.states.REJECTED; }, isResolved: function () { return this.state === this.states.RESOLVED; }, load: function () { if (this.isInitiated()) return this.promise; this.state = this.states.LOADING; for (var n = 0; n < this.imageCount; n++) this.loadImageLocation(this.imageLocations[n], n); return this.promise; }, handleImageError: function () { this.totalCount++; this.errorCount++; this.checkTheEnd(); }, handleImageLoad: function () { this.totalCount++; this.loadCount++; this.checkTheEnd(); }, checkTheEnd: function () { this.totalCount === this.imageCount && (this.errorCount ? ((this.state = this.states.REJECTED), this.deferred.reject(this.images)) : ((this.state = this.states.RESOLVED), this.deferred.resolve(this.images))); }, loadImageLocation: function (t, i) { var r = this, u = n(""); this.images.push(u); u.on("load", function () { r.handleImageLoad(); r = i = null; }); u.on("error", function () { r.handleImageError(); r.images[i] = !1; r = i = null; }); u[0].src = t; }, }), (t.preloadImages = function (n) { var i = new t(n); return i.load(); }), t ); }, ]) .factory("MyUtils", [ "window", "document", function (n, t) { function r() { this._id = 0; this._vendor = {}; this._readyList = []; this._readyFired = !1; this._readyEventHandlersInstalled = !1; this._initVendors(); this.supportsTransitions = this.supportsTransitions(); this.supportsPlaceholder = this.supportsPlaceholder(); this.supportsPerspective = this.supportsPerspective(); this.supportsColumns = this.supportsColumns(); } return ( (r.prototype.ajax = function (n, t, i) { var r = this; return new Promise(function (u, f) { var o = null, e = new XMLHttpRequest(), h, s; ((e.onreadystatechange = function () { if (4 == e.readyState) if (200 == e.status) { var n = JSON.parse(e.responseText); u(n); } else f(e.statusText); }), "POST" == n) ? "undefined" != typeof FormData && i instanceof FormData ? ((o = i), e.open(n, t, !0)) : ((o = r.serialize(i)), (o = o + "&t=" + Math.random()), e.open(n, t, !0), e.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" )) : ((h = r.serialize(i)), (s = t + "?" + h), (s += "&t=" + Math.random()), e.open(n, s, !0)); e.send(o); }); }), (r.prototype.serialize = function (n) { var i = [], t; for (t in n) n.hasOwnProperty(t) && i.push(encodeURIComponent(t) + "=" + encodeURIComponent(n[t])); return i.join("&"); }), (r.prototype.isArray = function () { return ( Array.isArray || function (n) { return "[object Array]" === Object.prototype.toString.call(n); } ); }), (r.prototype.isObject = function (n) { var t = typeof n; return "function" === t || ("object" === t && !!n); }), (r.prototype.isFunction = function (n) { return ( Object.prototype.toString.call(n) === "[object " + name + "]" ); }), (r.prototype.extend = function (n, t, r) { var e, s, f, o, h, u = n || {}, c = (arguments.length, r), l = t; "object" == typeof u || this.isFunction(u) || (u = {}); for (o in l) if (t.hasOwnProperty(o)) { if (((e = u[o]), (f = l[o]), u === f)) continue; c && f && (s = this.isArray(f)) ? (s ? ((s = !1), (h = e && this.isArray(e) ? e : [])) : (h = e ? e : {}), (u[o] = this.extend(h, f, c))) : f !== i && (u[o] = f); } return u; }), (r.prototype.getWiddowWidth = function () { return ( n.innerWidth || t.documentElement.clientWidth || t.body.clientWidth ); }), (r.prototype.getWiddowHeight = function () { return ( n.innerHeight || t.documentElement.clientHeight || t.body.clientHeight ); }), (r.prototype.supportsTransitions = function () { var n = t.createElement("div").style, i = this.getPrefixedPropertyName("transition") in n; return function () { return i; }; }), (r.prototype.supportsPlaceholder = function () { var n = t.createElement("input"), i = "undefined" != typeof n.placeholder; return function () { return i; }; }), (r.prototype.supportsPerspective = function () { var n = t.createElement("div").style, i = this.getPrefixedPropertyName("perspective") in n; return function () { return i; }; }), (r.prototype.supportsColumns = function () { for ( var u, f = t.createElement("div").style, n = !1, r = [ "columnCount", "webkitColumnCount", "WebkitColumnCount", "MozColumnCount", "msColumnCount", "MsColumnCount", "OColumnCount", ], i = 0, e = r.length; e > i; i++ ) if (((u = r[i]), u in f)) return ( (n = !0), function () { return n; } ); return function () { return n; }; }), (r.prototype.getElementText = function (n) { var r, i = "", u = 0, t = !1; if ("undefined" == typeof n) return !1; if (("undefined" != typeof n.nodeType && (t = n.nodeType), t)) { if (1 === t || 9 === t || 11 === t) { if ("string" == typeof n.textContent) return n.textContent; for (n = n.firstChild; n; n = n.nextSibling) i += this.getElementText(n); } else if (3 === t || 4 === t) return n.nodeValue; } else for (; (r = n[u++]);) i += this.getElementText(r); return i; }), (r.prototype.appendElement = function (n, t) { var i = this.createElement(t); n.appendChild(i); }), (r.prototype.prependElement = function (n, t) { var i = this.createElement(t); n.insertBefore(i, n.firstChild); }), (r.prototype.createElement = function (n) { var r = t.createDocumentFragment(), i = t.createElement("div"); for (i.innerHTML = n; i.childNodes[0];) r.appendChild(i.childNodes[0]); return r; }), (r.prototype.getElementIndex = function (n) { for (var t = 0; n.previousSibling;) (n = n.previousSibling), 1 === n.nodeType && t++; return t; }), (r.prototype.transitionEnd = function (n, t, i) { function r(f) { f.target.classList.contains(t) && (n.removeEventListener("transitionend", r, !1), n.removeEventListener("msTransitionEnd", r, !1), n.removeEventListener("mozTransitionEnd", r, !1), n.removeEventListener("webkitTransitionEnd", r, !1), clearTimeout(u), "function" == typeof i && i()); } var u = null; u = setTimeout(function () { var t = { target: n }; r(t); }, 5e3); n.addEventListener("transitionend", r, !1); n.addEventListener("msTransitionEnd", r, !1); n.addEventListener("mozTransitionEnd", r, !1); n.addEventListener("webkitTransitionEnd", r, !1); }), (r.prototype.animateCss = function (n, t, i) { function p() { var r = 0, i; for (i in t) t.hasOwnProperty(i) && ("transform" == i && (i = h.getPrefixedStyleValue(i)), (o += (0 === r ? "" : ", ") + i), r++); o && (n.style[a] = o); u && (n.style[u] = v); f && (n.style[f] = b); e && (n.style[e] = y); } function c() { var i, r; for (i in t) t.hasOwnProperty(i) && ((r = t[i]), (i = h.getCameCaseString(i)), "transform" == i && (i = h.getPrefixedPropertyName(i)), (n.style[i] = r)); } function s(t) { (t && t.target != n) || (n.removeEventListener(l, s, !1), o && (n.style[a] = ""), u && (n.style[u] = ""), f && (n.style[f] = ""), e && (n.style[e] = ""), "function" == typeof r.onComplete && r.onComplete()); } var h = this, w = { duration: 0, delay: 0, easing: "", onComplete: function () { }, }, r = this.extend(w, i), l = { webkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", msTransition: "MSTransitionEnd", transition: "transitionend", }[this.getPrefixedPropertyName("transition")], a = this.getPrefixedPropertyName("transitionProperty"), u = this.getPrefixedPropertyName("transitionDuration"), f = this.getPrefixedPropertyName("transitionTimingFunction"), e = this.getPrefixedPropertyName("transitionDelay"), o = "", v = r.duration ? r.duration / 1e3 + "s" : 0, b = r.easing ? r.easing : "", y = r.delay ? r.delay / 1e3 + "s" : 0; v || y ? (setTimeout(function () { p(); c(); }, 20), n.addEventListener(l, s, !1)) : (c(), s()); }), (r.prototype._initVendors = function () { var n, u, s, f, i, r, e, o; for ( o = t.createElement("div").style, i = ["t", "webkitT", "MozT", "msT", "OT"], f = ["", "-webkit-", "-moz-", "-ms-", "-o-"], n = r = 0, e = i.length; e > r; n = ++r ) if (((s = i[n]), (u = i[n] + "ransform"), u in o)) return void (this._vendor = { js: i[n].substr(0, i[n].length - 1), css: f[n], }); this._vendor = { js: !1, css: !1 }; }), (r.prototype.getPrefixedPropertyName = function (n) { return this._vendor.js === !1 ? !1 : "" === this._vendor.js ? n : this._vendor.js + n.charAt(0).toUpperCase() + n.substr(1); }), (r.prototype.getPrefixedStyleValue = function (n) { return this._vendor.css === !1 ? !1 : "" === this._vendor.css ? n : this._vendor.css + n; }), (r.prototype.getPrefixedEventType = function (n) { return this._vendor.js === !1 ? !1 : "" === this._vendor.js ? n.toLowerCase() : this._vendor.js.toLowerCase() + n; }), (r.prototype.getCameCaseString = function (n) { return n.replace(/-([a-z])/g, function (n, t) { return t.toUpperCase(); }); }), (r.prototype._ready = function () { if (!this._readyFired) { this._readyFired = !0; for (var n = 0; n < this._readyList.length; n++) this._readyList[n].fn(); this._readyList = []; } }), (r.prototype._readyStateChange = function () { "complete" === t.readyState && this._ready(); }), (r.prototype.domReady = function (i) { var r = this; return this._readyFired ? void setTimeout(function () { i(); }, 1) : (this._readyList.push({ fn: i }), void ("complete" === t.readyState ? setTimeout(function () { r._ready(); }, 1) : this._readyEventHandlersInstalled || (t.addEventListener ? (t.addEventListener( "DOMContentLoaded", function () { r._ready(); }, !1 ), n.addEventListener( "load", function () { r._ready(); }, !1 )) : (t.attachEvent("onreadystatechange", function () { r._readyStateChange(); }), n.attachEvent("onload", function () { r._ready(); })), (this._readyEventHandlersInstalled = !0)))); }), new r() ); }, ]) .factory("CookiesNotification", [ "Cookies", "$", function (n, t) { return { $holder: null, value: i, init: function () { var i = this; this.$holder = t(".cookie_notification"); this.value = n.get("cookiesNotification"); this.value && "true" == this.value && this._hide(!0); t("a.cn-close", this.$holder).on("click", function (t) { t.preventDefault(); n.set("cookiesNotification", "true", { expires: 365 }); i._hide(); }); }, _hide: function (n) { n ? (this.$holder[0].style.display = "none") : this.$holder.addClass("hide"); }, }; }, ]) .factory("FormValidation", [ "$", function (n) { var t = { formClass: "validate_form" }; return { init: function () { var i = n("form." + t.formClass); i.validate({ highlight: function (t, i) { n(t).closest(".field_holder").addClass(i); }, unhighlight: function (t, i) { n(t).closest(".field_holder").removeClass(i); }, errorPlacement: function (t, i) { var r = n(i).closest(".field_holder"), u = n(".bf-error_holder", r); u.append(t); }, }); }, }; }, ]) .factory("GoogleMapAPI", [ "$", "$script", "document", "window", function (n, t, i, r) { for ( var o, h = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDjacibP1D0jnd4sMlBJF5b2UjLs7zNh_I&libraries=places&v=weekly&callback=googleMapApiLoaded", s = !1, u = [], f = 256, e = 0; 20 > e; e++ ) (u[e] = f), (f = 2 * f); return ( (o = { isLoaded: !1, init: function () { if (!s) { var n = this; r.googleMapApiLoaded = function () { s = !0; n.apiLoaded(!0); }; } }, drawMap: function (t, i) { var u = t, r, mapInstance; "string" == typeof t && (u = n(t)); r = { center: new google.maps.LatLng(52.187741, 5.27937), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: !0, gestureHandling: 'cooperative' }; r = n.extend([], r, i); mapInstance = new google.maps.Map(u[0], r); // Add zoom changed listener to handle marker repositioning google.maps.event.addListener(mapInstance, 'zoom_changed', function () { // Force map refresh after zoom change google.maps.event.trigger(mapInstance, 'resize'); }); return mapInstance; }, addMarkers: function (t, i, r, u) { var f = new google.maps.LatLngBounds(), l = [], e, h, c, o, s, a, v, iconUrl, iconEl; for (e = 0; e < i.length; e++) { h = i[e]; c = new google.maps.LatLng(h.Latitude, h.Longitude); f.extend(c); o = { position: c }; o = n.extend([], o, r); // handle custom icon iconUrl = null; iconEl = null; r && r.icon && r.icon.url && (iconUrl = r.icon.url); // Create standard marker instead of Advanced Marker to avoid displacement issues var markerOptions = { position: c, map: t }; if (iconUrl) { markerOptions.icon = { url: iconUrl, size: new google.maps.Size( r.icon && r.icon.size && r.icon.size.width ? r.icon.size.width : 76, r.icon && r.icon.size && r.icon.size.height ? r.icon.size.height : 46 ), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point( (r.icon && r.icon.size && r.icon.size.width ? r.icon.size.width : 76) / 2, r.icon && r.icon.size && r.icon.size.height ? r.icon.size.height : 46 ), scaledSize: new google.maps.Size( r.icon && r.icon.size && r.icon.size.width ? r.icon.size.width : 76, r.icon && r.icon.size && r.icon.size.height ? r.icon.size.height : 46 ) }; } s = new google.maps.Marker(markerOptions); l.push(s); (function (n) { google.maps.event.addListener(s, "click", function () { u(n); }); })(e); } // if bounds is a single point, extend slightly if (f.getNorthEast().equals(f.getSouthWest())) { a = new google.maps.LatLng( f.getNorthEast().lat() + 0.01, f.getNorthEast().lng() + 0.01 ); v = new google.maps.LatLng( f.getNorthEast().lat() - 0.01, f.getNorthEast().lng() - 0.01 ); f.extend(a); f.extend(v); } return l; }, clearMarkers: function (n, t) { for (var i = 0, r = t.length; r > i; i++) t[i].setMap(null); return []; }, updateCenter: function (n, t, i, r) { function c(n, t, i, r) { if (i) { var u = n.getZoom(), f = t.getSouthWest(), e = r.lngToPx(f.lng(), u), o = r.pxToLng(e - i, u), s = new google.maps.LatLng(f.lat(), o); return new google.maps.LatLngBounds(s, t.getNorthEast()); } } var h, u, e, o, f, s; if (0 !== t.length) { if (((f = new google.maps.LatLngBounds()), r && i)) return void n.panBy(-i / 2, 0); if (1 === t.length) return ( (e = t[0]), (o = new google.maps.LatLng(e.Latitude, e.Longitude)), f.extend(o), n.fitBounds(f), (u = n.getZoom()), u > 15 && ((u = 15), n.setZoom(u)), void (i && n.panBy(-i / 2, 0)) ); for (s = 0; s < t.length; s++) (e = t[s]), (o = new google.maps.LatLng(e.Latitude, e.Longitude)), f.extend(o); i ? (n.fitBounds(f), (h = n.getZoom()), (f = c(n, f, i, this)), n.fitBounds(f)) : n.fitBounds(f); u = n.getZoom(); h != u && i && n.panBy(-i / 4, 0); u > 15 && ((u = 15), n.setZoom(u)); } }, getMarkerCenter: function (n, t, i, r) { var f = -i / 2, e = t.Latitude || t.getPosition().lat(), o = t.Longitude || t.getPosition().lng(), u = r || n.getZoom(), s = f, h = this.pxToLat(this.latToPx(e, u) + 0, u), c = this.pxToLng(this.lngToPx(o, u) + s, u); return new google.maps.LatLng(h, c); }, lngToPx: function (n, t) { return u[t] / 2 + (n * u[t]) / 360; }, pxToLng: function (n, t) { return (n - u[t] / 2) / (u[t] / 360); }, latToPx: function (n, t) { var i = Math.sin((n * Math.PI) / 180); return ( u[t] / 2 - (0.5 * Math.log((1 + i) / (1 - i)) * u[t]) / (2 * Math.PI) ); }, pxToLat: function (n, t) { var i = (n - u[t] / 2) / -(u[t] / (2 * Math.PI)); return ( (180 * (2 * Math.atan(Math.exp(i)) - Math.PI / 2)) / Math.PI ); }, load: function () { var n = this; return this.isLoaded ? void setTimeout(function () { n.apiLoaded(); }, 50) : (t([h]), void this.init()); }, apiLoaded: function (t) { t && (this.isLoaded = !0); n(i).triggerHandler("googleMapApiLoaded"); }, }), o.init(), o ); }, ]) .factory("DealersMap", [ "$", "document", "GoogleMapAPI", "Global", function (n, t, i, r) { return { $doc: null, $holder: null, $infoHolder: null, $searchForm: null, $searchFormInput: null, $mapBox: null, map: null, dealers: [], markers: [], init: function () { var u = this; this.$doc = n(t); this.$holder = n(".dealers_map"); 1 == this.$holder.length && ((this.$infoHolder = n(".dm-detail_marker", this.$holder)), (this.$mapBox = n("#dealersMap")), (this.$searchForm = n("#dealersMapForm")), (this.$searchFormInput = this.$searchForm.length ? n(".st-input", this.$searchForm) : null), this.$searchFormInput && this.$searchFormInput.length && (this.$searchFormInput[0].value = ""), (this.dealers = r.contactDealers || []), n("a.dm-link", this.$holder).on("click", function () { var i = n(this).data("id"), t = u.getDealerById(i); t && u.showDetail(t); }), i.load(), this.$doc.on("googleMapApiLoaded", function () { u.drawMap(); u.searchInit(); })); }, drawMap: function () { var n = { disableDefaultUI: !0, zoomControl: !0, zoomControlOptions: { style: google.maps.ZoomControlStyle.DEFAULT, position: google.maps.ControlPosition.RIGHT_BOTTOM, }, streetViewControl: !0, }; this.map = i.drawMap(this.$mapBox, n); this.map.setOptions({ styles: [ { featureType: "road.arterial", elementType: "geometry.fill", stylers: [{ color: "#ed008e" }], }, { featureType: "water", elementType: "geometry.fill", stylers: [{ color: "#44c8f8" }], }, { featureType: "administrative.locality", elementType: "labels.text.fill", stylers: [{ color: "#000000" }], }, { featureType: "road.highway", elementType: "geometry", stylers: [{ color: "#ed008e" }], }, ], }); 0 !== this.dealers.length && google.maps.event.addListenerOnce( this.map, "bounds_changed", function () { var n = { icon: { url: "bundles/css/Content/images/marker.png", size: new google.maps.Size(76, 46), anchor: new google.maps.Point(38, 40), }, shape: { coords: [38, 1, 52, 14, 39, 45, 23, 15], type: "poly", }, }; this.markers = i.addMarkers( this.map, this.dealers, n, this.markerClickHandler.bind(this) ); this.updateCenter(); }.bind(this) ); }, markerClickHandler: function (n) { var t = this.dealers[n]; this.showDetail(t); }, searchInit: function () { var n = this, autocomplete = new google.maps.places.Autocomplete( this.$searchFormInput[0], { componentRestrictions: { country: "nl" }, types: ['geocode'] } ); autocomplete.addListener("place_changed", function () { var place = autocomplete.getPlace(); if (place && place.geometry) { n._goToPlace(place); } }); this.$searchForm.on("submit", function (e) { e.preventDefault(); var place = autocomplete.getPlace(); if (place && place.geometry) { n._goToPlace(place); } }); }, _goToPlace: function (n) { n && n.geometry && (n.geometry.viewport ? this.map.fitBounds(n.geometry.viewport) : (this.map.setCenter(n.geometry.location), this.map.setZoom(17))); }, updateCenter: function () { var n = 250; this.$holder.width() <= 640 && (n = 0); i.updateCenter(this.map, this.dealers, n, !0); }, showDetail: function (n) { var t = 250, r; this.$holder.width() <= 640 && (t = 0); this.map.setZoom(13); r = i.getMarkerCenter(this.map, n, t, 13); this.map.setCenter(r); this.map.panBy(2, 2); this.fillDetail(n); }, fillDetail: function (n) { this.$infoHolder.html(n.Info); this.$holder.addClass("has_detail"); }, getDealerById: function (n) { for (var t = 0, i = this.dealers.length; i > t; t++) if (this.dealers[t].Id == n) return this.dealers[t]; return !1; }, }; }, ]); di.module("pp.jquery", []) .factory("jquery.customFile", [ "$", function (n) { function t(t, r) { this.options = n.extend([], i, r); this.$holder = n(t); this.$fileForm = n(".sf-form", this.$holder); this.$fileInput = n(".sf-input", this.$holder); this.$fileName = n(".sf-file_name", this.$holder); this.$clearFile = n(".sf-result_clear", this.$holder); this.$field = this.$holder.closest(this.options.fieldSelector); this.$form = this.$holder.closest(this.options.formSelector); this.isRequired = !1; this.isBusy = !1; this.iframeTimer = null; this.iframeErrorTimer = null; this.tempImageURL = null; this.$globalHolder = this.$holder.closest(this.options.fieldSelector); this.$globalForm = this.$holder.closest(this.options.formSelector); this.init(); } var i = { parentSelector: ".std_file", fieldSelector: ".field_holder", formSelector: "form", requiredClass: "required_field", }; return ( (t.prototype.init = function () { var t = this; this.$fileInput.on("change", function () { t.tempFileName = n(this).val().split("/").pop().split("\\").pop(); t.updateName(); }); this.$clearFile.on("click", function (n) { n.preventDefault(); t.tempFileName = null; t.updateName(); }); }), (t.prototype.changeFileHandler = function () { var i = this, r, u, f, t; this.isBusy || (((this.isBusy = !0), this.$holder.addClass("std_file__loading"), "undefined" != typeof FormData) ? ((r = new FormData()), n.each(this.$fileInput[0].files, function (n, t) { r.append("imageFiles", t); }), n .ajax({ type: "GET", url: "ajax/uploadImage.txt", data: r, dataType: "json", contentType: !1, processData: !1, cache: !1, }) .then( function (n) { i.isBusy = !1; i.imageUploadHandler(n); }, function (n) { i.isBusy = !1; i.$holder.removeClass("std_file__loading"); console.log("uploadPhoto() - " + n); } )) : ((u = /TempImage/g), (f = ''), this.$holder.append(f), (t = n("iframe", this.$holder)), (this.$form.target = "file_iframe"), this.$form.submit(), (this.iframeTimer = setInterval( function () { var f = t[0].contentDocument || t[0].contentWindow.document, e = f.querySelector("body"), i = n(e).text(), r; u.test(i) && ((r = JSON.parse(i)), this.imageUploadHandler(r), clearInterval(this.iframeTimer), clearTimeout(this.iframeErrorTimer), this.$holder[0].removeChild(t[0]), (this.isBusy = !1)); }.bind(this), 500 )), (this.iframeErrorTimer = setTimeout( function () { clearInterval(this.iframeTimer); this.$holder[0].removeChild(t[0]); this.$holder.removeClass("std_file__loading"); this.isBusy = !1; console.log("uploadPhotoIframe() - error"); }.bind(this), 1e4 )))); }), (t.prototype.imageUploadHandler = function (n) { n.Success ? ((this.tempFileURL = n.TempFileUrl), (this.tempFileName = n.TempFileName), this.updateName()) : this.$holder.removeClass("std_file__loading"); }), (t.prototype.updateName = function () { this.tempFileName ? (this.$fileName.text(this.tempFileName), this.$holder.addClass("std_file__load")) : this.$holder.removeClass("std_file__load"); }), (n.fn.customFile = function (i) { n(this).each(function () { n.data(this, "CustomFile") || n.data(this, "CustomFile", new t(this, i)); }); }), t ); }, ]) .factory("jquery.customSelect", [ "$", function (n) { function t(t, r) { this.options = n.extend([], i, r); this.input = t; this.$originalInput = n(t); this.$parent = this.$originalInput.closest( this.options.parentSelector ); this.$holder = this.$originalInput.closest( this.options.fieldSelector ); this.$form = this.$originalInput.closest(this.options.formSelector); this.placeholder = !1; this.isRequired = !1; this.init(); } var i = { parentSelector: ".std_select", fieldSelector: ".field_holder", formSelector: "form", requiredClass: "required_field", focusClass: "std_select__focus", placeholderClass: "std_select__placeholder", }; return ( (t.prototype.init = function () { var t = this, i = this.$originalInput.attr("placeholder"), r; i && (this.placeholder = i); "" === this.$originalInput[0].value && i && this.$parent.addClass(t.options.placeholderClass); r = !1; n("option", this.$originalInput).each(function (t, i) { var u = n(i).attr("selected"); u && "selected" == u && (r = t); }); r !== !1 && (this.$originalInput[0].selectedIndex = r); this.$originalInput .focus(function () { t.$parent.addClass(t.options.focusClass); }) .blur(function () { t.$parent.removeClass(t.options.focusClass); }) .change(function () { "" === t.$originalInput[0].value && i ? t.$parent.addClass(t.options.placeholderClass) : t.$parent.removeClass(t.options.placeholderClass); setTimeout(function () { t.$originalInput.blur(); }, 1); }); }), (n.fn.customSelect = function (i) { n(this).each(function () { n.data(this, "CustomSelect") || n.data(this, "CustomSelect", new t(this, i)); }); }), t ); }, ]) .factory("jquery.customTextBox", [ "$", function (n) { function t(t, r) { this.options = n.extend([], i, r); this.input = t; this.$originalInput = n(t); this.$parent = this.$originalInput.closest( this.options.parentSelector ); this.$holder = this.$originalInput.closest( this.options.fieldSelector ); this.$form = this.$originalInput.closest(this.options.formSelector); this.isRequired = !1; this.placeholder = this.input.placeholder; this.init(); } var i = { parentSelector: ".std_tbx", fieldSelector: ".field_holder", formSelector: "form", requiredClass: "required_field", focusClass: "std_tbx__focus", placeholderClass: "std_tbx__placeholder", passwordClass: "std_tbx__pass", supportPlaceholder: !0, }; return ( (t.prototype.init = function () { var n = this; this.options.supportPlaceholder || (this.placeholder = this.input.getAttribute("placeholder")); !this.options.supportPlaceholder && this.placeholder && ((this.input.value = this.placeholder), this.$parent.addClass(this.options.placeholderClass)); this.$originalInput .focus(function () { n.$parent.addClass(n.options.focusClass); !n.options.supportPlaceholder && n.placeholder && n.input.value.trim() == n.placeholder && ((n.input.value = ""), n.$parent.removeClass(n.options.placeholderClass)); }) .blur(function () { n.$parent.removeClass(n.options.focusClass); n.options.supportPlaceholder || !n.placeholder || ("" !== n.input.value && n.input.value.toLowerCase() != n.placeholder.toLowerCase()) || ((n.input.value = n.placeholder), n.$parent.addClass(n.options.placeholderClass)); }); }), (n.fn.customTextBox = function (i) { n(this).each(function () { n.data(this, "CustomTetxBox") || n.data(this, "CustomTetxBox", new t(this, i)); }); }), t ); }, ]) .factory("jquery.customTextArea", [ "$", function (n) { function t(t, r) { this.options = n.extend([], i, r); this.input = t; this.$originalInput = n(t); this.$parent = this.$originalInput.closest( this.options.parentSelector ); this.$holder = this.$originalInput.closest( this.options.fieldSelector ); this.$form = this.$originalInput.closest(this.options.formSelector); this.isRequired = !1; this.placeholder = this.input.placeholder; this.init(); } var i = { parentSelector: ".std_tar", fieldSelector: ".field_holder", formSelector: "form", requiredClass: "required_field", focusClass: "std_tar__focus", placeholderClass: "std_tar__placeholder", supportPlaceholder: !0, }; return ( (t.prototype.init = function () { var n = this; this.options.supportPlaceholder || (this.placeholder = this.input.getAttribute("placeholder")); !this.options.supportPlaceholder && this.placeholder && ((this.input.value = this.placeholder), this.$parent.addClass(this.options.placeholderClass)); this.$originalInput .focus(function () { n.$parent.addClass(n.options.focusClass); !n.options.supportPlaceholder && n.placeholder && n.input.value.trim() == n.placeholder && ((n.input.value = ""), n.$parent.removeClass(n.options.placeholderClass)); }) .blur(function () { n.$parent.removeClass(n.options.focusClass); n.options.supportPlaceholder || !n.placeholder || ("" !== n.input.value && n.input.value.toLowerCase() != n.placeholder.toLowerCase()) || ((n.input.value = n.placeholder), n.$parent.addClass(n.options.placeholderClass)); }); }), (n.fn.customTextArea = function (i) { n(this).each(function () { n.data(this, "CustomTetxArea") || n.data(this, "CustomTetxArea", new t(this, i)); }); }), t ); }, ]) .factory("jquery.customRadiobtn", [ "$", function (n) { function t(t, r) { this.options = n.extend([], i, r); this.$originalInput = n(t); this.$holder = this.$originalInput.closest( this.options.fieldSelector ); this.$form = this.$originalInput.closest(this.options.formSelector); this.isRequired = !1; this.init(); } var i = { parentSelector: ".std_rbn", fieldSelector: ".field_holder", formSelector: "form", requiredClass: "required_field", }; return ( (t.prototype.init = function () { var t = this.$originalInput[0].getAttribute("checked"), n; this.$originalInput[0].checked = t && "checked" == t ? !0 : !1; n = this.$originalInput[0].getAttribute("disabled"); this.$originalInput[0].disabled = n && "disabled" == n ? !0 : !1; this.$originalInput.on("change", function () { }); }), (n.fn.customRadiobtn = function (i) { n(this).each(function () { n.data(this, "CustomRadiobtn") || n.data(this, "CustomRadiobtn", new t(this, i)); }); }), t ); }, ]) .factory("jquery.customCheckboxes", [ "$", function (n) { function t(t, r) { this.options = n.extend([], i, r); this.$originalInput = n(t); this.$holder = this.$originalInput.closest( this.options.fieldSelector ); this.$form = this.$originalInput.closest(this.options.formSelector); this.isRequired = !1; this.init(); } var i = { parentSelector: ".std_cbx", fieldSelector: ".field_holder", formSelector: "form", requiredClass: "required_field", }; return ( (t.prototype.init = function () { var t = this.$originalInput[0].getAttribute("checked"), n; this.$originalInput[0].checked = t && "checked" == t ? !0 : !1; n = this.$originalInput[0].getAttribute("disabled"); this.$originalInput[0].disabled = n && "disabled" == n ? !0 : !1; this.$originalInput.on("change", function () { }); }), (n.fn.customCheckboxes = function (i) { n(this).each(function () { n.data(this, "CustomCheckboxes") || n.data(this, "CustomCheckboxes", new t(this, i)); }); }), t ); }, ]) .factory("jquery.equalHeight", [ "$", "window", function (n, t) { function i(t, i) { this.options = n.extend([], r, i); this.$holder = n(t); this.$childs = null; this.init(); } var r = { anchorClass: "eh_anchor" }; return ( (i.prototype.init = function () { var i = this; this.$childs = n("." + this.options.anchorClass, this.$holder); this.resize(); setTimeout(function () { i.resize(); }, 1e3); n(t).on("resize", function () { i.resize(); }); }), (i.prototype.resize = function () { var t = 0; this.$childs.each(function (i, r) { var f = n(r), u; f[0].style.height = "auto"; u = f.height(); u > t && (t = u); }); this.$childs.each(function (i, r) { n(r).height(t); }); }), (n.fn.equalHeight = function (t) { n(this).each(function () { n.data(this, "EqualHeight") || n.data(this, "EqualHeight", new i(this, t)); }); }), i ); }, ]); di.module("pp").run([ "$", "jquery.customFile", "jquery.customSelect", "jquery.customTextBox", "jquery.customTextArea", "jquery.customRadiobtn", "jquery.customCheckboxes", "jquery.equalHeight", "CookiesNotification", "FormValidation", "DealersMap", "MyUtils", function (n, t, i, r, u, f, e, o, s, h, c, l) { var a, v; (n(".std_file").customFile(), n(".std_tbx input").customTextBox(), n(".std_tar textarea").customTextArea(), n(".std_rbn input").customRadiobtn(), n(".std_cbx input").customCheckboxes(), n(".equal_height").equalHeight(), s.init(), h.init(), c.init(), n.extend(n.validator.messages, { required: "Dit is een verplicht veld.", remote: "Controleer dit veld.", email: "Vul hier een geldig e-mailadres in.", url: "Vul hier een geldige URL in.", date: "Vul hier een geldige datum in.", dateISO: "Vul hier een geldige datum in (ISO-formaat).", number: "Vul hier een geldig getal in.", digits: "Vul hier alleen getallen in.", creditcard: "Vul hier een geldig creditcardnummer in.", equalTo: "Vul hier dezelfde waarde in.", extension: "Vul hier een waarde in met een geldige extensie.", maxlength: n.validator.format("Vul hier maximaal {0} tekens in."), minlength: n.validator.format("Vul hier minimaal {0} tekens in."), rangelength: n.validator.format( "Vul hier een waarde in van minimaal {0} en maximaal {1} tekens." ), range: n.validator.format( "Vul hier een waarde in van minimaal {0} en maximaal {1}." ), max: n.validator.format( "Vul hier een waarde in kleiner dan of gelijk aan {0}." ), min: n.validator.format( "Vul hier een waarde in groter dan of gelijk aan {0}." ), iban: "Vul hier een geldig IBAN in.", dateNL: "Vul hier een geldige datum in.", phoneNL: "Vul hier een geldig Nederlands telefoonnummer in.", mobileNL: "Vul hier een geldig Nederlands mobiel telefoonnummer in.", postalcodeNL: "Vul hier een geldige postcode in.", bankaccountNL: "Vul hier een geldig bankrekeningnummer in.", giroaccountNL: "Vul hier een geldig gironummer in.", bankorgiroaccountNL: "Vul hier een geldig bank- of gironummer in.", }), !l.supportsColumns() && n.fn.columnize) && ((a = n(".custom_text .columns_2")), a.each(function (t, i) { var r = n(i); n(".column:first-child", r).length || (r.columnize({ columns: 2 }), n( "table, thead, tbody, tfoot, colgroup, caption, label, legend, script, style, textarea, button, object, embed, tr, th, td, li, h1, h2, h3, h4, h5, h6, form", r ).addClass("dontsplit"), n("h1, h2, h3, h4, h5, h6", r).addClass("dontend"), n("br", r).addClass("removeiflast").addClass("removeiffirst")); }), (v = n(".custom_text .columns_3")), v.each(function (t, i) { var r = n(i); n(".column:first-child", r).length || (r.columnize({ columns: 3 }), n( "table, thead, tbody, tfoot, colgroup, caption, label, legend, script, style, textarea, button, object, embed, tr, th, td, li, h1, h2, h3, h4, h5, h6, form", r ).addClass("dontsplit"), n("h1, h2, h3, h4, h5, h6", r).addClass("dontend"), n("br", r).addClass("removeiflast").addClass("removeiffirst")); })); }, ]); $(t).ready(function () { di.injector(["pp"]); }); })(window, document);