"use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! * Chart.js * http://chartjs.org/ * Version: 2.7.2 * * Copyright 2018 Chart.js Contributors * Released under the MIT license * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md * triglav.ba */ !function (t) { if ("object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "undefined" != typeof module) module.exports = t();else if ("function" == typeof define && define.amd) define([], t);else { ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).Chart = t(); } }(function () { return function t(e, i, n) { function a(r, s) { if (!i[r]) { if (!e[r]) { var l = "function" == typeof require && require;if (!s && l) return l(r, !0);if (o) return o(r, !0);var u = new Error("Cannot find module '" + r + "'");throw u.code = "MODULE_NOT_FOUND", u; }var d = i[r] = { exports: {} };e[r][0].call(d.exports, function (t) { var i = e[r][1][t];return a(i || t); }, d, d.exports, t, e, i, n); }return i[r].exports; }for (var o = "function" == typeof require && require, r = 0; r < n.length; r++) { a(n[r]); }return a; }({ 1: [function (t, e, i) {}, {}], 2: [function (t, e, i) { var n = t(6);function a(t) { if (t) { var e = [0, 0, 0], i = 1, a = t.match(/^#([a-fA-F0-9]{3})$/i);if (a) { a = a[1];for (var o = 0; o < e.length; o++) { e[o] = parseInt(a[o] + a[o], 16); } } else if (a = t.match(/^#([a-fA-F0-9]{6})$/i)) { a = a[1];for (o = 0; o < e.length; o++) { e[o] = parseInt(a.slice(2 * o, 2 * o + 2), 16); } } else if (a = t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)) { for (o = 0; o < e.length; o++) { e[o] = parseInt(a[o + 1]); }i = parseFloat(a[4]); } else if (a = t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)) { for (o = 0; o < e.length; o++) { e[o] = Math.round(2.55 * parseFloat(a[o + 1])); }i = parseFloat(a[4]); } else if (a = t.match(/(\w+)/)) { if ("transparent" == a[1]) return [0, 0, 0, 0];if (!(e = n[a[1]])) return; }for (o = 0; o < e.length; o++) { e[o] = d(e[o], 0, 255); }return i = i || 0 == i ? d(i, 0, 1) : 1, e[3] = i, e; } }function o(t) { if (t) { var e = t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if (e) { var i = parseFloat(e[4]);return [d(parseInt(e[1]), 0, 360), d(parseFloat(e[2]), 0, 100), d(parseFloat(e[3]), 0, 100), d(isNaN(i) ? 1 : i, 0, 1)]; } } }function r(t) { if (t) { var e = t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if (e) { var i = parseFloat(e[4]);return [d(parseInt(e[1]), 0, 360), d(parseFloat(e[2]), 0, 100), d(parseFloat(e[3]), 0, 100), d(isNaN(i) ? 1 : i, 0, 1)]; } } }function s(t, e) { return void 0 === e && (e = void 0 !== t[3] ? t[3] : 1), "rgba(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + e + ")"; }function l(t, e) { return "rgba(" + Math.round(t[0] / 255 * 100) + "%, " + Math.round(t[1] / 255 * 100) + "%, " + Math.round(t[2] / 255 * 100) + "%, " + (e || t[3] || 1) + ")"; }function u(t, e) { return void 0 === e && (e = void 0 !== t[3] ? t[3] : 1), "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + e + ")"; }function d(t, e, i) { return Math.min(Math.max(e, t), i); }function c(t) { var e = t.toString(16).toUpperCase();return e.length < 2 ? "0" + e : e; }e.exports = { getRgba: a, getHsla: o, getRgb: function getRgb(t) { var e = a(t);return e && e.slice(0, 3); }, getHsl: function getHsl(t) { var e = o(t);return e && e.slice(0, 3); }, getHwb: r, getAlpha: function getAlpha(t) { var e = a(t);{ if (e) return e[3];if (e = o(t)) return e[3];if (e = r(t)) return e[3]; } }, hexString: function hexString(t) { return "#" + c(t[0]) + c(t[1]) + c(t[2]); }, rgbString: function rgbString(t, e) { if (e < 1 || t[3] && t[3] < 1) return s(t, e);return "rgb(" + t[0] + ", " + t[1] + ", " + t[2] + ")"; }, rgbaString: s, percentString: function percentString(t, e) { if (e < 1 || t[3] && t[3] < 1) return l(t, e);var i = Math.round(t[0] / 255 * 100), n = Math.round(t[1] / 255 * 100), a = Math.round(t[2] / 255 * 100);return "rgb(" + i + "%, " + n + "%, " + a + "%)"; }, percentaString: l, hslString: function hslString(t, e) { if (e < 1 || t[3] && t[3] < 1) return u(t, e);return "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)"; }, hslaString: u, hwbString: function hwbString(t, e) { void 0 === e && (e = void 0 !== t[3] ? t[3] : 1);return "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + (void 0 !== e && 1 !== e ? ", " + e : "") + ")"; }, keyword: function keyword(t) { return h[t.slice(0, 3)]; } };var h = {};for (var f in n) { h[n[f]] = f; } }, { 6: 6 }], 3: [function (t, e, i) { var n = t(5), a = t(2), o = function o(t) { return t instanceof o ? t : this instanceof o ? (this.valid = !1, this.values = { rgb: [0, 0, 0], hsl: [0, 0, 0], hsv: [0, 0, 0], hwb: [0, 0, 0], cmyk: [0, 0, 0, 0], alpha: 1 }, void ("string" == typeof t ? (e = a.getRgba(t)) ? this.setValues("rgb", e) : (e = a.getHsla(t)) ? this.setValues("hsl", e) : (e = a.getHwb(t)) && this.setValues("hwb", e) : "object" == (typeof t === "undefined" ? "undefined" : _typeof(t)) && (void 0 !== (e = t).r || void 0 !== e.red ? this.setValues("rgb", e) : void 0 !== e.l || void 0 !== e.lightness ? this.setValues("hsl", e) : void 0 !== e.v || void 0 !== e.value ? this.setValues("hsv", e) : void 0 !== e.w || void 0 !== e.whiteness ? this.setValues("hwb", e) : void 0 === e.c && void 0 === e.cyan || this.setValues("cmyk", e)))) : new o(t);var e; };o.prototype = { isValid: function isValid() { return this.valid; }, rgb: function rgb() { return this.setSpace("rgb", arguments); }, hsl: function hsl() { return this.setSpace("hsl", arguments); }, hsv: function hsv() { return this.setSpace("hsv", arguments); }, hwb: function hwb() { return this.setSpace("hwb", arguments); }, cmyk: function cmyk() { return this.setSpace("cmyk", arguments); }, rgbArray: function rgbArray() { return this.values.rgb; }, hslArray: function hslArray() { return this.values.hsl; }, hsvArray: function hsvArray() { return this.values.hsv; }, hwbArray: function hwbArray() { var t = this.values;return 1 !== t.alpha ? t.hwb.concat([t.alpha]) : t.hwb; }, cmykArray: function cmykArray() { return this.values.cmyk; }, rgbaArray: function rgbaArray() { var t = this.values;return t.rgb.concat([t.alpha]); }, hslaArray: function hslaArray() { var t = this.values;return t.hsl.concat([t.alpha]); }, alpha: function alpha(t) { return void 0 === t ? this.values.alpha : (this.setValues("alpha", t), this); }, red: function red(t) { return this.setChannel("rgb", 0, t); }, green: function green(t) { return this.setChannel("rgb", 1, t); }, blue: function blue(t) { return this.setChannel("rgb", 2, t); }, hue: function hue(t) { return t && (t = (t %= 360) < 0 ? 360 + t : t), this.setChannel("hsl", 0, t); }, saturation: function saturation(t) { return this.setChannel("hsl", 1, t); }, lightness: function lightness(t) { return this.setChannel("hsl", 2, t); }, saturationv: function saturationv(t) { return this.setChannel("hsv", 1, t); }, whiteness: function whiteness(t) { return this.setChannel("hwb", 1, t); }, blackness: function blackness(t) { return this.setChannel("hwb", 2, t); }, value: function value(t) { return this.setChannel("hsv", 2, t); }, cyan: function cyan(t) { return this.setChannel("cmyk", 0, t); }, magenta: function magenta(t) { return this.setChannel("cmyk", 1, t); }, yellow: function yellow(t) { return this.setChannel("cmyk", 2, t); }, black: function black(t) { return this.setChannel("cmyk", 3, t); }, hexString: function hexString() { return a.hexString(this.values.rgb); }, rgbString: function rgbString() { return a.rgbString(this.values.rgb, this.values.alpha); }, rgbaString: function rgbaString() { return a.rgbaString(this.values.rgb, this.values.alpha); }, percentString: function percentString() { return a.percentString(this.values.rgb, this.values.alpha); }, hslString: function hslString() { return a.hslString(this.values.hsl, this.values.alpha); }, hslaString: function hslaString() { return a.hslaString(this.values.hsl, this.values.alpha); }, hwbString: function hwbString() { return a.hwbString(this.values.hwb, this.values.alpha); }, keyword: function keyword() { return a.keyword(this.values.rgb, this.values.alpha); }, rgbNumber: function rgbNumber() { var t = this.values.rgb;return t[0] << 16 | t[1] << 8 | t[2]; }, luminosity: function luminosity() { for (var t = this.values.rgb, e = [], i = 0; i < t.length; i++) { var n = t[i] / 255;e[i] = n <= .03928 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4); }return .2126 * e[0] + .7152 * e[1] + .0722 * e[2]; }, contrast: function contrast(t) { var e = this.luminosity(), i = t.luminosity();return e > i ? (e + .05) / (i + .05) : (i + .05) / (e + .05); }, level: function level(t) { var e = this.contrast(t);return e >= 7.1 ? "AAA" : e >= 4.5 ? "AA" : ""; }, dark: function dark() { var t = this.values.rgb;return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128; }, light: function light() { return !this.dark(); }, negate: function negate() { for (var t = [], e = 0; e < 3; e++) { t[e] = 255 - this.values.rgb[e]; }return this.setValues("rgb", t), this; }, lighten: function lighten(t) { var e = this.values.hsl;return e[2] += e[2] * t, this.setValues("hsl", e), this; }, darken: function darken(t) { var e = this.values.hsl;return e[2] -= e[2] * t, this.setValues("hsl", e), this; }, saturate: function saturate(t) { var e = this.values.hsl;return e[1] += e[1] * t, this.setValues("hsl", e), this; }, desaturate: function desaturate(t) { var e = this.values.hsl;return e[1] -= e[1] * t, this.setValues("hsl", e), this; }, whiten: function whiten(t) { var e = this.values.hwb;return e[1] += e[1] * t, this.setValues("hwb", e), this; }, blacken: function blacken(t) { var e = this.values.hwb;return e[2] += e[2] * t, this.setValues("hwb", e), this; }, greyscale: function greyscale() { var t = this.values.rgb, e = .3 * t[0] + .59 * t[1] + .11 * t[2];return this.setValues("rgb", [e, e, e]), this; }, clearer: function clearer(t) { var e = this.values.alpha;return this.setValues("alpha", e - e * t), this; }, opaquer: function opaquer(t) { var e = this.values.alpha;return this.setValues("alpha", e + e * t), this; }, rotate: function rotate(t) { var e = this.values.hsl, i = (e[0] + t) % 360;return e[0] = i < 0 ? 360 + i : i, this.setValues("hsl", e), this; }, mix: function mix(t, e) { var i = this, n = t, a = void 0 === e ? .5 : e, o = 2 * a - 1, r = i.alpha() - n.alpha(), s = ((o * r == -1 ? o : (o + r) / (1 + o * r)) + 1) / 2, l = 1 - s;return this.rgb(s * i.red() + l * n.red(), s * i.green() + l * n.green(), s * i.blue() + l * n.blue()).alpha(i.alpha() * a + n.alpha() * (1 - a)); }, toJSON: function toJSON() { return this.rgb(); }, clone: function clone() { var t, e, i = new o(), n = this.values, a = i.values;for (var r in n) { n.hasOwnProperty(r) && (t = n[r], "[object Array]" === (e = {}.toString.call(t)) ? a[r] = t.slice(0) : "[object Number]" === e ? a[r] = t : console.error("unexpected color value:", t)); }return i; } }, o.prototype.spaces = { rgb: ["red", "green", "blue"], hsl: ["hue", "saturation", "lightness"], hsv: ["hue", "saturation", "value"], hwb: ["hue", "whiteness", "blackness"], cmyk: ["cyan", "magenta", "yellow", "black"] }, o.prototype.maxes = { rgb: [255, 255, 255], hsl: [360, 100, 100], hsv: [360, 100, 100], hwb: [360, 100, 100], cmyk: [100, 100, 100, 100] }, o.prototype.getValues = function (t) { for (var e = this.values, i = {}, n = 0; n < t.length; n++) { i[t.charAt(n)] = e[t][n]; }return 1 !== e.alpha && (i.a = e.alpha), i; }, o.prototype.setValues = function (t, e) { var i, a, o = this.values, r = this.spaces, s = this.maxes, l = 1;if (this.valid = !0, "alpha" === t) l = e;else if (e.length) o[t] = e.slice(0, t.length), l = e[t.length];else if (void 0 !== e[t.charAt(0)]) { for (i = 0; i < t.length; i++) { o[t][i] = e[t.charAt(i)]; }l = e.a; } else if (void 0 !== e[r[t][0]]) { var u = r[t];for (i = 0; i < t.length; i++) { o[t][i] = e[u[i]]; }l = e.alpha; }if (o.alpha = Math.max(0, Math.min(1, void 0 === l ? o.alpha : l)), "alpha" === t) return !1;for (i = 0; i < t.length; i++) { a = Math.max(0, Math.min(s[t][i], o[t][i])), o[t][i] = Math.round(a); }for (var d in r) { d !== t && (o[d] = n[t][d](o[t])); }return !0; }, o.prototype.setSpace = function (t, e) { var i = e[0];return void 0 === i ? this.getValues(t) : ("number" == typeof i && (i = Array.prototype.slice.call(e)), this.setValues(t, i), this); }, o.prototype.setChannel = function (t, e, i) { var n = this.values[t];return void 0 === i ? n[e] : i === n[e] ? this : (n[e] = i, this.setValues(t, n), this); }, "undefined" != typeof window && (window.Color = o), e.exports = o; }, { 2: 2, 5: 5 }], 4: [function (t, e, i) { function n(t) { var e, i, n = t[0] / 255, a = t[1] / 255, o = t[2] / 255, r = Math.min(n, a, o), s = Math.max(n, a, o), l = s - r;return s == r ? e = 0 : n == s ? e = (a - o) / l : a == s ? e = 2 + (o - n) / l : o == s && (e = 4 + (n - a) / l), (e = Math.min(60 * e, 360)) < 0 && (e += 360), i = (r + s) / 2, [e, 100 * (s == r ? 0 : i <= .5 ? l / (s + r) : l / (2 - s - r)), 100 * i]; }function a(t) { var e, i, n = t[0], a = t[1], o = t[2], r = Math.min(n, a, o), s = Math.max(n, a, o), l = s - r;return i = 0 == s ? 0 : l / s * 1e3 / 10, s == r ? e = 0 : n == s ? e = (a - o) / l : a == s ? e = 2 + (o - n) / l : o == s && (e = 4 + (n - a) / l), (e = Math.min(60 * e, 360)) < 0 && (e += 360), [e, i, s / 255 * 1e3 / 10]; }function o(t) { var e = t[0], i = t[1], a = t[2];return [n(t)[0], 100 * (1 / 255 * Math.min(e, Math.min(i, a))), 100 * (a = 1 - 1 / 255 * Math.max(e, Math.max(i, a)))]; }function s(t) { var e, i = t[0] / 255, n = t[1] / 255, a = t[2] / 255;return [100 * ((1 - i - (e = Math.min(1 - i, 1 - n, 1 - a))) / (1 - e) || 0), 100 * ((1 - n - e) / (1 - e) || 0), 100 * ((1 - a - e) / (1 - e) || 0), 100 * e]; }function l(t) { return C[JSON.stringify(t)]; }function u(t) { var e = t[0] / 255, i = t[1] / 255, n = t[2] / 255;return [100 * (.4124 * (e = e > .04045 ? Math.pow((e + .055) / 1.055, 2.4) : e / 12.92) + .3576 * (i = i > .04045 ? Math.pow((i + .055) / 1.055, 2.4) : i / 12.92) + .1805 * (n = n > .04045 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92)), 100 * (.2126 * e + .7152 * i + .0722 * n), 100 * (.0193 * e + .1192 * i + .9505 * n)]; }function d(t) { var e = u(t), i = e[0], n = e[1], a = e[2];return n /= 100, a /= 108.883, i = (i /= 95.047) > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116, [116 * (n = n > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (i - n), 200 * (n - (a = a > .008856 ? Math.pow(a, 1 / 3) : 7.787 * a + 16 / 116))]; }function c(t) { var e, i, n, a, o, r = t[0] / 360, s = t[1] / 100, l = t[2] / 100;if (0 == s) return [o = 255 * l, o, o];e = 2 * l - (i = l < .5 ? l * (1 + s) : l + s - l * s), a = [0, 0, 0];for (var u = 0; u < 3; u++) { (n = r + 1 / 3 * -(u - 1)) < 0 && n++, n > 1 && n--, o = 6 * n < 1 ? e + 6 * (i - e) * n : 2 * n < 1 ? i : 3 * n < 2 ? e + (i - e) * (2 / 3 - n) * 6 : e, a[u] = 255 * o; }return a; }function h(t) { var e = t[0] / 60, i = t[1] / 100, n = t[2] / 100, a = Math.floor(e) % 6, o = e - Math.floor(e), r = 255 * n * (1 - i), s = 255 * n * (1 - i * o), l = 255 * n * (1 - i * (1 - o));n *= 255;switch (a) {case 0: return [n, l, r];case 1: return [s, n, r];case 2: return [r, n, l];case 3: return [r, s, n];case 4: return [l, r, n];case 5: return [n, r, s];} }function f(t) { var e, i, n, a, o = t[0] / 360, s = t[1] / 100, l = t[2] / 100, u = s + l;switch (u > 1 && (s /= u, l /= u), n = 6 * o - (e = Math.floor(6 * o)), 0 != (1 & e) && (n = 1 - n), a = s + n * ((i = 1 - l) - s), e) {default:case 6:case 0: r = i, g = a, b = s;break;case 1: r = a, g = i, b = s;break;case 2: r = s, g = i, b = a;break;case 3: r = s, g = a, b = i;break;case 4: r = a, g = s, b = i;break;case 5: r = i, g = s, b = a;}return [255 * r, 255 * g, 255 * b]; }function p(t) { var e = t[0] / 100, i = t[1] / 100, n = t[2] / 100, a = t[3] / 100;return [255 * (1 - Math.min(1, e * (1 - a) + a)), 255 * (1 - Math.min(1, i * (1 - a) + a)), 255 * (1 - Math.min(1, n * (1 - a) + a))]; }function m(t) { var e, i, n, a = t[0] / 100, o = t[1] / 100, r = t[2] / 100;return i = -.9689 * a + 1.8758 * o + .0415 * r, n = .0557 * a + -.204 * o + 1.057 * r, e = (e = 3.2406 * a + -1.5372 * o + -.4986 * r) > .0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - .055 : e *= 12.92, i = i > .0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - .055 : i *= 12.92, n = n > .0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - .055 : n *= 12.92, [255 * (e = Math.min(Math.max(0, e), 1)), 255 * (i = Math.min(Math.max(0, i), 1)), 255 * (n = Math.min(Math.max(0, n), 1))]; }function v(t) { var e = t[0], i = t[1], n = t[2];return i /= 100, n /= 108.883, e = (e /= 95.047) > .008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116, [116 * (i = i > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116) - 16, 500 * (e - i), 200 * (i - (n = n > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116))]; }function x(t) { var e, i, n, a, o = t[0], r = t[1], s = t[2];return o <= 8 ? a = (i = 100 * o / 903.3) / 100 * 7.787 + 16 / 116 : (i = 100 * Math.pow((o + 16) / 116, 3), a = Math.pow(i / 100, 1 / 3)), [e = e / 95.047 <= .008856 ? e = 95.047 * (r / 500 + a - 16 / 116) / 7.787 : 95.047 * Math.pow(r / 500 + a, 3), i, n = n / 108.883 <= .008859 ? n = 108.883 * (a - s / 200 - 16 / 116) / 7.787 : 108.883 * Math.pow(a - s / 200, 3)]; }function y(t) { var e, i = t[0], n = t[1], a = t[2];return (e = 360 * Math.atan2(a, n) / 2 / Math.PI) < 0 && (e += 360), [i, Math.sqrt(n * n + a * a), e]; }function k(t) { return m(x(t)); }function M(t) { var e, i = t[0], n = t[1];return e = t[2] / 360 * 2 * Math.PI, [i, n * Math.cos(e), n * Math.sin(e)]; }function w(t) { return S[t]; }e.exports = { rgb2hsl: n, rgb2hsv: a, rgb2hwb: o, rgb2cmyk: s, rgb2keyword: l, rgb2xyz: u, rgb2lab: d, rgb2lch: function rgb2lch(t) { return y(d(t)); }, hsl2rgb: c, hsl2hsv: function hsl2hsv(t) { var e = t[0], i = t[1] / 100, n = t[2] / 100;if (0 === n) return [0, 0, 0];return [e, 100 * (2 * (i *= (n *= 2) <= 1 ? n : 2 - n) / (n + i)), 100 * ((n + i) / 2)]; }, hsl2hwb: function hsl2hwb(t) { return o(c(t)); }, hsl2cmyk: function hsl2cmyk(t) { return s(c(t)); }, hsl2keyword: function hsl2keyword(t) { return l(c(t)); }, hsv2rgb: h, hsv2hsl: function hsv2hsl(t) { var e, i, n = t[0], a = t[1] / 100, o = t[2] / 100;return e = a * o, [n, 100 * (e = (e /= (i = (2 - a) * o) <= 1 ? i : 2 - i) || 0), 100 * (i /= 2)]; }, hsv2hwb: function hsv2hwb(t) { return o(h(t)); }, hsv2cmyk: function hsv2cmyk(t) { return s(h(t)); }, hsv2keyword: function hsv2keyword(t) { return l(h(t)); }, hwb2rgb: f, hwb2hsl: function hwb2hsl(t) { return n(f(t)); }, hwb2hsv: function hwb2hsv(t) { return a(f(t)); }, hwb2cmyk: function hwb2cmyk(t) { return s(f(t)); }, hwb2keyword: function hwb2keyword(t) { return l(f(t)); }, cmyk2rgb: p, cmyk2hsl: function cmyk2hsl(t) { return n(p(t)); }, cmyk2hsv: function cmyk2hsv(t) { return a(p(t)); }, cmyk2hwb: function cmyk2hwb(t) { return o(p(t)); }, cmyk2keyword: function cmyk2keyword(t) { return l(p(t)); }, keyword2rgb: w, keyword2hsl: function keyword2hsl(t) { return n(w(t)); }, keyword2hsv: function keyword2hsv(t) { return a(w(t)); }, keyword2hwb: function keyword2hwb(t) { return o(w(t)); }, keyword2cmyk: function keyword2cmyk(t) { return s(w(t)); }, keyword2lab: function keyword2lab(t) { return d(w(t)); }, keyword2xyz: function keyword2xyz(t) { return u(w(t)); }, xyz2rgb: m, xyz2lab: v, xyz2lch: function xyz2lch(t) { return y(v(t)); }, lab2xyz: x, lab2rgb: k, lab2lch: y, lch2lab: M, lch2xyz: function lch2xyz(t) { return x(M(t)); }, lch2rgb: function lch2rgb(t) { return k(M(t)); } };var S = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }, C = {};for (var _ in S) { C[JSON.stringify(S[_])] = _; } }, {}], 5: [function (t, e, i) { var n = t(4), a = function a() { return new u(); };for (var o in n) { a[o + "Raw"] = function (t) { return function (e) { return "number" == typeof e && (e = Array.prototype.slice.call(arguments)), n[t](e); }; }(o);var r = /(\w+)2(\w+)/.exec(o), s = r[1], l = r[2];(a[s] = a[s] || {})[l] = a[o] = function (t) { return function (e) { "number" == typeof e && (e = Array.prototype.slice.call(arguments));var i = n[t](e);if ("string" == typeof i || void 0 === i) return i;for (var a = 0; a < i.length; a++) { i[a] = Math.round(i[a]); }return i; }; }(o); }var u = function u() { this.convs = {}; };u.prototype.routeSpace = function (t, e) { var i = e[0];return void 0 === i ? this.getValues(t) : ("number" == typeof i && (i = Array.prototype.slice.call(e)), this.setValues(t, i)); }, u.prototype.setValues = function (t, e) { return this.space = t, this.convs = {}, this.convs[t] = e, this; }, u.prototype.getValues = function (t) { var e = this.convs[t];if (!e) { var i = this.space, n = this.convs[i];e = a[i][t](n), this.convs[t] = e; }return e; }, ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function (t) { u.prototype[t] = function (e) { return this.routeSpace(t, arguments); }; }), e.exports = a; }, { 4: 4 }], 6: [function (t, e, i) { "use strict"; e.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }; }, {}], 7: [function (t, e, i) { var n = t(29)();n.helpers = t(45), t(27)(n), n.defaults = t(25), n.Element = t(26), n.elements = t(40), n.Interaction = t(28), n.layouts = t(30), n.platform = t(48), n.plugins = t(31), n.Ticks = t(34), t(22)(n), t(23)(n), t(24)(n), t(33)(n), t(32)(n), t(35)(n), t(55)(n), t(53)(n), t(54)(n), t(56)(n), t(57)(n), t(58)(n), t(15)(n), t(16)(n), t(17)(n), t(18)(n), t(19)(n), t(20)(n), t(21)(n), t(8)(n), t(9)(n), t(10)(n), t(11)(n), t(12)(n), t(13)(n), t(14)(n);var a = t(49);for (var o in a) { a.hasOwnProperty(o) && n.plugins.register(a[o]); }n.platform.initialize(), e.exports = n, "undefined" != typeof window && (window.Chart = n), n.Legend = a.legend._element, n.Title = a.title._element, n.pluginService = n.plugins, n.PluginBase = n.Element.extend({}), n.canvasHelpers = n.helpers.canvas, n.layoutService = n.layouts; }, { 10: 10, 11: 11, 12: 12, 13: 13, 14: 14, 15: 15, 16: 16, 17: 17, 18: 18, 19: 19, 20: 20, 21: 21, 22: 22, 23: 23, 24: 24, 25: 25, 26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 40: 40, 45: 45, 48: 48, 49: 49, 53: 53, 54: 54, 55: 55, 56: 56, 57: 57, 58: 58, 8: 8, 9: 9 }], 8: [function (t, e, i) { "use strict"; e.exports = function (t) { t.Bar = function (e, i) { return i.type = "bar", new t(e, i); }; }; }, {}], 9: [function (t, e, i) { "use strict"; e.exports = function (t) { t.Bubble = function (e, i) { return i.type = "bubble", new t(e, i); }; }; }, {}], 10: [function (t, e, i) { "use strict"; e.exports = function (t) { t.Doughnut = function (e, i) { return i.type = "doughnut", new t(e, i); }; }; }, {}], 11: [function (t, e, i) { "use strict"; e.exports = function (t) { t.Line = function (e, i) { return i.type = "line", new t(e, i); }; }; }, {}], 12: [function (t, e, i) { "use strict"; e.exports = function (t) { t.PolarArea = function (e, i) { return i.type = "polarArea", new t(e, i); }; }; }, {}], 13: [function (t, e, i) { "use strict"; e.exports = function (t) { t.Radar = function (e, i) { return i.type = "radar", new t(e, i); }; }; }, {}], 14: [function (t, e, i) { "use strict"; e.exports = function (t) { t.Scatter = function (e, i) { return i.type = "scatter", new t(e, i); }; }; }, {}], 15: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("bar", { hover: { mode: "label" }, scales: { xAxes: [{ type: "category", categoryPercentage: .8, barPercentage: .9, offset: !0, gridLines: { offsetGridLines: !0 } }], yAxes: [{ type: "linear" }] } }), n._set("horizontalBar", { hover: { mode: "index", axis: "y" }, scales: { xAxes: [{ type: "linear", position: "bottom" }], yAxes: [{ position: "left", type: "category", categoryPercentage: .8, barPercentage: .9, offset: !0, gridLines: { offsetGridLines: !0 } }] }, elements: { rectangle: { borderSkipped: "left" } }, tooltips: { callbacks: { title: function title(t, e) { var i = "";return t.length > 0 && (t[0].yLabel ? i = t[0].yLabel : e.labels.length > 0 && t[0].index < e.labels.length && (i = e.labels[t[0].index])), i; }, label: function label(t, e) { return (e.datasets[t.datasetIndex].label || "") + ": " + t.xLabel; } }, mode: "index", axis: "y" } }), e.exports = function (t) { t.controllers.bar = t.DatasetController.extend({ dataElementType: a.Rectangle, initialize: function initialize() { var e;t.DatasetController.prototype.initialize.apply(this, arguments), (e = this.getMeta()).stack = this.getDataset().stack, e.bar = !0; }, update: function update(t) { var e, i, n = this.getMeta().data;for (this._ruler = this.getRuler(), e = 0, i = n.length; e < i; ++e) { this.updateElement(n[e], e, t); } }, updateElement: function updateElement(t, e, i) { var n = this, a = n.chart, r = n.getMeta(), s = n.getDataset(), l = t.custom || {}, u = a.options.elements.rectangle;t._xScale = n.getScaleForId(r.xAxisID), t._yScale = n.getScaleForId(r.yAxisID), t._datasetIndex = n.index, t._index = e, t._model = { datasetLabel: s.label, label: a.data.labels[e], borderSkipped: l.borderSkipped ? l.borderSkipped : u.borderSkipped, backgroundColor: l.backgroundColor ? l.backgroundColor : o.valueAtIndexOrDefault(s.backgroundColor, e, u.backgroundColor), borderColor: l.borderColor ? l.borderColor : o.valueAtIndexOrDefault(s.borderColor, e, u.borderColor), borderWidth: l.borderWidth ? l.borderWidth : o.valueAtIndexOrDefault(s.borderWidth, e, u.borderWidth) }, n.updateElementGeometry(t, e, i), t.pivot(); }, updateElementGeometry: function updateElementGeometry(t, e, i) { var n = this, a = t._model, o = n.getValueScale(), r = o.getBasePixel(), s = o.isHorizontal(), l = n._ruler || n.getRuler(), u = n.calculateBarValuePixels(n.index, e), d = n.calculateBarIndexPixels(n.index, e, l);a.horizontal = s, a.base = i ? r : u.base, a.x = s ? i ? r : u.head : d.center, a.y = s ? d.center : i ? r : u.head, a.height = s ? d.size : void 0, a.width = s ? void 0 : d.size; }, getValueScaleId: function getValueScaleId() { return this.getMeta().yAxisID; }, getIndexScaleId: function getIndexScaleId() { return this.getMeta().xAxisID; }, getValueScale: function getValueScale() { return this.getScaleForId(this.getValueScaleId()); }, getIndexScale: function getIndexScale() { return this.getScaleForId(this.getIndexScaleId()); }, _getStacks: function _getStacks(t) { var e, i, n = this.chart, a = this.getIndexScale().options.stacked, o = void 0 === t ? n.data.datasets.length : t + 1, r = [];for (e = 0; e < o; ++e) { (i = n.getDatasetMeta(e)).bar && n.isDatasetVisible(e) && (!1 === a || !0 === a && -1 === r.indexOf(i.stack) || void 0 === a && (void 0 === i.stack || -1 === r.indexOf(i.stack))) && r.push(i.stack); }return r; }, getStackCount: function getStackCount() { return this._getStacks().length; }, getStackIndex: function getStackIndex(t, e) { var i = this._getStacks(t), n = void 0 !== e ? i.indexOf(e) : -1;return -1 === n ? i.length - 1 : n; }, getRuler: function getRuler() { var t, e, i = this.getIndexScale(), n = this.getStackCount(), a = this.index, r = i.isHorizontal(), s = r ? i.left : i.top, l = s + (r ? i.width : i.height), u = [];for (t = 0, e = this.getMeta().data.length; t < e; ++t) { u.push(i.getPixelForValue(null, t, a)); }return { min: o.isNullOrUndef(i.options.barThickness) ? function (t, e) { var i, n, a, o, r = t.isHorizontal() ? t.width : t.height, s = t.getTicks();for (a = 1, o = e.length; a < o; ++a) { r = Math.min(r, e[a] - e[a - 1]); }for (a = 0, o = s.length; a < o; ++a) { n = t.getPixelForTick(a), r = a > 0 ? Math.min(r, n - i) : r, i = n; }return r; }(i, u) : -1, pixels: u, start: s, end: l, stackCount: n, scale: i }; }, calculateBarValuePixels: function calculateBarValuePixels(t, e) { var i, n, a, o, r, s, l = this.chart, u = this.getMeta(), d = this.getValueScale(), c = l.data.datasets, h = d.getRightValue(c[t].data[e]), f = d.options.stacked, g = u.stack, p = 0;if (f || void 0 === f && void 0 !== g) for (i = 0; i < t; ++i) { (n = l.getDatasetMeta(i)).bar && n.stack === g && n.controller.getValueScaleId() === d.id && l.isDatasetVisible(i) && (a = d.getRightValue(c[i].data[e]), (h < 0 && a < 0 || h >= 0 && a > 0) && (p += a)); }return o = d.getPixelForValue(p), { size: s = ((r = d.getPixelForValue(p + h)) - o) / 2, base: o, head: r, center: r + s / 2 }; }, calculateBarIndexPixels: function calculateBarIndexPixels(t, e, i) { var n, a, r, s, l, u, d, c, h, f, g, p, m, v, b, x, y, k = i.scale.options, M = "flex" === k.barThickness ? (h = e, g = k, m = (f = i).pixels, v = m[h], b = h > 0 ? m[h - 1] : null, x = h < m.length - 1 ? m[h + 1] : null, y = g.categoryPercentage, null === b && (b = v - (null === x ? f.end - v : x - v)), null === x && (x = v + v - b), p = v - (v - b) / 2 * y, { chunk: (x - b) / 2 * y / f.stackCount, ratio: g.barPercentage, start: p }) : (n = e, a = i, u = (r = k).barThickness, d = a.stackCount, c = a.pixels[n], o.isNullOrUndef(u) ? (s = a.min * r.categoryPercentage, l = r.barPercentage) : (s = u * d, l = 1), { chunk: s / d, ratio: l, start: c - s / 2 }), w = this.getStackIndex(t, this.getMeta().stack), S = M.start + M.chunk * w + M.chunk / 2, C = Math.min(o.valueOrDefault(k.maxBarThickness, 1 / 0), M.chunk * M.ratio);return { base: S - C / 2, head: S + C / 2, center: S, size: C }; }, draw: function draw() { var t = this.chart, e = this.getValueScale(), i = this.getMeta().data, n = this.getDataset(), a = i.length, r = 0;for (o.canvas.clipArea(t.ctx, t.chartArea); r < a; ++r) { isNaN(e.getRightValue(n.data[r])) || i[r].draw(); }o.canvas.unclipArea(t.ctx); }, setHoverStyle: function setHoverStyle(t) { var e = this.chart.data.datasets[t._datasetIndex], i = t._index, n = t.custom || {}, a = t._model;a.backgroundColor = n.hoverBackgroundColor ? n.hoverBackgroundColor : o.valueAtIndexOrDefault(e.hoverBackgroundColor, i, o.getHoverColor(a.backgroundColor)), a.borderColor = n.hoverBorderColor ? n.hoverBorderColor : o.valueAtIndexOrDefault(e.hoverBorderColor, i, o.getHoverColor(a.borderColor)), a.borderWidth = n.hoverBorderWidth ? n.hoverBorderWidth : o.valueAtIndexOrDefault(e.hoverBorderWidth, i, a.borderWidth); }, removeHoverStyle: function removeHoverStyle(t) { var e = this.chart.data.datasets[t._datasetIndex], i = t._index, n = t.custom || {}, a = t._model, r = this.chart.options.elements.rectangle;a.backgroundColor = n.backgroundColor ? n.backgroundColor : o.valueAtIndexOrDefault(e.backgroundColor, i, r.backgroundColor), a.borderColor = n.borderColor ? n.borderColor : o.valueAtIndexOrDefault(e.borderColor, i, r.borderColor), a.borderWidth = n.borderWidth ? n.borderWidth : o.valueAtIndexOrDefault(e.borderWidth, i, r.borderWidth); } }), t.controllers.horizontalBar = t.controllers.bar.extend({ getValueScaleId: function getValueScaleId() { return this.getMeta().xAxisID; }, getIndexScaleId: function getIndexScaleId() { return this.getMeta().yAxisID; } }); }; }, { 25: 25, 40: 40, 45: 45 }], 16: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("bubble", { hover: { mode: "single" }, scales: { xAxes: [{ type: "linear", position: "bottom", id: "x-axis-0" }], yAxes: [{ type: "linear", position: "left", id: "y-axis-0" }] }, tooltips: { callbacks: { title: function title() { return ""; }, label: function label(t, e) { var i = e.datasets[t.datasetIndex].label || "", n = e.datasets[t.datasetIndex].data[t.index];return i + ": (" + t.xLabel + ", " + t.yLabel + ", " + n.r + ")"; } } } }), e.exports = function (t) { t.controllers.bubble = t.DatasetController.extend({ dataElementType: a.Point, update: function update(t) { var e = this, i = e.getMeta().data;o.each(i, function (i, n) { e.updateElement(i, n, t); }); }, updateElement: function updateElement(t, e, i) { var n = this, a = n.getMeta(), o = t.custom || {}, r = n.getScaleForId(a.xAxisID), s = n.getScaleForId(a.yAxisID), l = n._resolveElementOptions(t, e), u = n.getDataset().data[e], d = n.index, c = i ? r.getPixelForDecimal(.5) : r.getPixelForValue("object" == (typeof u === "undefined" ? "undefined" : _typeof(u)) ? u : NaN, e, d), h = i ? s.getBasePixel() : s.getPixelForValue(u, e, d);t._xScale = r, t._yScale = s, t._options = l, t._datasetIndex = d, t._index = e, t._model = { backgroundColor: l.backgroundColor, borderColor: l.borderColor, borderWidth: l.borderWidth, hitRadius: l.hitRadius, pointStyle: l.pointStyle, radius: i ? 0 : l.radius, skip: o.skip || isNaN(c) || isNaN(h), x: c, y: h }, t.pivot(); }, setHoverStyle: function setHoverStyle(t) { var e = t._model, i = t._options;e.backgroundColor = o.valueOrDefault(i.hoverBackgroundColor, o.getHoverColor(i.backgroundColor)), e.borderColor = o.valueOrDefault(i.hoverBorderColor, o.getHoverColor(i.borderColor)), e.borderWidth = o.valueOrDefault(i.hoverBorderWidth, i.borderWidth), e.radius = i.radius + i.hoverRadius; }, removeHoverStyle: function removeHoverStyle(t) { var e = t._model, i = t._options;e.backgroundColor = i.backgroundColor, e.borderColor = i.borderColor, e.borderWidth = i.borderWidth, e.radius = i.radius; }, _resolveElementOptions: function _resolveElementOptions(t, e) { var i, n, a, r = this.chart, s = r.data.datasets[this.index], l = t.custom || {}, u = r.options.elements.point, d = o.options.resolve, c = s.data[e], h = {}, f = { chart: r, dataIndex: e, dataset: s, datasetIndex: this.index }, g = ["backgroundColor", "borderColor", "borderWidth", "hoverBackgroundColor", "hoverBorderColor", "hoverBorderWidth", "hoverRadius", "hitRadius", "pointStyle"];for (i = 0, n = g.length; i < n; ++i) { h[a = g[i]] = d([l[a], s[a], u[a]], f, e); }return h.radius = d([l.radius, c ? c.r : void 0, s.radius, u.radius], f, e), h; } }); }; }, { 25: 25, 40: 40, 45: 45 }], 17: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("doughnut", { animation: { animateRotate: !0, animateScale: !1 }, hover: { mode: "single" }, legendCallback: function legendCallback(t) { var e = [];e.push('"), e.join(""); }, legend: { labels: { generateLabels: function generateLabels(t) { var e = t.data;return e.labels.length && e.datasets.length ? e.labels.map(function (i, n) { var a = t.getDatasetMeta(0), r = e.datasets[0], s = a.data[n], l = s && s.custom || {}, u = o.valueAtIndexOrDefault, d = t.options.elements.arc;return { text: i, fillStyle: l.backgroundColor ? l.backgroundColor : u(r.backgroundColor, n, d.backgroundColor), strokeStyle: l.borderColor ? l.borderColor : u(r.borderColor, n, d.borderColor), lineWidth: l.borderWidth ? l.borderWidth : u(r.borderWidth, n, d.borderWidth), hidden: isNaN(r.data[n]) || a.data[n].hidden, index: n }; }) : []; } }, onClick: function onClick(t, e) { var i, n, a, o = e.index, r = this.chart;for (i = 0, n = (r.data.datasets || []).length; i < n; ++i) { (a = r.getDatasetMeta(i)).data[o] && (a.data[o].hidden = !a.data[o].hidden); }r.update(); } }, cutoutPercentage: 50, rotation: -.5 * Math.PI, circumference: 2 * Math.PI, tooltips: { callbacks: { title: function title() { return ""; }, label: function label(t, e) { var i = e.labels[t.index], n = ": " + e.datasets[t.datasetIndex].data[t.index];return o.isArray(i) ? (i = i.slice())[0] += n : i += n, i; } } } }), n._set("pie", o.clone(n.doughnut)), n._set("pie", { cutoutPercentage: 0 }), e.exports = function (t) { t.controllers.doughnut = t.controllers.pie = t.DatasetController.extend({ dataElementType: a.Arc, linkScales: o.noop, getRingIndex: function getRingIndex(t) { for (var e = 0, i = 0; i < t; ++i) { this.chart.isDatasetVisible(i) && ++e; }return e; }, update: function update(t) { var e = this, i = e.chart, n = i.chartArea, a = i.options, r = a.elements.arc, s = n.right - n.left - r.borderWidth, l = n.bottom - n.top - r.borderWidth, u = Math.min(s, l), d = { x: 0, y: 0 }, c = e.getMeta(), h = a.cutoutPercentage, f = a.circumference;if (f < 2 * Math.PI) { var g = a.rotation % (2 * Math.PI), p = (g += 2 * Math.PI * (g >= Math.PI ? -1 : g < -Math.PI ? 1 : 0)) + f, m = Math.cos(g), v = Math.sin(g), b = Math.cos(p), x = Math.sin(p), y = g <= 0 && p >= 0 || g <= 2 * Math.PI && 2 * Math.PI <= p, k = g <= .5 * Math.PI && .5 * Math.PI <= p || g <= 2.5 * Math.PI && 2.5 * Math.PI <= p, M = g <= -Math.PI && -Math.PI <= p || g <= Math.PI && Math.PI <= p, w = g <= .5 * -Math.PI && .5 * -Math.PI <= p || g <= 1.5 * Math.PI && 1.5 * Math.PI <= p, S = h / 100, C = M ? -1 : Math.min(m * (m < 0 ? 1 : S), b * (b < 0 ? 1 : S)), _ = w ? -1 : Math.min(v * (v < 0 ? 1 : S), x * (x < 0 ? 1 : S)), D = y ? 1 : Math.max(m * (m > 0 ? 1 : S), b * (b > 0 ? 1 : S)), I = k ? 1 : Math.max(v * (v > 0 ? 1 : S), x * (x > 0 ? 1 : S)), P = .5 * (D - C), A = .5 * (I - _);u = Math.min(s / P, l / A), d = { x: -.5 * (D + C), y: -.5 * (I + _) }; }i.borderWidth = e.getMaxBorderWidth(c.data), i.outerRadius = Math.max((u - i.borderWidth) / 2, 0), i.innerRadius = Math.max(h ? i.outerRadius / 100 * h : 0, 0), i.radiusLength = (i.outerRadius - i.innerRadius) / i.getVisibleDatasetCount(), i.offsetX = d.x * i.outerRadius, i.offsetY = d.y * i.outerRadius, c.total = e.calculateTotal(), e.outerRadius = i.outerRadius - i.radiusLength * e.getRingIndex(e.index), e.innerRadius = Math.max(e.outerRadius - i.radiusLength, 0), o.each(c.data, function (i, n) { e.updateElement(i, n, t); }); }, updateElement: function updateElement(t, e, i) { var n = this, a = n.chart, r = a.chartArea, s = a.options, l = s.animation, u = (r.left + r.right) / 2, d = (r.top + r.bottom) / 2, c = s.rotation, h = s.rotation, f = n.getDataset(), g = i && l.animateRotate ? 0 : t.hidden ? 0 : n.calculateCircumference(f.data[e]) * (s.circumference / (2 * Math.PI)), p = i && l.animateScale ? 0 : n.innerRadius, m = i && l.animateScale ? 0 : n.outerRadius, v = o.valueAtIndexOrDefault;o.extend(t, { _datasetIndex: n.index, _index: e, _model: { x: u + a.offsetX, y: d + a.offsetY, startAngle: c, endAngle: h, circumference: g, outerRadius: m, innerRadius: p, label: v(f.label, e, a.data.labels[e]) } });var b = t._model;this.removeHoverStyle(t), i && l.animateRotate || (b.startAngle = 0 === e ? s.rotation : n.getMeta().data[e - 1]._model.endAngle, b.endAngle = b.startAngle + b.circumference), t.pivot(); }, removeHoverStyle: function removeHoverStyle(e) { t.DatasetController.prototype.removeHoverStyle.call(this, e, this.chart.options.elements.arc); }, calculateTotal: function calculateTotal() { var t, e = this.getDataset(), i = this.getMeta(), n = 0;return o.each(i.data, function (i, a) { t = e.data[a], isNaN(t) || i.hidden || (n += Math.abs(t)); }), n; }, calculateCircumference: function calculateCircumference(t) { var e = this.getMeta().total;return e > 0 && !isNaN(t) ? 2 * Math.PI * (Math.abs(t) / e) : 0; }, getMaxBorderWidth: function getMaxBorderWidth(t) { for (var e, i, n = 0, a = this.index, o = t.length, r = 0; r < o; r++) { e = t[r]._model ? t[r]._model.borderWidth : 0, n = (i = t[r]._chart ? t[r]._chart.config.data.datasets[a].hoverBorderWidth : 0) > (n = e > n ? e : n) ? i : n; }return n; } }); }; }, { 25: 25, 40: 40, 45: 45 }], 18: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("line", { showLines: !0, spanGaps: !1, hover: { mode: "label" }, scales: { xAxes: [{ type: "category", id: "x-axis-0" }], yAxes: [{ type: "linear", id: "y-axis-0" }] } }), e.exports = function (t) { function e(t, e) { return o.valueOrDefault(t.showLine, e.showLines); }t.controllers.line = t.DatasetController.extend({ datasetElementType: a.Line, dataElementType: a.Point, update: function update(t) { var i, n, a, r = this, s = r.getMeta(), l = s.dataset, u = s.data || [], d = r.chart.options, c = d.elements.line, h = r.getScaleForId(s.yAxisID), f = r.getDataset(), g = e(f, d);for (g && (a = l.custom || {}, void 0 !== f.tension && void 0 === f.lineTension && (f.lineTension = f.tension), l._scale = h, l._datasetIndex = r.index, l._children = u, l._model = { spanGaps: f.spanGaps ? f.spanGaps : d.spanGaps, tension: a.tension ? a.tension : o.valueOrDefault(f.lineTension, c.tension), backgroundColor: a.backgroundColor ? a.backgroundColor : f.backgroundColor || c.backgroundColor, borderWidth: a.borderWidth ? a.borderWidth : f.borderWidth || c.borderWidth, borderColor: a.borderColor ? a.borderColor : f.borderColor || c.borderColor, borderCapStyle: a.borderCapStyle ? a.borderCapStyle : f.borderCapStyle || c.borderCapStyle, borderDash: a.borderDash ? a.borderDash : f.borderDash || c.borderDash, borderDashOffset: a.borderDashOffset ? a.borderDashOffset : f.borderDashOffset || c.borderDashOffset, borderJoinStyle: a.borderJoinStyle ? a.borderJoinStyle : f.borderJoinStyle || c.borderJoinStyle, fill: a.fill ? a.fill : void 0 !== f.fill ? f.fill : c.fill, steppedLine: a.steppedLine ? a.steppedLine : o.valueOrDefault(f.steppedLine, c.stepped), cubicInterpolationMode: a.cubicInterpolationMode ? a.cubicInterpolationMode : o.valueOrDefault(f.cubicInterpolationMode, c.cubicInterpolationMode) }, l.pivot()), i = 0, n = u.length; i < n; ++i) { r.updateElement(u[i], i, t); }for (g && 0 !== l._model.tension && r.updateBezierControlPoints(), i = 0, n = u.length; i < n; ++i) { u[i].pivot(); } }, getPointBackgroundColor: function getPointBackgroundColor(t, e) { var i = this.chart.options.elements.point.backgroundColor, n = this.getDataset(), a = t.custom || {};return a.backgroundColor ? i = a.backgroundColor : n.pointBackgroundColor ? i = o.valueAtIndexOrDefault(n.pointBackgroundColor, e, i) : n.backgroundColor && (i = n.backgroundColor), i; }, getPointBorderColor: function getPointBorderColor(t, e) { var i = this.chart.options.elements.point.borderColor, n = this.getDataset(), a = t.custom || {};return a.borderColor ? i = a.borderColor : n.pointBorderColor ? i = o.valueAtIndexOrDefault(n.pointBorderColor, e, i) : n.borderColor && (i = n.borderColor), i; }, getPointBorderWidth: function getPointBorderWidth(t, e) { var i = this.chart.options.elements.point.borderWidth, n = this.getDataset(), a = t.custom || {};return isNaN(a.borderWidth) ? !isNaN(n.pointBorderWidth) || o.isArray(n.pointBorderWidth) ? i = o.valueAtIndexOrDefault(n.pointBorderWidth, e, i) : isNaN(n.borderWidth) || (i = n.borderWidth) : i = a.borderWidth, i; }, updateElement: function updateElement(t, e, i) { var n, a, r = this, s = r.getMeta(), l = t.custom || {}, u = r.getDataset(), d = r.index, c = u.data[e], h = r.getScaleForId(s.yAxisID), f = r.getScaleForId(s.xAxisID), g = r.chart.options.elements.point;void 0 !== u.radius && void 0 === u.pointRadius && (u.pointRadius = u.radius), void 0 !== u.hitRadius && void 0 === u.pointHitRadius && (u.pointHitRadius = u.hitRadius), n = f.getPixelForValue("object" == (typeof c === "undefined" ? "undefined" : _typeof(c)) ? c : NaN, e, d), a = i ? h.getBasePixel() : r.calculatePointY(c, e, d), t._xScale = f, t._yScale = h, t._datasetIndex = d, t._index = e, t._model = { x: n, y: a, skip: l.skip || isNaN(n) || isNaN(a), radius: l.radius || o.valueAtIndexOrDefault(u.pointRadius, e, g.radius), pointStyle: l.pointStyle || o.valueAtIndexOrDefault(u.pointStyle, e, g.pointStyle), backgroundColor: r.getPointBackgroundColor(t, e), borderColor: r.getPointBorderColor(t, e), borderWidth: r.getPointBorderWidth(t, e), tension: s.dataset._model ? s.dataset._model.tension : 0, steppedLine: !!s.dataset._model && s.dataset._model.steppedLine, hitRadius: l.hitRadius || o.valueAtIndexOrDefault(u.pointHitRadius, e, g.hitRadius) }; }, calculatePointY: function calculatePointY(t, e, i) { var n, a, o, r = this.chart, s = this.getMeta(), l = this.getScaleForId(s.yAxisID), u = 0, d = 0;if (l.options.stacked) { for (n = 0; n < i; n++) { if (a = r.data.datasets[n], "line" === (o = r.getDatasetMeta(n)).type && o.yAxisID === l.id && r.isDatasetVisible(n)) { var c = Number(l.getRightValue(a.data[e]));c < 0 ? d += c || 0 : u += c || 0; } }var h = Number(l.getRightValue(t));return h < 0 ? l.getPixelForValue(d + h) : l.getPixelForValue(u + h); }return l.getPixelForValue(t); }, updateBezierControlPoints: function updateBezierControlPoints() { var t, e, i, n, a = this.getMeta(), r = this.chart.chartArea, s = a.data || [];function l(t, e, i) { return Math.max(Math.min(t, i), e); }if (a.dataset._model.spanGaps && (s = s.filter(function (t) { return !t._model.skip; })), "monotone" === a.dataset._model.cubicInterpolationMode) o.splineCurveMonotone(s);else for (t = 0, e = s.length; t < e; ++t) { i = s[t]._model, n = o.splineCurve(o.previousItem(s, t)._model, i, o.nextItem(s, t)._model, a.dataset._model.tension), i.controlPointPreviousX = n.previous.x, i.controlPointPreviousY = n.previous.y, i.controlPointNextX = n.next.x, i.controlPointNextY = n.next.y; }if (this.chart.options.elements.line.capBezierPoints) for (t = 0, e = s.length; t < e; ++t) { (i = s[t]._model).controlPointPreviousX = l(i.controlPointPreviousX, r.left, r.right), i.controlPointPreviousY = l(i.controlPointPreviousY, r.top, r.bottom), i.controlPointNextX = l(i.controlPointNextX, r.left, r.right), i.controlPointNextY = l(i.controlPointNextY, r.top, r.bottom); } }, draw: function draw() { var t = this.chart, i = this.getMeta(), n = i.data || [], a = t.chartArea, r = n.length, s = 0;for (o.canvas.clipArea(t.ctx, a), e(this.getDataset(), t.options) && i.dataset.draw(), o.canvas.unclipArea(t.ctx); s < r; ++s) { n[s].draw(a); } }, setHoverStyle: function setHoverStyle(t) { var e = this.chart.data.datasets[t._datasetIndex], i = t._index, n = t.custom || {}, a = t._model;a.radius = n.hoverRadius || o.valueAtIndexOrDefault(e.pointHoverRadius, i, this.chart.options.elements.point.hoverRadius), a.backgroundColor = n.hoverBackgroundColor || o.valueAtIndexOrDefault(e.pointHoverBackgroundColor, i, o.getHoverColor(a.backgroundColor)), a.borderColor = n.hoverBorderColor || o.valueAtIndexOrDefault(e.pointHoverBorderColor, i, o.getHoverColor(a.borderColor)), a.borderWidth = n.hoverBorderWidth || o.valueAtIndexOrDefault(e.pointHoverBorderWidth, i, a.borderWidth); }, removeHoverStyle: function removeHoverStyle(t) { var e = this, i = e.chart.data.datasets[t._datasetIndex], n = t._index, a = t.custom || {}, r = t._model;void 0 !== i.radius && void 0 === i.pointRadius && (i.pointRadius = i.radius), r.radius = a.radius || o.valueAtIndexOrDefault(i.pointRadius, n, e.chart.options.elements.point.radius), r.backgroundColor = e.getPointBackgroundColor(t, n), r.borderColor = e.getPointBorderColor(t, n), r.borderWidth = e.getPointBorderWidth(t, n); } }); }; }, { 25: 25, 40: 40, 45: 45 }], 19: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("polarArea", { scale: { type: "radialLinear", angleLines: { display: !1 }, gridLines: { circular: !0 }, pointLabels: { display: !1 }, ticks: { beginAtZero: !0 } }, animation: { animateRotate: !0, animateScale: !0 }, startAngle: -.5 * Math.PI, legendCallback: function legendCallback(t) { var e = [];e.push('"), e.join(""); }, legend: { labels: { generateLabels: function generateLabels(t) { var e = t.data;return e.labels.length && e.datasets.length ? e.labels.map(function (i, n) { var a = t.getDatasetMeta(0), r = e.datasets[0], s = a.data[n].custom || {}, l = o.valueAtIndexOrDefault, u = t.options.elements.arc;return { text: i, fillStyle: s.backgroundColor ? s.backgroundColor : l(r.backgroundColor, n, u.backgroundColor), strokeStyle: s.borderColor ? s.borderColor : l(r.borderColor, n, u.borderColor), lineWidth: s.borderWidth ? s.borderWidth : l(r.borderWidth, n, u.borderWidth), hidden: isNaN(r.data[n]) || a.data[n].hidden, index: n }; }) : []; } }, onClick: function onClick(t, e) { var i, n, a, o = e.index, r = this.chart;for (i = 0, n = (r.data.datasets || []).length; i < n; ++i) { (a = r.getDatasetMeta(i)).data[o].hidden = !a.data[o].hidden; }r.update(); } }, tooltips: { callbacks: { title: function title() { return ""; }, label: function label(t, e) { return e.labels[t.index] + ": " + t.yLabel; } } } }), e.exports = function (t) { t.controllers.polarArea = t.DatasetController.extend({ dataElementType: a.Arc, linkScales: o.noop, update: function update(t) { var e = this, i = e.chart, n = i.chartArea, a = e.getMeta(), r = i.options, s = r.elements.arc, l = Math.min(n.right - n.left, n.bottom - n.top);i.outerRadius = Math.max((l - s.borderWidth / 2) / 2, 0), i.innerRadius = Math.max(r.cutoutPercentage ? i.outerRadius / 100 * r.cutoutPercentage : 1, 0), i.radiusLength = (i.outerRadius - i.innerRadius) / i.getVisibleDatasetCount(), e.outerRadius = i.outerRadius - i.radiusLength * e.index, e.innerRadius = e.outerRadius - i.radiusLength, a.count = e.countVisibleElements(), o.each(a.data, function (i, n) { e.updateElement(i, n, t); }); }, updateElement: function updateElement(t, e, i) { for (var n = this, a = n.chart, r = n.getDataset(), s = a.options, l = s.animation, u = a.scale, d = a.data.labels, c = n.calculateCircumference(r.data[e]), h = u.xCenter, f = u.yCenter, g = 0, p = n.getMeta(), m = 0; m < e; ++m) { isNaN(r.data[m]) || p.data[m].hidden || ++g; }var v = s.startAngle, b = t.hidden ? 0 : u.getDistanceFromCenterForValue(r.data[e]), x = v + c * g, y = x + (t.hidden ? 0 : c), k = l.animateScale ? 0 : u.getDistanceFromCenterForValue(r.data[e]);o.extend(t, { _datasetIndex: n.index, _index: e, _scale: u, _model: { x: h, y: f, innerRadius: 0, outerRadius: i ? k : b, startAngle: i && l.animateRotate ? v : x, endAngle: i && l.animateRotate ? v : y, label: o.valueAtIndexOrDefault(d, e, d[e]) } }), n.removeHoverStyle(t), t.pivot(); }, removeHoverStyle: function removeHoverStyle(e) { t.DatasetController.prototype.removeHoverStyle.call(this, e, this.chart.options.elements.arc); }, countVisibleElements: function countVisibleElements() { var t = this.getDataset(), e = this.getMeta(), i = 0;return o.each(e.data, function (e, n) { isNaN(t.data[n]) || e.hidden || i++; }), i; }, calculateCircumference: function calculateCircumference(t) { var e = this.getMeta().count;return e > 0 && !isNaN(t) ? 2 * Math.PI / e : 0; } }); }; }, { 25: 25, 40: 40, 45: 45 }], 20: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("radar", { scale: { type: "radialLinear" }, elements: { line: { tension: 0 } } }), e.exports = function (t) { t.controllers.radar = t.DatasetController.extend({ datasetElementType: a.Line, dataElementType: a.Point, linkScales: o.noop, update: function update(t) { var e = this, i = e.getMeta(), n = i.dataset, a = i.data, r = n.custom || {}, s = e.getDataset(), l = e.chart.options.elements.line, u = e.chart.scale;void 0 !== s.tension && void 0 === s.lineTension && (s.lineTension = s.tension), o.extend(i.dataset, { _datasetIndex: e.index, _scale: u, _children: a, _loop: !0, _model: { tension: r.tension ? r.tension : o.valueOrDefault(s.lineTension, l.tension), backgroundColor: r.backgroundColor ? r.backgroundColor : s.backgroundColor || l.backgroundColor, borderWidth: r.borderWidth ? r.borderWidth : s.borderWidth || l.borderWidth, borderColor: r.borderColor ? r.borderColor : s.borderColor || l.borderColor, fill: r.fill ? r.fill : void 0 !== s.fill ? s.fill : l.fill, borderCapStyle: r.borderCapStyle ? r.borderCapStyle : s.borderCapStyle || l.borderCapStyle, borderDash: r.borderDash ? r.borderDash : s.borderDash || l.borderDash, borderDashOffset: r.borderDashOffset ? r.borderDashOffset : s.borderDashOffset || l.borderDashOffset, borderJoinStyle: r.borderJoinStyle ? r.borderJoinStyle : s.borderJoinStyle || l.borderJoinStyle } }), i.dataset.pivot(), o.each(a, function (i, n) { e.updateElement(i, n, t); }, e), e.updateBezierControlPoints(); }, updateElement: function updateElement(t, e, i) { var n = this, a = t.custom || {}, r = n.getDataset(), s = n.chart.scale, l = n.chart.options.elements.point, u = s.getPointPositionForValue(e, r.data[e]);void 0 !== r.radius && void 0 === r.pointRadius && (r.pointRadius = r.radius), void 0 !== r.hitRadius && void 0 === r.pointHitRadius && (r.pointHitRadius = r.hitRadius), o.extend(t, { _datasetIndex: n.index, _index: e, _scale: s, _model: { x: i ? s.xCenter : u.x, y: i ? s.yCenter : u.y, tension: a.tension ? a.tension : o.valueOrDefault(r.lineTension, n.chart.options.elements.line.tension), radius: a.radius ? a.radius : o.valueAtIndexOrDefault(r.pointRadius, e, l.radius), backgroundColor: a.backgroundColor ? a.backgroundColor : o.valueAtIndexOrDefault(r.pointBackgroundColor, e, l.backgroundColor), borderColor: a.borderColor ? a.borderColor : o.valueAtIndexOrDefault(r.pointBorderColor, e, l.borderColor), borderWidth: a.borderWidth ? a.borderWidth : o.valueAtIndexOrDefault(r.pointBorderWidth, e, l.borderWidth), pointStyle: a.pointStyle ? a.pointStyle : o.valueAtIndexOrDefault(r.pointStyle, e, l.pointStyle), hitRadius: a.hitRadius ? a.hitRadius : o.valueAtIndexOrDefault(r.pointHitRadius, e, l.hitRadius) } }), t._model.skip = a.skip ? a.skip : isNaN(t._model.x) || isNaN(t._model.y); }, updateBezierControlPoints: function updateBezierControlPoints() { var t = this.chart.chartArea, e = this.getMeta();o.each(e.data, function (i, n) { var a = i._model, r = o.splineCurve(o.previousItem(e.data, n, !0)._model, a, o.nextItem(e.data, n, !0)._model, a.tension);a.controlPointPreviousX = Math.max(Math.min(r.previous.x, t.right), t.left), a.controlPointPreviousY = Math.max(Math.min(r.previous.y, t.bottom), t.top), a.controlPointNextX = Math.max(Math.min(r.next.x, t.right), t.left), a.controlPointNextY = Math.max(Math.min(r.next.y, t.bottom), t.top), i.pivot(); }); }, setHoverStyle: function setHoverStyle(t) { var e = this.chart.data.datasets[t._datasetIndex], i = t.custom || {}, n = t._index, a = t._model;a.radius = i.hoverRadius ? i.hoverRadius : o.valueAtIndexOrDefault(e.pointHoverRadius, n, this.chart.options.elements.point.hoverRadius), a.backgroundColor = i.hoverBackgroundColor ? i.hoverBackgroundColor : o.valueAtIndexOrDefault(e.pointHoverBackgroundColor, n, o.getHoverColor(a.backgroundColor)), a.borderColor = i.hoverBorderColor ? i.hoverBorderColor : o.valueAtIndexOrDefault(e.pointHoverBorderColor, n, o.getHoverColor(a.borderColor)), a.borderWidth = i.hoverBorderWidth ? i.hoverBorderWidth : o.valueAtIndexOrDefault(e.pointHoverBorderWidth, n, a.borderWidth); }, removeHoverStyle: function removeHoverStyle(t) { var e = this.chart.data.datasets[t._datasetIndex], i = t.custom || {}, n = t._index, a = t._model, r = this.chart.options.elements.point;a.radius = i.radius ? i.radius : o.valueAtIndexOrDefault(e.pointRadius, n, r.radius), a.backgroundColor = i.backgroundColor ? i.backgroundColor : o.valueAtIndexOrDefault(e.pointBackgroundColor, n, r.backgroundColor), a.borderColor = i.borderColor ? i.borderColor : o.valueAtIndexOrDefault(e.pointBorderColor, n, r.borderColor), a.borderWidth = i.borderWidth ? i.borderWidth : o.valueAtIndexOrDefault(e.pointBorderWidth, n, r.borderWidth); } }); }; }, { 25: 25, 40: 40, 45: 45 }], 21: [function (t, e, i) { "use strict"; t(25)._set("scatter", { hover: { mode: "single" }, scales: { xAxes: [{ id: "x-axis-1", type: "linear", position: "bottom" }], yAxes: [{ id: "y-axis-1", type: "linear", position: "left" }] }, showLines: !1, tooltips: { callbacks: { title: function title() { return ""; }, label: function label(t) { return "(" + t.xLabel + ", " + t.yLabel + ")"; } } } }), e.exports = function (t) { t.controllers.scatter = t.controllers.line; }; }, { 25: 25 }], 22: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45);n._set("global", { animation: { duration: 1e3, easing: "easeOutQuart", onProgress: o.noop, onComplete: o.noop } }), e.exports = function (t) { t.Animation = a.extend({ chart: null, currentStep: 0, numSteps: 60, easing: "", render: null, onAnimationProgress: null, onAnimationComplete: null }), t.animationService = { frameDuration: 17, animations: [], dropFrames: 0, request: null, addAnimation: function addAnimation(t, e, i, n) { var a, o, r = this.animations;for (e.chart = t, n || (t.animating = !0), a = 0, o = r.length; a < o; ++a) { if (r[a].chart === t) return void (r[a] = e); }r.push(e), 1 === r.length && this.requestAnimationFrame(); }, cancelAnimation: function cancelAnimation(t) { var e = o.findIndex(this.animations, function (e) { return e.chart === t; });-1 !== e && (this.animations.splice(e, 1), t.animating = !1); }, requestAnimationFrame: function requestAnimationFrame() { var t = this;null === t.request && (t.request = o.requestAnimFrame.call(window, function () { t.request = null, t.startDigest(); })); }, startDigest: function startDigest() { var t = this, e = Date.now(), i = 0;t.dropFrames > 1 && (i = Math.floor(t.dropFrames), t.dropFrames = t.dropFrames % 1), t.advance(1 + i);var n = Date.now();t.dropFrames += (n - e) / t.frameDuration, t.animations.length > 0 && t.requestAnimationFrame(); }, advance: function advance(t) { for (var e, i, n = this.animations, a = 0; a < n.length;) { i = (e = n[a]).chart, e.currentStep = (e.currentStep || 0) + t, e.currentStep = Math.min(e.currentStep, e.numSteps), o.callback(e.render, [i, e], i), o.callback(e.onAnimationProgress, [e], i), e.currentStep >= e.numSteps ? (o.callback(e.onAnimationComplete, [e], i), i.animating = !1, n.splice(a, 1)) : ++a; } } }, Object.defineProperty(t.Animation.prototype, "animationObject", { get: function get() { return this; } }), Object.defineProperty(t.Animation.prototype, "chartInstance", { get: function get() { return this.chart; }, set: function set(t) { this.chart = t; } }); }; }, { 25: 25, 26: 26, 45: 45 }], 23: [function (t, e, i) { "use strict"; var n = t(25), a = t(45), o = t(28), r = t(30), s = t(48), l = t(31);e.exports = function (t) { function e(t) { return "top" === t || "bottom" === t; }t.types = {}, t.instances = {}, t.controllers = {}, a.extend(t.prototype, { construct: function construct(e, i) { var o, r, l = this;(r = (o = (o = i) || {}).data = o.data || {}).datasets = r.datasets || [], r.labels = r.labels || [], o.options = a.configMerge(n.global, n[o.type], o.options || {}), i = o;var u = s.acquireContext(e, i), d = u && u.canvas, c = d && d.height, h = d && d.width;l.id = a.uid(), l.ctx = u, l.canvas = d, l.config = i, l.width = h, l.height = c, l.aspectRatio = c ? h / c : null, l.options = i.options, l._bufferedRender = !1, l.chart = l, l.controller = l, t.instances[l.id] = l, Object.defineProperty(l, "data", { get: function get() { return l.config.data; }, set: function set(t) { l.config.data = t; } }), u && d ? (l.initialize(), l.update()) : console.error("Failed to create chart: can't acquire context from the given item"); }, initialize: function initialize() { var t = this;return l.notify(t, "beforeInit"), a.retinaScale(t, t.options.devicePixelRatio), t.bindEvents(), t.options.responsive && t.resize(!0), t.ensureScalesHaveIDs(), t.buildOrUpdateScales(), t.initToolTip(), l.notify(t, "afterInit"), t; }, clear: function clear() { return a.canvas.clear(this), this; }, stop: function stop() { return t.animationService.cancelAnimation(this), this; }, resize: function resize(t) { var e = this, i = e.options, n = e.canvas, o = i.maintainAspectRatio && e.aspectRatio || null, r = Math.max(0, Math.floor(a.getMaximumWidth(n))), s = Math.max(0, Math.floor(o ? r / o : a.getMaximumHeight(n)));if ((e.width !== r || e.height !== s) && (n.width = e.width = r, n.height = e.height = s, n.style.width = r + "px", n.style.height = s + "px", a.retinaScale(e, i.devicePixelRatio), !t)) { var u = { width: r, height: s };l.notify(e, "resize", [u]), e.options.onResize && e.options.onResize(e, u), e.stop(), e.update(e.options.responsiveAnimationDuration); } }, ensureScalesHaveIDs: function ensureScalesHaveIDs() { var t = this.options, e = t.scales || {}, i = t.scale;a.each(e.xAxes, function (t, e) { t.id = t.id || "x-axis-" + e; }), a.each(e.yAxes, function (t, e) { t.id = t.id || "y-axis-" + e; }), i && (i.id = i.id || "scale"); }, buildOrUpdateScales: function buildOrUpdateScales() { var i = this, n = i.options, o = i.scales || {}, r = [], s = Object.keys(o).reduce(function (t, e) { return t[e] = !1, t; }, {});n.scales && (r = r.concat((n.scales.xAxes || []).map(function (t) { return { options: t, dtype: "category", dposition: "bottom" }; }), (n.scales.yAxes || []).map(function (t) { return { options: t, dtype: "linear", dposition: "left" }; }))), n.scale && r.push({ options: n.scale, dtype: "radialLinear", isDefault: !0, dposition: "chartArea" }), a.each(r, function (n) { var r = n.options, l = r.id, u = a.valueOrDefault(r.type, n.dtype);e(r.position) !== e(n.dposition) && (r.position = n.dposition), s[l] = !0;var d = null;if (l in o && o[l].type === u) (d = o[l]).options = r, d.ctx = i.ctx, d.chart = i;else { var c = t.scaleService.getScaleConstructor(u);if (!c) return;d = new c({ id: l, type: u, options: r, ctx: i.ctx, chart: i }), o[d.id] = d; }d.mergeTicksOptions(), n.isDefault && (i.scale = d); }), a.each(s, function (t, e) { t || delete o[e]; }), i.scales = o, t.scaleService.addScalesToLayout(this); }, buildOrUpdateControllers: function buildOrUpdateControllers() { var e = this, i = [], n = [];return a.each(e.data.datasets, function (a, o) { var r = e.getDatasetMeta(o), s = a.type || e.config.type;if (r.type && r.type !== s && (e.destroyDatasetMeta(o), r = e.getDatasetMeta(o)), r.type = s, i.push(r.type), r.controller) r.controller.updateIndex(o), r.controller.linkScales();else { var l = t.controllers[r.type];if (void 0 === l) throw new Error('"' + r.type + '" is not a chart type.');r.controller = new l(e, o), n.push(r.controller); } }, e), n; }, resetElements: function resetElements() { var t = this;a.each(t.data.datasets, function (e, i) { t.getDatasetMeta(i).controller.reset(); }, t); }, reset: function reset() { this.resetElements(), this.tooltip.initialize(); }, update: function update(e) { var i, n, o = this;if (e && "object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) || (e = { duration: e, lazy: arguments[1] }), n = (i = o).options, a.each(i.scales, function (t) { r.removeBox(i, t); }), n = a.configMerge(t.defaults.global, t.defaults[i.config.type], n), i.options = i.config.options = n, i.ensureScalesHaveIDs(), i.buildOrUpdateScales(), i.tooltip._options = n.tooltips, i.tooltip.initialize(), l._invalidate(o), !1 !== l.notify(o, "beforeUpdate")) { o.tooltip._data = o.data;var s = o.buildOrUpdateControllers();a.each(o.data.datasets, function (t, e) { o.getDatasetMeta(e).controller.buildOrUpdateElements(); }, o), o.updateLayout(), o.options.animation && o.options.animation.duration && a.each(s, function (t) { t.reset(); }), o.updateDatasets(), o.tooltip.initialize(), o.lastActive = [], l.notify(o, "afterUpdate"), o._bufferedRender ? o._bufferedRequest = { duration: e.duration, easing: e.easing, lazy: e.lazy } : o.render(e); } }, updateLayout: function updateLayout() { !1 !== l.notify(this, "beforeLayout") && (r.update(this, this.width, this.height), l.notify(this, "afterScaleUpdate"), l.notify(this, "afterLayout")); }, updateDatasets: function updateDatasets() { if (!1 !== l.notify(this, "beforeDatasetsUpdate")) { for (var t = 0, e = this.data.datasets.length; t < e; ++t) { this.updateDataset(t); }l.notify(this, "afterDatasetsUpdate"); } }, updateDataset: function updateDataset(t) { var e = this.getDatasetMeta(t), i = { meta: e, index: t };!1 !== l.notify(this, "beforeDatasetUpdate", [i]) && (e.controller.update(), l.notify(this, "afterDatasetUpdate", [i])); }, render: function render(e) { var i = this;e && "object" == (typeof e === "undefined" ? "undefined" : _typeof(e)) || (e = { duration: e, lazy: arguments[1] });var n = e.duration, o = e.lazy;if (!1 !== l.notify(i, "beforeRender")) { var r = i.options.animation, s = function s(t) { l.notify(i, "afterRender"), a.callback(r && r.onComplete, [t], i); };if (r && (void 0 !== n && 0 !== n || void 0 === n && 0 !== r.duration)) { var u = new t.Animation({ numSteps: (n || r.duration) / 16.66, easing: e.easing || r.easing, render: function render(t, e) { var i = a.easing.effects[e.easing], n = e.currentStep, o = n / e.numSteps;t.draw(i(o), o, n); }, onAnimationProgress: r.onProgress, onAnimationComplete: s });t.animationService.addAnimation(i, u, n, o); } else i.draw(), s(new t.Animation({ numSteps: 0, chart: i }));return i; } }, draw: function draw(t) { var e = this;e.clear(), a.isNullOrUndef(t) && (t = 1), e.transition(t), !1 !== l.notify(e, "beforeDraw", [t]) && (a.each(e.boxes, function (t) { t.draw(e.chartArea); }, e), e.scale && e.scale.draw(), e.drawDatasets(t), e._drawTooltip(t), l.notify(e, "afterDraw", [t])); }, transition: function transition(t) { for (var e = 0, i = (this.data.datasets || []).length; e < i; ++e) { this.isDatasetVisible(e) && this.getDatasetMeta(e).controller.transition(t); }this.tooltip.transition(t); }, drawDatasets: function drawDatasets(t) { var e = this;if (!1 !== l.notify(e, "beforeDatasetsDraw", [t])) { for (var i = (e.data.datasets || []).length - 1; i >= 0; --i) { e.isDatasetVisible(i) && e.drawDataset(i, t); }l.notify(e, "afterDatasetsDraw", [t]); } }, drawDataset: function drawDataset(t, e) { var i = this.getDatasetMeta(t), n = { meta: i, index: t, easingValue: e };!1 !== l.notify(this, "beforeDatasetDraw", [n]) && (i.controller.draw(e), l.notify(this, "afterDatasetDraw", [n])); }, _drawTooltip: function _drawTooltip(t) { var e = this.tooltip, i = { tooltip: e, easingValue: t };!1 !== l.notify(this, "beforeTooltipDraw", [i]) && (e.draw(), l.notify(this, "afterTooltipDraw", [i])); }, getElementAtEvent: function getElementAtEvent(t) { return o.modes.single(this, t); }, getElementsAtEvent: function getElementsAtEvent(t) { return o.modes.label(this, t, { intersect: !0 }); }, getElementsAtXAxis: function getElementsAtXAxis(t) { return o.modes["x-axis"](this, t, { intersect: !0 }); }, getElementsAtEventForMode: function getElementsAtEventForMode(t, e, i) { var n = o.modes[e];return "function" == typeof n ? n(this, t, i) : []; }, getDatasetAtEvent: function getDatasetAtEvent(t) { return o.modes.dataset(this, t, { intersect: !0 }); }, getDatasetMeta: function getDatasetMeta(t) { var e = this.data.datasets[t];e._meta || (e._meta = {});var i = e._meta[this.id];return i || (i = e._meta[this.id] = { type: null, data: [], dataset: null, controller: null, hidden: null, xAxisID: null, yAxisID: null }), i; }, getVisibleDatasetCount: function getVisibleDatasetCount() { for (var t = 0, e = 0, i = this.data.datasets.length; e < i; ++e) { this.isDatasetVisible(e) && t++; }return t; }, isDatasetVisible: function isDatasetVisible(t) { var e = this.getDatasetMeta(t);return "boolean" == typeof e.hidden ? !e.hidden : !this.data.datasets[t].hidden; }, generateLegend: function generateLegend() { return this.options.legendCallback(this); }, destroyDatasetMeta: function destroyDatasetMeta(t) { var e = this.id, i = this.data.datasets[t], n = i._meta && i._meta[e];n && (n.controller.destroy(), delete i._meta[e]); }, destroy: function destroy() { var e, i, n = this, o = n.canvas;for (n.stop(), e = 0, i = n.data.datasets.length; e < i; ++e) { n.destroyDatasetMeta(e); }o && (n.unbindEvents(), a.canvas.clear(n), s.releaseContext(n.ctx), n.canvas = null, n.ctx = null), l.notify(n, "destroy"), delete t.instances[n.id]; }, toBase64Image: function toBase64Image() { return this.canvas.toDataURL.apply(this.canvas, arguments); }, initToolTip: function initToolTip() { var e = this;e.tooltip = new t.Tooltip({ _chart: e, _chartInstance: e, _data: e.data, _options: e.options.tooltips }, e); }, bindEvents: function bindEvents() { var t = this, e = t._listeners = {}, i = function i() { t.eventHandler.apply(t, arguments); };a.each(t.options.events, function (n) { s.addEventListener(t, n, i), e[n] = i; }), t.options.responsive && (i = function i() { t.resize(); }, s.addEventListener(t, "resize", i), e.resize = i); }, unbindEvents: function unbindEvents() { var t = this, e = t._listeners;e && (delete t._listeners, a.each(e, function (e, i) { s.removeEventListener(t, i, e); })); }, updateHoverStyle: function updateHoverStyle(t, e, i) { var n, a, o, r = i ? "setHoverStyle" : "removeHoverStyle";for (a = 0, o = t.length; a < o; ++a) { (n = t[a]) && this.getDatasetMeta(n._datasetIndex).controller[r](n); } }, eventHandler: function eventHandler(t) { var e = this, i = e.tooltip;if (!1 !== l.notify(e, "beforeEvent", [t])) { e._bufferedRender = !0, e._bufferedRequest = null;var n = e.handleEvent(t);i && (n = i._start ? i.handleEvent(t) : n | i.handleEvent(t)), l.notify(e, "afterEvent", [t]);var a = e._bufferedRequest;return a ? e.render(a) : n && !e.animating && (e.stop(), e.render(e.options.hover.animationDuration, !0)), e._bufferedRender = !1, e._bufferedRequest = null, e; } }, handleEvent: function handleEvent(t) { var e, i = this, n = i.options || {}, o = n.hover;return i.lastActive = i.lastActive || [], "mouseout" === t.type ? i.active = [] : i.active = i.getElementsAtEventForMode(t, o.mode, o), a.callback(n.onHover || n.hover.onHover, [t.native, i.active], i), "mouseup" !== t.type && "click" !== t.type || n.onClick && n.onClick.call(i, t.native, i.active), i.lastActive.length && i.updateHoverStyle(i.lastActive, o.mode, !1), i.active.length && o.mode && i.updateHoverStyle(i.active, o.mode, !0), e = !a.arrayEquals(i.active, i.lastActive), i.lastActive = i.active, e; } }), t.Controller = t; }; }, { 25: 25, 28: 28, 30: 30, 31: 31, 45: 45, 48: 48 }], 24: [function (t, e, i) { "use strict"; var n = t(45);e.exports = function (t) { var e = ["push", "pop", "shift", "splice", "unshift"];function i(t, i) { var n = t._chartjs;if (n) { var a = n.listeners, o = a.indexOf(i);-1 !== o && a.splice(o, 1), a.length > 0 || (e.forEach(function (e) { delete t[e]; }), delete t._chartjs); } }t.DatasetController = function (t, e) { this.initialize(t, e); }, n.extend(t.DatasetController.prototype, { datasetElementType: null, dataElementType: null, initialize: function initialize(t, e) { this.chart = t, this.index = e, this.linkScales(), this.addElements(); }, updateIndex: function updateIndex(t) { this.index = t; }, linkScales: function linkScales() { var t = this, e = t.getMeta(), i = t.getDataset();null !== e.xAxisID && e.xAxisID in t.chart.scales || (e.xAxisID = i.xAxisID || t.chart.options.scales.xAxes[0].id), null !== e.yAxisID && e.yAxisID in t.chart.scales || (e.yAxisID = i.yAxisID || t.chart.options.scales.yAxes[0].id); }, getDataset: function getDataset() { return this.chart.data.datasets[this.index]; }, getMeta: function getMeta() { return this.chart.getDatasetMeta(this.index); }, getScaleForId: function getScaleForId(t) { return this.chart.scales[t]; }, reset: function reset() { this.update(!0); }, destroy: function destroy() { this._data && i(this._data, this); }, createMetaDataset: function createMetaDataset() { var t = this.datasetElementType;return t && new t({ _chart: this.chart, _datasetIndex: this.index }); }, createMetaData: function createMetaData(t) { var e = this.dataElementType;return e && new e({ _chart: this.chart, _datasetIndex: this.index, _index: t }); }, addElements: function addElements() { var t, e, i = this.getMeta(), n = this.getDataset().data || [], a = i.data;for (t = 0, e = n.length; t < e; ++t) { a[t] = a[t] || this.createMetaData(t); }i.dataset = i.dataset || this.createMetaDataset(); }, addElementAndReset: function addElementAndReset(t) { var e = this.createMetaData(t);this.getMeta().data.splice(t, 0, e), this.updateElement(e, t, !0); }, buildOrUpdateElements: function buildOrUpdateElements() { var t, a, o = this, r = o.getDataset(), s = r.data || (r.data = []);o._data !== s && (o._data && i(o._data, o), a = o, (t = s)._chartjs ? t._chartjs.listeners.push(a) : (Object.defineProperty(t, "_chartjs", { configurable: !0, enumerable: !1, value: { listeners: [a] } }), e.forEach(function (e) { var i = "onData" + e.charAt(0).toUpperCase() + e.slice(1), a = t[e];Object.defineProperty(t, e, { configurable: !0, enumerable: !1, value: function value() { var e = Array.prototype.slice.call(arguments), o = a.apply(this, e);return n.each(t._chartjs.listeners, function (t) { "function" == typeof t[i] && t[i].apply(t, e); }), o; } }); })), o._data = s), o.resyncElements(); }, update: n.noop, transition: function transition(t) { for (var e = this.getMeta(), i = e.data || [], n = i.length, a = 0; a < n; ++a) { i[a].transition(t); }e.dataset && e.dataset.transition(t); }, draw: function draw() { var t = this.getMeta(), e = t.data || [], i = e.length, n = 0;for (t.dataset && t.dataset.draw(); n < i; ++n) { e[n].draw(); } }, removeHoverStyle: function removeHoverStyle(t, e) { var i = this.chart.data.datasets[t._datasetIndex], a = t._index, o = t.custom || {}, r = n.valueAtIndexOrDefault, s = t._model;s.backgroundColor = o.backgroundColor ? o.backgroundColor : r(i.backgroundColor, a, e.backgroundColor), s.borderColor = o.borderColor ? o.borderColor : r(i.borderColor, a, e.borderColor), s.borderWidth = o.borderWidth ? o.borderWidth : r(i.borderWidth, a, e.borderWidth); }, setHoverStyle: function setHoverStyle(t) { var e = this.chart.data.datasets[t._datasetIndex], i = t._index, a = t.custom || {}, o = n.valueAtIndexOrDefault, r = n.getHoverColor, s = t._model;s.backgroundColor = a.hoverBackgroundColor ? a.hoverBackgroundColor : o(e.hoverBackgroundColor, i, r(s.backgroundColor)), s.borderColor = a.hoverBorderColor ? a.hoverBorderColor : o(e.hoverBorderColor, i, r(s.borderColor)), s.borderWidth = a.hoverBorderWidth ? a.hoverBorderWidth : o(e.hoverBorderWidth, i, s.borderWidth); }, resyncElements: function resyncElements() { var t = this.getMeta(), e = this.getDataset().data, i = t.data.length, n = e.length;n < i ? t.data.splice(n, i - n) : n > i && this.insertElements(i, n - i); }, insertElements: function insertElements(t, e) { for (var i = 0; i < e; ++i) { this.addElementAndReset(t + i); } }, onDataPush: function onDataPush() { this.insertElements(this.getDataset().data.length - 1, arguments.length); }, onDataPop: function onDataPop() { this.getMeta().data.pop(); }, onDataShift: function onDataShift() { this.getMeta().data.shift(); }, onDataSplice: function onDataSplice(t, e) { this.getMeta().data.splice(t, e), this.insertElements(t, arguments.length - 2); }, onDataUnshift: function onDataUnshift() { this.insertElements(0, arguments.length); } }), t.DatasetController.extend = n.inherits; }; }, { 45: 45 }], 25: [function (t, e, i) { "use strict"; var n = t(45);e.exports = { _set: function _set(t, e) { return n.merge(this[t] || (this[t] = {}), e); } }; }, { 45: 45 }], 26: [function (t, e, i) { "use strict"; var n = t(3), a = t(45);var o = function o(t) { a.extend(this, t), this.initialize.apply(this, arguments); };a.extend(o.prototype, { initialize: function initialize() { this.hidden = !1; }, pivot: function pivot() { var t = this;return t._view || (t._view = a.clone(t._model)), t._start = {}, t; }, transition: function transition(t) { var e = this, i = e._model, a = e._start, o = e._view;return i && 1 !== t ? (o || (o = e._view = {}), a || (a = e._start = {}), function (t, e, i, a) { var o, r, s, l, u, d, c, h, f, g = Object.keys(i);for (o = 0, r = g.length; o < r; ++o) { if (d = i[s = g[o]], e.hasOwnProperty(s) || (e[s] = d), (l = e[s]) !== d && "_" !== s[0]) { if (t.hasOwnProperty(s) || (t[s] = l), (c = typeof d === "undefined" ? "undefined" : _typeof(d)) == _typeof(u = t[s])) if ("string" === c) { if ((h = n(u)).valid && (f = n(d)).valid) { e[s] = f.mix(h, a).rgbString();continue; } } else if ("number" === c && isFinite(u) && isFinite(d)) { e[s] = u + (d - u) * a;continue; }e[s] = d; } } }(a, o, i, t), e) : (e._view = i, e._start = null, e); }, tooltipPosition: function tooltipPosition() { return { x: this._model.x, y: this._model.y }; }, hasValue: function hasValue() { return a.isNumber(this._model.x) && a.isNumber(this._model.y); } }), o.extend = a.inherits, e.exports = o; }, { 3: 3, 45: 45 }], 27: [function (t, e, i) { "use strict"; var n = t(3), a = t(25), o = t(45);e.exports = function (t) { function e(t, e, i) { var n;return "string" == typeof t ? (n = parseInt(t, 10), -1 !== t.indexOf("%") && (n = n / 100 * e.parentNode[i])) : n = t, n; }function i(t) { return null != t && "none" !== t; }function r(t, n, a) { var o = document.defaultView, r = t.parentNode, s = o.getComputedStyle(t)[n], l = o.getComputedStyle(r)[n], u = i(s), d = i(l), c = Number.POSITIVE_INFINITY;return u || d ? Math.min(u ? e(s, t, a) : c, d ? e(l, r, a) : c) : "none"; }o.configMerge = function () { return o.merge(o.clone(arguments[0]), [].slice.call(arguments, 1), { merger: function merger(e, i, n, a) { var r = i[e] || {}, s = n[e];"scales" === e ? i[e] = o.scaleMerge(r, s) : "scale" === e ? i[e] = o.merge(r, [t.scaleService.getScaleDefaults(s.type), s]) : o._merger(e, i, n, a); } }); }, o.scaleMerge = function () { return o.merge(o.clone(arguments[0]), [].slice.call(arguments, 1), { merger: function merger(e, i, n, a) { if ("xAxes" === e || "yAxes" === e) { var r, s, l, u = n[e].length;for (i[e] || (i[e] = []), r = 0; r < u; ++r) { l = n[e][r], s = o.valueOrDefault(l.type, "xAxes" === e ? "category" : "linear"), r >= i[e].length && i[e].push({}), !i[e][r].type || l.type && l.type !== i[e][r].type ? o.merge(i[e][r], [t.scaleService.getScaleDefaults(s), l]) : o.merge(i[e][r], l); } } else o._merger(e, i, n, a); } }); }, o.where = function (t, e) { if (o.isArray(t) && Array.prototype.filter) return t.filter(e);var i = [];return o.each(t, function (t) { e(t) && i.push(t); }), i; }, o.findIndex = Array.prototype.findIndex ? function (t, e, i) { return t.findIndex(e, i); } : function (t, e, i) { i = void 0 === i ? t : i;for (var n = 0, a = t.length; n < a; ++n) { if (e.call(i, t[n], n, t)) return n; }return -1; }, o.findNextWhere = function (t, e, i) { o.isNullOrUndef(i) && (i = -1);for (var n = i + 1; n < t.length; n++) { var a = t[n];if (e(a)) return a; } }, o.findPreviousWhere = function (t, e, i) { o.isNullOrUndef(i) && (i = t.length);for (var n = i - 1; n >= 0; n--) { var a = t[n];if (e(a)) return a; } }, o.isNumber = function (t) { return !isNaN(parseFloat(t)) && isFinite(t); }, o.almostEquals = function (t, e, i) { return Math.abs(t - e) < i; }, o.almostWhole = function (t, e) { var i = Math.round(t);return i - e < t && i + e > t; }, o.max = function (t) { return t.reduce(function (t, e) { return isNaN(e) ? t : Math.max(t, e); }, Number.NEGATIVE_INFINITY); }, o.min = function (t) { return t.reduce(function (t, e) { return isNaN(e) ? t : Math.min(t, e); }, Number.POSITIVE_INFINITY); }, o.sign = Math.sign ? function (t) { return Math.sign(t); } : function (t) { return 0 === (t = +t) || isNaN(t) ? t : t > 0 ? 1 : -1; }, o.log10 = Math.log10 ? function (t) { return Math.log10(t); } : function (t) { var e = Math.log(t) * Math.LOG10E, i = Math.round(e);return t === Math.pow(10, i) ? i : e; }, o.toRadians = function (t) { return t * (Math.PI / 180); }, o.toDegrees = function (t) { return t * (180 / Math.PI); }, o.getAngleFromPoint = function (t, e) { var i = e.x - t.x, n = e.y - t.y, a = Math.sqrt(i * i + n * n), o = Math.atan2(n, i);return o < -.5 * Math.PI && (o += 2 * Math.PI), { angle: o, distance: a }; }, o.distanceBetweenPoints = function (t, e) { return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)); }, o.aliasPixel = function (t) { return t % 2 == 0 ? 0 : .5; }, o.splineCurve = function (t, e, i, n) { var a = t.skip ? e : t, o = e, r = i.skip ? e : i, s = Math.sqrt(Math.pow(o.x - a.x, 2) + Math.pow(o.y - a.y, 2)), l = Math.sqrt(Math.pow(r.x - o.x, 2) + Math.pow(r.y - o.y, 2)), u = s / (s + l), d = l / (s + l), c = n * (u = isNaN(u) ? 0 : u), h = n * (d = isNaN(d) ? 0 : d);return { previous: { x: o.x - c * (r.x - a.x), y: o.y - c * (r.y - a.y) }, next: { x: o.x + h * (r.x - a.x), y: o.y + h * (r.y - a.y) } }; }, o.EPSILON = Number.EPSILON || 1e-14, o.splineCurveMonotone = function (t) { var e, i, n, a, r, s, l, u, d, c = (t || []).map(function (t) { return { model: t._model, deltaK: 0, mK: 0 }; }), h = c.length;for (e = 0; e < h; ++e) { if (!(n = c[e]).model.skip) { if (i = e > 0 ? c[e - 1] : null, (a = e < h - 1 ? c[e + 1] : null) && !a.model.skip) { var f = a.model.x - n.model.x;n.deltaK = 0 !== f ? (a.model.y - n.model.y) / f : 0; }!i || i.model.skip ? n.mK = n.deltaK : !a || a.model.skip ? n.mK = i.deltaK : this.sign(i.deltaK) !== this.sign(n.deltaK) ? n.mK = 0 : n.mK = (i.deltaK + n.deltaK) / 2; } }for (e = 0; e < h - 1; ++e) { n = c[e], a = c[e + 1], n.model.skip || a.model.skip || (o.almostEquals(n.deltaK, 0, this.EPSILON) ? n.mK = a.mK = 0 : (r = n.mK / n.deltaK, s = a.mK / n.deltaK, (u = Math.pow(r, 2) + Math.pow(s, 2)) <= 9 || (l = 3 / Math.sqrt(u), n.mK = r * l * n.deltaK, a.mK = s * l * n.deltaK))); }for (e = 0; e < h; ++e) { (n = c[e]).model.skip || (i = e > 0 ? c[e - 1] : null, a = e < h - 1 ? c[e + 1] : null, i && !i.model.skip && (d = (n.model.x - i.model.x) / 3, n.model.controlPointPreviousX = n.model.x - d, n.model.controlPointPreviousY = n.model.y - d * n.mK), a && !a.model.skip && (d = (a.model.x - n.model.x) / 3, n.model.controlPointNextX = n.model.x + d, n.model.controlPointNextY = n.model.y + d * n.mK)); } }, o.nextItem = function (t, e, i) { return i ? e >= t.length - 1 ? t[0] : t[e + 1] : e >= t.length - 1 ? t[t.length - 1] : t[e + 1]; }, o.previousItem = function (t, e, i) { return i ? e <= 0 ? t[t.length - 1] : t[e - 1] : e <= 0 ? t[0] : t[e - 1]; }, o.niceNum = function (t, e) { var i = Math.floor(o.log10(t)), n = t / Math.pow(10, i);return (e ? n < 1.5 ? 1 : n < 3 ? 2 : n < 7 ? 5 : 10 : n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * Math.pow(10, i); }, o.requestAnimFrame = "undefined" == typeof window ? function (t) { t(); } : window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return window.setTimeout(t, 1e3 / 60); }, o.getRelativePosition = function (t, e) { var i, n, a = t.originalEvent || t, r = t.currentTarget || t.srcElement, s = r.getBoundingClientRect(), l = a.touches;l && l.length > 0 ? (i = l[0].clientX, n = l[0].clientY) : (i = a.clientX, n = a.clientY);var u = parseFloat(o.getStyle(r, "padding-left")), d = parseFloat(o.getStyle(r, "padding-top")), c = parseFloat(o.getStyle(r, "padding-right")), h = parseFloat(o.getStyle(r, "padding-bottom")), f = s.right - s.left - u - c, g = s.bottom - s.top - d - h;return { x: i = Math.round((i - s.left - u) / f * r.width / e.currentDevicePixelRatio), y: n = Math.round((n - s.top - d) / g * r.height / e.currentDevicePixelRatio) }; }, o.getConstraintWidth = function (t) { return r(t, "max-width", "clientWidth"); }, o.getConstraintHeight = function (t) { return r(t, "max-height", "clientHeight"); }, o.getMaximumWidth = function (t) { var e = t.parentNode;if (!e) return t.clientWidth;var i = parseInt(o.getStyle(e, "padding-left"), 10), n = parseInt(o.getStyle(e, "padding-right"), 10), a = e.clientWidth - i - n, r = o.getConstraintWidth(t);return isNaN(r) ? a : Math.min(a, r); }, o.getMaximumHeight = function (t) { var e = t.parentNode;if (!e) return t.clientHeight;var i = parseInt(o.getStyle(e, "padding-top"), 10), n = parseInt(o.getStyle(e, "padding-bottom"), 10), a = e.clientHeight - i - n, r = o.getConstraintHeight(t);return isNaN(r) ? a : Math.min(a, r); }, o.getStyle = function (t, e) { return t.currentStyle ? t.currentStyle[e] : document.defaultView.getComputedStyle(t, null).getPropertyValue(e); }, o.retinaScale = function (t, e) { var i = t.currentDevicePixelRatio = e || window.devicePixelRatio || 1;if (1 !== i) { var n = t.canvas, a = t.height, o = t.width;n.height = a * i, n.width = o * i, t.ctx.scale(i, i), n.style.height || n.style.width || (n.style.height = a + "px", n.style.width = o + "px"); } }, o.fontString = function (t, e, i) { return e + " " + t + "px " + i; }, o.longestText = function (t, e, i, n) { var a = (n = n || {}).data = n.data || {}, r = n.garbageCollect = n.garbageCollect || [];n.font !== e && (a = n.data = {}, r = n.garbageCollect = [], n.font = e), t.font = e;var s = 0;o.each(i, function (e) { null != e && !0 !== o.isArray(e) ? s = o.measureText(t, a, r, s, e) : o.isArray(e) && o.each(e, function (e) { null == e || o.isArray(e) || (s = o.measureText(t, a, r, s, e)); }); });var l = r.length / 2;if (l > i.length) { for (var u = 0; u < l; u++) { delete a[r[u]]; }r.splice(0, l); }return s; }, o.measureText = function (t, e, i, n, a) { var o = e[a];return o || (o = e[a] = t.measureText(a).width, i.push(a)), o > n && (n = o), n; }, o.numberOfLabelLines = function (t) { var e = 1;return o.each(t, function (t) { o.isArray(t) && t.length > e && (e = t.length); }), e; }, o.color = n ? function (t) { return t instanceof CanvasGradient && (t = a.global.defaultColor), n(t); } : function (t) { return console.error("Color.js not found!"), t; }, o.getHoverColor = function (t) { return t instanceof CanvasPattern ? t : o.color(t).saturate(.5).darken(.1).rgbString(); }; }; }, { 25: 25, 3: 3, 45: 45 }], 28: [function (t, e, i) { "use strict"; var n = t(45);function a(t, e) { return t.native ? { x: t.x, y: t.y } : n.getRelativePosition(t, e); }function o(t, e) { var i, n, a, o, r;for (n = 0, o = t.data.datasets.length; n < o; ++n) { if (t.isDatasetVisible(n)) for (a = 0, r = (i = t.getDatasetMeta(n)).data.length; a < r; ++a) { var s = i.data[a];s._view.skip || e(s); } } }function r(t, e) { var i = [];return o(t, function (t) { t.inRange(e.x, e.y) && i.push(t); }), i; }function s(t, e, i, n) { var a = Number.POSITIVE_INFINITY, r = [];return o(t, function (t) { if (!i || t.inRange(e.x, e.y)) { var o = t.getCenterPoint(), s = n(e, o);s < a ? (r = [t], a = s) : s === a && r.push(t); } }), r; }function l(t) { var e = -1 !== t.indexOf("x"), i = -1 !== t.indexOf("y");return function (t, n) { var a = e ? Math.abs(t.x - n.x) : 0, o = i ? Math.abs(t.y - n.y) : 0;return Math.sqrt(Math.pow(a, 2) + Math.pow(o, 2)); }; }function u(t, e, i) { var n = a(e, t);i.axis = i.axis || "x";var o = l(i.axis), u = i.intersect ? r(t, n) : s(t, n, !1, o), d = [];return u.length ? (t.data.datasets.forEach(function (e, i) { if (t.isDatasetVisible(i)) { var n = t.getDatasetMeta(i).data[u[0]._index];n && !n._view.skip && d.push(n); } }), d) : []; }e.exports = { modes: { single: function single(t, e) { var i = a(e, t), n = [];return o(t, function (t) { if (t.inRange(i.x, i.y)) return n.push(t), n; }), n.slice(0, 1); }, label: u, index: u, dataset: function dataset(t, e, i) { var n = a(e, t);i.axis = i.axis || "xy";var o = l(i.axis), u = i.intersect ? r(t, n) : s(t, n, !1, o);return u.length > 0 && (u = t.getDatasetMeta(u[0]._datasetIndex).data), u; }, "x-axis": function xAxis(t, e) { return u(t, e, { intersect: !1 }); }, point: function point(t, e) { return r(t, a(e, t)); }, nearest: function nearest(t, e, i) { var n = a(e, t);i.axis = i.axis || "xy";var o = l(i.axis), r = s(t, n, i.intersect, o);return r.length > 1 && r.sort(function (t, e) { var i = t.getArea() - e.getArea();return 0 === i && (i = t._datasetIndex - e._datasetIndex), i; }), r.slice(0, 1); }, x: function x(t, e, i) { var n = a(e, t), r = [], s = !1;return o(t, function (t) { t.inXRange(n.x) && r.push(t), t.inRange(n.x, n.y) && (s = !0); }), i.intersect && !s && (r = []), r; }, y: function y(t, e, i) { var n = a(e, t), r = [], s = !1;return o(t, function (t) { t.inYRange(n.y) && r.push(t), t.inRange(n.x, n.y) && (s = !0); }), i.intersect && !s && (r = []), r; } } }; }, { 45: 45 }], 29: [function (t, e, i) { "use strict"; t(25)._set("global", { responsive: !0, responsiveAnimationDuration: 0, maintainAspectRatio: !0, events: ["mousemove", "mouseout", "click", "touchstart", "touchmove"], hover: { onHover: null, mode: "nearest", intersect: !0, animationDuration: 400 }, onClick: null, defaultColor: "rgba(0,0,0,0.1)", defaultFontColor: "#666", defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", defaultFontSize: 12, defaultFontStyle: "normal", showLines: !0, elements: {}, layout: { padding: { top: 0, right: 0, bottom: 0, left: 0 } } }), e.exports = function () { var t = function t(_t, e) { return this.construct(_t, e), this; };return t.Chart = t, t; }; }, { 25: 25 }], 30: [function (t, e, i) { "use strict"; var n = t(45);function a(t, e) { return n.where(t, function (t) { return t.position === e; }); }function o(t, e) { t.forEach(function (t, e) { return t._tmpIndex_ = e, t; }), t.sort(function (t, i) { var n = e ? i : t, a = e ? t : i;return n.weight === a.weight ? n._tmpIndex_ - a._tmpIndex_ : n.weight - a.weight; }), t.forEach(function (t) { delete t._tmpIndex_; }); }e.exports = { defaults: {}, addBox: function addBox(t, e) { t.boxes || (t.boxes = []), e.fullWidth = e.fullWidth || !1, e.position = e.position || "top", e.weight = e.weight || 0, t.boxes.push(e); }, removeBox: function removeBox(t, e) { var i = t.boxes ? t.boxes.indexOf(e) : -1;-1 !== i && t.boxes.splice(i, 1); }, configure: function configure(t, e, i) { for (var n, a = ["fullWidth", "position", "weight"], o = a.length, r = 0; r < o; ++r) { n = a[r], i.hasOwnProperty(n) && (e[n] = i[n]); } }, update: function update(t, e, i) { if (t) { var r = t.options.layout || {}, s = n.options.toPadding(r.padding), l = s.left, u = s.right, d = s.top, c = s.bottom, h = a(t.boxes, "left"), f = a(t.boxes, "right"), g = a(t.boxes, "top"), p = a(t.boxes, "bottom"), m = a(t.boxes, "chartArea");o(h, !0), o(f, !1), o(g, !0), o(p, !1);var v = e - l - u, b = i - d - c, x = b / 2, y = (e - v / 2) / (h.length + f.length), k = (i - x) / (g.length + p.length), M = v, w = b, S = [];n.each(h.concat(f, g, p), function (t) { var e, i = t.isHorizontal();i ? (e = t.update(t.fullWidth ? v : M, k), w -= e.height) : (e = t.update(y, w), M -= e.width), S.push({ horizontal: i, minSize: e, box: t }); });var C = 0, _ = 0, D = 0, I = 0;n.each(g.concat(p), function (t) { if (t.getPadding) { var e = t.getPadding();C = Math.max(C, e.left), _ = Math.max(_, e.right); } }), n.each(h.concat(f), function (t) { if (t.getPadding) { var e = t.getPadding();D = Math.max(D, e.top), I = Math.max(I, e.bottom); } });var P = l, A = u, T = d, F = c;n.each(h.concat(f), N), n.each(h, function (t) { P += t.width; }), n.each(f, function (t) { A += t.width; }), n.each(g.concat(p), N), n.each(g, function (t) { T += t.height; }), n.each(p, function (t) { F += t.height; }), n.each(h.concat(f), function (t) { var e = n.findNextWhere(S, function (e) { return e.box === t; }), i = { left: 0, right: 0, top: T, bottom: F };e && t.update(e.minSize.width, w, i); }), P = l, A = u, T = d, F = c, n.each(h, function (t) { P += t.width; }), n.each(f, function (t) { A += t.width; }), n.each(g, function (t) { T += t.height; }), n.each(p, function (t) { F += t.height; });var O = Math.max(C - P, 0);P += O, A += Math.max(_ - A, 0);var R = Math.max(D - T, 0);T += R, F += Math.max(I - F, 0);var L = i - T - F, z = e - P - A;z === M && L === w || (n.each(h, function (t) { t.height = L; }), n.each(f, function (t) { t.height = L; }), n.each(g, function (t) { t.fullWidth || (t.width = z); }), n.each(p, function (t) { t.fullWidth || (t.width = z); }), w = L, M = z);var B = l + O, W = d + R;n.each(h.concat(g), V), B += M, W += w, n.each(f, V), n.each(p, V), t.chartArea = { left: P, top: T, right: P + M, bottom: T + w }, n.each(m, function (e) { e.left = t.chartArea.left, e.top = t.chartArea.top, e.right = t.chartArea.right, e.bottom = t.chartArea.bottom, e.update(M, w); }); }function N(t) { var e = n.findNextWhere(S, function (e) { return e.box === t; });if (e) if (t.isHorizontal()) { var i = { left: Math.max(P, C), right: Math.max(A, _), top: 0, bottom: 0 };t.update(t.fullWidth ? v : M, b / 2, i); } else t.update(e.minSize.width, w); }function V(t) { t.isHorizontal() ? (t.left = t.fullWidth ? l : P, t.right = t.fullWidth ? e - u : P + M, t.top = W, t.bottom = W + t.height, W = t.bottom) : (t.left = B, t.right = B + t.width, t.top = T, t.bottom = T + w, B = t.right); } } }; }, { 45: 45 }], 31: [function (t, e, i) { "use strict"; var n = t(25), a = t(45);n._set("global", { plugins: {} }), e.exports = { _plugins: [], _cacheId: 0, register: function register(t) { var e = this._plugins;[].concat(t).forEach(function (t) { -1 === e.indexOf(t) && e.push(t); }), this._cacheId++; }, unregister: function unregister(t) { var e = this._plugins;[].concat(t).forEach(function (t) { var i = e.indexOf(t);-1 !== i && e.splice(i, 1); }), this._cacheId++; }, clear: function clear() { this._plugins = [], this._cacheId++; }, count: function count() { return this._plugins.length; }, getAll: function getAll() { return this._plugins; }, notify: function notify(t, e, i) { var n, a, o, r, s, l = this.descriptors(t), u = l.length;for (n = 0; n < u; ++n) { if ("function" == typeof (s = (o = (a = l[n]).plugin)[e]) && ((r = [t].concat(i || [])).push(a.options), !1 === s.apply(o, r))) return !1; }return !0; }, descriptors: function descriptors(t) { var e = t.$plugins || (t.$plugins = {});if (e.id === this._cacheId) return e.descriptors;var i = [], o = [], r = t && t.config || {}, s = r.options && r.options.plugins || {};return this._plugins.concat(r.plugins || []).forEach(function (t) { if (-1 === i.indexOf(t)) { var e = t.id, r = s[e];!1 !== r && (!0 === r && (r = a.clone(n.global.plugins[e])), i.push(t), o.push({ plugin: t, options: r || {} })); } }), e.descriptors = o, e.id = this._cacheId, o; }, _invalidate: function _invalidate(t) { delete t.$plugins; } }; }, { 25: 25, 45: 45 }], 32: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45), r = t(34);function s(t) { var e, i, n = [];for (e = 0, i = t.length; e < i; ++e) { n.push(t[e].label); }return n; }function l(t, e, i) { var n = t.getPixelForTick(e);return i && (n -= 0 === e ? (t.getPixelForTick(1) - n) / 2 : (n - t.getPixelForTick(e - 1)) / 2), n; }n._set("scale", { display: !0, position: "left", offset: !1, gridLines: { display: !0, color: "rgba(0, 0, 0, 0.1)", lineWidth: 1, drawBorder: !0, drawOnChartArea: !0, drawTicks: !0, tickMarkLength: 10, zeroLineWidth: 1, zeroLineColor: "rgba(0,0,0,0.25)", zeroLineBorderDash: [], zeroLineBorderDashOffset: 0, offsetGridLines: !1, borderDash: [], borderDashOffset: 0 }, scaleLabel: { display: !1, labelString: "", lineHeight: 1.2, padding: { top: 4, bottom: 4 } }, ticks: { beginAtZero: !1, minRotation: 0, maxRotation: 50, mirror: !1, padding: 0, reverse: !1, display: !0, autoSkip: !0, autoSkipPadding: 0, labelOffset: 0, callback: r.formatters.values, minor: {}, major: {} } }), e.exports = function (t) { function e(t, e, i) { return o.isArray(e) ? o.longestText(t, i, e) : t.measureText(e).width; }function i(t) { var e = o.valueOrDefault, i = n.global, a = e(t.fontSize, i.defaultFontSize), r = e(t.fontStyle, i.defaultFontStyle), s = e(t.fontFamily, i.defaultFontFamily);return { size: a, style: r, family: s, font: o.fontString(a, r, s) }; }function r(t) { return o.options.toLineHeight(o.valueOrDefault(t.lineHeight, 1.2), o.valueOrDefault(t.fontSize, n.global.defaultFontSize)); }t.Scale = a.extend({ getPadding: function getPadding() { return { left: this.paddingLeft || 0, top: this.paddingTop || 0, right: this.paddingRight || 0, bottom: this.paddingBottom || 0 }; }, getTicks: function getTicks() { return this._ticks; }, mergeTicksOptions: function mergeTicksOptions() { var t = this.options.ticks;for (var e in !1 === t.minor && (t.minor = { display: !1 }), !1 === t.major && (t.major = { display: !1 }), t) { "major" !== e && "minor" !== e && (void 0 === t.minor[e] && (t.minor[e] = t[e]), void 0 === t.major[e] && (t.major[e] = t[e])); } }, beforeUpdate: function beforeUpdate() { o.callback(this.options.beforeUpdate, [this]); }, update: function update(t, e, i) { var n, a, r, s, l, u, d = this;for (d.beforeUpdate(), d.maxWidth = t, d.maxHeight = e, d.margins = o.extend({ left: 0, right: 0, top: 0, bottom: 0 }, i), d.longestTextCache = d.longestTextCache || {}, d.beforeSetDimensions(), d.setDimensions(), d.afterSetDimensions(), d.beforeDataLimits(), d.determineDataLimits(), d.afterDataLimits(), d.beforeBuildTicks(), l = d.buildTicks() || [], d.afterBuildTicks(), d.beforeTickToLabelConversion(), r = d.convertTicksToLabels(l) || d.ticks, d.afterTickToLabelConversion(), d.ticks = r, n = 0, a = r.length; n < a; ++n) { s = r[n], (u = l[n]) ? u.label = s : l.push(u = { label: s, major: !1 }); }return d._ticks = l, d.beforeCalculateTickRotation(), d.calculateTickRotation(), d.afterCalculateTickRotation(), d.beforeFit(), d.fit(), d.afterFit(), d.afterUpdate(), d.minSize; }, afterUpdate: function afterUpdate() { o.callback(this.options.afterUpdate, [this]); }, beforeSetDimensions: function beforeSetDimensions() { o.callback(this.options.beforeSetDimensions, [this]); }, setDimensions: function setDimensions() { var t = this;t.isHorizontal() ? (t.width = t.maxWidth, t.left = 0, t.right = t.width) : (t.height = t.maxHeight, t.top = 0, t.bottom = t.height), t.paddingLeft = 0, t.paddingTop = 0, t.paddingRight = 0, t.paddingBottom = 0; }, afterSetDimensions: function afterSetDimensions() { o.callback(this.options.afterSetDimensions, [this]); }, beforeDataLimits: function beforeDataLimits() { o.callback(this.options.beforeDataLimits, [this]); }, determineDataLimits: o.noop, afterDataLimits: function afterDataLimits() { o.callback(this.options.afterDataLimits, [this]); }, beforeBuildTicks: function beforeBuildTicks() { o.callback(this.options.beforeBuildTicks, [this]); }, buildTicks: o.noop, afterBuildTicks: function afterBuildTicks() { o.callback(this.options.afterBuildTicks, [this]); }, beforeTickToLabelConversion: function beforeTickToLabelConversion() { o.callback(this.options.beforeTickToLabelConversion, [this]); }, convertTicksToLabels: function convertTicksToLabels() { var t = this.options.ticks;this.ticks = this.ticks.map(t.userCallback || t.callback, this); }, afterTickToLabelConversion: function afterTickToLabelConversion() { o.callback(this.options.afterTickToLabelConversion, [this]); }, beforeCalculateTickRotation: function beforeCalculateTickRotation() { o.callback(this.options.beforeCalculateTickRotation, [this]); }, calculateTickRotation: function calculateTickRotation() { var t = this, e = t.ctx, n = t.options.ticks, a = s(t._ticks), r = i(n);e.font = r.font;var l = n.minRotation || 0;if (a.length && t.options.display && t.isHorizontal()) for (var u, d = o.longestText(e, r.font, a, t.longestTextCache), c = d, h = t.getPixelForTick(1) - t.getPixelForTick(0) - 6; c > h && l < n.maxRotation;) { var f = o.toRadians(l);if (u = Math.cos(f), Math.sin(f) * d > t.maxHeight) { l--;break; }l++, c = u * d; }t.labelRotation = l; }, afterCalculateTickRotation: function afterCalculateTickRotation() { o.callback(this.options.afterCalculateTickRotation, [this]); }, beforeFit: function beforeFit() { o.callback(this.options.beforeFit, [this]); }, fit: function fit() { var t = this, n = t.minSize = { width: 0, height: 0 }, a = s(t._ticks), l = t.options, u = l.ticks, d = l.scaleLabel, c = l.gridLines, h = l.display, f = t.isHorizontal(), g = i(u), p = l.gridLines.tickMarkLength;if (n.width = f ? t.isFullWidth() ? t.maxWidth - t.margins.left - t.margins.right : t.maxWidth : h && c.drawTicks ? p : 0, n.height = f ? h && c.drawTicks ? p : 0 : t.maxHeight, d.display && h) { var m = r(d) + o.options.toPadding(d.padding).height;f ? n.height += m : n.width += m; }if (u.display && h) { var v = o.longestText(t.ctx, g.font, a, t.longestTextCache), b = o.numberOfLabelLines(a), x = .5 * g.size, y = t.options.ticks.padding;if (f) { t.longestLabelWidth = v;var k = o.toRadians(t.labelRotation), M = Math.cos(k), w = Math.sin(k) * v + g.size * b + x * (b - 1) + x;n.height = Math.min(t.maxHeight, n.height + w + y), t.ctx.font = g.font;var S = e(t.ctx, a[0], g.font), C = e(t.ctx, a[a.length - 1], g.font);0 !== t.labelRotation ? (t.paddingLeft = "bottom" === l.position ? M * S + 3 : M * x + 3, t.paddingRight = "bottom" === l.position ? M * x + 3 : M * C + 3) : (t.paddingLeft = S / 2 + 3, t.paddingRight = C / 2 + 3); } else u.mirror ? v = 0 : v += y + x, n.width = Math.min(t.maxWidth, n.width + v), t.paddingTop = g.size / 2, t.paddingBottom = g.size / 2; }t.handleMargins(), t.width = n.width, t.height = n.height; }, handleMargins: function handleMargins() { var t = this;t.margins && (t.paddingLeft = Math.max(t.paddingLeft - t.margins.left, 0), t.paddingTop = Math.max(t.paddingTop - t.margins.top, 0), t.paddingRight = Math.max(t.paddingRight - t.margins.right, 0), t.paddingBottom = Math.max(t.paddingBottom - t.margins.bottom, 0)); }, afterFit: function afterFit() { o.callback(this.options.afterFit, [this]); }, isHorizontal: function isHorizontal() { return "top" === this.options.position || "bottom" === this.options.position; }, isFullWidth: function isFullWidth() { return this.options.fullWidth; }, getRightValue: function getRightValue(t) { if (o.isNullOrUndef(t)) return NaN;if ("number" == typeof t && !isFinite(t)) return NaN;if (t) if (this.isHorizontal()) { if (void 0 !== t.x) return this.getRightValue(t.x); } else if (void 0 !== t.y) return this.getRightValue(t.y);return t; }, getLabelForIndex: o.noop, getPixelForValue: o.noop, getValueForPixel: o.noop, getPixelForTick: function getPixelForTick(t) { var e = this, i = e.options.offset;if (e.isHorizontal()) { var n = (e.width - (e.paddingLeft + e.paddingRight)) / Math.max(e._ticks.length - (i ? 0 : 1), 1), a = n * t + e.paddingLeft;i && (a += n / 2);var o = e.left + Math.round(a);return o += e.isFullWidth() ? e.margins.left : 0; }var r = e.height - (e.paddingTop + e.paddingBottom);return e.top + t * (r / (e._ticks.length - 1)); }, getPixelForDecimal: function getPixelForDecimal(t) { var e = this;if (e.isHorizontal()) { var i = (e.width - (e.paddingLeft + e.paddingRight)) * t + e.paddingLeft, n = e.left + Math.round(i);return n += e.isFullWidth() ? e.margins.left : 0; }return e.top + t * e.height; }, getBasePixel: function getBasePixel() { return this.getPixelForValue(this.getBaseValue()); }, getBaseValue: function getBaseValue() { var t = this.min, e = this.max;return this.beginAtZero ? 0 : t < 0 && e < 0 ? e : t > 0 && e > 0 ? t : 0; }, _autoSkip: function _autoSkip(t) { var e, i, n, a, r = this, s = r.isHorizontal(), l = r.options.ticks.minor, u = t.length, d = o.toRadians(r.labelRotation), c = Math.cos(d), h = r.longestLabelWidth * c, f = [];for (l.maxTicksLimit && (a = l.maxTicksLimit), s && (e = !1, (h + l.autoSkipPadding) * u > r.width - (r.paddingLeft + r.paddingRight) && (e = 1 + Math.floor((h + l.autoSkipPadding) * u / (r.width - (r.paddingLeft + r.paddingRight)))), a && u > a && (e = Math.max(e, Math.floor(u / a)))), i = 0; i < u; i++) { n = t[i], (e > 1 && i % e > 0 || i % e == 0 && i + e >= u) && i !== u - 1 && delete n.label, f.push(n); }return f; }, draw: function draw(t) { var e = this, a = e.options;if (a.display) { var s = e.ctx, u = n.global, d = a.ticks.minor, c = a.ticks.major || d, h = a.gridLines, f = a.scaleLabel, g = 0 !== e.labelRotation, p = e.isHorizontal(), m = d.autoSkip ? e._autoSkip(e.getTicks()) : e.getTicks(), v = o.valueOrDefault(d.fontColor, u.defaultFontColor), b = i(d), x = o.valueOrDefault(c.fontColor, u.defaultFontColor), y = i(c), k = h.drawTicks ? h.tickMarkLength : 0, M = o.valueOrDefault(f.fontColor, u.defaultFontColor), w = i(f), S = o.options.toPadding(f.padding), C = o.toRadians(e.labelRotation), _ = [], D = e.options.gridLines.lineWidth, I = "right" === a.position ? e.right : e.right - D - k, P = "right" === a.position ? e.right + k : e.right, A = "bottom" === a.position ? e.top + D : e.bottom - k - D, T = "bottom" === a.position ? e.top + D + k : e.bottom + D;if (o.each(m, function (i, n) { if (!o.isNullOrUndef(i.label)) { var r, s, c, f, v, b, x, y, M, w, S, F, O, R, L = i.label;n === e.zeroLineIndex && a.offset === h.offsetGridLines ? (r = h.zeroLineWidth, s = h.zeroLineColor, c = h.zeroLineBorderDash, f = h.zeroLineBorderDashOffset) : (r = o.valueAtIndexOrDefault(h.lineWidth, n), s = o.valueAtIndexOrDefault(h.color, n), c = o.valueOrDefault(h.borderDash, u.borderDash), f = o.valueOrDefault(h.borderDashOffset, u.borderDashOffset));var z = "middle", B = "middle", W = d.padding;if (p) { var N = k + W;"bottom" === a.position ? (B = g ? "middle" : "top", z = g ? "right" : "center", R = e.top + N) : (B = g ? "middle" : "bottom", z = g ? "left" : "center", R = e.bottom - N);var V = l(e, n, h.offsetGridLines && m.length > 1);V < e.left && (s = "rgba(0,0,0,0)"), V += o.aliasPixel(r), O = e.getPixelForTick(n) + d.labelOffset, v = x = M = S = V, b = A, y = T, w = t.top, F = t.bottom + D; } else { var E, H = "left" === a.position;d.mirror ? (z = H ? "left" : "right", E = W) : (z = H ? "right" : "left", E = k + W), O = H ? e.right - E : e.left + E;var j = l(e, n, h.offsetGridLines && m.length > 1);j < e.top && (s = "rgba(0,0,0,0)"), j += o.aliasPixel(r), R = e.getPixelForTick(n) + d.labelOffset, v = I, x = P, M = t.left, S = t.right + D, b = y = w = F = j; }_.push({ tx1: v, ty1: b, tx2: x, ty2: y, x1: M, y1: w, x2: S, y2: F, labelX: O, labelY: R, glWidth: r, glColor: s, glBorderDash: c, glBorderDashOffset: f, rotation: -1 * C, label: L, major: i.major, textBaseline: B, textAlign: z }); } }), o.each(_, function (t) { if (h.display && (s.save(), s.lineWidth = t.glWidth, s.strokeStyle = t.glColor, s.setLineDash && (s.setLineDash(t.glBorderDash), s.lineDashOffset = t.glBorderDashOffset), s.beginPath(), h.drawTicks && (s.moveTo(t.tx1, t.ty1), s.lineTo(t.tx2, t.ty2)), h.drawOnChartArea && (s.moveTo(t.x1, t.y1), s.lineTo(t.x2, t.y2)), s.stroke(), s.restore()), d.display) { s.save(), s.translate(t.labelX, t.labelY), s.rotate(t.rotation), s.font = t.major ? y.font : b.font, s.fillStyle = t.major ? x : v, s.textBaseline = t.textBaseline, s.textAlign = t.textAlign;var i = t.label;if (o.isArray(i)) for (var n = i.length, a = 1.5 * b.size, r = e.isHorizontal() ? 0 : -a * (n - 1) / 2, l = 0; l < n; ++l) { s.fillText("" + i[l], 0, r), r += a; } else s.fillText(i, 0, 0);s.restore(); } }), f.display) { var F, O, R = 0, L = r(f) / 2;if (p) F = e.left + (e.right - e.left) / 2, O = "bottom" === a.position ? e.bottom - L - S.bottom : e.top + L + S.top;else { var z = "left" === a.position;F = z ? e.left + L + S.top : e.right - L - S.top, O = e.top + (e.bottom - e.top) / 2, R = z ? -.5 * Math.PI : .5 * Math.PI; }s.save(), s.translate(F, O), s.rotate(R), s.textAlign = "center", s.textBaseline = "middle", s.fillStyle = M, s.font = w.font, s.fillText(f.labelString, 0, 0), s.restore(); }if (h.drawBorder) { s.lineWidth = o.valueAtIndexOrDefault(h.lineWidth, 0), s.strokeStyle = o.valueAtIndexOrDefault(h.color, 0);var B = e.left, W = e.right + D, N = e.top, V = e.bottom + D, E = o.aliasPixel(s.lineWidth);p ? (N = V = "top" === a.position ? e.bottom : e.top, N += E, V += E) : (B = W = "left" === a.position ? e.right : e.left, B += E, W += E), s.beginPath(), s.moveTo(B, N), s.lineTo(W, V), s.stroke(); } } } }); }; }, { 25: 25, 26: 26, 34: 34, 45: 45 }], 33: [function (t, e, i) { "use strict"; var n = t(25), a = t(45), o = t(30);e.exports = function (t) { t.scaleService = { constructors: {}, defaults: {}, registerScaleType: function registerScaleType(t, e, i) { this.constructors[t] = e, this.defaults[t] = a.clone(i); }, getScaleConstructor: function getScaleConstructor(t) { return this.constructors.hasOwnProperty(t) ? this.constructors[t] : void 0; }, getScaleDefaults: function getScaleDefaults(t) { return this.defaults.hasOwnProperty(t) ? a.merge({}, [n.scale, this.defaults[t]]) : {}; }, updateScaleDefaults: function updateScaleDefaults(t, e) { this.defaults.hasOwnProperty(t) && (this.defaults[t] = a.extend(this.defaults[t], e)); }, addScalesToLayout: function addScalesToLayout(t) { a.each(t.scales, function (e) { e.fullWidth = e.options.fullWidth, e.position = e.options.position, e.weight = e.options.weight, o.addBox(t, e); }); } }; }; }, { 25: 25, 30: 30, 45: 45 }], 34: [function (t, e, i) { "use strict"; var n = t(45);e.exports = { formatters: { values: function values(t) { return n.isArray(t) ? t : "" + t; }, linear: function linear(t, e, i) { var a = i.length > 3 ? i[2] - i[1] : i[1] - i[0];Math.abs(a) > 1 && t !== Math.floor(t) && (a = t - Math.floor(t));var o = n.log10(Math.abs(a)), r = "";if (0 !== t) { var s = -1 * Math.floor(o);s = Math.max(Math.min(s, 20), 0), r = t.toFixed(s); } else r = "0";return r; }, logarithmic: function logarithmic(t, e, i) { var a = t / Math.pow(10, Math.floor(n.log10(t)));return 0 === t ? "0" : 1 === a || 2 === a || 5 === a || 0 === e || e === i.length - 1 ? t.toExponential() : ""; } } }; }, { 45: 45 }], 35: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45);n._set("global", { tooltips: { enabled: !0, custom: null, mode: "nearest", position: "average", intersect: !0, backgroundColor: "rgba(0,0,0,0.8)", titleFontStyle: "bold", titleSpacing: 2, titleMarginBottom: 6, titleFontColor: "#fff", titleAlign: "left", bodySpacing: 2, bodyFontColor: "#fff", bodyAlign: "left", footerFontStyle: "bold", footerSpacing: 2, footerMarginTop: 6, footerFontColor: "#fff", footerAlign: "left", yPadding: 6, xPadding: 6, caretPadding: 2, caretSize: 5, cornerRadius: 6, multiKeyBackground: "#fff", displayColors: !0, borderColor: "rgba(0,0,0,0)", borderWidth: 0, callbacks: { beforeTitle: o.noop, title: function title(t, e) { var i = "", n = e.labels, a = n ? n.length : 0;if (t.length > 0) { var o = t[0];o.xLabel ? i = o.xLabel : a > 0 && o.index < a && (i = n[o.index]); }return i; }, afterTitle: o.noop, beforeBody: o.noop, beforeLabel: o.noop, label: function label(t, e) { var i = e.datasets[t.datasetIndex].label || "";return i && (i += ": "), i += t.yLabel; }, labelColor: function labelColor(t, e) { var i = e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return { borderColor: i.borderColor, backgroundColor: i.backgroundColor }; }, labelTextColor: function labelTextColor() { return this._options.bodyFontColor; }, afterLabel: o.noop, afterBody: o.noop, beforeFooter: o.noop, footer: o.noop, afterFooter: o.noop } } }), e.exports = function (t) { function e(t, e) { var i = o.color(t);return i.alpha(e * i.alpha()).rgbaString(); }function i(t, e) { return e && (o.isArray(e) ? Array.prototype.push.apply(t, e) : t.push(e)), t; }function r(t) { var e = n.global, i = o.valueOrDefault;return { xPadding: t.xPadding, yPadding: t.yPadding, xAlign: t.xAlign, yAlign: t.yAlign, bodyFontColor: t.bodyFontColor, _bodyFontFamily: i(t.bodyFontFamily, e.defaultFontFamily), _bodyFontStyle: i(t.bodyFontStyle, e.defaultFontStyle), _bodyAlign: t.bodyAlign, bodyFontSize: i(t.bodyFontSize, e.defaultFontSize), bodySpacing: t.bodySpacing, titleFontColor: t.titleFontColor, _titleFontFamily: i(t.titleFontFamily, e.defaultFontFamily), _titleFontStyle: i(t.titleFontStyle, e.defaultFontStyle), titleFontSize: i(t.titleFontSize, e.defaultFontSize), _titleAlign: t.titleAlign, titleSpacing: t.titleSpacing, titleMarginBottom: t.titleMarginBottom, footerFontColor: t.footerFontColor, _footerFontFamily: i(t.footerFontFamily, e.defaultFontFamily), _footerFontStyle: i(t.footerFontStyle, e.defaultFontStyle), footerFontSize: i(t.footerFontSize, e.defaultFontSize), _footerAlign: t.footerAlign, footerSpacing: t.footerSpacing, footerMarginTop: t.footerMarginTop, caretSize: t.caretSize, cornerRadius: t.cornerRadius, backgroundColor: t.backgroundColor, opacity: 0, legendColorBackground: t.multiKeyBackground, displayColors: t.displayColors, borderColor: t.borderColor, borderWidth: t.borderWidth }; }t.Tooltip = a.extend({ initialize: function initialize() { this._model = r(this._options), this._lastActive = []; }, getTitle: function getTitle() { var t = this._options.callbacks, e = t.beforeTitle.apply(this, arguments), n = t.title.apply(this, arguments), a = t.afterTitle.apply(this, arguments), o = [];return o = i(o = i(o = i(o, e), n), a); }, getBeforeBody: function getBeforeBody() { var t = this._options.callbacks.beforeBody.apply(this, arguments);return o.isArray(t) ? t : void 0 !== t ? [t] : []; }, getBody: function getBody(t, e) { var n = this, a = n._options.callbacks, r = [];return o.each(t, function (t) { var o = { before: [], lines: [], after: [] };i(o.before, a.beforeLabel.call(n, t, e)), i(o.lines, a.label.call(n, t, e)), i(o.after, a.afterLabel.call(n, t, e)), r.push(o); }), r; }, getAfterBody: function getAfterBody() { var t = this._options.callbacks.afterBody.apply(this, arguments);return o.isArray(t) ? t : void 0 !== t ? [t] : []; }, getFooter: function getFooter() { var t = this._options.callbacks, e = t.beforeFooter.apply(this, arguments), n = t.footer.apply(this, arguments), a = t.afterFooter.apply(this, arguments), o = [];return o = i(o = i(o = i(o, e), n), a); }, update: function update(e) { var i, n, a, s, l, u, d, c, h, f, g, p, m, v, b, x, y, k, M, w, S = this, C = S._options, _ = S._model, D = S._model = r(C), I = S._active, P = S._data, A = { xAlign: _.xAlign, yAlign: _.yAlign }, T = { x: _.x, y: _.y }, F = { width: _.width, height: _.height }, O = { x: _.caretX, y: _.caretY };if (I.length) { D.opacity = 1;var R = [], L = [];O = t.Tooltip.positioners[C.position].call(S, I, S._eventPosition);var z = [];for (i = 0, n = I.length; i < n; ++i) { z.push((x = I[i], y = void 0, k = void 0, void 0, void 0, y = x._xScale, k = x._yScale || x._scale, M = x._index, w = x._datasetIndex, { xLabel: y ? y.getLabelForIndex(M, w) : "", yLabel: k ? k.getLabelForIndex(M, w) : "", index: M, datasetIndex: w, x: x._model.x, y: x._model.y })); }C.filter && (z = z.filter(function (t) { return C.filter(t, P); })), C.itemSort && (z = z.sort(function (t, e) { return C.itemSort(t, e, P); })), o.each(z, function (t) { R.push(C.callbacks.labelColor.call(S, t, S._chart)), L.push(C.callbacks.labelTextColor.call(S, t, S._chart)); }), D.title = S.getTitle(z, P), D.beforeBody = S.getBeforeBody(z, P), D.body = S.getBody(z, P), D.afterBody = S.getAfterBody(z, P), D.footer = S.getFooter(z, P), D.x = Math.round(O.x), D.y = Math.round(O.y), D.caretPadding = C.caretPadding, D.labelColors = R, D.labelTextColors = L, D.dataPoints = z, A = function (t, e) { var i, n, a, o, r, s = t._model, l = t._chart, u = t._chart.chartArea, d = "center", c = "center";s.y < e.height ? c = "top" : s.y > l.height - e.height && (c = "bottom");var h = (u.left + u.right) / 2, f = (u.top + u.bottom) / 2;"center" === c ? (i = function i(t) { return t <= h; }, n = function n(t) { return t > h; }) : (i = function i(t) { return t <= e.width / 2; }, n = function n(t) { return t >= l.width - e.width / 2; }), a = function a(t) { return t + e.width + s.caretSize + s.caretPadding > l.width; }, o = function o(t) { return t - e.width - s.caretSize - s.caretPadding < 0; }, r = function r(t) { return t <= f ? "top" : "bottom"; }, i(s.x) ? (d = "left", a(s.x) && (d = "center", c = r(s.y))) : n(s.x) && (d = "right", o(s.x) && (d = "center", c = r(s.y)));var g = t._options;return { xAlign: g.xAlign ? g.xAlign : d, yAlign: g.yAlign ? g.yAlign : c }; }(this, F = function (t, e) { var i = t._chart.ctx, n = 2 * e.yPadding, a = 0, r = e.body, s = r.reduce(function (t, e) { return t + e.before.length + e.lines.length + e.after.length; }, 0);s += e.beforeBody.length + e.afterBody.length;var l = e.title.length, u = e.footer.length, d = e.titleFontSize, c = e.bodyFontSize, h = e.footerFontSize;n += l * d, n += l ? (l - 1) * e.titleSpacing : 0, n += l ? e.titleMarginBottom : 0, n += s * c, n += s ? (s - 1) * e.bodySpacing : 0, n += u ? e.footerMarginTop : 0, n += u * h, n += u ? (u - 1) * e.footerSpacing : 0;var f = 0, g = function g(t) { a = Math.max(a, i.measureText(t).width + f); };return i.font = o.fontString(d, e._titleFontStyle, e._titleFontFamily), o.each(e.title, g), i.font = o.fontString(c, e._bodyFontStyle, e._bodyFontFamily), o.each(e.beforeBody.concat(e.afterBody), g), f = e.displayColors ? c + 2 : 0, o.each(r, function (t) { o.each(t.before, g), o.each(t.lines, g), o.each(t.after, g); }), f = 0, i.font = o.fontString(h, e._footerFontStyle, e._footerFontFamily), o.each(e.footer, g), { width: a += 2 * e.xPadding, height: n }; }(this, D)), a = D, s = F, l = A, u = S._chart, d = a.x, c = a.y, h = a.caretSize, f = a.caretPadding, g = a.cornerRadius, p = l.xAlign, m = l.yAlign, v = h + f, b = g + f, "right" === p ? d -= s.width : "center" === p && ((d -= s.width / 2) + s.width > u.width && (d = u.width - s.width), d < 0 && (d = 0)), "top" === m ? c += v : c -= "bottom" === m ? s.height + v : s.height / 2, "center" === m ? "left" === p ? d += v : "right" === p && (d -= v) : "left" === p ? d -= b : "right" === p && (d += b), T = { x: d, y: c }; } else D.opacity = 0;return D.xAlign = A.xAlign, D.yAlign = A.yAlign, D.x = T.x, D.y = T.y, D.width = F.width, D.height = F.height, D.caretX = O.x, D.caretY = O.y, S._model = D, e && C.custom && C.custom.call(S, D), S; }, drawCaret: function drawCaret(t, e) { var i = this._chart.ctx, n = this._view, a = this.getCaretPosition(t, e, n);i.lineTo(a.x1, a.y1), i.lineTo(a.x2, a.y2), i.lineTo(a.x3, a.y3); }, getCaretPosition: function getCaretPosition(t, e, i) { var n, a, o, r, s, l, u = i.caretSize, d = i.cornerRadius, c = i.xAlign, h = i.yAlign, f = t.x, g = t.y, p = e.width, m = e.height;if ("center" === h) s = g + m / 2, "left" === c ? (a = (n = f) - u, o = n, r = s + u, l = s - u) : (a = (n = f + p) + u, o = n, r = s - u, l = s + u);else if ("left" === c ? (n = (a = f + d + u) - u, o = a + u) : "right" === c ? (n = (a = f + p - d - u) - u, o = a + u) : (n = (a = i.caretX) - u, o = a + u), "top" === h) s = (r = g) - u, l = r;else { s = (r = g + m) + u, l = r;var v = o;o = n, n = v; }return { x1: n, x2: a, x3: o, y1: r, y2: s, y3: l }; }, drawTitle: function drawTitle(t, i, n, a) { var r = i.title;if (r.length) { n.textAlign = i._titleAlign, n.textBaseline = "top";var s, l, u = i.titleFontSize, d = i.titleSpacing;for (n.fillStyle = e(i.titleFontColor, a), n.font = o.fontString(u, i._titleFontStyle, i._titleFontFamily), s = 0, l = r.length; s < l; ++s) { n.fillText(r[s], t.x, t.y), t.y += u + d, s + 1 === r.length && (t.y += i.titleMarginBottom - d); } } }, drawBody: function drawBody(t, i, n, a) { var r = i.bodyFontSize, s = i.bodySpacing, l = i.body;n.textAlign = i._bodyAlign, n.textBaseline = "top", n.font = o.fontString(r, i._bodyFontStyle, i._bodyFontFamily);var u = 0, d = function d(e) { n.fillText(e, t.x + u, t.y), t.y += r + s; };n.fillStyle = e(i.bodyFontColor, a), o.each(i.beforeBody, d);var c = i.displayColors;u = c ? r + 2 : 0, o.each(l, function (s, l) { var u = e(i.labelTextColors[l], a);n.fillStyle = u, o.each(s.before, d), o.each(s.lines, function (o) { c && (n.fillStyle = e(i.legendColorBackground, a), n.fillRect(t.x, t.y, r, r), n.lineWidth = 1, n.strokeStyle = e(i.labelColors[l].borderColor, a), n.strokeRect(t.x, t.y, r, r), n.fillStyle = e(i.labelColors[l].backgroundColor, a), n.fillRect(t.x + 1, t.y + 1, r - 2, r - 2), n.fillStyle = u), d(o); }), o.each(s.after, d); }), u = 0, o.each(i.afterBody, d), t.y -= s; }, drawFooter: function drawFooter(t, i, n, a) { var r = i.footer;r.length && (t.y += i.footerMarginTop, n.textAlign = i._footerAlign, n.textBaseline = "top", n.fillStyle = e(i.footerFontColor, a), n.font = o.fontString(i.footerFontSize, i._footerFontStyle, i._footerFontFamily), o.each(r, function (e) { n.fillText(e, t.x, t.y), t.y += i.footerFontSize + i.footerSpacing; })); }, drawBackground: function drawBackground(t, i, n, a, o) { n.fillStyle = e(i.backgroundColor, o), n.strokeStyle = e(i.borderColor, o), n.lineWidth = i.borderWidth;var r = i.xAlign, s = i.yAlign, l = t.x, u = t.y, d = a.width, c = a.height, h = i.cornerRadius;n.beginPath(), n.moveTo(l + h, u), "top" === s && this.drawCaret(t, a), n.lineTo(l + d - h, u), n.quadraticCurveTo(l + d, u, l + d, u + h), "center" === s && "right" === r && this.drawCaret(t, a), n.lineTo(l + d, u + c - h), n.quadraticCurveTo(l + d, u + c, l + d - h, u + c), "bottom" === s && this.drawCaret(t, a), n.lineTo(l + h, u + c), n.quadraticCurveTo(l, u + c, l, u + c - h), "center" === s && "left" === r && this.drawCaret(t, a), n.lineTo(l, u + h), n.quadraticCurveTo(l, u, l + h, u), n.closePath(), n.fill(), i.borderWidth > 0 && n.stroke(); }, draw: function draw() { var t = this._chart.ctx, e = this._view;if (0 !== e.opacity) { var i = { width: e.width, height: e.height }, n = { x: e.x, y: e.y }, a = Math.abs(e.opacity < .001) ? 0 : e.opacity, o = e.title.length || e.beforeBody.length || e.body.length || e.afterBody.length || e.footer.length;this._options.enabled && o && (this.drawBackground(n, e, t, i, a), n.x += e.xPadding, n.y += e.yPadding, this.drawTitle(n, e, t, a), this.drawBody(n, e, t, a), this.drawFooter(n, e, t, a)); } }, handleEvent: function handleEvent(t) { var e, i = this, n = i._options;return i._lastActive = i._lastActive || [], "mouseout" === t.type ? i._active = [] : i._active = i._chart.getElementsAtEventForMode(t, n.mode, n), (e = !o.arrayEquals(i._active, i._lastActive)) && (i._lastActive = i._active, (n.enabled || n.custom) && (i._eventPosition = { x: t.x, y: t.y }, i.update(!0), i.pivot())), e; } }), t.Tooltip.positioners = { average: function average(t) { if (!t.length) return !1;var e, i, n = 0, a = 0, o = 0;for (e = 0, i = t.length; e < i; ++e) { var r = t[e];if (r && r.hasValue()) { var s = r.tooltipPosition();n += s.x, a += s.y, ++o; } }return { x: Math.round(n / o), y: Math.round(a / o) }; }, nearest: function nearest(t, e) { var i, n, a, r = e.x, s = e.y, l = Number.POSITIVE_INFINITY;for (i = 0, n = t.length; i < n; ++i) { var u = t[i];if (u && u.hasValue()) { var d = u.getCenterPoint(), c = o.distanceBetweenPoints(e, d);c < l && (l = c, a = u); } }if (a) { var h = a.tooltipPosition();r = h.x, s = h.y; }return { x: r, y: s }; } }; }; }, { 25: 25, 26: 26, 45: 45 }], 36: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45);n._set("global", { elements: { arc: { backgroundColor: n.global.defaultColor, borderColor: "#fff", borderWidth: 2 } } }), e.exports = a.extend({ inLabelRange: function inLabelRange(t) { var e = this._view;return !!e && Math.pow(t - e.x, 2) < Math.pow(e.radius + e.hoverRadius, 2); }, inRange: function inRange(t, e) { var i = this._view;if (i) { for (var n = o.getAngleFromPoint(i, { x: t, y: e }), a = n.angle, r = n.distance, s = i.startAngle, l = i.endAngle; l < s;) { l += 2 * Math.PI; }for (; a > l;) { a -= 2 * Math.PI; }for (; a < s;) { a += 2 * Math.PI; }var u = a >= s && a <= l, d = r >= i.innerRadius && r <= i.outerRadius;return u && d; }return !1; }, getCenterPoint: function getCenterPoint() { var t = this._view, e = (t.startAngle + t.endAngle) / 2, i = (t.innerRadius + t.outerRadius) / 2;return { x: t.x + Math.cos(e) * i, y: t.y + Math.sin(e) * i }; }, getArea: function getArea() { var t = this._view;return Math.PI * ((t.endAngle - t.startAngle) / (2 * Math.PI)) * (Math.pow(t.outerRadius, 2) - Math.pow(t.innerRadius, 2)); }, tooltipPosition: function tooltipPosition() { var t = this._view, e = t.startAngle + (t.endAngle - t.startAngle) / 2, i = (t.outerRadius - t.innerRadius) / 2 + t.innerRadius;return { x: t.x + Math.cos(e) * i, y: t.y + Math.sin(e) * i }; }, draw: function draw() { var t = this._chart.ctx, e = this._view, i = e.startAngle, n = e.endAngle;t.beginPath(), t.arc(e.x, e.y, e.outerRadius, i, n), t.arc(e.x, e.y, e.innerRadius, n, i, !0), t.closePath(), t.strokeStyle = e.borderColor, t.lineWidth = e.borderWidth, t.fillStyle = e.backgroundColor, t.fill(), t.lineJoin = "bevel", e.borderWidth && t.stroke(); } }); }, { 25: 25, 26: 26, 45: 45 }], 37: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45), r = n.global;n._set("global", { elements: { line: { tension: .4, backgroundColor: r.defaultColor, borderWidth: 3, borderColor: r.defaultColor, borderCapStyle: "butt", borderDash: [], borderDashOffset: 0, borderJoinStyle: "miter", capBezierPoints: !0, fill: !0 } } }), e.exports = a.extend({ draw: function draw() { var t, e, i, n, a = this._view, s = this._chart.ctx, l = a.spanGaps, u = this._children.slice(), d = r.elements.line, c = -1;for (this._loop && u.length && u.push(u[0]), s.save(), s.lineCap = a.borderCapStyle || d.borderCapStyle, s.setLineDash && s.setLineDash(a.borderDash || d.borderDash), s.lineDashOffset = a.borderDashOffset || d.borderDashOffset, s.lineJoin = a.borderJoinStyle || d.borderJoinStyle, s.lineWidth = a.borderWidth || d.borderWidth, s.strokeStyle = a.borderColor || r.defaultColor, s.beginPath(), c = -1, t = 0; t < u.length; ++t) { e = u[t], i = o.previousItem(u, t), n = e._view, 0 === t ? n.skip || (s.moveTo(n.x, n.y), c = t) : (i = -1 === c ? i : u[c], n.skip || (c !== t - 1 && !l || -1 === c ? s.moveTo(n.x, n.y) : o.canvas.lineTo(s, i._view, e._view), c = t)); }s.stroke(), s.restore(); } }); }, { 25: 25, 26: 26, 45: 45 }], 38: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45), r = n.global.defaultColor;function s(t) { var e = this._view;return !!e && Math.abs(t - e.x) < e.radius + e.hitRadius; }n._set("global", { elements: { point: { radius: 3, pointStyle: "circle", backgroundColor: r, borderColor: r, borderWidth: 1, hitRadius: 1, hoverRadius: 4, hoverBorderWidth: 1 } } }), e.exports = a.extend({ inRange: function inRange(t, e) { var i = this._view;return !!i && Math.pow(t - i.x, 2) + Math.pow(e - i.y, 2) < Math.pow(i.hitRadius + i.radius, 2); }, inLabelRange: s, inXRange: s, inYRange: function inYRange(t) { var e = this._view;return !!e && Math.abs(t - e.y) < e.radius + e.hitRadius; }, getCenterPoint: function getCenterPoint() { var t = this._view;return { x: t.x, y: t.y }; }, getArea: function getArea() { return Math.PI * Math.pow(this._view.radius, 2); }, tooltipPosition: function tooltipPosition() { var t = this._view;return { x: t.x, y: t.y, padding: t.radius + t.borderWidth }; }, draw: function draw(t) { var e = this._view, i = this._model, a = this._chart.ctx, s = e.pointStyle, l = e.radius, u = e.x, d = e.y, c = o.color, h = 0;e.skip || (a.strokeStyle = e.borderColor || r, a.lineWidth = o.valueOrDefault(e.borderWidth, n.global.elements.point.borderWidth), a.fillStyle = e.backgroundColor || r, void 0 !== t && (i.x < t.left || 1.01 * t.right < i.x || i.y < t.top || 1.01 * t.bottom < i.y) && (i.x < t.left ? h = (u - i.x) / (t.left - i.x) : 1.01 * t.right < i.x ? h = (i.x - u) / (i.x - t.right) : i.y < t.top ? h = (d - i.y) / (t.top - i.y) : 1.01 * t.bottom < i.y && (h = (i.y - d) / (i.y - t.bottom)), h = Math.round(100 * h) / 100, a.strokeStyle = c(a.strokeStyle).alpha(h).rgbString(), a.fillStyle = c(a.fillStyle).alpha(h).rgbString()), o.canvas.drawPoint(a, s, l, u, d)); } }); }, { 25: 25, 26: 26, 45: 45 }], 39: [function (t, e, i) { "use strict"; var n = t(25), a = t(26);function o(t) { return void 0 !== t._view.width; }function r(t) { var e, i, n, a, r = t._view;if (o(t)) { var s = r.width / 2;e = r.x - s, i = r.x + s, n = Math.min(r.y, r.base), a = Math.max(r.y, r.base); } else { var l = r.height / 2;e = Math.min(r.x, r.base), i = Math.max(r.x, r.base), n = r.y - l, a = r.y + l; }return { left: e, top: n, right: i, bottom: a }; }n._set("global", { elements: { rectangle: { backgroundColor: n.global.defaultColor, borderColor: n.global.defaultColor, borderSkipped: "bottom", borderWidth: 0 } } }), e.exports = a.extend({ draw: function draw() { var t, e, i, n, a, o, r, s = this._chart.ctx, l = this._view, u = l.borderWidth;if (l.horizontal ? (t = l.base, e = l.x, i = l.y - l.height / 2, n = l.y + l.height / 2, a = e > t ? 1 : -1, o = 1, r = l.borderSkipped || "left") : (t = l.x - l.width / 2, e = l.x + l.width / 2, i = l.y, a = 1, o = (n = l.base) > i ? 1 : -1, r = l.borderSkipped || "bottom"), u) { var d = Math.min(Math.abs(t - e), Math.abs(i - n)), c = (u = u > d ? d : u) / 2, h = t + ("left" !== r ? c * a : 0), f = e + ("right" !== r ? -c * a : 0), g = i + ("top" !== r ? c * o : 0), p = n + ("bottom" !== r ? -c * o : 0);h !== f && (i = g, n = p), g !== p && (t = h, e = f); }s.beginPath(), s.fillStyle = l.backgroundColor, s.strokeStyle = l.borderColor, s.lineWidth = u;var m = [[t, n], [t, i], [e, i], [e, n]], v = ["bottom", "left", "top", "right"].indexOf(r, 0);function b(t) { return m[(v + t) % 4]; }-1 === v && (v = 0);var x = b(0);s.moveTo(x[0], x[1]);for (var y = 1; y < 4; y++) { x = b(y), s.lineTo(x[0], x[1]); }s.fill(), u && s.stroke(); }, height: function height() { var t = this._view;return t.base - t.y; }, inRange: function inRange(t, e) { var i = !1;if (this._view) { var n = r(this);i = t >= n.left && t <= n.right && e >= n.top && e <= n.bottom; }return i; }, inLabelRange: function inLabelRange(t, e) { if (!this._view) return !1;var i = r(this);return o(this) ? t >= i.left && t <= i.right : e >= i.top && e <= i.bottom; }, inXRange: function inXRange(t) { var e = r(this);return t >= e.left && t <= e.right; }, inYRange: function inYRange(t) { var e = r(this);return t >= e.top && t <= e.bottom; }, getCenterPoint: function getCenterPoint() { var t, e, i = this._view;return o(this) ? (t = i.x, e = (i.y + i.base) / 2) : (t = (i.x + i.base) / 2, e = i.y), { x: t, y: e }; }, getArea: function getArea() { var t = this._view;return t.width * Math.abs(t.y - t.base); }, tooltipPosition: function tooltipPosition() { var t = this._view;return { x: t.x, y: t.y }; } }); }, { 25: 25, 26: 26 }], 40: [function (t, e, i) { "use strict"; e.exports = {}, e.exports.Arc = t(36), e.exports.Line = t(37), e.exports.Point = t(38), e.exports.Rectangle = t(39); }, { 36: 36, 37: 37, 38: 38, 39: 39 }], 41: [function (t, e, i) { "use strict"; var n = t(42);i = e.exports = { clear: function clear(t) { t.ctx.clearRect(0, 0, t.width, t.height); }, roundedRect: function roundedRect(t, e, i, n, a, o) { if (o) { var r = Math.min(o, n / 2), s = Math.min(o, a / 2);t.moveTo(e + r, i), t.lineTo(e + n - r, i), t.quadraticCurveTo(e + n, i, e + n, i + s), t.lineTo(e + n, i + a - s), t.quadraticCurveTo(e + n, i + a, e + n - r, i + a), t.lineTo(e + r, i + a), t.quadraticCurveTo(e, i + a, e, i + a - s), t.lineTo(e, i + s), t.quadraticCurveTo(e, i, e + r, i); } else t.rect(e, i, n, a); }, drawPoint: function drawPoint(t, e, i, n, a) { var o, r, s, l, u, d;if (!e || "object" != (typeof e === "undefined" ? "undefined" : _typeof(e)) || "[object HTMLImageElement]" !== (o = e.toString()) && "[object HTMLCanvasElement]" !== o) { if (!(isNaN(i) || i <= 0)) { switch (e) {default: t.beginPath(), t.arc(n, a, i, 0, 2 * Math.PI), t.closePath(), t.fill();break;case "triangle": t.beginPath(), u = (r = 3 * i / Math.sqrt(3)) * Math.sqrt(3) / 2, t.moveTo(n - r / 2, a + u / 3), t.lineTo(n + r / 2, a + u / 3), t.lineTo(n, a - 2 * u / 3), t.closePath(), t.fill();break;case "rect": d = 1 / Math.SQRT2 * i, t.beginPath(), t.fillRect(n - d, a - d, 2 * d, 2 * d), t.strokeRect(n - d, a - d, 2 * d, 2 * d);break;case "rectRounded": var c = i / Math.SQRT2, h = n - c, f = a - c, g = Math.SQRT2 * i;t.beginPath(), this.roundedRect(t, h, f, g, g, i / 2), t.closePath(), t.fill();break;case "rectRot": d = 1 / Math.SQRT2 * i, t.beginPath(), t.moveTo(n - d, a), t.lineTo(n, a + d), t.lineTo(n + d, a), t.lineTo(n, a - d), t.closePath(), t.fill();break;case "cross": t.beginPath(), t.moveTo(n, a + i), t.lineTo(n, a - i), t.moveTo(n - i, a), t.lineTo(n + i, a), t.closePath();break;case "crossRot": t.beginPath(), s = Math.cos(Math.PI / 4) * i, l = Math.sin(Math.PI / 4) * i, t.moveTo(n - s, a - l), t.lineTo(n + s, a + l), t.moveTo(n - s, a + l), t.lineTo(n + s, a - l), t.closePath();break;case "star": t.beginPath(), t.moveTo(n, a + i), t.lineTo(n, a - i), t.moveTo(n - i, a), t.lineTo(n + i, a), s = Math.cos(Math.PI / 4) * i, l = Math.sin(Math.PI / 4) * i, t.moveTo(n - s, a - l), t.lineTo(n + s, a + l), t.moveTo(n - s, a + l), t.lineTo(n + s, a - l), t.closePath();break;case "line": t.beginPath(), t.moveTo(n - i, a), t.lineTo(n + i, a), t.closePath();break;case "dash": t.beginPath(), t.moveTo(n, a), t.lineTo(n + i, a), t.closePath();}t.stroke(); } } else t.drawImage(e, n - e.width / 2, a - e.height / 2, e.width, e.height); }, clipArea: function clipArea(t, e) { t.save(), t.beginPath(), t.rect(e.left, e.top, e.right - e.left, e.bottom - e.top), t.clip(); }, unclipArea: function unclipArea(t) { t.restore(); }, lineTo: function lineTo(t, e, i, n) { if (i.steppedLine) return "after" === i.steppedLine && !n || "after" !== i.steppedLine && n ? t.lineTo(e.x, i.y) : t.lineTo(i.x, e.y), void t.lineTo(i.x, i.y);i.tension ? t.bezierCurveTo(n ? e.controlPointPreviousX : e.controlPointNextX, n ? e.controlPointPreviousY : e.controlPointNextY, n ? i.controlPointNextX : i.controlPointPreviousX, n ? i.controlPointNextY : i.controlPointPreviousY, i.x, i.y) : t.lineTo(i.x, i.y); } };n.clear = i.clear, n.drawRoundedRectangle = function (t) { t.beginPath(), i.roundedRect.apply(i, arguments), t.closePath(); }; }, { 42: 42 }], 42: [function (t, e, i) { "use strict"; var n, a = { noop: function noop() {}, uid: (n = 0, function () { return n++; }), isNullOrUndef: function isNullOrUndef(t) { return null == t; }, isArray: Array.isArray ? Array.isArray : function (t) { return "[object Array]" === Object.prototype.toString.call(t); }, isObject: function isObject(t) { return null !== t && "[object Object]" === Object.prototype.toString.call(t); }, valueOrDefault: function valueOrDefault(t, e) { return void 0 === t ? e : t; }, valueAtIndexOrDefault: function valueAtIndexOrDefault(t, e, i) { return a.valueOrDefault(a.isArray(t) ? t[e] : t, i); }, callback: function callback(t, e, i) { if (t && "function" == typeof t.call) return t.apply(i, e); }, each: function each(t, e, i, n) { var o, r, s;if (a.isArray(t)) { if (r = t.length, n) for (o = r - 1; o >= 0; o--) { e.call(i, t[o], o); } else for (o = 0; o < r; o++) { e.call(i, t[o], o); } } else if (a.isObject(t)) for (r = (s = Object.keys(t)).length, o = 0; o < r; o++) { e.call(i, t[s[o]], s[o]); } }, arrayEquals: function arrayEquals(t, e) { var i, n, o, r;if (!t || !e || t.length !== e.length) return !1;for (i = 0, n = t.length; i < n; ++i) { if (o = t[i], r = e[i], o instanceof Array && r instanceof Array) { if (!a.arrayEquals(o, r)) return !1; } else if (o !== r) return !1; }return !0; }, clone: function clone(t) { if (a.isArray(t)) return t.map(a.clone);if (a.isObject(t)) { for (var e = {}, i = Object.keys(t), n = i.length, o = 0; o < n; ++o) { e[i[o]] = a.clone(t[i[o]]); }return e; }return t; }, _merger: function _merger(t, e, i, n) { var o = e[t], r = i[t];a.isObject(o) && a.isObject(r) ? a.merge(o, r, n) : e[t] = a.clone(r); }, _mergerIf: function _mergerIf(t, e, i) { var n = e[t], o = i[t];a.isObject(n) && a.isObject(o) ? a.mergeIf(n, o) : e.hasOwnProperty(t) || (e[t] = a.clone(o)); }, merge: function merge(t, e, i) { var n, o, r, s, l, u = a.isArray(e) ? e : [e], d = u.length;if (!a.isObject(t)) return t;for (n = (i = i || {}).merger || a._merger, o = 0; o < d; ++o) { if (e = u[o], a.isObject(e)) for (l = 0, s = (r = Object.keys(e)).length; l < s; ++l) { n(r[l], t, e, i); } }return t; }, mergeIf: function mergeIf(t, e) { return a.merge(t, e, { merger: a._mergerIf }); }, extend: function extend(t) { for (var e = function e(_e, i) { t[i] = _e; }, i = 1, n = arguments.length; i < n; ++i) { a.each(arguments[i], e); }return t; }, inherits: function inherits(t) { var e = this, i = t && t.hasOwnProperty("constructor") ? t.constructor : function () { return e.apply(this, arguments); }, n = function n() { this.constructor = i; };return n.prototype = e.prototype, i.prototype = new n(), i.extend = a.inherits, t && a.extend(i.prototype, t), i.__super__ = e.prototype, i; } };e.exports = a, a.callCallback = a.callback, a.indexOf = function (t, e, i) { return Array.prototype.indexOf.call(t, e, i); }, a.getValueOrDefault = a.valueOrDefault, a.getValueAtIndexOrDefault = a.valueAtIndexOrDefault; }, {}], 43: [function (t, e, i) { "use strict"; var n = t(42), a = { linear: function linear(t) { return t; }, easeInQuad: function easeInQuad(t) { return t * t; }, easeOutQuad: function easeOutQuad(t) { return -t * (t - 2); }, easeInOutQuad: function easeInOutQuad(t) { return (t /= .5) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1); }, easeInCubic: function easeInCubic(t) { return t * t * t; }, easeOutCubic: function easeOutCubic(t) { return (t -= 1) * t * t + 1; }, easeInOutCubic: function easeInOutCubic(t) { return (t /= .5) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2); }, easeInQuart: function easeInQuart(t) { return t * t * t * t; }, easeOutQuart: function easeOutQuart(t) { return -((t -= 1) * t * t * t - 1); }, easeInOutQuart: function easeInOutQuart(t) { return (t /= .5) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2); }, easeInQuint: function easeInQuint(t) { return t * t * t * t * t; }, easeOutQuint: function easeOutQuint(t) { return (t -= 1) * t * t * t * t + 1; }, easeInOutQuint: function easeInOutQuint(t) { return (t /= .5) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2); }, easeInSine: function easeInSine(t) { return 1 - Math.cos(t * (Math.PI / 2)); }, easeOutSine: function easeOutSine(t) { return Math.sin(t * (Math.PI / 2)); }, easeInOutSine: function easeInOutSine(t) { return -.5 * (Math.cos(Math.PI * t) - 1); }, easeInExpo: function easeInExpo(t) { return 0 === t ? 0 : Math.pow(2, 10 * (t - 1)); }, easeOutExpo: function easeOutExpo(t) { return 1 === t ? 1 : 1 - Math.pow(2, -10 * t); }, easeInOutExpo: function easeInOutExpo(t) { return 0 === t ? 0 : 1 === t ? 1 : (t /= .5) < 1 ? .5 * Math.pow(2, 10 * (t - 1)) : .5 * (2 - Math.pow(2, -10 * --t)); }, easeInCirc: function easeInCirc(t) { return t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1); }, easeOutCirc: function easeOutCirc(t) { return Math.sqrt(1 - (t -= 1) * t); }, easeInOutCirc: function easeInOutCirc(t) { return (t /= .5) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1); }, easeInElastic: function easeInElastic(t) { var e = 1.70158, i = 0, n = 1;return 0 === t ? 0 : 1 === t ? 1 : (i || (i = .3), n < 1 ? (n = 1, e = i / 4) : e = i / (2 * Math.PI) * Math.asin(1 / n), -n * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / i)); }, easeOutElastic: function easeOutElastic(t) { var e = 1.70158, i = 0, n = 1;return 0 === t ? 0 : 1 === t ? 1 : (i || (i = .3), n < 1 ? (n = 1, e = i / 4) : e = i / (2 * Math.PI) * Math.asin(1 / n), n * Math.pow(2, -10 * t) * Math.sin((t - e) * (2 * Math.PI) / i) + 1); }, easeInOutElastic: function easeInOutElastic(t) { var e = 1.70158, i = 0, n = 1;return 0 === t ? 0 : 2 == (t /= .5) ? 1 : (i || (i = .45), n < 1 ? (n = 1, e = i / 4) : e = i / (2 * Math.PI) * Math.asin(1 / n), t < 1 ? n * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / i) * -.5 : n * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / i) * .5 + 1); }, easeInBack: function easeInBack(t) { return t * t * (2.70158 * t - 1.70158); }, easeOutBack: function easeOutBack(t) { return (t -= 1) * t * (2.70158 * t + 1.70158) + 1; }, easeInOutBack: function easeInOutBack(t) { var e = 1.70158;return (t /= .5) < 1 ? t * t * ((1 + (e *= 1.525)) * t - e) * .5 : .5 * ((t -= 2) * t * ((1 + (e *= 1.525)) * t + e) + 2); }, easeInBounce: function easeInBounce(t) { return 1 - a.easeOutBounce(1 - t); }, easeOutBounce: function easeOutBounce(t) { return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; }, easeInOutBounce: function easeInOutBounce(t) { return t < .5 ? .5 * a.easeInBounce(2 * t) : .5 * a.easeOutBounce(2 * t - 1) + .5; } };e.exports = { effects: a }, n.easingEffects = a; }, { 42: 42 }], 44: [function (t, e, i) { "use strict"; var n = t(42);e.exports = { toLineHeight: function toLineHeight(t, e) { var i = ("" + t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if (!i || "normal" === i[1]) return 1.2 * e;switch (t = +i[2], i[3]) {case "px": return t;case "%": t /= 100;}return e * t; }, toPadding: function toPadding(t) { var e, i, a, o;return n.isObject(t) ? (e = +t.top || 0, i = +t.right || 0, a = +t.bottom || 0, o = +t.left || 0) : e = i = a = o = +t || 0, { top: e, right: i, bottom: a, left: o, height: e + a, width: o + i }; }, resolve: function resolve(t, e, i) { var a, o, r;for (a = 0, o = t.length; a < o; ++a) { if (void 0 !== (r = t[a]) && (void 0 !== e && "function" == typeof r && (r = r(e)), void 0 !== i && n.isArray(r) && (r = r[i]), void 0 !== r)) return r; } } }; }, { 42: 42 }], 45: [function (t, e, i) { "use strict"; e.exports = t(42), e.exports.easing = t(43), e.exports.canvas = t(41), e.exports.options = t(44); }, { 41: 41, 42: 42, 43: 43, 44: 44 }], 46: [function (t, e, i) { e.exports = { acquireContext: function acquireContext(t) { return t && t.canvas && (t = t.canvas), t && t.getContext("2d") || null; } }; }, {}], 47: [function (t, e, i) { "use strict"; var n = t(45), a = "$chartjs", o = "chartjs-", r = o + "render-monitor", s = o + "render-animation", l = ["animationstart", "webkitAnimationStart"], u = { touchstart: "mousedown", touchmove: "mousemove", touchend: "mouseup", pointerenter: "mouseenter", pointerdown: "mousedown", pointermove: "mousemove", pointerup: "mouseup", pointerleave: "mouseout", pointerout: "mouseout" };function d(t, e) { var i = n.getStyle(t, e), a = i && i.match(/^(\d+)(\.\d+)?px$/);return a ? Number(a[1]) : void 0; }var c = !!function () { var t = !1;try { var e = Object.defineProperty({}, "passive", { get: function get() { t = !0; } });window.addEventListener("e", null, e); } catch (t) {}return t; }() && { passive: !0 };function h(t, e, i) { t.addEventListener(e, i, c); }function f(t, e, i) { t.removeEventListener(e, i, c); }function g(t, e, i, n, a) { return { type: t, chart: e, native: a || null, x: void 0 !== i ? i : null, y: void 0 !== n ? n : null }; }function p(t, e, i) { var u, d, c, f, p, m, v, b, x = t[a] || (t[a] = {}), y = x.resizer = function (t) { var e = document.createElement("div"), i = o + "size-monitor", n = "position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText = n, e.className = i, e.innerHTML = '
';var a = e.childNodes[0], r = e.childNodes[1];e._reset = function () { a.scrollLeft = 1e6, a.scrollTop = 1e6, r.scrollLeft = 1e6, r.scrollTop = 1e6; };var s = function s() { e._reset(), t(); };return h(a, "scroll", s.bind(a, "expand")), h(r, "scroll", s.bind(r, "shrink")), e; }((u = function u() { if (x.resizer) return e(g("resize", i)); }, c = !1, f = [], function () { f = Array.prototype.slice.call(arguments), d = d || this, c || (c = !0, n.requestAnimFrame.call(window, function () { c = !1, u.apply(d, f); })); }));m = function m() { if (x.resizer) { var e = t.parentNode;e && e !== y.parentNode && e.insertBefore(y, e.firstChild), y._reset(); } }, v = (p = t)[a] || (p[a] = {}), b = v.renderProxy = function (t) { t.animationName === s && m(); }, n.each(l, function (t) { h(p, t, b); }), v.reflow = !!p.offsetParent, p.classList.add(r); }function m(t) { var e, i, o, s = t[a] || {}, u = s.resizer;delete s.resizer, i = (e = t)[a] || {}, (o = i.renderProxy) && (n.each(l, function (t) { f(e, t, o); }), delete i.renderProxy), e.classList.remove(r), u && u.parentNode && u.parentNode.removeChild(u); }e.exports = { _enabled: "undefined" != typeof window && "undefined" != typeof document, initialize: function initialize() { var t, e, i, n = "from{opacity:0.99}to{opacity:1}";e = "@-webkit-keyframes " + s + "{" + n + "}@keyframes " + s + "{" + n + "}." + r + "{-webkit-animation:" + s + " 0.001s;animation:" + s + " 0.001s;}", i = (t = this)._style || document.createElement("style"), t._style || (t._style = i, e = "/* Chart.js */\n" + e, i.setAttribute("type", "text/css"), document.getElementsByTagName("head")[0].appendChild(i)), i.appendChild(document.createTextNode(e)); }, acquireContext: function acquireContext(t, e) { "string" == typeof t ? t = document.getElementById(t) : t.length && (t = t[0]), t && t.canvas && (t = t.canvas);var i = t && t.getContext && t.getContext("2d");return i && i.canvas === t ? (function (t, e) { var i = t.style, n = t.getAttribute("height"), o = t.getAttribute("width");if (t[a] = { initial: { height: n, width: o, style: { display: i.display, height: i.height, width: i.width } } }, i.display = i.display || "block", null === o || "" === o) { var r = d(t, "width");void 0 !== r && (t.width = r); }if (null === n || "" === n) if ("" === t.style.height) t.height = t.width / (e.options.aspectRatio || 2);else { var s = d(t, "height");void 0 !== r && (t.height = s); } }(t, e), i) : null; }, releaseContext: function releaseContext(t) { var e = t.canvas;if (e[a]) { var i = e[a].initial;["height", "width"].forEach(function (t) { var a = i[t];n.isNullOrUndef(a) ? e.removeAttribute(t) : e.setAttribute(t, a); }), n.each(i.style || {}, function (t, i) { e.style[i] = t; }), e.width = e.width, delete e[a]; } }, addEventListener: function addEventListener(t, e, i) { var o = t.canvas;if ("resize" !== e) { var r = i[a] || (i[a] = {});h(o, e, (r.proxies || (r.proxies = {}))[t.id + "_" + e] = function (e) { var a, o, r, s;i((o = t, r = u[(a = e).type] || a.type, s = n.getRelativePosition(a, o), g(r, o, s.x, s.y, a))); }); } else p(o, i, t); }, removeEventListener: function removeEventListener(t, e, i) { var n = t.canvas;if ("resize" !== e) { var o = ((i[a] || {}).proxies || {})[t.id + "_" + e];o && f(n, e, o); } else m(n); } }, n.addEvent = h, n.removeEvent = f; }, { 45: 45 }], 48: [function (t, e, i) { "use strict"; var n = t(45), a = t(46), o = t(47), r = o._enabled ? o : a;e.exports = n.extend({ initialize: function initialize() {}, acquireContext: function acquireContext() {}, releaseContext: function releaseContext() {}, addEventListener: function addEventListener() {}, removeEventListener: function removeEventListener() {} }, r); }, { 45: 45, 46: 46, 47: 47 }], 49: [function (t, e, i) { "use strict"; e.exports = {}, e.exports.filler = t(50), e.exports.legend = t(51), e.exports.title = t(52); }, { 50: 50, 51: 51, 52: 52 }], 50: [function (t, e, i) { "use strict"; var n = t(25), a = t(40), o = t(45);n._set("global", { plugins: { filler: { propagate: !0 } } });var r = { dataset: function dataset(t) { var e = t.fill, i = t.chart, n = i.getDatasetMeta(e), a = n && i.isDatasetVisible(e) && n.dataset._children || [], o = a.length || 0;return o ? function (t, e) { return e < o && a[e]._view || null; } : null; }, boundary: function boundary(t) { var e = t.boundary, i = e ? e.x : null, n = e ? e.y : null;return function (t) { return { x: null === i ? t.x : i, y: null === n ? t.y : n }; }; } };function s(t, e, i) { var n, a = t._model || {}, o = a.fill;if (void 0 === o && (o = !!a.backgroundColor), !1 === o || null === o) return !1;if (!0 === o) return "origin";if (n = parseFloat(o, 10), isFinite(n) && Math.floor(n) === n) return "-" !== o[0] && "+" !== o[0] || (n = e + n), !(n === e || n < 0 || n >= i) && n;switch (o) {case "bottom": return "start";case "top": return "end";case "zero": return "origin";case "origin":case "start":case "end": return o;default: return !1;} }function l(t) { var e, i = t.el._model || {}, n = t.el._scale || {}, a = t.fill, o = null;if (isFinite(a)) return null;if ("start" === a ? o = void 0 === i.scaleBottom ? n.bottom : i.scaleBottom : "end" === a ? o = void 0 === i.scaleTop ? n.top : i.scaleTop : void 0 !== i.scaleZero ? o = i.scaleZero : n.getBasePosition ? o = n.getBasePosition() : n.getBasePixel && (o = n.getBasePixel()), null != o) { if (void 0 !== o.x && void 0 !== o.y) return o;if ("number" == typeof o && isFinite(o)) return { x: (e = n.isHorizontal()) ? o : null, y: e ? null : o }; }return null; }function u(t, e, i) { var n, a = t[e].fill, o = [e];if (!i) return a;for (; !1 !== a && -1 === o.indexOf(a);) { if (!isFinite(a)) return a;if (!(n = t[a])) return !1;if (n.visible) return a;o.push(a), a = n.fill; }return !1; }function d(t) { return t && !t.skip; }function c(t, e, i, n, a) { var r;if (n && a) { for (t.moveTo(e[0].x, e[0].y), r = 1; r < n; ++r) { o.canvas.lineTo(t, e[r - 1], e[r]); }for (t.lineTo(i[a - 1].x, i[a - 1].y), r = a - 1; r > 0; --r) { o.canvas.lineTo(t, i[r], i[r - 1], !0); } } }e.exports = { id: "filler", afterDatasetsUpdate: function afterDatasetsUpdate(t, e) { var i, n, o, d, c, h, f, g = (t.data.datasets || []).length, p = e.propagate, m = [];for (n = 0; n < g; ++n) { d = null, (o = (i = t.getDatasetMeta(n)).dataset) && o._model && o instanceof a.Line && (d = { visible: t.isDatasetVisible(n), fill: s(o, n, g), chart: t, el: o }), i.$filler = d, m.push(d); }for (n = 0; n < g; ++n) { (d = m[n]) && (d.fill = u(m, n, p), d.boundary = l(d), d.mapper = (void 0, f = void 0, h = (c = d).fill, f = "dataset", !1 === h ? null : (isFinite(h) || (f = "boundary"), r[f](c)))); } }, beforeDatasetDraw: function beforeDatasetDraw(t, e) { var i = e.meta.$filler;if (i) { var a = t.ctx, r = i.el, s = r._view, l = r._children || [], u = i.mapper, h = s.backgroundColor || n.global.defaultColor;u && h && l.length && (o.canvas.clipArea(a, t.chartArea), function (t, e, i, n, a, o) { var r, s, l, u, h, f, g, p = e.length, m = n.spanGaps, v = [], b = [], x = 0, y = 0;for (t.beginPath(), r = 0, s = p + !!o; r < s; ++r) { h = i(u = e[l = r % p]._view, l, n), f = d(u), g = d(h), f && g ? (x = v.push(u), y = b.push(h)) : x && y && (m ? (f && v.push(u), g && b.push(h)) : (c(t, v, b, x, y), x = y = 0, v = [], b = [])); }c(t, v, b, x, y), t.closePath(), t.fillStyle = a, t.fill(); }(a, l, u, s, h, r._loop), o.canvas.unclipArea(a)); } } }; }, { 25: 25, 40: 40, 45: 45 }], 51: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45), r = t(30), s = o.noop;function l(t, e) { return t.usePointStyle ? e * Math.SQRT2 : t.boxWidth; }n._set("global", { legend: { display: !0, position: "top", fullWidth: !0, reverse: !1, weight: 1e3, onClick: function onClick(t, e) { var i = e.datasetIndex, n = this.chart, a = n.getDatasetMeta(i);a.hidden = null === a.hidden ? !n.data.datasets[i].hidden : null, n.update(); }, onHover: null, labels: { boxWidth: 40, padding: 10, generateLabels: function generateLabels(t) { var e = t.data;return o.isArray(e.datasets) ? e.datasets.map(function (e, i) { return { text: e.label, fillStyle: o.isArray(e.backgroundColor) ? e.backgroundColor[0] : e.backgroundColor, hidden: !t.isDatasetVisible(i), lineCap: e.borderCapStyle, lineDash: e.borderDash, lineDashOffset: e.borderDashOffset, lineJoin: e.borderJoinStyle, lineWidth: e.borderWidth, strokeStyle: e.borderColor, pointStyle: e.pointStyle, datasetIndex: i }; }, this) : []; } } }, legendCallback: function legendCallback(t) { var e = [];e.push('"), e.join(""); } });var u = a.extend({ initialize: function initialize(t) { o.extend(this, t), this.legendHitBoxes = [], this.doughnutMode = !1; }, beforeUpdate: s, update: function update(t, e, i) { var n = this;return n.beforeUpdate(), n.maxWidth = t, n.maxHeight = e, n.margins = i, n.beforeSetDimensions(), n.setDimensions(), n.afterSetDimensions(), n.beforeBuildLabels(), n.buildLabels(), n.afterBuildLabels(), n.beforeFit(), n.fit(), n.afterFit(), n.afterUpdate(), n.minSize; }, afterUpdate: s, beforeSetDimensions: s, setDimensions: function setDimensions() { var t = this;t.isHorizontal() ? (t.width = t.maxWidth, t.left = 0, t.right = t.width) : (t.height = t.maxHeight, t.top = 0, t.bottom = t.height), t.paddingLeft = 0, t.paddingTop = 0, t.paddingRight = 0, t.paddingBottom = 0, t.minSize = { width: 0, height: 0 }; }, afterSetDimensions: s, beforeBuildLabels: s, buildLabels: function buildLabels() { var t = this, e = t.options.labels || {}, i = o.callback(e.generateLabels, [t.chart], t) || [];e.filter && (i = i.filter(function (i) { return e.filter(i, t.chart.data); })), t.options.reverse && i.reverse(), t.legendItems = i; }, afterBuildLabels: s, beforeFit: s, fit: function fit() { var t = this, e = t.options, i = e.labels, a = e.display, r = t.ctx, s = n.global, u = o.valueOrDefault, d = u(i.fontSize, s.defaultFontSize), c = u(i.fontStyle, s.defaultFontStyle), h = u(i.fontFamily, s.defaultFontFamily), f = o.fontString(d, c, h), g = t.legendHitBoxes = [], p = t.minSize, m = t.isHorizontal();if (m ? (p.width = t.maxWidth, p.height = a ? 10 : 0) : (p.width = a ? 10 : 0, p.height = t.maxHeight), a) if (r.font = f, m) { var v = t.lineWidths = [0], b = t.legendItems.length ? d + i.padding : 0;r.textAlign = "left", r.textBaseline = "top", o.each(t.legendItems, function (e, n) { var a = l(i, d) + d / 2 + r.measureText(e.text).width;v[v.length - 1] + a + i.padding >= t.width && (b += d + i.padding, v[v.length] = t.left), g[n] = { left: 0, top: 0, width: a, height: d }, v[v.length - 1] += a + i.padding; }), p.height += b; } else { var x = i.padding, y = t.columnWidths = [], k = i.padding, M = 0, w = 0, S = d + x;o.each(t.legendItems, function (t, e) { var n = l(i, d) + d / 2 + r.measureText(t.text).width;w + S > p.height && (k += M + i.padding, y.push(M), M = 0, w = 0), M = Math.max(M, n), w += S, g[e] = { left: 0, top: 0, width: n, height: d }; }), k += M, y.push(M), p.width += k; }t.width = p.width, t.height = p.height; }, afterFit: s, isHorizontal: function isHorizontal() { return "top" === this.options.position || "bottom" === this.options.position; }, draw: function draw() { var t = this, e = t.options, i = e.labels, a = n.global, r = a.elements.line, s = t.width, u = t.lineWidths;if (e.display) { var d, c = t.ctx, h = o.valueOrDefault, f = h(i.fontColor, a.defaultFontColor), g = h(i.fontSize, a.defaultFontSize), p = h(i.fontStyle, a.defaultFontStyle), m = h(i.fontFamily, a.defaultFontFamily), v = o.fontString(g, p, m);c.textAlign = "left", c.textBaseline = "middle", c.lineWidth = .5, c.strokeStyle = f, c.fillStyle = f, c.font = v;var b = l(i, g), x = t.legendHitBoxes, y = t.isHorizontal();d = y ? { x: t.left + (s - u[0]) / 2, y: t.top + i.padding, line: 0 } : { x: t.left + i.padding, y: t.top + i.padding, line: 0 };var k = g + i.padding;o.each(t.legendItems, function (n, l) { var f, p, m, v, M, w = c.measureText(n.text).width, S = b + g / 2 + w, C = d.x, _ = d.y;y ? C + S >= s && (_ = d.y += k, d.line++, C = d.x = t.left + (s - u[d.line]) / 2) : _ + k > t.bottom && (C = d.x = C + t.columnWidths[d.line] + i.padding, _ = d.y = t.top + i.padding, d.line++), function (t, i, n) { if (!(isNaN(b) || b <= 0)) { c.save(), c.fillStyle = h(n.fillStyle, a.defaultColor), c.lineCap = h(n.lineCap, r.borderCapStyle), c.lineDashOffset = h(n.lineDashOffset, r.borderDashOffset), c.lineJoin = h(n.lineJoin, r.borderJoinStyle), c.lineWidth = h(n.lineWidth, r.borderWidth), c.strokeStyle = h(n.strokeStyle, a.defaultColor);var s = 0 === h(n.lineWidth, r.borderWidth);if (c.setLineDash && c.setLineDash(h(n.lineDash, r.borderDash)), e.labels && e.labels.usePointStyle) { var l = g * Math.SQRT2 / 2, u = l / Math.SQRT2, d = t + u, f = i + u;o.canvas.drawPoint(c, n.pointStyle, l, d, f); } else s || c.strokeRect(t, i, b, g), c.fillRect(t, i, b, g);c.restore(); } }(C, _, n), x[l].left = C, x[l].top = _, f = n, p = w, v = b + (m = g / 2) + C, M = _ + m, c.fillText(f.text, v, M), f.hidden && (c.beginPath(), c.lineWidth = 2, c.moveTo(v, M), c.lineTo(v + p, M), c.stroke()), y ? d.x += S + i.padding : d.y += k; }); } }, handleEvent: function handleEvent(t) { var e = this, i = e.options, n = "mouseup" === t.type ? "click" : t.type, a = !1;if ("mousemove" === n) { if (!i.onHover) return; } else { if ("click" !== n) return;if (!i.onClick) return; }var o = t.x, r = t.y;if (o >= e.left && o <= e.right && r >= e.top && r <= e.bottom) for (var s = e.legendHitBoxes, l = 0; l < s.length; ++l) { var u = s[l];if (o >= u.left && o <= u.left + u.width && r >= u.top && r <= u.top + u.height) { if ("click" === n) { i.onClick.call(e, t.native, e.legendItems[l]), a = !0;break; }if ("mousemove" === n) { i.onHover.call(e, t.native, e.legendItems[l]), a = !0;break; } } }return a; } });function d(t, e) { var i = new u({ ctx: t.ctx, options: e, chart: t });r.configure(t, i, e), r.addBox(t, i), t.legend = i; }e.exports = { id: "legend", _element: u, beforeInit: function beforeInit(t) { var e = t.options.legend;e && d(t, e); }, beforeUpdate: function beforeUpdate(t) { var e = t.options.legend, i = t.legend;e ? (o.mergeIf(e, n.global.legend), i ? (r.configure(t, i, e), i.options = e) : d(t, e)) : i && (r.removeBox(t, i), delete t.legend); }, afterEvent: function afterEvent(t, e) { var i = t.legend;i && i.handleEvent(e); } }; }, { 25: 25, 26: 26, 30: 30, 45: 45 }], 52: [function (t, e, i) { "use strict"; var n = t(25), a = t(26), o = t(45), r = t(30), s = o.noop;n._set("global", { title: { display: !1, fontStyle: "bold", fullWidth: !0, lineHeight: 1.2, padding: 10, position: "top", text: "", weight: 2e3 } });var l = a.extend({ initialize: function initialize(t) { o.extend(this, t), this.legendHitBoxes = []; }, beforeUpdate: s, update: function update(t, e, i) { var n = this;return n.beforeUpdate(), n.maxWidth = t, n.maxHeight = e, n.margins = i, n.beforeSetDimensions(), n.setDimensions(), n.afterSetDimensions(), n.beforeBuildLabels(), n.buildLabels(), n.afterBuildLabels(), n.beforeFit(), n.fit(), n.afterFit(), n.afterUpdate(), n.minSize; }, afterUpdate: s, beforeSetDimensions: s, setDimensions: function setDimensions() { var t = this;t.isHorizontal() ? (t.width = t.maxWidth, t.left = 0, t.right = t.width) : (t.height = t.maxHeight, t.top = 0, t.bottom = t.height), t.paddingLeft = 0, t.paddingTop = 0, t.paddingRight = 0, t.paddingBottom = 0, t.minSize = { width: 0, height: 0 }; }, afterSetDimensions: s, beforeBuildLabels: s, buildLabels: s, afterBuildLabels: s, beforeFit: s, fit: function fit() { var t = this, e = o.valueOrDefault, i = t.options, a = i.display, r = e(i.fontSize, n.global.defaultFontSize), s = t.minSize, l = o.isArray(i.text) ? i.text.length : 1, u = o.options.toLineHeight(i.lineHeight, r), d = a ? l * u + 2 * i.padding : 0;t.isHorizontal() ? (s.width = t.maxWidth, s.height = d) : (s.width = d, s.height = t.maxHeight), t.width = s.width, t.height = s.height; }, afterFit: s, isHorizontal: function isHorizontal() { var t = this.options.position;return "top" === t || "bottom" === t; }, draw: function draw() { var t = this, e = t.ctx, i = o.valueOrDefault, a = t.options, r = n.global;if (a.display) { var s, l, u, d = i(a.fontSize, r.defaultFontSize), c = i(a.fontStyle, r.defaultFontStyle), h = i(a.fontFamily, r.defaultFontFamily), f = o.fontString(d, c, h), g = o.options.toLineHeight(a.lineHeight, d), p = g / 2 + a.padding, m = 0, v = t.top, b = t.left, x = t.bottom, y = t.right;e.fillStyle = i(a.fontColor, r.defaultFontColor), e.font = f, t.isHorizontal() ? (l = b + (y - b) / 2, u = v + p, s = y - b) : (l = "left" === a.position ? b + p : y - p, u = v + (x - v) / 2, s = x - v, m = Math.PI * ("left" === a.position ? -.5 : .5)), e.save(), e.translate(l, u), e.rotate(m), e.textAlign = "center", e.textBaseline = "middle";var k = a.text;if (o.isArray(k)) for (var M = 0, w = 0; w < k.length; ++w) { e.fillText(k[w], 0, M, s), M += g; } else e.fillText(k, 0, 0, s);e.restore(); } } });function u(t, e) { var i = new l({ ctx: t.ctx, options: e, chart: t });r.configure(t, i, e), r.addBox(t, i), t.titleBlock = i; }e.exports = { id: "title", _element: l, beforeInit: function beforeInit(t) { var e = t.options.title;e && u(t, e); }, beforeUpdate: function beforeUpdate(t) { var e = t.options.title, i = t.titleBlock;e ? (o.mergeIf(e, n.global.title), i ? (r.configure(t, i, e), i.options = e) : u(t, e)) : i && (r.removeBox(t, i), delete t.titleBlock); } }; }, { 25: 25, 26: 26, 30: 30, 45: 45 }], 53: [function (t, e, i) { "use strict"; e.exports = function (t) { var e = t.Scale.extend({ getLabels: function getLabels() { var t = this.chart.data;return this.options.labels || (this.isHorizontal() ? t.xLabels : t.yLabels) || t.labels; }, determineDataLimits: function determineDataLimits() { var t, e = this, i = e.getLabels();e.minIndex = 0, e.maxIndex = i.length - 1, void 0 !== e.options.ticks.min && (t = i.indexOf(e.options.ticks.min), e.minIndex = -1 !== t ? t : e.minIndex), void 0 !== e.options.ticks.max && (t = i.indexOf(e.options.ticks.max), e.maxIndex = -1 !== t ? t : e.maxIndex), e.min = i[e.minIndex], e.max = i[e.maxIndex]; }, buildTicks: function buildTicks() { var t = this, e = t.getLabels();t.ticks = 0 === t.minIndex && t.maxIndex === e.length - 1 ? e : e.slice(t.minIndex, t.maxIndex + 1); }, getLabelForIndex: function getLabelForIndex(t, e) { var i = this, n = i.chart.data, a = i.isHorizontal();return n.yLabels && !a ? i.getRightValue(n.datasets[e].data[t]) : i.ticks[t - i.minIndex]; }, getPixelForValue: function getPixelForValue(t, e) { var i, n = this, a = n.options.offset, o = Math.max(n.maxIndex + 1 - n.minIndex - (a ? 0 : 1), 1);if (null != t && (i = n.isHorizontal() ? t.x : t.y), void 0 !== i || void 0 !== t && isNaN(e)) { t = i || t;var r = n.getLabels().indexOf(t);e = -1 !== r ? r : e; }if (n.isHorizontal()) { var s = n.width / o, l = s * (e - n.minIndex);return a && (l += s / 2), n.left + Math.round(l); }var u = n.height / o, d = u * (e - n.minIndex);return a && (d += u / 2), n.top + Math.round(d); }, getPixelForTick: function getPixelForTick(t) { return this.getPixelForValue(this.ticks[t], t + this.minIndex, null); }, getValueForPixel: function getValueForPixel(t) { var e = this, i = e.options.offset, n = Math.max(e._ticks.length - (i ? 0 : 1), 1), a = e.isHorizontal(), o = (a ? e.width : e.height) / n;return t -= a ? e.left : e.top, i && (t -= o / 2), (t <= 0 ? 0 : Math.round(t / o)) + e.minIndex; }, getBasePixel: function getBasePixel() { return this.bottom; } });t.scaleService.registerScaleType("category", e, { position: "bottom" }); }; }, {}], 54: [function (t, e, i) { "use strict"; var n = t(25), a = t(45), o = t(34);e.exports = function (t) { var e = { position: "left", ticks: { callback: o.formatters.linear } }, i = t.LinearScaleBase.extend({ determineDataLimits: function determineDataLimits() { var t = this, e = t.options, i = t.chart, n = i.data.datasets, o = t.isHorizontal();function r(e) { return o ? e.xAxisID === t.id : e.yAxisID === t.id; }t.min = null, t.max = null;var s = e.stacked;if (void 0 === s && a.each(n, function (t, e) { if (!s) { var n = i.getDatasetMeta(e);i.isDatasetVisible(e) && r(n) && void 0 !== n.stack && (s = !0); } }), e.stacked || s) { var l = {};a.each(n, function (n, o) { var s = i.getDatasetMeta(o), u = [s.type, void 0 === e.stacked && void 0 === s.stack ? o : "", s.stack].join(".");void 0 === l[u] && (l[u] = { positiveValues: [], negativeValues: [] });var d = l[u].positiveValues, c = l[u].negativeValues;i.isDatasetVisible(o) && r(s) && a.each(n.data, function (i, n) { var a = +t.getRightValue(i);isNaN(a) || s.data[n].hidden || (d[n] = d[n] || 0, c[n] = c[n] || 0, e.relativePoints ? d[n] = 100 : a < 0 ? c[n] += a : d[n] += a); }); }), a.each(l, function (e) { var i = e.positiveValues.concat(e.negativeValues), n = a.min(i), o = a.max(i);t.min = null === t.min ? n : Math.min(t.min, n), t.max = null === t.max ? o : Math.max(t.max, o); }); } else a.each(n, function (e, n) { var o = i.getDatasetMeta(n);i.isDatasetVisible(n) && r(o) && a.each(e.data, function (e, i) { var n = +t.getRightValue(e);isNaN(n) || o.data[i].hidden || (null === t.min ? t.min = n : n < t.min && (t.min = n), null === t.max ? t.max = n : n > t.max && (t.max = n)); }); });t.min = isFinite(t.min) && !isNaN(t.min) ? t.min : 0, t.max = isFinite(t.max) && !isNaN(t.max) ? t.max : 1, this.handleTickRangeOptions(); }, getTickLimit: function getTickLimit() { var t, e = this.options.ticks;if (this.isHorizontal()) t = Math.min(e.maxTicksLimit ? e.maxTicksLimit : 11, Math.ceil(this.width / 50));else { var i = a.valueOrDefault(e.fontSize, n.global.defaultFontSize);t = Math.min(e.maxTicksLimit ? e.maxTicksLimit : 11, Math.ceil(this.height / (2 * i))); }return t; }, handleDirectionalChanges: function handleDirectionalChanges() { this.isHorizontal() || this.ticks.reverse(); }, getLabelForIndex: function getLabelForIndex(t, e) { return +this.getRightValue(this.chart.data.datasets[e].data[t]); }, getPixelForValue: function getPixelForValue(t) { var e = this, i = e.start, n = +e.getRightValue(t), a = e.end - i;return e.isHorizontal() ? e.left + e.width / a * (n - i) : e.bottom - e.height / a * (n - i); }, getValueForPixel: function getValueForPixel(t) { var e = this, i = e.isHorizontal(), n = i ? e.width : e.height, a = (i ? t - e.left : e.bottom - t) / n;return e.start + (e.end - e.start) * a; }, getPixelForTick: function getPixelForTick(t) { return this.getPixelForValue(this.ticksAsNumbers[t]); } });t.scaleService.registerScaleType("linear", i, e); }; }, { 25: 25, 34: 34, 45: 45 }], 55: [function (t, e, i) { "use strict"; var n = t(45);e.exports = function (t) { var e = n.noop;t.LinearScaleBase = t.Scale.extend({ getRightValue: function getRightValue(e) { return "string" == typeof e ? +e : t.Scale.prototype.getRightValue.call(this, e); }, handleTickRangeOptions: function handleTickRangeOptions() { var t = this, e = t.options.ticks;if (e.beginAtZero) { var i = n.sign(t.min), a = n.sign(t.max);i < 0 && a < 0 ? t.max = 0 : i > 0 && a > 0 && (t.min = 0); }var o = void 0 !== e.min || void 0 !== e.suggestedMin, r = void 0 !== e.max || void 0 !== e.suggestedMax;void 0 !== e.min ? t.min = e.min : void 0 !== e.suggestedMin && (null === t.min ? t.min = e.suggestedMin : t.min = Math.min(t.min, e.suggestedMin)), void 0 !== e.max ? t.max = e.max : void 0 !== e.suggestedMax && (null === t.max ? t.max = e.suggestedMax : t.max = Math.max(t.max, e.suggestedMax)), o !== r && t.min >= t.max && (o ? t.max = t.min + 1 : t.min = t.max - 1), t.min === t.max && (t.max++, e.beginAtZero || t.min--); }, getTickLimit: e, handleDirectionalChanges: e, buildTicks: function buildTicks() { var t = this, e = t.options.ticks, i = t.getTickLimit(), a = { maxTicks: i = Math.max(2, i), min: e.min, max: e.max, stepSize: n.valueOrDefault(e.fixedStepSize, e.stepSize) }, o = t.ticks = function (t, e) { var i, a = [];if (t.stepSize && t.stepSize > 0) i = t.stepSize;else { var o = n.niceNum(e.max - e.min, !1);i = n.niceNum(o / (t.maxTicks - 1), !0); }var r = Math.floor(e.min / i) * i, s = Math.ceil(e.max / i) * i;t.min && t.max && t.stepSize && n.almostWhole((t.max - t.min) / t.stepSize, i / 1e3) && (r = t.min, s = t.max);var l = (s - r) / i;l = n.almostEquals(l, Math.round(l), i / 1e3) ? Math.round(l) : Math.ceil(l);var u = 1;i < 1 && (u = Math.pow(10, i.toString().length - 2), r = Math.round(r * u) / u, s = Math.round(s * u) / u), a.push(void 0 !== t.min ? t.min : r);for (var d = 1; d < l; ++d) { a.push(Math.round((r + d * i) * u) / u); }return a.push(void 0 !== t.max ? t.max : s), a; }(a, t);t.handleDirectionalChanges(), t.max = n.max(o), t.min = n.min(o), e.reverse ? (o.reverse(), t.start = t.max, t.end = t.min) : (t.start = t.min, t.end = t.max); }, convertTicksToLabels: function convertTicksToLabels() { var e = this;e.ticksAsNumbers = e.ticks.slice(), e.zeroLineIndex = e.ticks.indexOf(0), t.Scale.prototype.convertTicksToLabels.call(e); } }); }; }, { 45: 45 }], 56: [function (t, e, i) { "use strict"; var n = t(45), a = t(34);e.exports = function (t) { var e = { position: "left", ticks: { callback: a.formatters.logarithmic } }, i = t.Scale.extend({ determineDataLimits: function determineDataLimits() { var t = this, e = t.options, i = t.chart, a = i.data.datasets, o = t.isHorizontal();function r(e) { return o ? e.xAxisID === t.id : e.yAxisID === t.id; }t.min = null, t.max = null, t.minNotZero = null;var s = e.stacked;if (void 0 === s && n.each(a, function (t, e) { if (!s) { var n = i.getDatasetMeta(e);i.isDatasetVisible(e) && r(n) && void 0 !== n.stack && (s = !0); } }), e.stacked || s) { var l = {};n.each(a, function (a, o) { var s = i.getDatasetMeta(o), u = [s.type, void 0 === e.stacked && void 0 === s.stack ? o : "", s.stack].join(".");i.isDatasetVisible(o) && r(s) && (void 0 === l[u] && (l[u] = []), n.each(a.data, function (e, i) { var n = l[u], a = +t.getRightValue(e);isNaN(a) || s.data[i].hidden || a < 0 || (n[i] = n[i] || 0, n[i] += a); })); }), n.each(l, function (e) { if (e.length > 0) { var i = n.min(e), a = n.max(e);t.min = null === t.min ? i : Math.min(t.min, i), t.max = null === t.max ? a : Math.max(t.max, a); } }); } else n.each(a, function (e, a) { var o = i.getDatasetMeta(a);i.isDatasetVisible(a) && r(o) && n.each(e.data, function (e, i) { var n = +t.getRightValue(e);isNaN(n) || o.data[i].hidden || n < 0 || (null === t.min ? t.min = n : n < t.min && (t.min = n), null === t.max ? t.max = n : n > t.max && (t.max = n), 0 !== n && (null === t.minNotZero || n < t.minNotZero) && (t.minNotZero = n)); }); });this.handleTickRangeOptions(); }, handleTickRangeOptions: function handleTickRangeOptions() { var t = this, e = t.options.ticks, i = n.valueOrDefault;t.min = i(e.min, t.min), t.max = i(e.max, t.max), t.min === t.max && (0 !== t.min && null !== t.min ? (t.min = Math.pow(10, Math.floor(n.log10(t.min)) - 1), t.max = Math.pow(10, Math.floor(n.log10(t.max)) + 1)) : (t.min = 1, t.max = 10)), null === t.min && (t.min = Math.pow(10, Math.floor(n.log10(t.max)) - 1)), null === t.max && (t.max = 0 !== t.min ? Math.pow(10, Math.floor(n.log10(t.min)) + 1) : 10), null === t.minNotZero && (t.min > 0 ? t.minNotZero = t.min : t.max < 1 ? t.minNotZero = Math.pow(10, Math.floor(n.log10(t.max))) : t.minNotZero = 1); }, buildTicks: function buildTicks() { var t = this, e = t.options.ticks, i = !t.isHorizontal(), a = { min: e.min, max: e.max }, o = t.ticks = function (t, e) { var i, a, o = [], r = n.valueOrDefault, s = r(t.min, Math.pow(10, Math.floor(n.log10(e.min)))), l = Math.floor(n.log10(e.max)), u = Math.ceil(e.max / Math.pow(10, l));0 === s ? (i = Math.floor(n.log10(e.minNotZero)), a = Math.floor(e.minNotZero / Math.pow(10, i)), o.push(s), s = a * Math.pow(10, i)) : (i = Math.floor(n.log10(s)), a = Math.floor(s / Math.pow(10, i)));for (var d = i < 0 ? Math.pow(10, Math.abs(i)) : 1; o.push(s), 10 == ++a && (a = 1, d = ++i >= 0 ? 1 : d), s = Math.round(a * Math.pow(10, i) * d) / d, i < l || i === l && a < u;) {}var c = r(t.max, s);return o.push(c), o; }(a, t);t.max = n.max(o), t.min = n.min(o), e.reverse ? (i = !i, t.start = t.max, t.end = t.min) : (t.start = t.min, t.end = t.max), i && o.reverse(); }, convertTicksToLabels: function convertTicksToLabels() { this.tickValues = this.ticks.slice(), t.Scale.prototype.convertTicksToLabels.call(this); }, getLabelForIndex: function getLabelForIndex(t, e) { return +this.getRightValue(this.chart.data.datasets[e].data[t]); }, getPixelForTick: function getPixelForTick(t) { return this.getPixelForValue(this.tickValues[t]); }, _getFirstTickValue: function _getFirstTickValue(t) { var e = Math.floor(n.log10(t));return Math.floor(t / Math.pow(10, e)) * Math.pow(10, e); }, getPixelForValue: function getPixelForValue(e) { var i, a, o, r, s, l = this, u = l.options.ticks.reverse, d = n.log10, c = l._getFirstTickValue(l.minNotZero), h = 0;return e = +l.getRightValue(e), u ? (o = l.end, r = l.start, s = -1) : (o = l.start, r = l.end, s = 1), l.isHorizontal() ? (i = l.width, a = u ? l.right : l.left) : (i = l.height, s *= -1, a = u ? l.top : l.bottom), e !== o && (0 === o && (i -= h = n.getValueOrDefault(l.options.ticks.fontSize, t.defaults.global.defaultFontSize), o = c), 0 !== e && (h += i / (d(r) - d(o)) * (d(e) - d(o))), a += s * h), a; }, getValueForPixel: function getValueForPixel(e) { var i, a, o, r, s = this, l = s.options.ticks.reverse, u = n.log10, d = s._getFirstTickValue(s.minNotZero);if (l ? (a = s.end, o = s.start) : (a = s.start, o = s.end), s.isHorizontal() ? (i = s.width, r = l ? s.right - e : e - s.left) : (i = s.height, r = l ? e - s.top : s.bottom - e), r !== a) { if (0 === a) { var c = n.getValueOrDefault(s.options.ticks.fontSize, t.defaults.global.defaultFontSize);r -= c, i -= c, a = d; }r *= u(o) - u(a), r /= i, r = Math.pow(10, u(a) + r); }return r; } });t.scaleService.registerScaleType("logarithmic", i, e); }; }, { 34: 34, 45: 45 }], 57: [function (t, e, i) { "use strict"; var n = t(25), a = t(45), o = t(34);e.exports = function (t) { var e = n.global, i = { display: !0, animate: !0, position: "chartArea", angleLines: { display: !0, color: "rgba(0, 0, 0, 0.1)", lineWidth: 1 }, gridLines: { circular: !1 }, ticks: { showLabelBackdrop: !0, backdropColor: "rgba(255,255,255,0.75)", backdropPaddingY: 2, backdropPaddingX: 2, callback: o.formatters.linear }, pointLabels: { display: !0, fontSize: 10, callback: function callback(t) { return t; } } };function r(t) { var e = t.options;return e.angleLines.display || e.pointLabels.display ? t.chart.data.labels.length : 0; }function s(t) { var i = t.options.pointLabels, n = a.valueOrDefault(i.fontSize, e.defaultFontSize), o = a.valueOrDefault(i.fontStyle, e.defaultFontStyle), r = a.valueOrDefault(i.fontFamily, e.defaultFontFamily);return { size: n, style: o, family: r, font: a.fontString(n, o, r) }; }function l(t, e, i, n, a) { return t === n || t === a ? { start: e - i / 2, end: e + i / 2 } : t < n || t > a ? { start: e - i - 5, end: e } : { start: e, end: e + i + 5 }; }function u(t, e, i, n) { if (a.isArray(e)) for (var o = i.y, r = 1.5 * n, s = 0; s < e.length; ++s) { t.fillText(e[s], i.x, o), o += r; } else t.fillText(e, i.x, i.y); }function d(t) { return a.isNumber(t) ? t : 0; }var c = t.LinearScaleBase.extend({ setDimensions: function setDimensions() { var t = this, i = t.options, n = i.ticks;t.width = t.maxWidth, t.height = t.maxHeight, t.xCenter = Math.round(t.width / 2), t.yCenter = Math.round(t.height / 2);var o = a.min([t.height, t.width]), r = a.valueOrDefault(n.fontSize, e.defaultFontSize);t.drawingArea = i.display ? o / 2 - (r / 2 + n.backdropPaddingY) : o / 2; }, determineDataLimits: function determineDataLimits() { var t = this, e = t.chart, i = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY;a.each(e.data.datasets, function (o, r) { if (e.isDatasetVisible(r)) { var s = e.getDatasetMeta(r);a.each(o.data, function (e, a) { var o = +t.getRightValue(e);isNaN(o) || s.data[a].hidden || (i = Math.min(o, i), n = Math.max(o, n)); }); } }), t.min = i === Number.POSITIVE_INFINITY ? 0 : i, t.max = n === Number.NEGATIVE_INFINITY ? 0 : n, t.handleTickRangeOptions(); }, getTickLimit: function getTickLimit() { var t = this.options.ticks, i = a.valueOrDefault(t.fontSize, e.defaultFontSize);return Math.min(t.maxTicksLimit ? t.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * i))); }, convertTicksToLabels: function convertTicksToLabels() { var e = this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e), e.pointLabels = e.chart.data.labels.map(e.options.pointLabels.callback, e); }, getLabelForIndex: function getLabelForIndex(t, e) { return +this.getRightValue(this.chart.data.datasets[e].data[t]); }, fit: function fit() { var t, e;this.options.pointLabels.display ? function (t) { var e, i, n, o = s(t), u = Math.min(t.height / 2, t.width / 2), d = { r: t.width, l: 0, t: t.height, b: 0 }, c = {};t.ctx.font = o.font, t._pointLabelSizes = [];var h, f, g, p = r(t);for (e = 0; e < p; e++) { n = t.getPointPosition(e, u), h = t.ctx, f = o.size, g = t.pointLabels[e] || "", i = a.isArray(g) ? { w: a.longestText(h, h.font, g), h: g.length * f + 1.5 * (g.length - 1) * f } : { w: h.measureText(g).width, h: f }, t._pointLabelSizes[e] = i;var m = t.getIndexAngle(e), v = a.toDegrees(m) % 360, b = l(v, n.x, i.w, 0, 180), x = l(v, n.y, i.h, 90, 270);b.start < d.l && (d.l = b.start, c.l = m), b.end > d.r && (d.r = b.end, c.r = m), x.start < d.t && (d.t = x.start, c.t = m), x.end > d.b && (d.b = x.end, c.b = m); }t.setReductions(u, d, c); }(this) : (t = this, e = Math.min(t.height / 2, t.width / 2), t.drawingArea = Math.round(e), t.setCenterPoint(0, 0, 0, 0)); }, setReductions: function setReductions(t, e, i) { var n = e.l / Math.sin(i.l), a = Math.max(e.r - this.width, 0) / Math.sin(i.r), o = -e.t / Math.cos(i.t), r = -Math.max(e.b - this.height, 0) / Math.cos(i.b);n = d(n), a = d(a), o = d(o), r = d(r), this.drawingArea = Math.min(Math.round(t - (n + a) / 2), Math.round(t - (o + r) / 2)), this.setCenterPoint(n, a, o, r); }, setCenterPoint: function setCenterPoint(t, e, i, n) { var a = this, o = a.width - e - a.drawingArea, r = t + a.drawingArea, s = i + a.drawingArea, l = a.height - n - a.drawingArea;a.xCenter = Math.round((r + o) / 2 + a.left), a.yCenter = Math.round((s + l) / 2 + a.top); }, getIndexAngle: function getIndexAngle(t) { return t * (2 * Math.PI / r(this)) + (this.chart.options && this.chart.options.startAngle ? this.chart.options.startAngle : 0) * Math.PI * 2 / 360; }, getDistanceFromCenterForValue: function getDistanceFromCenterForValue(t) { var e = this;if (null === t) return 0;var i = e.drawingArea / (e.max - e.min);return e.options.ticks.reverse ? (e.max - t) * i : (t - e.min) * i; }, getPointPosition: function getPointPosition(t, e) { var i = this.getIndexAngle(t) - Math.PI / 2;return { x: Math.round(Math.cos(i) * e) + this.xCenter, y: Math.round(Math.sin(i) * e) + this.yCenter }; }, getPointPositionForValue: function getPointPositionForValue(t, e) { return this.getPointPosition(t, this.getDistanceFromCenterForValue(e)); }, getBasePosition: function getBasePosition() { var t = this.min, e = this.max;return this.getPointPositionForValue(0, this.beginAtZero ? 0 : t < 0 && e < 0 ? e : t > 0 && e > 0 ? t : 0); }, draw: function draw() { var t = this, i = t.options, n = i.gridLines, o = i.ticks, l = a.valueOrDefault;if (i.display) { var d = t.ctx, c = this.getIndexAngle(0), h = l(o.fontSize, e.defaultFontSize), f = l(o.fontStyle, e.defaultFontStyle), g = l(o.fontFamily, e.defaultFontFamily), p = a.fontString(h, f, g);a.each(t.ticks, function (i, s) { if (s > 0 || o.reverse) { var u = t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if (n.display && 0 !== s && function (t, e, i, n) { var o = t.ctx;if (o.strokeStyle = a.valueAtIndexOrDefault(e.color, n - 1), o.lineWidth = a.valueAtIndexOrDefault(e.lineWidth, n - 1), t.options.gridLines.circular) o.beginPath(), o.arc(t.xCenter, t.yCenter, i, 0, 2 * Math.PI), o.closePath(), o.stroke();else { var s = r(t);if (0 === s) return;o.beginPath();var l = t.getPointPosition(0, i);o.moveTo(l.x, l.y);for (var u = 1; u < s; u++) { l = t.getPointPosition(u, i), o.lineTo(l.x, l.y); }o.closePath(), o.stroke(); } }(t, n, u, s), o.display) { var f = l(o.fontColor, e.defaultFontColor);if (d.font = p, d.save(), d.translate(t.xCenter, t.yCenter), d.rotate(c), o.showLabelBackdrop) { var g = d.measureText(i).width;d.fillStyle = o.backdropColor, d.fillRect(-g / 2 - o.backdropPaddingX, -u - h / 2 - o.backdropPaddingY, g + 2 * o.backdropPaddingX, h + 2 * o.backdropPaddingY); }d.textAlign = "center", d.textBaseline = "middle", d.fillStyle = f, d.fillText(i, 0, -u), d.restore(); } } }), (i.angleLines.display || i.pointLabels.display) && function (t) { var i = t.ctx, n = t.options, o = n.angleLines, l = n.pointLabels;i.lineWidth = o.lineWidth, i.strokeStyle = o.color;var d, c, h, f, g = t.getDistanceFromCenterForValue(n.ticks.reverse ? t.min : t.max), p = s(t);i.textBaseline = "top";for (var m = r(t) - 1; m >= 0; m--) { if (o.display) { var v = t.getPointPosition(m, g);i.beginPath(), i.moveTo(t.xCenter, t.yCenter), i.lineTo(v.x, v.y), i.stroke(), i.closePath(); }if (l.display) { var b = t.getPointPosition(m, g + 5), x = a.valueAtIndexOrDefault(l.fontColor, m, e.defaultFontColor);i.font = p.font, i.fillStyle = x;var y = t.getIndexAngle(m), k = a.toDegrees(y);i.textAlign = 0 === (f = k) || 180 === f ? "center" : f < 180 ? "left" : "right", d = k, c = t._pointLabelSizes[m], h = b, 90 === d || 270 === d ? h.y -= c.h / 2 : (d > 270 || d < 90) && (h.y -= c.h), u(i, t.pointLabels[m] || "", b, p.size); } } }(t); } } });t.scaleService.registerScaleType("radialLinear", c, i); }; }, { 25: 25, 34: 34, 45: 45 }], 58: [function (t, e, i) { "use strict"; var n = t(1);n = "function" == typeof n ? n : window.moment;var a = t(25), o = t(45), r = Number.MIN_SAFE_INTEGER || -9007199254740991, s = Number.MAX_SAFE_INTEGER || 9007199254740991, l = { millisecond: { common: !0, size: 1, steps: [1, 2, 5, 10, 20, 50, 100, 250, 500] }, second: { common: !0, size: 1e3, steps: [1, 2, 5, 10, 30] }, minute: { common: !0, size: 6e4, steps: [1, 2, 5, 10, 30] }, hour: { common: !0, size: 36e5, steps: [1, 2, 3, 6, 12] }, day: { common: !0, size: 864e5, steps: [1, 2, 5] }, week: { common: !1, size: 6048e5, steps: [1, 2, 3, 4] }, month: { common: !0, size: 2628e6, steps: [1, 2, 3] }, quarter: { common: !1, size: 7884e6, steps: [1, 2, 3, 4] }, year: { common: !0, size: 3154e7 } }, u = Object.keys(l);function d(t, e) { return t - e; }function c(t) { var e, i, n, a = {}, o = [];for (e = 0, i = t.length; e < i; ++e) { a[n = t[e]] || (a[n] = !0, o.push(n)); }return o; }function h(t, e, i, n) { var a = function (t, e, i) { for (var n, a, o, r = 0, s = t.length - 1; r >= 0 && r <= s;) { if (a = t[(n = r + s >> 1) - 1] || null, o = t[n], !a) return { lo: null, hi: o };if (o[e] < i) r = n + 1;else { if (!(a[e] > i)) return { lo: a, hi: o };s = n - 1; } }return { lo: o, hi: null }; }(t, e, i), o = a.lo ? a.hi ? a.lo : t[t.length - 2] : t[0], r = a.lo ? a.hi ? a.hi : t[t.length - 1] : t[1], s = r[e] - o[e], l = s ? (i - o[e]) / s : 0, u = (r[n] - o[n]) * l;return o[n] + u; }function f(t, e) { var i = e.parser, a = e.parser || e.format;return "function" == typeof i ? i(t) : "string" == typeof t && "string" == typeof a ? n(t, a) : (t instanceof n || (t = n(t)), t.isValid() ? t : "function" == typeof a ? a(t) : t); }function g(t, e) { if (o.isNullOrUndef(t)) return null;var i = e.options.time, n = f(e.getRightValue(t), i);return n.isValid() ? (i.round && n.startOf(i.round), n.valueOf()) : null; }function p(t) { for (var e = u.indexOf(t) + 1, i = u.length; e < i; ++e) { if (l[u[e]].common) return u[e]; } }function m(t, e, i, a) { var r, d = a.time, c = d.unit || function (t, e, i, n) { var a, o, r, d = u.length;for (a = u.indexOf(t); a < d - 1; ++a) { if (r = (o = l[u[a]]).steps ? o.steps[o.steps.length - 1] : s, o.common && Math.ceil((i - e) / (r * o.size)) <= n) return u[a]; }return u[d - 1]; }(d.minUnit, t, e, i), h = p(c), f = o.valueOrDefault(d.stepSize, d.unitStepSize), g = "week" === c && d.isoWeekday, m = a.ticks.major.enabled, v = l[c], b = n(t), x = n(e), y = [];for (f || (f = function (t, e, i, n) { var a, o, r, s = e - t, u = l[i], d = u.size, c = u.steps;if (!c) return Math.ceil(s / (n * d));for (a = 0, o = c.length; a < o && (r = c[a], !(Math.ceil(s / (d * r)) <= n)); ++a) {}return r; }(t, e, c, i)), g && (b = b.isoWeekday(g), x = x.isoWeekday(g)), b = b.startOf(g ? "day" : c), (x = x.startOf(g ? "day" : c)) < e && x.add(1, c), r = n(b), m && h && !g && !d.round && (r.startOf(h), r.add(~~((b - r) / (v.size * f)) * f, c)); r < x; r.add(f, c)) { y.push(+r); }return y.push(+r), y; }e.exports = function (t) { var e = t.Scale.extend({ initialize: function initialize() { if (!n) throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(), t.Scale.prototype.initialize.call(this); }, update: function update() { var e = this.options;return e.time && e.time.format && console.warn("options.time.format is deprecated and replaced by options.time.parser."), t.Scale.prototype.update.apply(this, arguments); }, getRightValue: function getRightValue(e) { return e && void 0 !== e.t && (e = e.t), t.Scale.prototype.getRightValue.call(this, e); }, determineDataLimits: function determineDataLimits() { var t, e, i, a, l, u, h = this, f = h.chart, p = h.options.time, m = p.unit || "day", v = s, b = r, x = [], y = [], k = [];for (t = 0, i = f.data.labels.length; t < i; ++t) { k.push(g(f.data.labels[t], h)); }for (t = 0, i = (f.data.datasets || []).length; t < i; ++t) { if (f.isDatasetVisible(t)) { if (l = f.data.datasets[t].data, o.isObject(l[0])) for (y[t] = [], e = 0, a = l.length; e < a; ++e) { u = g(l[e], h), x.push(u), y[t][e] = u; } else x.push.apply(x, k), y[t] = k.slice(0); } else y[t] = []; }k.length && (k = c(k).sort(d), v = Math.min(v, k[0]), b = Math.max(b, k[k.length - 1])), x.length && (x = c(x).sort(d), v = Math.min(v, x[0]), b = Math.max(b, x[x.length - 1])), v = g(p.min, h) || v, b = g(p.max, h) || b, v = v === s ? +n().startOf(m) : v, b = b === r ? +n().endOf(m) + 1 : b, h.min = Math.min(v, b), h.max = Math.max(v + 1, b), h._horizontal = h.isHorizontal(), h._table = [], h._timestamps = { data: x, datasets: y, labels: k }; }, buildTicks: function buildTicks() { var t, e, i, a, o, r, s, d, c, v, b, x, y = this, k = y.min, M = y.max, w = y.options, S = w.time, C = [], _ = [];switch (w.ticks.source) {case "data": C = y._timestamps.data;break;case "labels": C = y._timestamps.labels;break;case "auto":default: C = m(k, M, y.getLabelCapacity(k), w);}for ("ticks" === w.bounds && C.length && (k = C[0], M = C[C.length - 1]), k = g(S.min, y) || k, M = g(S.max, y) || M, t = 0, e = C.length; t < e; ++t) { (i = C[t]) >= k && i <= M && _.push(i); }return y.min = k, y.max = M, y._unit = S.unit || function (t, e, i, a) { var o, r, s = n.duration(n(a).diff(n(i)));for (o = u.length - 1; o >= u.indexOf(e); o--) { if (r = u[o], l[r].common && s.as(r) >= t.length) return r; }return u[e ? u.indexOf(e) : 0]; }(_, S.minUnit, y.min, y.max), y._majorUnit = p(y._unit), y._table = function (t, e, i, n) { if ("linear" === n || !t.length) return [{ time: e, pos: 0 }, { time: i, pos: 1 }];var a, o, r, s, l, u = [], d = [e];for (a = 0, o = t.length; a < o; ++a) { (s = t[a]) > e && s < i && d.push(s); }for (d.push(i), a = 0, o = d.length; a < o; ++a) { l = d[a + 1], r = d[a - 1], s = d[a], void 0 !== r && void 0 !== l && Math.round((l + r) / 2) === s || u.push({ time: s, pos: a / (o - 1) }); }return u; }(y._timestamps.data, k, M, w.distribution), y._offsets = (a = y._table, o = _, r = k, s = M, b = 0, x = 0, (d = w).offset && o.length && (d.time.min || (c = o.length > 1 ? o[1] : s, v = o[0], b = (h(a, "time", c, "pos") - h(a, "time", v, "pos")) / 2), d.time.max || (c = o[o.length - 1], v = o.length > 1 ? o[o.length - 2] : r, x = (h(a, "time", c, "pos") - h(a, "time", v, "pos")) / 2)), { left: b, right: x }), y._labelFormat = function (t, e) { var i, n, a, o = t.length;for (i = 0; i < o; i++) { if (0 !== (n = f(t[i], e)).millisecond()) return "MMM D, YYYY h:mm:ss.SSS a";0 === n.second() && 0 === n.minute() && 0 === n.hour() || (a = !0); }return a ? "MMM D, YYYY h:mm:ss a" : "MMM D, YYYY"; }(y._timestamps.data, S), function (t, e) { var i, a, o, r, s = [];for (i = 0, a = t.length; i < a; ++i) { o = t[i], r = !!e && o === +n(o).startOf(e), s.push({ value: o, major: r }); }return s; }(_, y._majorUnit); }, getLabelForIndex: function getLabelForIndex(t, e) { var i = this.chart.data, n = this.options.time, a = i.labels && t < i.labels.length ? i.labels[t] : "", r = i.datasets[e].data[t];return o.isObject(r) && (a = this.getRightValue(r)), n.tooltipFormat ? f(a, n).format(n.tooltipFormat) : "string" == typeof a ? a : f(a, n).format(this._labelFormat); }, tickFormatFunction: function tickFormatFunction(t, e, i, n) { var a = this.options, r = t.valueOf(), s = a.time.displayFormats, l = s[this._unit], u = this._majorUnit, d = s[u], c = t.clone().startOf(u).valueOf(), h = a.ticks.major, f = h.enabled && u && d && r === c, g = t.format(n || (f ? d : l)), p = f ? h : a.ticks.minor, m = o.valueOrDefault(p.callback, p.userCallback);return m ? m(g, e, i) : g; }, convertTicksToLabels: function convertTicksToLabels(t) { var e, i, a = [];for (e = 0, i = t.length; e < i; ++e) { a.push(this.tickFormatFunction(n(t[e].value), e, t)); }return a; }, getPixelForOffset: function getPixelForOffset(t) { var e = this, i = e._horizontal ? e.width : e.height, n = e._horizontal ? e.left : e.top, a = h(e._table, "time", t, "pos");return n + i * (e._offsets.left + a) / (e._offsets.left + 1 + e._offsets.right); }, getPixelForValue: function getPixelForValue(t, e, i) { var n = null;if (void 0 !== e && void 0 !== i && (n = this._timestamps.datasets[i][e]), null === n && (n = g(t, this)), null !== n) return this.getPixelForOffset(n); }, getPixelForTick: function getPixelForTick(t) { var e = this.getTicks();return t >= 0 && t < e.length ? this.getPixelForOffset(e[t].value) : null; }, getValueForPixel: function getValueForPixel(t) { var e = this, i = e._horizontal ? e.width : e.height, a = e._horizontal ? e.left : e.top, o = (i ? (t - a) / i : 0) * (e._offsets.left + 1 + e._offsets.left) - e._offsets.right, r = h(e._table, "pos", o, "time");return n(r); }, getLabelWidth: function getLabelWidth(t) { var e = this.options.ticks, i = this.ctx.measureText(t).width, n = o.toRadians(e.maxRotation), r = Math.cos(n), s = Math.sin(n);return i * r + o.valueOrDefault(e.fontSize, a.global.defaultFontSize) * s; }, getLabelCapacity: function getLabelCapacity(t) { var e = this, i = e.options.time.displayFormats.millisecond, a = e.tickFormatFunction(n(t), 0, [], i), o = e.getLabelWidth(a), r = e.isHorizontal() ? e.width : e.height, s = Math.floor(r / o);return s > 0 ? s : 1; } });t.scaleService.registerScaleType("time", e, { position: "bottom", distribution: "linear", bounds: "data", time: { parser: !1, format: !1, unit: !1, round: !1, displayFormat: !1, isoWeekday: !1, minUnit: "millisecond", displayFormats: { millisecond: "h:mm:ss.SSS a", second: "h:mm:ss a", minute: "h:mm a", hour: "hA", day: "MMM D", week: "ll", month: "MMM YYYY", quarter: "[Q]Q - YYYY", year: "YYYY" } }, ticks: { autoSkip: !1, source: "auto", major: { enabled: !1 } } }); }; }, { 1: 1, 25: 25, 45: 45 }] }, {}, [7])(7); }); "use strict"; (function (d) { d.fn.shake = function (a) { "function" === typeof a && (a = { callback: a });a = d.extend({ direction: "left", distance: 20, times: 3, speed: 140, easing: "swing" }, a);return this.each(function () { var b = d(this), k = { position: b.css("position"), top: b.css("top"), bottom: b.css("bottom"), left: b.css("left"), right: b.css("right") };b.css("position", "relative");var c = "up" == a.direction || "down" == a.direction ? "top" : "left", e = "up" == a.direction || "left" == a.direction ? "pos" : "neg", f = {}, g = {}, h = {};f[c] = ("pos" == e ? "-=" : "+=") + a.distance;g[c] = ("pos" == e ? "+=" : "-=") + 2 * a.distance;h[c] = ("pos" == e ? "-=" : "+=") + 2 * a.distance;b.animate(f, a.speed, a.easing);for (c = 1; c < a.times; c++) { b.animate(g, a.speed, a.easing).animate(h, a.speed, a.easing); }b.animate(g, a.speed, a.easing).animate(f, a.speed / 2, a.easing, function () { b.css(k);a.callback && a.callback.apply(this, arguments); }); }); }; })(jQuery); "use strict"; /* AngularJS v1.5.6 (c) 2010-2016 Google, Inc. http://angularjs.org License: MIT */ (function (S, B) { 'use strict'; function Aa(a, b, c) { if (!a) throw Ma("areq", b || "?", c || "required");return a; }function Ba(a, b) { if (!a && !b) return "";if (!a) return b;if (!b) return a;ca(a) && (a = a.join(" "));ca(b) && (b = b.join(" "));return a + " " + b; }function Na(a) { var b = {};a && (a.to || a.from) && (b.to = a.to, b.from = a.from);return b; }function Y(a, b, c) { var d = "";a = ca(a) ? a : a && P(a) && a.length ? a.split(/\s+/) : [];s(a, function (a, l) { a && 0 < a.length && (d += 0 < l ? " " : "", d += c ? b + a : a + b); });return d; }function Oa(a) { if (a instanceof E) switch (a.length) {case 0: return a; case 1: if (1 === a[0].nodeType) return a;break;default: return E(da(a));}if (1 === a.nodeType) return E(a); }function da(a) { if (!a[0]) return a;for (var b = 0; b < a.length; b++) { var c = a[b];if (1 == c.nodeType) return c; } }function Pa(a, b, c) { s(b, function (b) { a.addClass(b, c); }); }function Qa(a, b, c) { s(b, function (b) { a.removeClass(b, c); }); }function V(a) { return function (b, c) { c.addClass && (Pa(a, b, c.addClass), c.addClass = null);c.removeClass && (Qa(a, b, c.removeClass), c.removeClass = null); }; }function pa(a) { a = a || {};if (!a.$$prepared) { var b = a.domOperation || R;a.domOperation = function () { a.$$domOperationFired = !0;b();b = R; };a.$$prepared = !0; }return a; }function ha(a, b) { Ca(a, b);Da(a, b); }function Ca(a, b) { b.from && (a.css(b.from), b.from = null); }function Da(a, b) { b.to && (a.css(b.to), b.to = null); }function W(a, b, c) { var d = b.options || {};c = c.options || {};var e = (d.addClass || "") + " " + (c.addClass || ""), l = (d.removeClass || "") + " " + (c.removeClass || "");a = Ra(a.attr("class"), e, l);c.preparationClasses && (d.preparationClasses = Z(c.preparationClasses, d.preparationClasses), delete c.preparationClasses); e = d.domOperation !== R ? d.domOperation : null;Ea(d, c);e && (d.domOperation = e);d.addClass = a.addClass ? a.addClass : null;d.removeClass = a.removeClass ? a.removeClass : null;b.addClass = d.addClass;b.removeClass = d.removeClass;return d; }function Ra(a, b, c) { function d(a) { P(a) && (a = a.split(" "));var b = {};s(a, function (a) { a.length && (b[a] = !0); });return b; }var e = {};a = d(a);b = d(b);s(b, function (a, b) { e[b] = 1; });c = d(c);s(c, function (a, b) { e[b] = 1 === e[b] ? null : -1; });var l = { addClass: "", removeClass: "" };s(e, function (b, c) { var d, e;1 === b ? (d = "addClass", e = !a[c]) : -1 === b && (d = "removeClass", e = a[c]);e && (l[d].length && (l[d] += " "), l[d] += c); });return l; }function z(a) { return a instanceof B.element ? a[0] : a; }function Sa(a, b, c) { var d = "";b && (d = Y(b, "ng-", !0));c.addClass && (d = Z(d, Y(c.addClass, "-add")));c.removeClass && (d = Z(d, Y(c.removeClass, "-remove")));d.length && (c.preparationClasses = d, a.addClass(d)); }function qa(a, b) { var c = b ? "-" + b + "s" : "";la(a, [ma, c]);return [ma, c]; }function ta(a, b) { var c = b ? "paused" : "", d = $ + "PlayState";la(a, [d, c]);return [d, c]; }function la(a, b) { a.style[b[0]] = b[1]; }function Z(a, b) { return a ? b ? a + " " + b : a : b; }function Fa(a, b, c) { var d = Object.create(null), e = a.getComputedStyle(b) || {};s(c, function (a, b) { var c = e[a];if (c) { var k = c.charAt(0);if ("-" === k || "+" === k || 0 <= k) c = Ta(c);0 === c && (c = null);d[b] = c; } });return d; }function Ta(a) { var b = 0;a = a.split(/\s*,\s*/);s(a, function (a) { "s" == a.charAt(a.length - 1) && (a = a.substring(0, a.length - 1));a = parseFloat(a) || 0;b = b ? Math.max(a, b) : a; });return b; }function ua(a) { return 0 === a || null != a; }function Ga(a, b) { var c = T, d = a + "s";b ? c += "Duration" : d += " linear all"; return [c, d]; }function Ha() { var a = Object.create(null);return { flush: function flush() { a = Object.create(null); }, count: function count(b) { return (b = a[b]) ? b.total : 0; }, get: function get(b) { return (b = a[b]) && b.value; }, put: function put(b, c) { a[b] ? a[b].total++ : a[b] = { total: 1, value: c }; } }; }function Ia(a, b, c) { s(c, function (c) { a[c] = ea(a[c]) ? a[c] : b.style.getPropertyValue(c); }); }var R = B.noop, Ja = B.copy, Ea = B.extend, E = B.element, s = B.forEach, ca = B.isArray, P = B.isString, va = B.isObject, O = B.isUndefined, ea = B.isDefined, Ka = B.isFunction, wa = B.isElement, T, xa, $, ya;O(S.ontransitionend) && ea(S.onwebkittransitionend) ? (T = "WebkitTransition", xa = "webkitTransitionEnd transitionend") : (T = "transition", xa = "transitionend");O(S.onanimationend) && ea(S.onwebkitanimationend) ? ($ = "WebkitAnimation", ya = "webkitAnimationEnd animationend") : ($ = "animation", ya = "animationend");var ra = $ + "Delay", za = $ + "Duration", ma = T + "Delay", La = T + "Duration", Ma = B.$$minErr("ng"), Ua = { transitionDuration: La, transitionDelay: ma, transitionProperty: T + "Property", animationDuration: za, animationDelay: ra, animationIterationCount: $ + "IterationCount" }, Va = { transitionDuration: La, transitionDelay: ma, animationDuration: za, animationDelay: ra };B.module("ngAnimate", []).directive("ngAnimateSwap", ["$animate", "$rootScope", function (a, b) { return { restrict: "A", transclude: "element", terminal: !0, priority: 600, link: function link(b, d, e, l, m) { var I, k;b.$watchCollection(e.ngAnimateSwap || e["for"], function (e) { I && a.leave(I);k && (k.$destroy(), k = null);if (e || 0 === e) k = b.$new(), m(k, function (b) { I = b;a.enter(b, null, d); }); }); } }; }]).directive("ngAnimateChildren", ["$interpolate", function (a) { return { link: function link(b, c, d) { function e(a) { c.data("$$ngAnimateChildren", "on" === a || "true" === a); }var l = d.ngAnimateChildren;B.isString(l) && 0 === l.length ? c.data("$$ngAnimateChildren", !0) : (e(a(l)(b)), d.$observe("ngAnimateChildren", e)); } }; }]).factory("$$rAFScheduler", ["$$rAF", function (a) { function b(a) { d = d.concat(a);c(); }function c() { if (d.length) { for (var b = d.shift(), m = 0; m < b.length; m++) { b[m](); }e || a(function () { e || c(); }); } }var d, e;d = b.queue = [];b.waitUntilQuiet = function (b) { e && e();e = a(function () { e = null;b();c(); }); };return b; }]).provider("$$animateQueue", ["$animateProvider", function (a) { function b(a) { if (!a) return null;a = a.split(" ");var b = Object.create(null);s(a, function (a) { b[a] = !0; });return b; }function c(a, c) { if (a && c) { var d = b(c);return a.split(" ").some(function (a) { return d[a]; }); } }function d(a, b, c, d) { return l[a].some(function (a) { return a(b, c, d); }); }function e(a, b) { var c = 0 < (a.addClass || "").length, d = 0 < (a.removeClass || "").length;return b ? c && d : c || d; }var l = this.rules = { skip: [], cancel: [], join: [] };l.join.push(function (a, b, c) { return !b.structural && e(b); });l.skip.push(function (a, b, c) { return !b.structural && !e(b); });l.skip.push(function (a, b, c) { return "leave" == c.event && b.structural; });l.skip.push(function (a, b, c) { return c.structural && 2 === c.state && !b.structural; });l.cancel.push(function (a, b, c) { return c.structural && b.structural; });l.cancel.push(function (a, b, c) { return 2 === c.state && b.structural; });l.cancel.push(function (a, b, d) { if (d.structural) return !1;a = b.addClass;b = b.removeClass;var e = d.addClass;d = d.removeClass;return O(a) && O(b) || O(e) && O(d) ? !1 : c(a, d) || c(b, e); });this.$get = ["$$rAF", "$rootScope", "$rootElement", "$document", "$$HashMap", "$$animation", "$$AnimateRunner", "$templateRequest", "$$jqLite", "$$forceReflow", function (b, c, k, l, w, Wa, Q, u, F, n) { function K() { var a = !1;return function (b) { a ? b() : c.$$postDigest(function () { a = !0;b(); }); }; }function J(a, b, c) { var f = z(b), d = z(a), L = [];(a = h[c]) && s(a, function (a) { y.call(a.node, f) ? L.push(a.callback) : "leave" === c && y.call(a.node, d) && L.push(a.callback); });return L; }function r(a, b, c) { var f = da(b);return a.filter(function (a) { return !(a.node === f && (!c || a.callback === c)); }); }function t(a, h, x) { function r(c, f, d, h) { H(function () { var c = J(oa, a, f);c.length ? b(function () { s(c, function (b) { b(a, d, h); });"close" !== d || a[0].parentNode || sa.off(a); }) : "close" !== d || a[0].parentNode || sa.off(a); });c.progress(f, d, h); }function g(b) { var c = a, f = p;f.preparationClasses && (c.removeClass(f.preparationClasses), f.preparationClasses = null);f.activeClasses && (c.removeClass(f.activeClasses), f.activeClasses = null);D(a, p);ha(a, p);p.domOperation();n.complete(!b); }var p = Ja(x), t, oa;if (a = Oa(a)) t = z(a), oa = a.parent();var p = pa(p), n = new Q(), H = K();ca(p.addClass) && (p.addClass = p.addClass.join(" "));p.addClass && !P(p.addClass) && (p.addClass = null);ca(p.removeClass) && (p.removeClass = p.removeClass.join(" "));p.removeClass && !P(p.removeClass) && (p.removeClass = null);p.from && !va(p.from) && (p.from = null);p.to && !va(p.to) && (p.to = null);if (!t) return g(), n;x = [t.className, p.addClass, p.removeClass].join(" ");if (!Xa(x)) return g(), n;var k = 0 <= ["enter", "move", "leave"].indexOf(h), y = l[0].hidden, u = !f || y || L.get(t);x = !u && A.get(t) || {};var F = !!x.state;u || F && 1 == x.state || (u = !N(a, oa, h));if (u) return y && r(n, h, "start"), g(), y && r(n, h, "close"), n;k && M(a);y = { structural: k, element: a, event: h, addClass: p.addClass, removeClass: p.removeClass, close: g, options: p, runner: n };if (F) { if (d("skip", a, y, x)) { if (2 === x.state) return g(), n;W(a, x, y);return x.runner; }if (d("cancel", a, y, x)) { if (2 === x.state) x.runner.end();else if (x.structural) x.close();else return W(a, x, y), x.runner; } else if (d("join", a, y, x)) if (2 === x.state) W(a, y, {});else return Sa(a, k ? h : null, p), h = y.event = x.event, p = W(a, x, y), x.runner; } else W(a, y, {});(F = y.structural) || (F = "animate" === y.event && 0 < Object.keys(y.options.to || {}).length || e(y));if (!F) return g(), ka(a), n;var w = (x.counter || 0) + 1;y.counter = w;G(a, 1, y);c.$$postDigest(function () { var b = A.get(t), c = !b, b = b || {}, f = 0 < (a.parent() || []).length && ("animate" === b.event || b.structural || e(b));if (c || b.counter !== w || !f) { c && (D(a, p), ha(a, p));if (c || k && b.event !== h) p.domOperation(), n.end();f || ka(a); } else h = !b.structural && e(b, !0) ? "setClass" : b.event, G(a, 2), b = Wa(a, h, b.options), n.setHost(b), r(n, h, "start", {}), b.done(function (b) { g(!b); (b = A.get(t)) && b.counter === w && ka(z(a));r(n, h, "close", {}); }); });return n; }function M(a) { a = z(a).querySelectorAll("[data-ng-animate]");s(a, function (a) { var b = parseInt(a.getAttribute("data-ng-animate")), c = A.get(a);if (c) switch (b) {case 2: c.runner.end();case 1: A.remove(a);} }); }function ka(a) { a = z(a);a.removeAttribute("data-ng-animate");A.remove(a); }function g(a, b) { return z(a) === z(b); }function N(a, b, c) { c = E(l[0].body);var f = g(a, c) || "HTML" === a[0].nodeName, d = g(a, k), h = !1, r, e = L.get(z(a));(a = E.data(a[0], "$ngAnimatePin")) && (b = a);for (b = z(b); b;) { d || (d = g(b, k));if (1 !== b.nodeType) break;a = A.get(b) || {};if (!h) { var n = L.get(b);if (!0 === n && !1 !== e) { e = !0;break; } else !1 === n && (e = !1);h = a.structural; }if (O(r) || !0 === r) a = E.data(b, "$$ngAnimateChildren"), ea(a) && (r = a);if (h && !1 === r) break;f || (f = g(b, c));if (f && d) break;if (!d && (a = E.data(b, "$ngAnimatePin"))) { b = z(a);continue; }b = b.parentNode; }return (!h || r) && !0 !== e && d && f; }function G(a, b, c) { c = c || {};c.state = b;a = z(a);a.setAttribute("data-ng-animate", b);c = (b = A.get(a)) ? Ea(b, c) : c;A.put(a, c); }var A = new w(), L = new w(), f = null, oa = c.$watch(function () { return 0 === u.totalPendingRequests; }, function (a) { a && (oa(), c.$$postDigest(function () { c.$$postDigest(function () { null === f && (f = !0); }); })); }), h = {}, H = a.classNameFilter(), Xa = H ? function (a) { return H.test(a); } : function () { return !0; }, D = V(F), y = S.Node.prototype.contains || function (a) { return this === a || !!(this.compareDocumentPosition(a) & 16); }, sa = { on: function on(a, b, c) { var f = da(b);h[a] = h[a] || [];h[a].push({ node: f, callback: c });E(b).on("$destroy", function () { A.get(f) || sa.off(a, b, c); }); }, off: function off(a, b, c) { if (1 !== arguments.length || B.isString(arguments[0])) { var f = h[a];f && (h[a] = 1 === arguments.length ? null : r(f, b, c)); } else for (f in b = arguments[0], h) { h[f] = r(h[f], b); } }, pin: function pin(a, b) { Aa(wa(a), "element", "not an element");Aa(wa(b), "parentElement", "not an element");a.data("$ngAnimatePin", b); }, push: function push(a, b, c, f) { c = c || {};c.domOperation = f;return t(a, b, c); }, enabled: function enabled(a, b) { var c = arguments.length;if (0 === c) b = !!f;else if (wa(a)) { var d = z(a), h = L.get(d);1 === c ? b = !h : L.put(d, !b); } else b = f = !!a;return b; } };return sa; }]; }]).provider("$$animation", ["$animateProvider", function (a) { var b = this.drivers = [];this.$get = ["$$jqLite", "$rootScope", "$injector", "$$AnimateRunner", "$$HashMap", "$$rAFScheduler", function (a, d, e, l, m, I) { function k(a) { function b(a) { if (a.processed) return a;a.processed = !0;var d = a.domNode, t = d.parentNode;e.put(d, a);for (var M; t;) { if (M = e.get(t)) { M.processed || (M = b(M));break; }t = t.parentNode; }(M || c).children.push(a);return a; }var c = { children: [] }, d, e = new m();for (d = 0; d < a.length; d++) { var k = a[d];e.put(k.domNode, a[d] = { domNode: k.domNode, fn: k.fn, children: [] }); }for (d = 0; d < a.length; d++) { b(a[d]); }return function (a) { var b = [], c = [], d;for (d = 0; d < a.children.length; d++) { c.push(a.children[d]); }a = c.length;var e = 0, g = [];for (d = 0; d < c.length; d++) { var n = c[d];0 >= a && (a = e, e = 0, b.push(g), g = []);g.push(n.fn);n.children.forEach(function (a) { e++;c.push(a); });a--; }g.length && b.push(g);return b; }(c); }var v = [], w = V(a);return function (m, Q, u) { function F(a) { a = a.hasAttribute("ng-animate-ref") ? [a] : a.querySelectorAll("[ng-animate-ref]");var b = [];s(a, function (a) { var c = a.getAttribute("ng-animate-ref");c && c.length && b.push(a); });return b; }function n(a) { var b = [], c = {};s(a, function (a, d) { var h = z(a.element), e = 0 <= ["enter", "move"].indexOf(a.event), h = a.structural ? F(h) : [];if (h.length) { var g = e ? "to" : "from";s(h, function (a) { var b = a.getAttribute("ng-animate-ref");c[b] = c[b] || {};c[b][g] = { animationID: d, element: E(a) }; }); } else b.push(a); });var d = {}, e = {};s(c, function (c, g) { var r = c.from, n = c.to;if (r && n) { var A = a[r.animationID], t = a[n.animationID], m = r.animationID.toString();if (!e[m]) { var k = e[m] = { structural: !0, beforeStart: function beforeStart() { A.beforeStart(); t.beforeStart(); }, close: function close() { A.close();t.close(); }, classes: K(A.classes, t.classes), from: A, to: t, anchors: [] };k.classes.length ? b.push(k) : (b.push(A), b.push(t)); }e[m].anchors.push({ out: r.element, "in": n.element }); } else r = r ? r.animationID : n.animationID, n = r.toString(), d[n] || (d[n] = !0, b.push(a[r])); });return b; }function K(a, b) { a = a.split(" ");b = b.split(" ");for (var c = [], d = 0; d < a.length; d++) { var e = a[d];if ("ng-" !== e.substring(0, 3)) for (var r = 0; r < b.length; r++) { if (e === b[r]) { c.push(e);break; } } }return c.join(" "); }function J(a) { for (var c = b.length - 1; 0 <= c; c--) { var d = b[c];if (e.has(d) && (d = e.get(d)(a))) return d; } }function r(a, b) { function c(a) { (a = a.data("$$animationRunner")) && a.setHost(b); }a.from && a.to ? (c(a.from.element), c(a.to.element)) : c(a.element); }function t() { var a = m.data("$$animationRunner");!a || "leave" === Q && u.$$domOperationFired || a.end(); }function M(b) { m.off("$destroy", t);m.removeData("$$animationRunner");w(m, u);ha(m, u);u.domOperation();G && a.removeClass(m, G);m.removeClass("ng-animate");g.complete(!b); }u = pa(u);var ka = 0 <= ["enter", "move", "leave"].indexOf(Q), g = new l({ end: function end() { M(); }, cancel: function cancel() { M(!0); } });if (!b.length) return M(), g;m.data("$$animationRunner", g);var N = Ba(m.attr("class"), Ba(u.addClass, u.removeClass)), G = u.tempClasses;G && (N += " " + G, u.tempClasses = null);var A;ka && (A = "ng-" + Q + "-prepare", a.addClass(m, A));v.push({ element: m, classes: N, event: Q, structural: ka, options: u, beforeStart: function beforeStart() { m.addClass("ng-animate");G && a.addClass(m, G);A && (a.removeClass(m, A), A = null); }, close: M });m.on("$destroy", t);if (1 < v.length) return g;d.$$postDigest(function () { var a = [];s(v, function (b) { b.element.data("$$animationRunner") ? a.push(b) : b.close(); });v.length = 0;var b = n(a), c = [];s(b, function (a) { c.push({ domNode: z(a.from ? a.from.element : a.element), fn: function fn() { a.beforeStart();var b, c = a.close;if ((a.anchors ? a.from.element || a.to.element : a.element).data("$$animationRunner")) { var d = J(a);d && (b = d.start); }b ? (b = b(), b.done(function (a) { c(!a); }), r(a, b)) : c(); } }); });I(k(c)); });return g; }; }]; }]).provider("$animateCss", ["$animateProvider", function (a) { var b = Ha(), c = Ha();this.$get = ["$window", "$$jqLite", "$$AnimateRunner", "$timeout", "$$forceReflow", "$sniffer", "$$rAFScheduler", "$$animateQueue", function (a, e, l, m, I, k, v, w) { function B(a, b) { var c = a.parentNode;return (c.$$ngAnimateParentKey || (c.$$ngAnimateParentKey = ++K)) + "-" + a.getAttribute("class") + "-" + b; }function Q(r, n, m, k) { var g;0 < b.count(m) && (g = c.get(m), g || (n = Y(n, "-stagger"), e.addClass(r, n), g = Fa(a, r, k), g.animationDuration = Math.max(g.animationDuration, 0), g.transitionDuration = Math.max(g.transitionDuration, 0), e.removeClass(r, n), c.put(m, g)));return g || {}; }function u(a) { J.push(a); v.waitUntilQuiet(function () { b.flush();c.flush();for (var a = I(), d = 0; d < J.length; d++) { J[d](a); }J.length = 0; }); }function F(c, e, n) { e = b.get(n);e || (e = Fa(a, c, Ua), "infinite" === e.animationIterationCount && (e.animationIterationCount = 1));b.put(n, e);c = e;n = c.animationDelay;e = c.transitionDelay;c.maxDelay = n && e ? Math.max(n, e) : n || e;c.maxDuration = Math.max(c.animationDuration * c.animationIterationCount, c.transitionDuration);return c; }var n = V(e), K = 0, J = [];return function (a, c) { function d() { g(); }function v() { g(!0); }function g(b) { if (!(y || E && K)) { y = !0;K = !1;f.$$skipPreparationClasses || e.removeClass(a, ga);e.removeClass(a, ea);ta(h, !1);qa(h, !1);s(H, function (a) { h.style[a[0]] = ""; });n(a, f);ha(a, f);Object.keys(J).length && s(J, function (a, b) { a ? h.style.setProperty(b, a) : h.style.removeProperty(b); });if (f.onDone) f.onDone();fa && fa.length && a.off(fa.join(" "), A);var c = a.data("$$animateCss");c && (m.cancel(c[0].timer), a.removeData("$$animateCss"));O && O.complete(!b); } }function N(a) { q.blockTransition && qa(h, a);q.blockKeyframeAnimation && ta(h, !!a); }function G() { O = new l({ end: d, cancel: v });u(R);g();return { $$willAnimate: !1, start: function start() { return O; }, end: d }; }function A(a) { a.stopPropagation();var b = a.originalEvent || a;a = b.$manualTimeStamp || Date.now();b = parseFloat(b.elapsedTime.toFixed(3));Math.max(a - W, 0) >= S && b >= p && (E = !0, g()); }function L() { function b() { if (!y) { N(!1);s(H, function (a) { h.style[a[0]] = a[1]; });n(a, f);e.addClass(a, ea);if (q.recalculateTimingStyles) { na = h.className + " " + ga;ia = B(h, na);C = F(h, na, ia);aa = C.maxDelay;P = Math.max(aa, 0);p = C.maxDuration;if (0 === p) { g();return; }q.hasTransitions = 0 < C.transitionDuration;q.hasAnimations = 0 < C.animationDuration; }q.applyAnimationDelay && (aa = "boolean" !== typeof f.delay && ua(f.delay) ? parseFloat(f.delay) : aa, P = Math.max(aa, 0), C.animationDelay = aa, ba = [ra, aa + "s"], H.push(ba), h.style[ba[0]] = ba[1]);S = 1E3 * P;V = 1E3 * p;if (f.easing) { var d, k = f.easing;q.hasTransitions && (d = T + "TimingFunction", H.push([d, k]), h.style[d] = k);q.hasAnimations && (d = $ + "TimingFunction", H.push([d, k]), h.style[d] = k); }C.transitionDuration && fa.push(xa);C.animationDuration && fa.push(ya);W = Date.now();var L = S + 1.5 * V;d = W + L;var k = a.data("$$animateCss") || [], l = !0;if (k.length) { var G = k[0];(l = d > G.expectedEndTime) ? m.cancel(G.timer) : k.push(g); }l && (L = m(c, L, !1), k[0] = { timer: L, expectedEndTime: d }, k.push(g), a.data("$$animateCss", k));if (fa.length) a.on(fa.join(" "), A);f.to && (f.cleanupStyles && Ia(J, h, Object.keys(f.to)), Da(a, f)); } }function c() { var b = a.data("$$animateCss");if (b) { for (var d = 1; d < b.length; d++) { b[d](); }a.removeData("$$animateCss"); } }if (!y) if (h.parentNode) { var d = function d(a) { if (E) K && a && (K = !1, g());else if (K = !a, C.animationDuration) if (a = ta(h, K), K) H.push(a);else { var b = H, c = b.indexOf(a);0 <= a && b.splice(c, 1); } }, k = 0 < da && (C.transitionDuration && 0 === X.transitionDuration || C.animationDuration && 0 === X.animationDuration) && Math.max(X.animationDelay, X.transitionDelay);k ? m(b, Math.floor(k * da * 1E3), !1) : b();x.resume = function () { d(!0); };x.pause = function () { d(!1); }; } else g(); }var f = c || {};f.$$prepared || (f = pa(Ja(f)));var J = {}, h = z(a);if (!h || !h.parentNode || !w.enabled()) return G();var H = [], I = a.attr("class"), D = Na(f), y, K, E, O, x, P, S, p, V, W, fa = [];if (0 === f.duration || !k.animations && !k.transitions) return G();var ja = f.event && ca(f.event) ? f.event.join(" ") : f.event, Z = "", U = "";ja && f.structural ? Z = Y(ja, "ng-", !0) : ja && (Z = ja);f.addClass && (U += Y(f.addClass, "-add"));f.removeClass && (U.length && (U += " "), U += Y(f.removeClass, "-remove"));f.applyClassesEarly && U.length && n(a, f);var ga = [Z, U].join(" ").trim(), na = I + " " + ga, ea = Y(ga, "-active"), I = D.to && 0 < Object.keys(D.to).length;if (!(0 < (f.keyframeStyle || "").length || I || ga)) return G();var ia, X;0 < f.stagger ? (D = parseFloat(f.stagger), X = { transitionDelay: D, animationDelay: D, transitionDuration: 0, animationDuration: 0 }) : (ia = B(h, na), X = Q(h, ga, ia, Va));f.$$skipPreparationClasses || e.addClass(a, ga);f.transitionStyle && (D = [T, f.transitionStyle], la(h, D), H.push(D));0 <= f.duration && (D = 0 < h.style[T].length, D = Ga(f.duration, D), la(h, D), H.push(D));f.keyframeStyle && (D = [$, f.keyframeStyle], la(h, D), H.push(D));var da = X ? 0 <= f.staggerIndex ? f.staggerIndex : b.count(ia) : 0;(ja = 0 === da) && !f.skipBlocking && qa(h, 9999);var C = F(h, na, ia), aa = C.maxDelay;P = Math.max(aa, 0);p = C.maxDuration;var q = {};q.hasTransitions = 0 < C.transitionDuration;q.hasAnimations = 0 < C.animationDuration;q.hasTransitionAll = q.hasTransitions && "all" == C.transitionProperty;q.applyTransitionDuration = I && (q.hasTransitions && !q.hasTransitionAll || q.hasAnimations && !q.hasTransitions);q.applyAnimationDuration = f.duration && q.hasAnimations;q.applyTransitionDelay = ua(f.delay) && (q.applyTransitionDuration || q.hasTransitions);q.applyAnimationDelay = ua(f.delay) && q.hasAnimations;q.recalculateTimingStyles = 0 < U.length;if (q.applyTransitionDuration || q.applyAnimationDuration) p = f.duration ? parseFloat(f.duration) : p, q.applyTransitionDuration && (q.hasTransitions = !0, C.transitionDuration = p, D = 0 < h.style[T + "Property"].length, H.push(Ga(p, D))), q.applyAnimationDuration && (q.hasAnimations = !0, C.animationDuration = p, H.push([za, p + "s"]));if (0 === p && !q.recalculateTimingStyles) return G();if (null != f.delay) { var ba;"boolean" !== typeof f.delay && (ba = parseFloat(f.delay), P = Math.max(ba, 0));q.applyTransitionDelay && H.push([ma, ba + "s"]);q.applyAnimationDelay && H.push([ra, ba + "s"]); }null == f.duration && 0 < C.transitionDuration && (q.recalculateTimingStyles = q.recalculateTimingStyles || ja);S = 1E3 * P;V = 1E3 * p;f.skipBlocking || (q.blockTransition = 0 < C.transitionDuration, q.blockKeyframeAnimation = 0 < C.animationDuration && 0 < X.animationDelay && 0 === X.animationDuration);f.from && (f.cleanupStyles && Ia(J, h, Object.keys(f.from)), Ca(a, f));q.blockTransition || q.blockKeyframeAnimation ? N(p) : f.skipBlocking || qa(h, !1);return { $$willAnimate: !0, end: d, start: function start() { if (!y) return x = { end: d, cancel: v, resume: null, pause: null }, O = new l(x), u(L), O; } }; }; }]; }]).provider("$$animateCssDriver", ["$$animationProvider", function (a) { a.drivers.push("$$animateCssDriver");this.$get = ["$animateCss", "$rootScope", "$$AnimateRunner", "$rootElement", "$sniffer", "$$jqLite", "$document", function (a, c, d, e, l, m, I) { function k(a) { return a.replace(/\bng-\S+\b/g, ""); }function v(a, b) { P(a) && (a = a.split(" "));P(b) && (b = b.split(" "));return a.filter(function (a) { return -1 === b.indexOf(a); }).join(" "); }function w(c, e, m) { function l(a) { var b = {}, c = z(a).getBoundingClientRect();s(["width", "height", "top", "left"], function (a) { var d = c[a]; switch (a) {case "top": d += u.scrollTop;break;case "left": d += u.scrollLeft;}b[a] = Math.floor(d) + "px"; });return b; }function t() { var c = k(m.attr("class") || ""), d = v(c, g), c = v(g, c), d = a(w, { to: l(m), addClass: "ng-anchor-in " + d, removeClass: "ng-anchor-out " + c, delay: !0 });return d.$$willAnimate ? d : null; }function I() { w.remove();e.removeClass("ng-animate-shim");m.removeClass("ng-animate-shim"); }var w = E(z(e).cloneNode(!0)), g = k(w.attr("class") || "");e.addClass("ng-animate-shim");m.addClass("ng-animate-shim");w.addClass("ng-anchor"); F.append(w);var N;c = function () { var c = a(w, { addClass: "ng-anchor-out", delay: !0, from: l(e) });return c.$$willAnimate ? c : null; }();if (!c && (N = t(), !N)) return I();var G = c || N;return { start: function start() { function a() { c && c.end(); }var b, c = G.start();c.done(function () { c = null;if (!N && (N = t())) return c = N.start(), c.done(function () { c = null;I();b.complete(); }), c;I();b.complete(); });return b = new d({ end: a, cancel: a }); } }; }function B(a, b, c, e) { var k = Q(a, R), m = Q(b, R), l = [];s(e, function (a) { (a = w(c, a.out, a["in"])) && l.push(a); });if (k || m || 0 !== l.length) return { start: function start() { function a() { s(b, function (a) { a.end(); }); }var b = [];k && b.push(k.start());m && b.push(m.start());s(l, function (a) { b.push(a.start()); });var c = new d({ end: a, cancel: a });d.all(b, function (a) { c.complete(a); });return c; } }; }function Q(c) { var d = c.element, e = c.options || {};c.structural && (e.event = c.event, e.structural = !0, e.applyClassesEarly = !0, "leave" === c.event && (e.onDone = e.domOperation));e.preparationClasses && (e.event = Z(e.event, e.preparationClasses));c = a(d, e);return c.$$willAnimate ? c : null; }if (!l.animations && !l.transitions) return R;var u = I[0].body; c = z(e);var F = E(c.parentNode && 11 === c.parentNode.nodeType || u.contains(c) ? c : u);V(m);return function (a) { return a.from && a.to ? B(a.from, a.to, a.classes, a.anchors) : Q(a); }; }]; }]).provider("$$animateJs", ["$animateProvider", function (a) { this.$get = ["$injector", "$$AnimateRunner", "$$jqLite", function (b, c, d) { function e(c) { c = ca(c) ? c : c.split(" ");for (var d = [], e = {}, l = 0; l < c.length; l++) { var w = c[l], s = a.$$registeredAnimations[w];s && !e[w] && (d.push(b.get(s)), e[w] = !0); }return d; }var l = V(d);return function (a, b, d, v) { function w() { v.domOperation(); l(a, v); }function B(a, b, d, e, f) { switch (d) {case "animate": b = [b, e.from, e.to, f];break;case "setClass": b = [b, n, K, f];break;case "addClass": b = [b, n, f];break;case "removeClass": b = [b, K, f];break;default: b = [b, f];}b.push(e);if (a = a.apply(a, b)) if (Ka(a.start) && (a = a.start()), a instanceof c) a.done(f);else if (Ka(a)) return a;return R; }function z(a, b, d, e, f) { var g = [];s(e, function (e) { var k = e[f];k && g.push(function () { var e, f, h = !1, g = function g(a) { h || (h = !0, (f || R)(a), e.complete(!a)); };e = new c({ end: function end() { g(); }, cancel: function cancel() { g(!0); } }); f = B(k, a, b, d, function (a) { g(!1 === a); });return e; }); });return g; }function u(a, b, d, e, f) { var g = z(a, b, d, e, f);if (0 === g.length) { var h, k;"beforeSetClass" === f ? (h = z(a, "removeClass", d, e, "beforeRemoveClass"), k = z(a, "addClass", d, e, "beforeAddClass")) : "setClass" === f && (h = z(a, "removeClass", d, e, "removeClass"), k = z(a, "addClass", d, e, "addClass"));h && (g = g.concat(h));k && (g = g.concat(k)); }if (0 !== g.length) return function (a) { var b = [];g.length && s(g, function (a) { b.push(a()); });b.length ? c.all(b, a) : a();return function (a) { s(b, function (b) { a ? b.cancel() : b.end(); }); }; }; }var F = !1;3 === arguments.length && va(d) && (v = d, d = null);v = pa(v);d || (d = a.attr("class") || "", v.addClass && (d += " " + v.addClass), v.removeClass && (d += " " + v.removeClass));var n = v.addClass, K = v.removeClass, J = e(d), r, t;if (J.length) { var M, E;"leave" == b ? (E = "leave", M = "afterLeave") : (E = "before" + b.charAt(0).toUpperCase() + b.substr(1), M = b);"enter" !== b && "move" !== b && (r = u(a, b, v, J, E));t = u(a, b, v, J, M); }if (r || t) { var g;return { $$willAnimate: !0, end: function end() { g ? g.end() : (F = !0, w(), ha(a, v), g = new c(), g.complete(!0));return g; }, start: function start() { function b(c) { F = !0;w();ha(a, v);g.complete(c); }if (g) return g;g = new c();var d, e = [];r && e.push(function (a) { d = r(a); });e.length ? e.push(function (a) { w();a(!0); }) : w();t && e.push(function (a) { d = t(a); });g.setHost({ end: function end() { F || ((d || R)(void 0), b(void 0)); }, cancel: function cancel() { F || ((d || R)(!0), b(!0)); } });c.chain(e, b);return g; } }; } }; }]; }]).provider("$$animateJsDriver", ["$$animationProvider", function (a) { a.drivers.push("$$animateJsDriver");this.$get = ["$$animateJs", "$$AnimateRunner", function (a, c) { function d(c) { return a(c.element, c.event, c.classes, c.options); }return function (a) { if (a.from && a.to) { var b = d(a.from), m = d(a.to);if (b || m) return { start: function start() { function a() { return function () { s(d, function (a) { a.end(); }); }; }var d = [];b && d.push(b.start());m && d.push(m.start());c.all(d, function (a) { e.complete(a); });var e = new c({ end: a(), cancel: a() });return e; } }; } else return d(a); }; }]; }]); })(window, window.angular); //# sourceMappingURL=angular-animate.min.js.map "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* AngularJS v1.5.6 (c) 2010-2016 Google, Inc. http://angularjs.org License: MIT */ (function (P, d) { 'use strict'; function G(t, g) { g = g || {};d.forEach(g, function (d, q) { delete g[q]; });for (var q in t) { !t.hasOwnProperty(q) || "$" === q.charAt(0) && "$" === q.charAt(1) || (g[q] = t[q]); }return g; }var z = d.$$minErr("$resource"), M = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource", ["ng"]).provider("$resource", function () { var t = /^https?:\/\/[^\/]*/, g = this;this.defaults = { stripTrailingSlashes: !0, actions: { get: { method: "GET" }, save: { method: "POST" }, query: { method: "GET", isArray: !0 }, remove: { method: "DELETE" }, "delete": { method: "DELETE" } } }; this.$get = ["$http", "$log", "$q", "$timeout", function (q, L, H, I) { function A(d, h) { return encodeURIComponent(d).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, h ? "%20" : "+"); }function B(d, h) { this.template = d;this.defaults = v({}, g.defaults, h);this.urlParams = {}; }function J(e, h, n, k) { function c(a, b) { var c = {};b = v({}, h, b);u(b, function (b, h) { x(b) && (b = b());var f;if (b && b.charAt && "@" == b.charAt(0)) { f = a;var l = b.substr(1);if (null == l || "" === l || "hasOwnProperty" === l || !M.test("." + l)) throw z("badmember", l);for (var l = l.split("."), m = 0, k = l.length; m < k && d.isDefined(f); m++) { var r = l[m];f = null !== f ? f[r] : void 0; } } else f = b;c[h] = f; });return c; }function N(a) { return a.resource; }function m(a) { G(a || {}, this); }var t = new B(e, k);n = v({}, g.defaults.actions, n);m.prototype.toJSON = function () { var a = v({}, this);delete a.$promise;delete a.$resolved;return a; };u(n, function (a, b) { var h = /^(POST|PUT|PATCH)$/i.test(a.method), e = a.timeout, E = d.isDefined(a.cancellable) ? a.cancellable : k && d.isDefined(k.cancellable) ? k.cancellable : g.defaults.cancellable;e && !d.isNumber(e) && (L.debug("ngResource:\n Only numeric values are allowed as `timeout`.\n Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."), delete a.timeout, e = null);m[b] = function (f, l, k, g) { var r = {}, n, w, C;switch (arguments.length) {case 4: C = g, w = k;case 3:case 2: if (x(l)) { if (x(f)) { w = f;C = l;break; }w = l;C = k; } else { r = f;n = l;w = k;break; }case 1: x(f) ? w = f : h ? n = f : r = f;break;case 0: break;default: throw z("badargs", arguments.length);}var D = this instanceof m, p = D ? n : a.isArray ? [] : new m(n), s = {}, A = a.interceptor && a.interceptor.response || N, B = a.interceptor && a.interceptor.responseError || void 0, y, F;u(a, function (a, b) { switch (b) {default: s[b] = O(a);case "params":case "isArray":case "interceptor":case "cancellable":} });!D && E && (y = H.defer(), s.timeout = y.promise, e && (F = I(y.resolve, e)));h && (s.data = n);t.setUrlParams(s, v({}, c(n, a.params || {}), r), a.url);r = q(s).then(function (f) { var c = f.data;if (c) { if (d.isArray(c) !== !!a.isArray) throw z("badcfg", b, a.isArray ? "array" : "object", d.isArray(c) ? "array" : "object", s.method, s.url);if (a.isArray) p.length = 0, u(c, function (b) { "object" === (typeof b === "undefined" ? "undefined" : _typeof(b)) ? p.push(new m(b)) : p.push(b); });else { var l = p.$promise;G(c, p);p.$promise = l; } }f.resource = p;return f; }, function (b) { (C || K)(b);return H.reject(b); });r["finally"](function () { p.$resolved = !0;!D && E && (p.$cancelRequest = d.noop, I.cancel(F), y = F = s.timeout = null); });r = r.then(function (b) { var a = A(b);(w || K)(a, b.headers);return a; }, B); return D ? r : (p.$promise = r, p.$resolved = !1, E && (p.$cancelRequest = y.resolve), p); };m.prototype["$" + b] = function (a, c, d) { x(a) && (d = c, c = a, a = {});a = m[b].call(this, a, this, c, d);return a.$promise || a; }; });m.bind = function (a) { return J(e, v({}, h, a), n); };return m; }var K = d.noop, u = d.forEach, v = d.extend, O = d.copy, x = d.isFunction;B.prototype = { setUrlParams: function setUrlParams(e, h, n) { var k = this, c = n || k.template, g, m, q = "", a = k.urlParams = {};u(c.split(/\W/), function (b) { if ("hasOwnProperty" === b) throw z("badname");!/^\d+$/.test(b) && b && new RegExp("(^|[^\\\\]):" + b + "(\\W|$)").test(c) && (a[b] = { isQueryParamValue: new RegExp("\\?.*=:" + b + "(?:\\W|$)").test(c) }); });c = c.replace(/\\:/g, ":");c = c.replace(t, function (a) { q = a;return ""; });h = h || {};u(k.urlParams, function (a, e) { g = h.hasOwnProperty(e) ? h[e] : k.defaults[e];d.isDefined(g) && null !== g ? (m = a.isQueryParamValue ? A(g, !0) : A(g, !0).replace(/%26/gi, "&").replace(/%3D/gi, "=").replace(/%2B/gi, "+"), c = c.replace(new RegExp(":" + e + "(\\W|$)", "g"), function (a, b) { return m + b; })) : c = c.replace(new RegExp("(/?):" + e + "(\\W|$)", "g"), function (a, b, c) { return "/" == c.charAt(0) ? c : b + c; }); });k.defaults.stripTrailingSlashes && (c = c.replace(/\/+$/, "") || "/");c = c.replace(/\/\.(?=\w+($|\?))/, ".");e.url = q + c.replace(/\/\\\./, "/.");u(h, function (a, c) { k.urlParams[c] || (e.params = e.params || {}, e.params[c] = a); }); } };return J; }]; }); })(window, window.angular); //# sourceMappingURL=angular-resource.min.js.map "use strict"; /* AngularJS v1.5.6 (c) 2010-2016 Google, Inc. http://angularjs.org License: MIT */ (function (x, n) { 'use strict'; function s(f, k) { var e = !1, a = !1;this.ngClickOverrideEnabled = function (b) { return n.isDefined(b) ? (b && !a && (a = !0, t.$$moduleName = "ngTouch", k.directive("ngClick", t), f.decorator("ngClickDirective", ["$delegate", function (a) { if (e) a.shift();else for (var b = a.length - 1; 0 <= b;) { if ("ngTouch" === a[b].$$moduleName) { a.splice(b, 1);break; }b--; }return a; }])), e = b, this) : e; };this.$get = function () { return { ngClickOverrideEnabled: function ngClickOverrideEnabled() { return e; } }; }; }function v(f, k, e) { p.directive(f, ["$parse", "$swipe", function (a, b) { return function (l, u, g) { function h(c) { if (!d) return !1;var a = Math.abs(c.y - d.y);c = (c.x - d.x) * k;return r && 75 > a && 0 < c && 30 < c && .3 > a / c; }var m = a(g[f]), d, r, c = ["touch"];n.isDefined(g.ngSwipeDisableMouse) || c.push("mouse");b.bind(u, { start: function start(c, a) { d = c;r = !0; }, cancel: function cancel(c) { r = !1; }, end: function end(c, d) { h(c) && l.$apply(function () { u.triggerHandler(e);m(l, { $event: d }); }); } }, c); }; }]); }var p = n.module("ngTouch", []);p.provider("$touch", s);s.$inject = ["$provide", "$compileProvider"];p.factory("$swipe", [function () { function f(a) { a = a.originalEvent || a;var b = a.touches && a.touches.length ? a.touches : [a];a = a.changedTouches && a.changedTouches[0] || b[0];return { x: a.clientX, y: a.clientY }; }function k(a, b) { var l = [];n.forEach(a, function (a) { (a = e[a][b]) && l.push(a); });return l.join(" "); }var e = { mouse: { start: "mousedown", move: "mousemove", end: "mouseup" }, touch: { start: "touchstart", move: "touchmove", end: "touchend", cancel: "touchcancel" } };return { bind: function bind(a, b, l) { var e, g, h, m, d = !1;l = l || ["mouse", "touch"];a.on(k(l, "start"), function (c) { h = f(c);d = !0;g = e = 0;m = h;b.start && b.start(h, c); });var r = k(l, "cancel");if (r) a.on(r, function (c) { d = !1;b.cancel && b.cancel(c); });a.on(k(l, "move"), function (c) { if (d && h) { var a = f(c);e += Math.abs(a.x - m.x);g += Math.abs(a.y - m.y);m = a;10 > e && 10 > g || (g > e ? (d = !1, b.cancel && b.cancel(c)) : (c.preventDefault(), b.move && b.move(a, c))); } });a.on(k(l, "end"), function (c) { d && (d = !1, b.end && b.end(f(c), c)); }); } }; }]);var t = ["$parse", "$timeout", "$rootElement", function (f, k, e) { function a(a, d, b) { for (var c = 0; c < a.length; c += 2) { var g = a[c + 1], e = b;if (25 > Math.abs(a[c] - d) && 25 > Math.abs(g - e)) return a.splice(c, c + 2), !0; }return !1; }function b(b) { if (!(2500 < Date.now() - u)) { var d = b.touches && b.touches.length ? b.touches : [b], e = d[0].clientX, d = d[0].clientY;if (!(1 > e && 1 > d || h && h[0] === e && h[1] === d)) { h && (h = null);var c = b.target;"label" === n.lowercase(c.nodeName || c[0] && c[0].nodeName) && (h = [e, d]);a(g, e, d) || (b.stopPropagation(), b.preventDefault(), b.target && b.target.blur && b.target.blur()); } } }function l(a) { a = a.touches && a.touches.length ? a.touches : [a];var b = a[0].clientX, e = a[0].clientY;g.push(b, e);k(function () { for (var a = 0; a < g.length; a += 2) { if (g[a] == b && g[a + 1] == e) { g.splice(a, a + 2);break; } } }, 2500, !1); }var u, g, h;return function (h, d, k) { var c = f(k.ngClick), w = !1, q, p, s, t;d.on("touchstart", function (a) { w = !0;q = a.target ? a.target : a.srcElement;3 == q.nodeType && (q = q.parentNode);d.addClass("ng-click-active");p = Date.now();a = a.originalEvent || a;a = (a.touches && a.touches.length ? a.touches : [a])[0];s = a.clientX;t = a.clientY; });d.on("touchcancel", function (a) { w = !1;d.removeClass("ng-click-active"); });d.on("touchend", function (c) { var h = Date.now() - p, f = c.originalEvent || c, m = (f.changedTouches && f.changedTouches.length ? f.changedTouches : f.touches && f.touches.length ? f.touches : [f])[0], f = m.clientX, m = m.clientY, v = Math.sqrt(Math.pow(f - s, 2) + Math.pow(m - t, 2));w && 750 > h && 12 > v && (g || (e[0].addEventListener("click", b, !0), e[0].addEventListener("touchstart", l, !0), g = []), u = Date.now(), a(g, f, m), q && q.blur(), n.isDefined(k.disabled) && !1 !== k.disabled || d.triggerHandler("click", [c]));w = !1;d.removeClass("ng-click-active"); });d.onclick = function (a) {};d.on("click", function (a, b) { h.$apply(function () { c(h, { $event: b || a }); }); });d.on("mousedown", function (a) { d.addClass("ng-click-active"); });d.on("mousemove mouseup", function (a) { d.removeClass("ng-click-active"); }); }; }];v("ngSwipeLeft", -1, "swipeleft");v("ngSwipeRight", 1, "swiperight"); })(window, window.angular); //# sourceMappingURL=angular-touch.min.js.map 'use strict'; angular.module("ngLocale", [], ["$provide", function ($provide) { var PLURAL_CATEGORY = { ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other" }; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return i == -1 ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = (n * base | 0) % base; return { v: v, f: f }; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": ["dop.", "pop."], "DAY": ["nedelja", "ponedeljek", "torek", "sreda", "\u010Detrtek", "petek", "sobota"], "ERANAMES": ["pred na\u0161im \u0161tetjem", "na\u0161e \u0161tetje"], "ERAS": ["pr. n. \u0161t.", "po Kr."], "FIRSTDAYOFWEEK": 0, "MONTH": ["januar", "februar", "marec", "april", "maj", "junij", "julij", "avgust", "september", "oktober", "november", "december"], "SHORTDAY": ["ned.", "pon.", "tor.", "sre.", "\u010Det.", "pet.", "sob."], "SHORTMONTH": ["jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "avg.", "sep.", "okt.", "nov.", "dec."], "WEEKENDRANGE": [5, 6], "fullDate": "EEEE, dd. MMMM y", "longDate": "dd. MMMM y", "medium": "d. MMM y HH.mm.ss", "mediumDate": "d. MMM y", "mediumTime": "HH.mm.ss", "short": "d. MM. yy HH.mm", "shortDate": "d. MM. yy", "shortTime": "HH.mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20AC", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [{ "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\xA0\xA4", "posPre": "", "posSuf": "\xA0\xA4" }] }, "id": "sl-si", "pluralCat": function pluralCat(n, opt_precision) { var i = n | 0;var vf = getVF(n, opt_precision);if (vf.v == 0 && i % 100 == 1) { return PLURAL_CATEGORY.ONE; }if (vf.v == 0 && i % 100 == 2) { return PLURAL_CATEGORY.TWO; }if (vf.v == 0 && i % 100 >= 3 && i % 100 <= 4 || vf.v != 0) { return PLURAL_CATEGORY.FEW; }return PLURAL_CATEGORY.OTHER; } }); }]); "use strict"; /******************************************** * COOKIES ********************************************/ function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function setCookieLaw() { closeCookies(); setCookie('cookie_agreement', "YES", 1000); var ga_id = $('#div-cookie input').val(); window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', ga_id); } function closeCookies() { $("#div-cookie").fadeOut('fast', function () {}); } $("#span-cookies-agree").click(function () { setCookieLaw(); }); 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*! angularjs-slider - v6.6.1 - (c) Rafal Zajac , Valentin Hervieu , Jussi Saarivirta , Angelin Sirbu - https://github.com/angular-slider/angularjs-slider - 2018-06-30 */ /*jslint unparam: true */ /*global angular: false, console: false, define, module */ ;(function (root, factory) { 'use strict'; /* istanbul ignore next */ if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['angular'], factory); } else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. // to support bundler like browserify var angularObj = angular || require('angular'); if ((!angularObj || !angularObj.module) && typeof angular != 'undefined') { angularObj = angular; } module.exports = factory(angularObj); } else { // Browser globals (root is window) factory(root.angular); } })(window, function (angular) { 'use strict'; var module = angular.module('rzModule', []).factory('RzSliderOptions', function () { var defaultOptions = { floor: 0, ceil: null, //defaults to rz-slider-model step: 1, precision: 0, minRange: null, maxRange: null, restrictedRange: null, pushRange: false, minLimit: null, maxLimit: null, id: null, translate: null, getLegend: null, stepsArray: null, bindIndexForStepsArray: false, draggableRange: false, draggableRangeOnly: false, showSelectionBar: false, showSelectionBarEnd: false, showSelectionBarFromValue: null, showOuterSelectionBars: false, hidePointerLabels: false, hideLimitLabels: false, autoHideLimitLabels: true, readOnly: false, disabled: false, interval: 350, showTicks: false, showTicksValues: false, ticksArray: null, ticksTooltip: null, ticksValuesTooltip: null, vertical: false, getSelectionBarColor: null, getTickColor: null, getPointerColor: null, keyboardSupport: true, scale: 1, enforceStep: true, enforceRange: false, noSwitching: false, onlyBindHandles: false, onStart: null, onChange: null, onEnd: null, rightToLeft: false, reversedControls: false, boundPointerLabels: true, mergeRangeLabelsIfSame: false, labelOverlapSeparator: ' - ', customTemplateScope: null, logScale: false, customValueToPosition: null, customPositionToValue: null, selectionBarGradient: null, ariaLabel: null, ariaLabelledBy: null, ariaLabelHigh: null, ariaLabelledByHigh: null }; var globalOptions = {}; var factory = {}; /** * `options({})` allows global configuration of all sliders in the * application. * * var app = angular.module( 'App', ['rzModule'], function( RzSliderOptions ) { * // show ticks for all sliders * RzSliderOptions.options( { showTicks: true } ); * }); */ factory.options = function (value) { angular.extend(globalOptions, value); }; factory.getOptions = function (options) { return angular.extend({}, defaultOptions, globalOptions, options); }; return factory; }).factory('rzThrottle', ['$timeout', function ($timeout) { /** * rzThrottle * * Taken from underscore project * * @param {Function} func * @param {number} wait * @param {ThrottleOptions} options * @returns {Function} */ return function (func, wait, options) { 'use strict'; /* istanbul ignore next */ var getTime = Date.now || function () { return new Date().getTime(); }; var context, args, result; var timeout = null; var previous = 0; options = options || {}; var later = function later() { previous = getTime(); timeout = null; result = func.apply(context, args); context = args = null; }; return function () { var now = getTime(); var remaining = wait - (now - previous); context = this; args = arguments; if (remaining <= 0) { $timeout.cancel(timeout); timeout = null; previous = now; result = func.apply(context, args); context = args = null; } else if (!timeout && options.trailing !== false) { timeout = $timeout(later, remaining); } return result; }; }; }]).factory('RzSlider', ['$timeout', '$document', '$window', '$compile', 'RzSliderOptions', 'rzThrottle', function ($timeout, $document, $window, $compile, RzSliderOptions, rzThrottle) { 'use strict'; /** * Slider * * @param {ngScope} scope The AngularJS scope * @param {Element} sliderElem The slider directive element wrapped in jqLite * @constructor */ var Slider = function Slider(scope, sliderElem) { /** * The slider's scope * * @type {ngScope} */ this.scope = scope; /** * The slider inner low value (linked to rzSliderModel) * @type {number} */ this.lowValue = 0; /** * The slider inner high value (linked to rzSliderHigh) * @type {number} */ this.highValue = 0; /** * Slider element wrapped in jqLite * * @type {jqLite} */ this.sliderElem = sliderElem; /** * Slider type * * @type {boolean} Set to true for range slider */ this.range = this.scope.rzSliderModel !== undefined && this.scope.rzSliderHigh !== undefined; /** * Values recorded when first dragging the bar * * @type {Object} */ this.dragging = { active: false, value: 0, difference: 0, position: 0, lowLimit: 0, highLimit: 0 /** * property that handle position (defaults to left for horizontal) * @type {string} */ };this.positionProperty = 'left'; /** * property that handle dimension (defaults to width for horizontal) * @type {string} */ this.dimensionProperty = 'width'; /** * Half of the width or height of the slider handles * * @type {number} */ this.handleHalfDim = 0; /** * Maximum position the slider handle can have * * @type {number} */ this.maxPos = 0; /** * Precision * * @type {number} */ this.precision = 0; /** * Step * * @type {number} */ this.step = 1; /** * The name of the handle we are currently tracking * * @type {string} */ this.tracking = ''; /** * Minimum value (floor) of the model * * @type {number} */ this.minValue = 0; /** * Maximum value (ceiling) of the model * * @type {number} */ this.maxValue = 0; /** * The delta between min and max value * * @type {number} */ this.valueRange = 0; /** * If showTicks/showTicksValues options are number. * In this case, ticks values should be displayed below the slider. * @type {boolean} */ this.intermediateTicks = false; /** * Set to true if init method already executed * * @type {boolean} */ this.initHasRun = false; /** * Used to call onStart on the first keydown event * * @type {boolean} */ this.firstKeyDown = false; /** * Internal flag to prevent watchers to be called when the sliders value are modified internally. * @type {boolean} */ this.internalChange = false; /** * Internal flag to keep track of the visibility of combo label * @type {boolean} */ this.cmbLabelShown = false; /** * Internal variable to keep track of the focus element */ this.currentFocusElement = null; // Slider DOM elements wrapped in jqLite this.fullBar = null; // The whole slider bar this.selBar = null; // Highlight between two handles this.minH = null; // Left slider handle this.maxH = null; // Right slider handle this.flrLab = null; // Floor label this.ceilLab = null; // Ceiling label this.minLab = null; // Label above the low value this.maxLab = null; // Label above the high value this.cmbLab = null; // Combined label this.ticks = null; // The ticks // Initialize slider this.init(); }; // Add instance methods Slider.prototype = { /** * Initialize slider * * @returns {undefined} */ init: function init() { var thrLow, thrHigh, self = this; var calcDimFn = function calcDimFn() { self.calcViewDimensions(); }; this.applyOptions(); this.syncLowValue(); if (this.range) this.syncHighValue(); this.initElemHandles(); this.manageElementsStyle(); this.setDisabledState(); this.calcViewDimensions(); this.setMinAndMax(); this.updateRestrictionBar(); this.addAccessibility(); this.updateCeilLab(); this.updateFloorLab(); this.initHandles(); this.manageEventsBindings(); // Recalculate slider view dimensions this.scope.$on('reCalcViewDimensions', calcDimFn); // Recalculate stuff if view port dimensions have changed angular.element($window).on('resize', calcDimFn); this.initHasRun = true; // Watch for changes to the model thrLow = rzThrottle(function () { self.onLowHandleChange(); }, self.options.interval); thrHigh = rzThrottle(function () { self.onHighHandleChange(); }, self.options.interval); this.scope.$on('rzSliderForceRender', function () { self.resetLabelsValue(); thrLow(); if (self.range) { thrHigh(); } self.resetSlider(); }); // Watchers (order is important because in case of simultaneous change, // watchers will be called in the same order) this.scope.$watchCollection('rzSliderOptions()', function (newValue, oldValue) { if (newValue === oldValue) return; self.applyOptions(); // need to be called before synchronizing the values self.syncLowValue(); if (self.range) self.syncHighValue(); self.resetSlider(); }); this.scope.$watch('rzSliderModel', function (newValue, oldValue) { if (self.internalChange) return; if (newValue === oldValue) return; thrLow(); }); this.scope.$watch('rzSliderHigh', function (newValue, oldValue) { if (self.internalChange) return; if (newValue === oldValue) return; if (newValue != null) thrHigh(); if (self.range && newValue == null || !self.range && newValue != null) { self.applyOptions(); self.resetSlider(); } }); this.scope.$on('$destroy', function () { self.unbindEvents(); angular.element($window).off('resize', calcDimFn); self.currentFocusElement = null; }); }, findStepIndex: function findStepIndex(modelValue) { var index = 0; for (var i = 0; i < this.options.stepsArray.length; i++) { var step = this.options.stepsArray[i]; if (step === modelValue) { index = i; break; } else if (angular.isDate(step)) { if (step.getTime() === modelValue.getTime()) { index = i; break; } } else if (angular.isObject(step)) { if (angular.isDate(step.value) && step.value.getTime() === modelValue.getTime() || step.value === modelValue) { index = i; break; } } } return index; }, syncLowValue: function syncLowValue() { if (this.options.stepsArray) { if (!this.options.bindIndexForStepsArray) this.lowValue = this.findStepIndex(this.scope.rzSliderModel);else this.lowValue = this.scope.rzSliderModel; } else this.lowValue = this.scope.rzSliderModel; }, syncHighValue: function syncHighValue() { if (this.options.stepsArray) { if (!this.options.bindIndexForStepsArray) this.highValue = this.findStepIndex(this.scope.rzSliderHigh);else this.highValue = this.scope.rzSliderHigh; } else this.highValue = this.scope.rzSliderHigh; }, getStepValue: function getStepValue(sliderValue) { var step = this.options.stepsArray[sliderValue]; if (angular.isDate(step)) return step; if (angular.isObject(step)) return step.value; return step; }, applyLowValue: function applyLowValue() { if (this.options.stepsArray) { if (!this.options.bindIndexForStepsArray) this.scope.rzSliderModel = this.getStepValue(this.lowValue);else this.scope.rzSliderModel = this.lowValue; } else this.scope.rzSliderModel = this.lowValue; }, applyHighValue: function applyHighValue() { if (this.options.stepsArray) { if (!this.options.bindIndexForStepsArray) this.scope.rzSliderHigh = this.getStepValue(this.highValue);else this.scope.rzSliderHigh = this.highValue; } else this.scope.rzSliderHigh = this.highValue; }, /* * Reflow the slider when the low handle changes (called with throttle) */ onLowHandleChange: function onLowHandleChange() { this.syncLowValue(); if (this.range) this.syncHighValue(); this.setMinAndMax(); this.updateLowHandle(this.valueToPosition(this.lowValue)); this.updateSelectionBar(); this.updateTicksScale(); this.updateAriaAttributes(); if (this.range) { this.updateCmbLabel(); } }, /* * Reflow the slider when the high handle changes (called with throttle) */ onHighHandleChange: function onHighHandleChange() { this.syncLowValue(); this.syncHighValue(); this.setMinAndMax(); this.updateHighHandle(this.valueToPosition(this.highValue)); this.updateSelectionBar(); this.updateTicksScale(); this.updateCmbLabel(); this.updateAriaAttributes(); }, /** * Read the user options and apply them to the slider model */ applyOptions: function applyOptions() { var sliderOptions; if (this.scope.rzSliderOptions) sliderOptions = this.scope.rzSliderOptions();else sliderOptions = {}; this.options = RzSliderOptions.getOptions(sliderOptions); if (this.options.step <= 0) this.options.step = 1; this.range = this.scope.rzSliderModel !== undefined && this.scope.rzSliderHigh !== undefined; this.options.draggableRange = this.range && this.options.draggableRange; this.options.draggableRangeOnly = this.range && this.options.draggableRangeOnly; if (this.options.draggableRangeOnly) { this.options.draggableRange = true; } this.options.showTicks = this.options.showTicks || this.options.showTicksValues || !!this.options.ticksArray; this.scope.showTicks = this.options.showTicks; //scope is used in the template if (angular.isNumber(this.options.showTicks) || this.options.ticksArray) this.intermediateTicks = true; this.options.showSelectionBar = this.options.showSelectionBar || this.options.showSelectionBarEnd || this.options.showSelectionBarFromValue !== null; if (this.options.stepsArray) { this.parseStepsArray(); } else { if (this.options.translate) this.customTrFn = this.options.translate;else this.customTrFn = function (value) { return String(value); }; this.getLegend = this.options.getLegend; } if (this.options.vertical) { this.positionProperty = 'bottom'; this.dimensionProperty = 'height'; } if (this.options.customTemplateScope) this.scope.custom = this.options.customTemplateScope; }, parseStepsArray: function parseStepsArray() { this.options.floor = 0; this.options.ceil = this.options.stepsArray.length - 1; this.options.step = 1; if (this.options.translate) { this.customTrFn = this.options.translate; } else { this.customTrFn = function (modelValue) { if (this.options.bindIndexForStepsArray) return this.getStepValue(modelValue); return modelValue; }; } this.getLegend = function (index) { var step = this.options.stepsArray[index]; if (angular.isObject(step)) return step.legend; return null; }; }, /** * Resets slider * * @returns {undefined} */ resetSlider: function resetSlider() { this.manageElementsStyle(); this.addAccessibility(); this.setMinAndMax(); this.updateCeilLab(); this.updateFloorLab(); this.unbindEvents(); this.manageEventsBindings(); this.setDisabledState(); this.calcViewDimensions(); this.updateRestrictionBar(); this.refocusPointerIfNeeded(); }, refocusPointerIfNeeded: function refocusPointerIfNeeded() { if (this.currentFocusElement) { this.onPointerFocus(this.currentFocusElement.pointer, this.currentFocusElement.ref); this.focusElement(this.currentFocusElement.pointer); } }, /** * Set the slider children to variables for easy access * * Run only once during initialization * * @returns {undefined} */ initElemHandles: function initElemHandles() { // Assign all slider elements to object properties for easy access angular.forEach(this.sliderElem.children(), function (elem, index) { var jElem = angular.element(elem); switch (index) { case 0: this.leftOutSelBar = jElem; break; case 1: this.rightOutSelBar = jElem; break; case 2: this.fullBar = jElem; break; case 3: this.selBar = jElem; break; case 4: this.restrictedBar = jElem; break; case 5: this.minH = jElem; break; case 6: this.maxH = jElem; break; case 7: this.flrLab = jElem; break; case 8: this.ceilLab = jElem; break; case 9: this.minLab = jElem; break; case 10: this.maxLab = jElem; break; case 11: this.cmbLab = jElem; break; case 12: this.ticks = jElem; break; } }, this); // Initialize position cache properties this.selBar.rzsp = 0; this.minH.rzsp = 0; this.maxH.rzsp = 0; this.flrLab.rzsp = 0; this.ceilLab.rzsp = 0; this.minLab.rzsp = 0; this.maxLab.rzsp = 0; this.cmbLab.rzsp = 0; }, /** * Update each elements style based on options */ manageElementsStyle: function manageElementsStyle() { if (!this.range) this.maxH.css('display', 'none');else this.maxH.css('display', ''); this.alwaysHide(this.flrLab, this.options.showTicksValues || this.options.hideLimitLabels); this.alwaysHide(this.ceilLab, this.options.showTicksValues || this.options.hideLimitLabels); var hideLabelsForTicks = this.options.showTicksValues && !this.intermediateTicks; this.alwaysHide(this.minLab, hideLabelsForTicks || this.options.hidePointerLabels); this.alwaysHide(this.maxLab, hideLabelsForTicks || !this.range || this.options.hidePointerLabels); this.alwaysHide(this.cmbLab, hideLabelsForTicks || !this.range || this.options.hidePointerLabels); this.alwaysHide(this.selBar, !this.range && !this.options.showSelectionBar); this.alwaysHide(this.leftOutSelBar, !this.range || !this.options.showOuterSelectionBars); this.alwaysHide(this.restrictedBar, !this.options.restrictedRange); this.alwaysHide(this.rightOutSelBar, !this.range || !this.options.showOuterSelectionBars); if (this.range && this.options.showOuterSelectionBars) { this.fullBar.addClass('rz-transparent'); } if (this.options.vertical) this.sliderElem.addClass('rz-vertical'); if (this.options.draggableRange) this.selBar.addClass('rz-draggable');else this.selBar.removeClass('rz-draggable'); if (this.intermediateTicks && this.options.showTicksValues) this.ticks.addClass('rz-ticks-values-under'); }, alwaysHide: function alwaysHide(el, hide) { el.rzAlwaysHide = hide; if (hide) this.hideEl(el);else this.showEl(el); }, /** * Manage the events bindings based on readOnly and disabled options * * @returns {undefined} */ manageEventsBindings: function manageEventsBindings() { if (this.options.disabled || this.options.readOnly) this.unbindEvents();else this.bindEvents(); }, /** * Set the disabled state based on rzSliderDisabled * * @returns {undefined} */ setDisabledState: function setDisabledState() { if (this.options.disabled) { this.sliderElem.attr('disabled', 'disabled'); } else { this.sliderElem.attr('disabled', null); } }, /** * Reset label values * * @return {undefined} */ resetLabelsValue: function resetLabelsValue() { this.minLab.rzsv = undefined; this.maxLab.rzsv = undefined; }, /** * Initialize slider handles positions and labels * * Run only once during initialization and every time view port changes size * * @returns {undefined} */ initHandles: function initHandles() { this.updateLowHandle(this.valueToPosition(this.lowValue)); /* the order here is important since the selection bar should be updated after the high handle but before the combined label */ if (this.range) this.updateHighHandle(this.valueToPosition(this.highValue)); this.updateSelectionBar(); if (this.range) this.updateCmbLabel(); this.updateTicksScale(); }, /** * Translate value to human readable format * * @param {number|string} value * @param {jqLite} label * @param {String} which * @param {boolean} [useCustomTr] * @returns {undefined} */ translateFn: function translateFn(value, label, which, useCustomTr) { useCustomTr = useCustomTr === undefined ? true : useCustomTr; var valStr = '', getDimension = false, noLabelInjection = label.hasClass('no-label-injection'); if (useCustomTr) { if (this.options.stepsArray && !this.options.bindIndexForStepsArray) value = this.getStepValue(value); valStr = String(this.customTrFn(value, this.options.id, which)); } else { valStr = String(value); } if (label.rzsv === undefined || label.rzsv.length !== valStr.length || label.rzsv.length > 0 && label.rzsd === 0) { getDimension = true; label.rzsv = valStr; } if (!noLabelInjection) { label.html(valStr); } this.scope[which + 'Label'] = valStr; // Update width only when length of the label have changed if (getDimension) { this.getDimension(label); } }, /** * Set maximum and minimum values for the slider and ensure the model and high * value match these limits * @returns {undefined} */ setMinAndMax: function setMinAndMax() { this.step = +this.options.step; this.precision = +this.options.precision; this.minValue = this.options.floor; if (this.options.logScale && this.minValue === 0) throw Error("Can't use floor=0 with logarithmic scale"); if (this.options.enforceStep) { this.lowValue = this.roundStep(this.lowValue); if (this.range) this.highValue = this.roundStep(this.highValue); } if (this.options.ceil != null) this.maxValue = this.options.ceil;else this.maxValue = this.options.ceil = this.range ? this.highValue : this.lowValue; if (this.options.enforceRange) { this.lowValue = this.sanitizeValue(this.lowValue); if (this.range) this.highValue = this.sanitizeValue(this.highValue); } this.applyLowValue(); if (this.range) this.applyHighValue(); this.valueRange = this.maxValue - this.minValue; }, /** * Adds accessibility attributes * * Run only once during initialization * * @returns {undefined} */ addAccessibility: function addAccessibility() { this.minH.attr('role', 'slider'); this.updateAriaAttributes(); if (this.options.keyboardSupport && !(this.options.readOnly || this.options.disabled)) this.minH.attr('tabindex', '0');else this.minH.attr('tabindex', ''); if (this.options.vertical) this.minH.attr('aria-orientation', 'vertical'); if (this.options.ariaLabel) this.minH.attr('aria-label', this.options.ariaLabel);else if (this.options.ariaLabelledBy) this.minH.attr('aria-labelledby', this.options.ariaLabelledBy); if (this.range) { this.maxH.attr('role', 'slider'); if (this.options.keyboardSupport && !(this.options.readOnly || this.options.disabled)) this.maxH.attr('tabindex', '0');else this.maxH.attr('tabindex', ''); if (this.options.vertical) this.maxH.attr('aria-orientation', 'vertical'); if (this.options.ariaLabelHigh) this.maxH.attr('aria-label', this.options.ariaLabelHigh);else if (this.options.ariaLabelledByHigh) this.maxH.attr('aria-labelledby', this.options.ariaLabelledByHigh); } }, /** * Updates aria attributes according to current values */ updateAriaAttributes: function updateAriaAttributes() { this.minH.attr({ 'aria-valuenow': this.scope.rzSliderModel, 'aria-valuetext': this.customTrFn(this.scope.rzSliderModel, this.options.id, 'model'), 'aria-valuemin': this.minValue, 'aria-valuemax': this.maxValue }); if (this.range) { this.maxH.attr({ 'aria-valuenow': this.scope.rzSliderHigh, 'aria-valuetext': this.customTrFn(this.scope.rzSliderHigh, this.options.id, 'high'), 'aria-valuemin': this.minValue, 'aria-valuemax': this.maxValue }); } }, /** * Calculate dimensions that are dependent on view port size * * Run once during initialization and every time view port changes size. * * @returns {undefined} */ calcViewDimensions: function calcViewDimensions() { var handleWidth = this.getDimension(this.minH); this.handleHalfDim = handleWidth / 2; this.barDimension = this.getDimension(this.fullBar); this.maxPos = this.barDimension - handleWidth; this.getDimension(this.sliderElem); this.sliderElem.rzsp = this.sliderElem[0].getBoundingClientRect()[this.positionProperty]; if (this.initHasRun) { this.updateFloorLab(); this.updateCeilLab(); this.initHandles(); var self = this; $timeout(function () { self.updateTicksScale(); }); } }, /** * Update the ticks position * * @returns {undefined} */ updateTicksScale: function updateTicksScale() { if (!this.options.showTicks) return; var ticksArray = this.options.ticksArray || this.getTicksArray(), translate = this.options.vertical ? 'translateY' : 'translateX', self = this; if (this.options.rightToLeft) ticksArray.reverse(); this.scope.ticks = ticksArray.map(function (value) { var position = self.valueToPosition(value); if (self.options.vertical) position = self.maxPos - position; var translation = translate + '(' + Math.round(position) + 'px)'; var tick = { selected: self.isTickSelected(value), style: { '-webkit-transform': translation, '-moz-transform': translation, '-o-transform': translation, '-ms-transform': translation, transform: translation } }; if (tick.selected && self.options.getSelectionBarColor) { tick.style['background-color'] = self.getSelectionBarColor(); } if (!tick.selected && self.options.getTickColor) { tick.style['background-color'] = self.getTickColor(value); } if (self.options.ticksTooltip) { tick.tooltip = self.options.ticksTooltip(value); tick.tooltipPlacement = self.options.vertical ? 'right' : 'top'; } if (self.options.showTicksValues === true || value % self.options.showTicksValues === 0) { tick.value = self.getDisplayValue(value, 'tick-value'); if (self.options.ticksValuesTooltip) { tick.valueTooltip = self.options.ticksValuesTooltip(value); tick.valueTooltipPlacement = self.options.vertical ? 'right' : 'top'; } } if (self.getLegend) { var legend = self.getLegend(value, self.options.id); if (legend) tick.legend = legend; } return tick; }); }, getTicksArray: function getTicksArray() { var step = this.step, ticksArray = []; if (this.intermediateTicks) step = this.options.showTicks; for (var value = this.minValue; value <= this.maxValue; value += step) { ticksArray.push(value); } return ticksArray; }, isTickSelected: function isTickSelected(value) { if (!this.range) { if (this.options.showSelectionBarFromValue !== null) { var center = this.options.showSelectionBarFromValue; if (this.lowValue > center && value >= center && value <= this.lowValue) return true;else if (this.lowValue < center && value <= center && value >= this.lowValue) return true; } else if (this.options.showSelectionBarEnd) { if (value >= this.lowValue) return true; } else if (this.options.showSelectionBar && value <= this.lowValue) return true; } if (this.range && value >= this.lowValue && value <= this.highValue) return true; return false; }, /** * Update position of the floor label * * @returns {undefined} */ updateFloorLab: function updateFloorLab() { this.translateFn(this.minValue, this.flrLab, 'floor'); this.getDimension(this.flrLab); var position = this.options.rightToLeft ? this.barDimension - this.flrLab.rzsd : 0; this.setPosition(this.flrLab, position); }, /** * Update position of the ceiling label * * @returns {undefined} */ updateCeilLab: function updateCeilLab() { this.translateFn(this.maxValue, this.ceilLab, 'ceil'); this.getDimension(this.ceilLab); var position = this.options.rightToLeft ? 0 : this.barDimension - this.ceilLab.rzsd; this.setPosition(this.ceilLab, position); }, /** * Update slider handles and label positions * * @param {string} which * @param {number} newPos */ updateHandles: function updateHandles(which, newPos) { if (which === 'lowValue') this.updateLowHandle(newPos);else this.updateHighHandle(newPos); this.updateSelectionBar(); this.updateTicksScale(); if (this.range) this.updateCmbLabel(); }, /** * Helper function to work out the position for handle labels depending on RTL or not * * @param {string} labelName maxLab or minLab * @param newPos * * @returns {number} */ getHandleLabelPos: function getHandleLabelPos(labelName, newPos) { var labelRzsd = this[labelName].rzsd, nearHandlePos = newPos - labelRzsd / 2 + this.handleHalfDim, endOfBarPos = this.barDimension - labelRzsd; if (!this.options.boundPointerLabels) return nearHandlePos; if (this.options.rightToLeft && labelName === 'minLab' || !this.options.rightToLeft && labelName === 'maxLab') { return Math.min(nearHandlePos, endOfBarPos); } else { return Math.min(Math.max(nearHandlePos, 0), endOfBarPos); } }, /** * Update low slider handle position and label * * @param {number} newPos * @returns {undefined} */ updateLowHandle: function updateLowHandle(newPos) { this.setPosition(this.minH, newPos); this.translateFn(this.lowValue, this.minLab, 'model'); this.setPosition(this.minLab, this.getHandleLabelPos('minLab', newPos)); if (this.options.getPointerColor) { var pointercolor = this.getPointerColor('min'); this.scope.minPointerStyle = { backgroundColor: pointercolor }; } if (this.options.autoHideLimitLabels) { this.shFloorCeil(); } }, /** * Update high slider handle position and label * * @param {number} newPos * @returns {undefined} */ updateHighHandle: function updateHighHandle(newPos) { this.setPosition(this.maxH, newPos); this.translateFn(this.highValue, this.maxLab, 'high'); this.setPosition(this.maxLab, this.getHandleLabelPos('maxLab', newPos)); if (this.options.getPointerColor) { var pointercolor = this.getPointerColor('max'); this.scope.maxPointerStyle = { backgroundColor: pointercolor }; } if (this.options.autoHideLimitLabels) { this.shFloorCeil(); } }, /** * Show/hide floor/ceiling label * * @returns {undefined} */ shFloorCeil: function shFloorCeil() { // Show based only on hideLimitLabels if pointer labels are hidden if (this.options.hidePointerLabels) { return; } var flHidden = false, clHidden = false, isMinLabAtFloor = this.isLabelBelowFloorLab(this.minLab), isMinLabAtCeil = this.isLabelAboveCeilLab(this.minLab), isMaxLabAtCeil = this.isLabelAboveCeilLab(this.maxLab), isCmbLabAtFloor = this.isLabelBelowFloorLab(this.cmbLab), isCmbLabAtCeil = this.isLabelAboveCeilLab(this.cmbLab); if (isMinLabAtFloor) { flHidden = true; this.hideEl(this.flrLab); } else { flHidden = false; this.showEl(this.flrLab); } if (isMinLabAtCeil) { clHidden = true; this.hideEl(this.ceilLab); } else { clHidden = false; this.showEl(this.ceilLab); } if (this.range) { var hideCeil = this.cmbLabelShown ? isCmbLabAtCeil : isMaxLabAtCeil; var hideFloor = this.cmbLabelShown ? isCmbLabAtFloor : isMinLabAtFloor; if (hideCeil) { this.hideEl(this.ceilLab); } else if (!clHidden) { this.showEl(this.ceilLab); } // Hide or show floor label if (hideFloor) { this.hideEl(this.flrLab); } else if (!flHidden) { this.showEl(this.flrLab); } } }, isLabelBelowFloorLab: function isLabelBelowFloorLab(label) { var isRTL = this.options.rightToLeft, pos = label.rzsp, dim = label.rzsd, floorPos = this.flrLab.rzsp, floorDim = this.flrLab.rzsd; return isRTL ? pos + dim >= floorPos - 2 : pos <= floorPos + floorDim + 2; }, isLabelAboveCeilLab: function isLabelAboveCeilLab(label) { var isRTL = this.options.rightToLeft, pos = label.rzsp, dim = label.rzsd, ceilPos = this.ceilLab.rzsp, ceilDim = this.ceilLab.rzsd; return isRTL ? pos <= ceilPos + ceilDim + 2 : pos + dim >= ceilPos - 2; }, /** * Update restricted area bar * * @returns {undefined} */ updateRestrictionBar: function updateRestrictionBar() { var position = 0, dimension = 0; if (this.options.restrictedRange) { var from = this.valueToPosition(this.options.restrictedRange.from), to = this.valueToPosition(this.options.restrictedRange.to); dimension = Math.abs(to - from); position = this.options.rightToLeft ? to + this.handleHalfDim : from + this.handleHalfDim; this.setDimension(this.restrictedBar, dimension); this.setPosition(this.restrictedBar, position); } }, /** * Update slider selection bar, combined label and range label * * @returns {undefined} */ updateSelectionBar: function updateSelectionBar() { var position = 0, dimension = 0, isSelectionBarFromRight = this.options.rightToLeft ? !this.options.showSelectionBarEnd : this.options.showSelectionBarEnd, positionForRange = this.options.rightToLeft ? this.maxH.rzsp + this.handleHalfDim : this.minH.rzsp + this.handleHalfDim; if (this.range) { dimension = Math.abs(this.maxH.rzsp - this.minH.rzsp); position = positionForRange; } else { if (this.options.showSelectionBarFromValue !== null) { var center = this.options.showSelectionBarFromValue, centerPosition = this.valueToPosition(center), isModelGreaterThanCenter = this.options.rightToLeft ? this.lowValue <= center : this.lowValue > center; if (isModelGreaterThanCenter) { dimension = this.minH.rzsp - centerPosition; position = centerPosition + this.handleHalfDim; } else { dimension = centerPosition - this.minH.rzsp; position = this.minH.rzsp + this.handleHalfDim; } } else if (isSelectionBarFromRight) { dimension = Math.abs(this.maxPos - this.minH.rzsp) + this.handleHalfDim; position = this.minH.rzsp + this.handleHalfDim; } else { dimension = this.minH.rzsp + this.handleHalfDim; position = 0; } } this.setDimension(this.selBar, dimension); this.setPosition(this.selBar, position); if (this.range && this.options.showOuterSelectionBars) { if (this.options.rightToLeft) { this.setDimension(this.rightOutSelBar, position); this.setPosition(this.rightOutSelBar, 0); this.setDimension(this.leftOutSelBar, this.getDimension(this.fullBar) - (position + dimension)); this.setPosition(this.leftOutSelBar, position + dimension); } else { this.setDimension(this.leftOutSelBar, position); this.setPosition(this.leftOutSelBar, 0); this.setDimension(this.rightOutSelBar, this.getDimension(this.fullBar) - (position + dimension)); this.setPosition(this.rightOutSelBar, position + dimension); } } if (this.options.getSelectionBarColor) { var color = this.getSelectionBarColor(); this.scope.barStyle = { backgroundColor: color }; } else if (this.options.selectionBarGradient) { var offset = this.options.showSelectionBarFromValue !== null ? this.valueToPosition(this.options.showSelectionBarFromValue) : 0, reversed = offset - position > 0 ^ isSelectionBarFromRight, direction = this.options.vertical ? reversed ? 'bottom' : 'top' : reversed ? 'left' : 'right'; this.scope.barStyle = { backgroundImage: 'linear-gradient(to ' + direction + ', ' + this.options.selectionBarGradient.from + ' 0%,' + this.options.selectionBarGradient.to + ' 100%)' }; if (this.options.vertical) { this.scope.barStyle.backgroundPosition = 'center ' + (offset + dimension + position + (reversed ? -this.handleHalfDim : 0)) + 'px'; this.scope.barStyle.backgroundSize = '100% ' + (this.barDimension - this.handleHalfDim) + 'px'; } else { this.scope.barStyle.backgroundPosition = offset - position + (reversed ? this.handleHalfDim : 0) + 'px center'; this.scope.barStyle.backgroundSize = this.barDimension - this.handleHalfDim + 'px 100%'; } } }, /** * Wrapper around the getSelectionBarColor of the user to pass to * correct parameters */ getSelectionBarColor: function getSelectionBarColor() { if (this.range) return this.options.getSelectionBarColor(this.scope.rzSliderModel, this.scope.rzSliderHigh); return this.options.getSelectionBarColor(this.scope.rzSliderModel); }, /** * Wrapper around the getPointerColor of the user to pass to * correct parameters */ getPointerColor: function getPointerColor(pointerType) { if (pointerType === 'max') { return this.options.getPointerColor(this.scope.rzSliderHigh, pointerType); } return this.options.getPointerColor(this.scope.rzSliderModel, pointerType); }, /** * Wrapper around the getTickColor of the user to pass to * correct parameters */ getTickColor: function getTickColor(value) { return this.options.getTickColor(value); }, /** * Update combined label position and value * * @returns {undefined} */ updateCmbLabel: function updateCmbLabel() { var isLabelOverlap = null; if (this.options.rightToLeft) { isLabelOverlap = this.minLab.rzsp - this.minLab.rzsd - 10 <= this.maxLab.rzsp; } else { isLabelOverlap = this.minLab.rzsp + this.minLab.rzsd + 10 >= this.maxLab.rzsp; } if (isLabelOverlap) { var lowTr = this.getDisplayValue(this.lowValue, 'model'), highTr = this.getDisplayValue(this.highValue, 'high'), labelVal = ''; if (this.options.mergeRangeLabelsIfSame && lowTr === highTr) { labelVal = lowTr; } else { labelVal = this.options.rightToLeft ? highTr + this.options.labelOverlapSeparator + lowTr : lowTr + this.options.labelOverlapSeparator + highTr; } this.translateFn(labelVal, this.cmbLab, 'cmb', false); var pos = this.options.boundPointerLabels ? Math.min(Math.max(this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2, 0), this.barDimension - this.cmbLab.rzsd) : this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2; this.setPosition(this.cmbLab, pos); this.cmbLabelShown = true; this.hideEl(this.minLab); this.hideEl(this.maxLab); this.showEl(this.cmbLab); } else { this.cmbLabelShown = false; this.updateHighHandle(this.valueToPosition(this.highValue)); this.updateLowHandle(this.valueToPosition(this.lowValue)); this.showEl(this.maxLab); this.showEl(this.minLab); this.hideEl(this.cmbLab); } if (this.options.autoHideLimitLabels) { this.shFloorCeil(); } }, /** * Return the translated value if a translate function is provided else the original value * @param value * @param which if it's min or max handle * @returns {*} */ getDisplayValue: function getDisplayValue(value, which) { if (this.options.stepsArray && !this.options.bindIndexForStepsArray) { value = this.getStepValue(value); } return this.customTrFn(value, this.options.id, which); }, /** * Round value to step and precision based on minValue * * @param {number} value * @param {number} customStep a custom step to override the defined step * @returns {number} */ roundStep: function roundStep(value, customStep) { var step = customStep ? customStep : this.step, steppedDifference = parseFloat((value - this.minValue) / step).toPrecision(12); steppedDifference = Math.round(+steppedDifference) * step; var newValue = (this.minValue + steppedDifference).toFixed(this.precision); return +newValue; }, /** * Hide element * * @param element * @returns {jqLite} The jqLite wrapped DOM element */ hideEl: function hideEl(element) { return element.css({ visibility: 'hidden' }); }, /** * Show element * * @param element The jqLite wrapped DOM element * @returns {jqLite} The jqLite */ showEl: function showEl(element) { if (!!element.rzAlwaysHide) { return element; } return element.css({ visibility: 'visible' }); }, /** * Set element left/top position depending on whether slider is horizontal or vertical * * @param {jqLite} elem The jqLite wrapped DOM element * @param {number} pos * @returns {number} */ setPosition: function setPosition(elem, pos) { elem.rzsp = pos; var css = {}; css[this.positionProperty] = Math.round(pos) + 'px'; elem.css(css); return pos; }, /** * Get element width/height depending on whether slider is horizontal or vertical * * @param {jqLite} elem The jqLite wrapped DOM element * @returns {number} */ getDimension: function getDimension(elem) { var val = elem[0].getBoundingClientRect(); if (this.options.vertical) elem.rzsd = (val.bottom - val.top) * this.options.scale;else elem.rzsd = (val.right - val.left) * this.options.scale; return elem.rzsd; }, /** * Set element width/height depending on whether slider is horizontal or vertical * * @param {jqLite} elem The jqLite wrapped DOM element * @param {number} dim * @returns {number} */ setDimension: function setDimension(elem, dim) { elem.rzsd = dim; var css = {}; css[this.dimensionProperty] = Math.round(dim) + 'px'; elem.css(css); return dim; }, /** * Returns a value that is within slider range * * @param {number} val * @returns {number} */ sanitizeValue: function sanitizeValue(val) { return Math.min(Math.max(val, this.minValue), this.maxValue); }, /** * Translate value to pixel position * * @param {number} val * @returns {number} */ valueToPosition: function valueToPosition(val) { var fn = this.linearValueToPosition; if (this.options.customValueToPosition) fn = this.options.customValueToPosition;else if (this.options.logScale) fn = this.logValueToPosition; val = this.sanitizeValue(val); var percent = fn(val, this.minValue, this.maxValue) || 0; if (this.options.rightToLeft) percent = 1 - percent; return percent * this.maxPos; }, linearValueToPosition: function linearValueToPosition(val, minVal, maxVal) { var range = maxVal - minVal; return (val - minVal) / range; }, logValueToPosition: function logValueToPosition(val, minVal, maxVal) { val = Math.log(val); minVal = Math.log(minVal); maxVal = Math.log(maxVal); var range = maxVal - minVal; return (val - minVal) / range; }, /** * Translate position to model value * * @param {number} position * @returns {number} */ positionToValue: function positionToValue(position) { var percent = position / this.maxPos; if (this.options.rightToLeft) percent = 1 - percent; var fn = this.linearPositionToValue; if (this.options.customPositionToValue) fn = this.options.customPositionToValue;else if (this.options.logScale) fn = this.logPositionToValue; return fn(percent, this.minValue, this.maxValue) || 0; }, linearPositionToValue: function linearPositionToValue(percent, minVal, maxVal) { return percent * (maxVal - minVal) + minVal; }, logPositionToValue: function logPositionToValue(percent, minVal, maxVal) { minVal = Math.log(minVal); maxVal = Math.log(maxVal); var value = percent * (maxVal - minVal) + minVal; return Math.exp(value); }, getEventAttr: function getEventAttr(event, attr) { return event.originalEvent === undefined ? event[attr] : event.originalEvent[attr]; }, // Events /** * Get the X-coordinate or Y-coordinate of an event * * @param {Object} event The event * @param targetTouchId The identifier of the touch with the X/Y coordinates * @returns {number} */ getEventXY: function getEventXY(event, targetTouchId) { /* http://stackoverflow.com/a/12336075/282882 */ //noinspection JSLint var clientXY = this.options.vertical ? 'clientY' : 'clientX'; if (event[clientXY] !== undefined) { return event[clientXY]; } var touches = this.getEventAttr(event, 'touches'); if (targetTouchId !== undefined) { for (var i = 0; i < touches.length; i++) { if (touches[i].identifier === targetTouchId) { return touches[i][clientXY]; } } } // If no target touch or the target touch was not found in the event // returns the coordinates of the first touch return touches[0][clientXY]; }, /** * Compute the event position depending on whether the slider is horizontal or vertical * @param event * @param targetTouchId If targetTouchId is provided it will be considered the position of that * @returns {number} */ getEventPosition: function getEventPosition(event, targetTouchId) { var sliderPos = this.sliderElem.rzsp, eventPos = 0; if (this.options.vertical) eventPos = -this.getEventXY(event, targetTouchId) + sliderPos;else eventPos = this.getEventXY(event, targetTouchId) - sliderPos; return eventPos * this.options.scale - this.handleHalfDim; // #346 handleHalfDim is already scaled }, /** * Get event names for move and event end * * @param {Event} event The event * * @return {{moveEvent: string, endEvent: string}} */ getEventNames: function getEventNames(event) { var eventNames = { moveEvent: '', endEvent: '' }; if (this.getEventAttr(event, 'touches')) { eventNames.moveEvent = 'touchmove'; eventNames.endEvent = 'touchend'; } else { eventNames.moveEvent = 'mousemove'; eventNames.endEvent = 'mouseup'; } return eventNames; }, /** * Get the handle closest to an event. * * @param event {Event} The event * @returns {jqLite} The handle closest to the event. */ getNearestHandle: function getNearestHandle(event) { if (!this.range) { return this.minH; } var position = this.getEventPosition(event), distanceMin = Math.abs(position - this.minH.rzsp), distanceMax = Math.abs(position - this.maxH.rzsp); if (distanceMin < distanceMax) return this.minH;else if (distanceMin > distanceMax) return this.maxH;else if (!this.options.rightToLeft) //if event is at the same distance from min/max then if it's at left of minH, we return minH else maxH return position < this.minH.rzsp ? this.minH : this.maxH; //reverse in rtl else return position > this.minH.rzsp ? this.minH : this.maxH; }, /** * Wrapper function to focus an angular element * * @param el {AngularElement} the element to focus */ focusElement: function focusElement(el) { var DOM_ELEMENT = 0; el[DOM_ELEMENT].focus(); }, /** * Bind mouse and touch events to slider handles * * @returns {undefined} */ bindEvents: function bindEvents() { var barTracking, barStart, barMove; if (this.options.draggableRange) { barTracking = 'rzSliderDrag'; barStart = this.onDragStart; barMove = this.onDragMove; } else { barTracking = 'lowValue'; barStart = this.onStart; barMove = this.onMove; } if (!this.options.onlyBindHandles) { this.selBar.on('mousedown', angular.bind(this, barStart, null, barTracking)); this.selBar.on('mousedown', angular.bind(this, barMove, this.selBar)); } if (this.options.draggableRangeOnly) { this.minH.on('mousedown', angular.bind(this, barStart, null, barTracking)); this.maxH.on('mousedown', angular.bind(this, barStart, null, barTracking)); } else { this.minH.on('mousedown', angular.bind(this, this.onStart, this.minH, 'lowValue')); if (this.range) { this.maxH.on('mousedown', angular.bind(this, this.onStart, this.maxH, 'highValue')); } if (!this.options.onlyBindHandles) { this.fullBar.on('mousedown', angular.bind(this, this.onStart, null, null)); this.fullBar.on('mousedown', angular.bind(this, this.onMove, this.fullBar)); this.ticks.on('mousedown', angular.bind(this, this.onStart, null, null)); this.ticks.on('mousedown', angular.bind(this, this.onTickClick, this.ticks)); } } if (!this.options.onlyBindHandles) { this.selBar.on('touchstart', angular.bind(this, barStart, null, barTracking)); this.selBar.on('touchstart', angular.bind(this, barMove, this.selBar)); } if (this.options.draggableRangeOnly) { this.minH.on('touchstart', angular.bind(this, barStart, null, barTracking)); this.maxH.on('touchstart', angular.bind(this, barStart, null, barTracking)); } else { this.minH.on('touchstart', angular.bind(this, this.onStart, this.minH, 'lowValue')); if (this.range) { this.maxH.on('touchstart', angular.bind(this, this.onStart, this.maxH, 'highValue')); } if (!this.options.onlyBindHandles) { this.fullBar.on('touchstart', angular.bind(this, this.onStart, null, null)); this.fullBar.on('touchstart', angular.bind(this, this.onMove, this.fullBar)); this.ticks.on('touchstart', angular.bind(this, this.onStart, null, null)); this.ticks.on('touchstart', angular.bind(this, this.onTickClick, this.ticks)); } } if (this.options.keyboardSupport) { this.minH.on('focus', angular.bind(this, this.onPointerFocus, this.minH, 'lowValue')); if (this.range) { this.maxH.on('focus', angular.bind(this, this.onPointerFocus, this.maxH, 'highValue')); } } }, /** * Unbind mouse and touch events to slider handles * * @returns {undefined} */ unbindEvents: function unbindEvents() { this.minH.off(); this.maxH.off(); this.fullBar.off(); this.selBar.off(); this.ticks.off(); }, /** * onStart event handler * * @param {?Object} pointer The jqLite wrapped DOM element; if null, the closest handle is used * @param {?string} ref The name of the handle being changed; if null, the closest handle's value is modified * @param {Event} event The event * @returns {undefined} */ onStart: function onStart(pointer, ref, event) { var ehMove, ehEnd, eventNames = this.getEventNames(event); event.stopPropagation(); event.preventDefault(); // We have to do this in case the HTML where the sliders are on // have been animated into view. this.calcViewDimensions(); if (pointer) { this.tracking = ref; } else { pointer = this.getNearestHandle(event); this.tracking = pointer === this.minH ? 'lowValue' : 'highValue'; } pointer.addClass('rz-active'); if (this.options.keyboardSupport) this.focusElement(pointer); ehMove = angular.bind(this, this.dragging.active ? this.onDragMove : this.onMove, pointer); ehEnd = angular.bind(this, this.onEnd, ehMove); $document.on(eventNames.moveEvent, ehMove); $document.on(eventNames.endEvent, ehEnd); this.endHandlerToBeRemovedOnEnd = ehEnd; this.callOnStart(); var changedTouches = this.getEventAttr(event, 'changedTouches'); if (changedTouches) { // Store the touch identifier if (!this.touchId) { this.isDragging = true; this.touchId = changedTouches[0].identifier; } } }, /** * onMove event handler * * @param {jqLite} pointer * @param {Event} event The event * @param {boolean} fromTick if the event occured on a tick or not * @returns {undefined} */ onMove: function onMove(pointer, event, fromTick) { var changedTouches = this.getEventAttr(event, 'changedTouches'); var touchForThisSlider; if (changedTouches) { for (var i = 0; i < changedTouches.length; i++) { if (changedTouches[i].identifier === this.touchId) { touchForThisSlider = changedTouches[i]; break; } } } if (changedTouches && !touchForThisSlider) { return; } var newPos = this.getEventPosition(event, touchForThisSlider ? touchForThisSlider.identifier : undefined), newValue, ceilValue = this.options.rightToLeft ? this.minValue : this.maxValue, flrValue = this.options.rightToLeft ? this.maxValue : this.minValue; if (newPos <= 0) { newValue = flrValue; } else if (newPos >= this.maxPos) { newValue = ceilValue; } else { newValue = this.positionToValue(newPos); if (fromTick && angular.isNumber(this.options.showTicks)) newValue = this.roundStep(newValue, this.options.showTicks);else newValue = this.roundStep(newValue); } this.positionTrackingHandle(newValue); }, /** * onEnd event handler * * @param {Event} event The event * @param {Function} ehMove The bound move event handler * @returns {undefined} */ onEnd: function onEnd(ehMove, event) { var changedTouches = this.getEventAttr(event, 'changedTouches'); if (changedTouches && changedTouches[0].identifier !== this.touchId) { return; } this.isDragging = false; this.touchId = null; if (!this.options.keyboardSupport) { this.minH.removeClass('rz-active'); this.maxH.removeClass('rz-active'); this.tracking = ''; } this.dragging.active = false; var eventName = this.getEventNames(event); $document.off(eventName.moveEvent, ehMove); $document.off(eventName.endEvent, this.endHandlerToBeRemovedOnEnd); this.endHandlerToBeRemovedOnEnd = null; this.callOnEnd(); }, onTickClick: function onTickClick(pointer, event) { this.onMove(pointer, event, true); }, onPointerFocus: function onPointerFocus(pointer, ref) { this.tracking = ref; pointer.one('blur', angular.bind(this, this.onPointerBlur, pointer)); pointer.on('keydown', angular.bind(this, this.onKeyboardEvent)); pointer.on('keyup', angular.bind(this, this.onKeyUp)); this.firstKeyDown = true; pointer.addClass('rz-active'); this.currentFocusElement = { pointer: pointer, ref: ref }; }, onKeyUp: function onKeyUp() { this.firstKeyDown = true; this.callOnEnd(); }, onPointerBlur: function onPointerBlur(pointer) { pointer.off('keydown'); pointer.off('keyup'); pointer.removeClass('rz-active'); if (!this.isDragging) { this.tracking = ''; this.currentFocusElement = null; } }, /** * Key actions helper function * * @param {number} currentValue value of the slider * * @returns {?Object} action value mappings */ getKeyActions: function getKeyActions(currentValue) { var increaseStep = currentValue + this.step, decreaseStep = currentValue - this.step, increasePage = currentValue + this.valueRange / 10, decreasePage = currentValue - this.valueRange / 10; if (this.options.reversedControls) { increaseStep = currentValue - this.step; decreaseStep = currentValue + this.step; increasePage = currentValue - this.valueRange / 10; decreasePage = currentValue + this.valueRange / 10; } //Left to right default actions var actions = { UP: increaseStep, DOWN: decreaseStep, LEFT: decreaseStep, RIGHT: increaseStep, PAGEUP: increasePage, PAGEDOWN: decreasePage, HOME: this.options.reversedControls ? this.maxValue : this.minValue, END: this.options.reversedControls ? this.minValue : this.maxValue //right to left means swapping right and left arrows };if (this.options.rightToLeft) { actions.LEFT = increaseStep; actions.RIGHT = decreaseStep; // right to left and vertical means we also swap up and down if (this.options.vertical) { actions.UP = decreaseStep; actions.DOWN = increaseStep; } } return actions; }, onKeyboardEvent: function onKeyboardEvent(event) { var currentValue = this[this.tracking], keyCode = event.keyCode || event.which, keys = { 38: 'UP', 40: 'DOWN', 37: 'LEFT', 39: 'RIGHT', 33: 'PAGEUP', 34: 'PAGEDOWN', 36: 'HOME', 35: 'END' }, actions = this.getKeyActions(currentValue), key = keys[keyCode], action = actions[key]; if (action == null || this.tracking === '') return; event.preventDefault(); if (this.firstKeyDown) { this.firstKeyDown = false; this.callOnStart(); } var self = this; $timeout(function () { var newValue = self.roundStep(self.sanitizeValue(action)); if (!self.options.draggableRangeOnly) { self.positionTrackingHandle(newValue); } else { var difference = self.highValue - self.lowValue, newMinValue, newMaxValue; if (self.tracking === 'lowValue') { newMinValue = newValue; newMaxValue = newValue + difference; if (newMaxValue > self.maxValue) { newMaxValue = self.maxValue; newMinValue = newMaxValue - difference; } } else { newMaxValue = newValue; newMinValue = newValue - difference; if (newMinValue < self.minValue) { newMinValue = self.minValue; newMaxValue = newMinValue + difference; } } self.positionTrackingBar(newMinValue, newMaxValue); } }); }, /** * onDragStart event handler * * Handles dragging of the middle bar. * * @param {Object} pointer The jqLite wrapped DOM element * @param {string} ref One of the refLow, refHigh values * @param {Event} event The event * @returns {undefined} */ onDragStart: function onDragStart(pointer, ref, event) { var position = this.getEventPosition(event); this.dragging = { active: true, value: this.positionToValue(position), difference: this.highValue - this.lowValue, lowLimit: this.options.rightToLeft ? this.minH.rzsp - position : position - this.minH.rzsp, highLimit: this.options.rightToLeft ? position - this.maxH.rzsp : this.maxH.rzsp - position }; this.onStart(pointer, ref, event); }, /** * getValue helper function * * gets max or min value depending on whether the newPos is outOfBounds above or below the bar and rightToLeft * * @param {string} type 'max' || 'min' The value we are calculating * @param {number} newPos The new position * @param {boolean} outOfBounds Is the new position above or below the max/min? * @param {boolean} isAbove Is the new position above the bar if out of bounds? * * @returns {number} */ getValue: function getValue(type, newPos, outOfBounds, isAbove) { var isRTL = this.options.rightToLeft, value = null; if (type === 'min') { if (outOfBounds) { if (isAbove) { value = isRTL ? this.minValue : this.maxValue - this.dragging.difference; } else { value = isRTL ? this.maxValue - this.dragging.difference : this.minValue; } } else { value = isRTL ? this.positionToValue(newPos + this.dragging.lowLimit) : this.positionToValue(newPos - this.dragging.lowLimit); } } else { if (outOfBounds) { if (isAbove) { value = isRTL ? this.minValue + this.dragging.difference : this.maxValue; } else { value = isRTL ? this.maxValue : this.minValue + this.dragging.difference; } } else { if (isRTL) { value = this.positionToValue(newPos + this.dragging.lowLimit) + this.dragging.difference; } else { value = this.positionToValue(newPos - this.dragging.lowLimit) + this.dragging.difference; } } } return this.roundStep(value); }, /** * onDragMove event handler * * Handles dragging of the middle bar. * * @param {jqLite} pointer * @param {Event} event The event * @returns {undefined} */ onDragMove: function onDragMove(pointer, event) { var newPos = this.getEventPosition(event), newMinValue, newMaxValue, ceilLimit, flrLimit, isUnderFlrLimit, isOverCeilLimit, flrH, ceilH; if (this.options.rightToLeft) { ceilLimit = this.dragging.lowLimit; flrLimit = this.dragging.highLimit; flrH = this.maxH; ceilH = this.minH; } else { ceilLimit = this.dragging.highLimit; flrLimit = this.dragging.lowLimit; flrH = this.minH; ceilH = this.maxH; } isUnderFlrLimit = newPos <= flrLimit; isOverCeilLimit = newPos >= this.maxPos - ceilLimit; if (isUnderFlrLimit) { if (flrH.rzsp === 0) return; newMinValue = this.getValue('min', newPos, true, false); newMaxValue = this.getValue('max', newPos, true, false); } else if (isOverCeilLimit) { if (ceilH.rzsp === this.maxPos) return; newMaxValue = this.getValue('max', newPos, true, true); newMinValue = this.getValue('min', newPos, true, true); } else { newMinValue = this.getValue('min', newPos, false); newMaxValue = this.getValue('max', newPos, false); } this.positionTrackingBar(newMinValue, newMaxValue); }, /** * Set the new value and position for the entire bar * * @param {number} newMinValue the new minimum value * @param {number} newMaxValue the new maximum value */ positionTrackingBar: function positionTrackingBar(newMinValue, newMaxValue) { if (this.options.minLimit != null && newMinValue < this.options.minLimit) { newMinValue = this.options.minLimit; newMaxValue = newMinValue + this.dragging.difference; } if (this.options.maxLimit != null && newMaxValue > this.options.maxLimit) { newMaxValue = this.options.maxLimit; newMinValue = newMaxValue - this.dragging.difference; } this.lowValue = newMinValue; this.highValue = newMaxValue; this.applyLowValue(); if (this.range) this.applyHighValue(); this.applyModel(true); this.updateHandles('lowValue', this.valueToPosition(newMinValue)); this.updateHandles('highValue', this.valueToPosition(newMaxValue)); }, /** * Set the new value and position to the current tracking handle * * @param {number} newValue new model value */ positionTrackingHandle: function positionTrackingHandle(newValue) { var valueChanged = false; newValue = this.applyMinMaxLimit(newValue); newValue = this.applyRestrictedRange(newValue); if (this.range) { if (this.options.pushRange) { newValue = this.applyPushRange(newValue); valueChanged = true; } else { if (this.options.noSwitching) { if (this.tracking === 'lowValue' && newValue > this.highValue) newValue = this.applyMinMaxRange(this.highValue);else if (this.tracking === 'highValue' && newValue < this.lowValue) newValue = this.applyMinMaxRange(this.lowValue); } newValue = this.applyMinMaxRange(newValue); /* This is to check if we need to switch the min and max handles */ if (this.tracking === 'lowValue' && newValue > this.highValue) { this.lowValue = this.highValue; this.applyLowValue(); this.applyModel(); this.updateHandles(this.tracking, this.maxH.rzsp); this.updateAriaAttributes(); this.tracking = 'highValue'; this.minH.removeClass('rz-active'); this.maxH.addClass('rz-active'); if (this.options.keyboardSupport) this.focusElement(this.maxH); valueChanged = true; } else if (this.tracking === 'highValue' && newValue < this.lowValue) { this.highValue = this.lowValue; this.applyHighValue(); this.applyModel(); this.updateHandles(this.tracking, this.minH.rzsp); this.updateAriaAttributes(); this.tracking = 'lowValue'; this.maxH.removeClass('rz-active'); this.minH.addClass('rz-active'); if (this.options.keyboardSupport) this.focusElement(this.minH); valueChanged = true; } } } if (this[this.tracking] !== newValue) { this[this.tracking] = newValue; if (this.tracking === 'lowValue') this.applyLowValue();else this.applyHighValue(); this.applyModel(); this.updateHandles(this.tracking, this.valueToPosition(newValue)); this.updateAriaAttributes(); valueChanged = true; } if (valueChanged) this.applyModel(true); }, applyMinMaxLimit: function applyMinMaxLimit(newValue) { if (this.options.minLimit != null && newValue < this.options.minLimit) return this.options.minLimit; if (this.options.maxLimit != null && newValue > this.options.maxLimit) return this.options.maxLimit; return newValue; }, applyMinMaxRange: function applyMinMaxRange(newValue) { var oppositeValue = this.tracking === 'lowValue' ? this.highValue : this.lowValue, difference = Math.abs(newValue - oppositeValue); if (this.options.minRange != null) { if (difference < this.options.minRange) { if (this.tracking === 'lowValue') return this.highValue - this.options.minRange;else return this.lowValue + this.options.minRange; } } if (this.options.maxRange != null) { if (difference > this.options.maxRange) { if (this.tracking === 'lowValue') return this.highValue - this.options.maxRange;else return this.lowValue + this.options.maxRange; } } return newValue; }, applyRestrictedRange: function applyRestrictedRange(newValue) { if (this.options.restrictedRange != null && newValue > this.options.restrictedRange.from && newValue < this.options.restrictedRange.to) { var halfWidth = (this.options.restrictedRange.to - this.options.restrictedRange.from) / 2; if (this.tracking === 'lowValue') { return newValue > this.options.restrictedRange.from + halfWidth ? this.options.restrictedRange.to : this.options.restrictedRange.from; } if (this.tracking === 'highValue') { return newValue < this.options.restrictedRange.to - halfWidth ? this.options.restrictedRange.from : this.options.restrictedRange.to; } } return newValue; }, applyPushRange: function applyPushRange(newValue) { var difference = this.tracking === 'lowValue' ? this.highValue - newValue : newValue - this.lowValue, minRange = this.options.minRange !== null ? this.options.minRange : this.options.step, maxRange = this.options.maxRange; // if smaller than minRange if (difference < minRange) { if (this.tracking === 'lowValue') { this.highValue = Math.min(newValue + minRange, this.maxValue); newValue = this.highValue - minRange; this.applyHighValue(); this.updateHandles('highValue', this.valueToPosition(this.highValue)); } else { this.lowValue = Math.max(newValue - minRange, this.minValue); newValue = this.lowValue + minRange; this.applyLowValue(); this.updateHandles('lowValue', this.valueToPosition(this.lowValue)); } this.updateAriaAttributes(); } else if (maxRange !== null && difference > maxRange) { // if greater than maxRange if (this.tracking === 'lowValue') { this.highValue = newValue + maxRange; this.applyHighValue(); this.updateHandles('highValue', this.valueToPosition(this.highValue)); } else { this.lowValue = newValue - maxRange; this.applyLowValue(); this.updateHandles('lowValue', this.valueToPosition(this.lowValue)); } this.updateAriaAttributes(); } return newValue; }, /** * Apply the model values using scope.$apply. * We wrap it with the internalChange flag to avoid the watchers to be called */ applyModel: function applyModel(callOnChange) { this.internalChange = true; this.scope.$apply(); callOnChange && this.callOnChange(); this.internalChange = false; }, /** * Call the onStart callback if defined * The callback call is wrapped in a $evalAsync to ensure that its result will be applied to the scope. * * @returns {undefined} */ callOnStart: function callOnStart() { if (this.options.onStart) { var self = this, pointerType = this.tracking === 'lowValue' ? 'min' : 'max'; this.scope.$evalAsync(function () { self.options.onStart(self.options.id, self.scope.rzSliderModel, self.scope.rzSliderHigh, pointerType); }); } }, /** * Call the onChange callback if defined * The callback call is wrapped in a $evalAsync to ensure that its result will be applied to the scope. * * @returns {undefined} */ callOnChange: function callOnChange() { if (this.options.onChange) { var self = this, pointerType = this.tracking === 'lowValue' ? 'min' : 'max'; this.scope.$evalAsync(function () { self.options.onChange(self.options.id, self.scope.rzSliderModel, self.scope.rzSliderHigh, pointerType); }); } }, /** * Call the onEnd callback if defined * The callback call is wrapped in a $evalAsync to ensure that its result will be applied to the scope. * * @returns {undefined} */ callOnEnd: function callOnEnd() { if (this.options.onEnd) { var self = this, pointerType = this.tracking === 'lowValue' ? 'min' : 'max'; this.scope.$evalAsync(function () { self.options.onEnd(self.options.id, self.scope.rzSliderModel, self.scope.rzSliderHigh, pointerType); }); } this.scope.$emit('slideEnded'); } }; return Slider; }]).directive('rzslider', ['RzSlider', function (RzSlider) { 'use strict'; return { restrict: 'AE', replace: true, scope: { rzSliderModel: '=?', rzSliderHigh: '=?', rzSliderOptions: '&?', rzSliderTplUrl: '@' }, /** * Return template URL * * @param {jqLite} elem * @param {Object} attrs * @return {string} */ templateUrl: function templateUrl(elem, attrs) { //noinspection JSUnresolvedVariable return attrs.rzSliderTplUrl || 'rzSliderTpl.html'; }, link: function link(scope, elem) { scope.slider = new RzSlider(scope, elem); //attach on scope so we can test it } }; }]); // IDE assist /** * @name ngScope * * @property {number} rzSliderModel * @property {number} rzSliderHigh * @property {Object} rzSliderOptions */ /** * @name jqLite * * @property {number|undefined} rzsp rzslider label position position * @property {number|undefined} rzsd rzslider element dimension * @property {string|undefined} rzsv rzslider label value/text * @property {Function} css * @property {Function} text */ /** * @name Event * @property {Array} touches * @property {Event} originalEvent */ /** * @name ThrottleOptions * * @property {boolean} leading * @property {boolean} trailing */ module.run(['$templateCache', function ($templateCache) { 'use strict'; $templateCache.put('rzSliderTpl.html', "
  • {{ t.value }} {{ t.legend }}
"); }]); return module.name; }); 'use strict'; /** * @ngdoc overview * @name alterKonfig * @description * # alterKonfig * * Main module of the application. */ angular.module('triglavQuiz', ['ngAnimate', 'ngResource', 'rzModule', '720kb.tooltips', 'angularjs-datetime-picker', 'angular-google-analytics'] //'ui.bootstrap', // 'toastr', //'ngCookies', ).run(['$window', '$rootScope', 'RzSliderOptions', function ($window, $rootScope, RzSliderOptions) { $rootScope.busy = false; //rzSlider RzSliderOptions.options({ noSwitching: true, showTicks: false, showSelectionBar: true, hidePointerLabels: true, hideLimitLabels: true, enforceStep: false }); }]).directive('numberInput', ['$parse', function ($parse) { return { require: 'ngModel', link: function link(scope, element, attrs, modelCtrl) { var capitalize = function capitalize(inputValue) { if (inputValue === undefined || typeof inputValue !== "string") { inputValue = ''; } var parsed = inputValue.replace(/[^\d]/g, ""); if (parsed !== inputValue) { modelCtrl.$setViewValue(parsed); modelCtrl.$render(); } return parsed; }; modelCtrl.$parsers.push(capitalize); capitalize($parse(attrs.ngModel)(scope)); // capitalize initial value } }; }]).directive('roundSlider', [function () { return { restrict: 'A', scope: { sliderModel: "=roundSlider", options: "=sliderOptions" }, link: function link(scope, element, attr) { angular.element(element).roundSlider(angular.extend({}, scope.options, { change: function change(vl) { scope.$apply(function () { scope.sliderModel = vl.value; }); } })); } }; }]).directive('radarChart', [function () { return { restrict: 'A', scope: { radarChart: "=radarChart" }, link: function link(scope, element, attr) { //var ctx = angular.element(element)[0].getContext('2d'); new Chart(angular.element(element)[0].getContext('2d'), { type: 'radar', data: scope.radarChart, options: { legend: { display: false } } }); } }; }]).directive('staticSocialShare', ['$timeout', function ($timeout) { return { restrict: 'A', link: function link(scope, element, attr) { $timeout(function () { angular.element(element).specto_sharer({ //CONTENT content_wrapp_id: ".static-social-share-texts", //id of content wrapper - valid only if not present in href atttribute or html is rendered by plugin //string or function, which translates to any css selector (!string!) elm_title: function elm_title(icn_wrapper, share_type) { return share_type === "linkedin" ? ".title-linked" : ".title"; }, elm_description: function elm_description(icn_wrapper, share_type) { return share_type === "email" ? ".description-mail" : share_type === "linkedin" ? ".desc-linked" : ".description"; }, elm_image: "img", // css selector for image element //FB settings appId: "348860999185792", //Facebook appId version: "v3.1", //Facebook app version has_fb: true //has facebook sharer (to async load fb sdk) -> by default is false }); }, 200); } }; }]).directive('socialShareQuiz', ['$timeout', function ($timeout) { return { restrict: 'A', link: function link(scope, element, attr) { $timeout(function () { angular.element(element).specto_sharer({ //CONTENT content_wrapp_id: "#socialResults", //id of content wrapper - valid only if not present in href atttribute or html is rendered by plugin //string or function, which translates to any css selector (!string!) elm_title: function elm_title(icn_wrapper, share_type) { return share_type === "linkedin" ? ".share_title_linked" : ".share_title"; }, elm_description: function elm_description(icn_wrapper, share_type) { return share_type === "email" ? ".share_description_mail" : share_type === "linkedin" ? ".share_description_linked" : ".share_description"; }, elm_image: "img", // css selector for image element //FB settings appId: "348860999185792", //Facebook appId version: "v3.1", //Facebook app version has_fb: true //has facebook sharer (to async load fb sdk) -> by default is false }); }, 200); } }; }]).directive('equalHeight', ['$timeout', function ($timeout) { return { restrict: 'A', link: function link(scope, element, attr) { $timeout(function () { $(element).find('.equal-height-title').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); $(element).find('.equal-height-par').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); }, 200); } }; }]).config(['AnalyticsProvider', function (AnalyticsProvider) { AnalyticsProvider.setAccount({ tracker: 'UA-58349186-1', trackEvent: true }); if($.cookie("cookie_module_cat") == "01" || $.cookie("cookie_module_cat") == "00") { AnalyticsProvider.disableAnalytics(true); } }]).run(['Analytics', function(Analytics) { }]).directive("datepicker", function () { return { restrict: "A", require: "ngModel", link: function (scope, elem, attrs, ngModelCtrl) { var updateModel = function (dateText) { scope.$apply(function () { ngModelCtrl.$setViewValue(dateText); }); }; var options = { closeText: "Confirm", minDate: +1, maxDate: +356, dateFormat: 'dd.mm.yy', timeFormat: "HH:mm", hour: new Date().getHours(), minute: new Date().getMinutes(), controlType: 'select', onSelect: function (dateText) { updateModel(dateText); } }; elem.datetimepicker(options, $.datepicker.regional["sl"] ); } } }).directive('onlyNumbers', function () { return { restrict: 'A', link: function (scope, elm, attrs, ctrl) { elm.on('keydown', function (event) { if(event.shiftKey){event.preventDefault(); return false;} //console.log(event.which); if ([8, 13, 27, 37, 38, 39, 40].indexOf(event.which) > -1) { // backspace, enter, escape, arrows return true; } else if (event.which >= 48 && event.which <= 57) { // numbers 0 to 9 return true; } else if (event.which >= 96 && event.which <= 105) { // numpad number return true; } // else if ([110, 190].indexOf(event.which) > -1) { // // dot and numpad dot // return true; // } else { event.preventDefault(); return false; } }); } } }); /* .filter('notDisabled', function() { return function(input, list) { if(input) { var filtered = []; angular.forEach(input, function(item, ind){ if(list.indexOf(item.code) < 0) filtered.push(item); }); return filtered; } return []; } }); */ window.mobileAndTabletcheck = function () { var check = false; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) { check = true; } if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { check = true; } })(navigator.userAgent || navigator.vendor || window.opera); return check; }; function emailCheck(checkit) { return checkit.search(/^[\w\d\._\-]+@[\w\d\-_\.]+\.[\d\w][\d\w]+$/) > -1; } 'use strict'; angular.module('triglavQuiz') .controller('Quiz', ['$scope', '$window', '$http', '$timeout', '$sce', '$filter', 'Analytics', function ($scope, $window, $http, $timeout, $sce, $filter, Analytics) { $scope.scrolling_speed = 600; $scope.step = 1; $scope.isStep = function(step){ return step == $scope.step; }; $scope.changeStep = function(step){ $scope.step = step; $timeout(function(){ specto_scroll($(".calc-quiz-wrap").offset().top, $scope.scrolling_speed, 'easeInOutQuint'); //scroll to start steps }, 0); }; $scope.tooltip = $sce.trustAsHtml("
" + "" + "

Dob utječe na izloženost potencijalnim kritičnim bolestima, na prihode i druge elemente koji utječu na Vaš život. Dob se također uzima u obzir prilikom ugovaranja životnog osiguranja za slučaj smrti, jer ga mogu ugovoriti osobe u dobi od 18 do 65 godina.

" + "
"); $scope.moneyFormat = function(value){ return $filter("number")(value); }; $scope.questions = { step1: { starost: { value: 53, options: { floor: 18, ceil: 65, showTicks: true, showTicksValues: true, ticksArray: [18,30,40,50,60,65], } }, partner_je: -1, partner_starost: { value: 0, options: { floor: 18, ceil: 99, showTicks: true, showTicksValues: true, ticksArray: [18,30,40,50,60,70,80,90,99], } }, partner_dela: -1, otrok_je: -1, otrok_najmlajsi: { value: 23, options: { floor: 0, ceil: 50, showTicks: true, showTicksValues: true, ticksArray: [0,10,20,30,40,50], } }, }, step2: { ima_kredit: -1, preostanek_kredita: { value: 74000, options: { floor: 1000, ceil: 500000, step : 1000, showTicks: true, showTicksValues: true, ticksArray: [1000,50000,100000,200000,300000,400000,500000], translate: $scope.moneyFormat, } }, prihranki: { value: 48000, options: { floor: 0, ceil: 100000, onEnd: function(){ $scope.questions.step2.prihranki_extra = false; }, step : 1000, showTicks: true, showTicksValues: true, ticksArray: [0,10000,20000,40000,60000,80000,100000], translate: $scope.moneyFormat, } }, prihranki_extra: false, prihranki_extra_val: "", drugo_premozenje: -1, drugo_premozenje_val: { value: 12000, options: { floor: 0, ceil: 600000, step : 1000, showTicks: true, showTicksValues: true, ticksArray: [1000,100000,200000,300000,400000,500000,600000], translate: $scope.moneyFormat, } }, ze_zivljensko: -1, zavarovalna_ob_smrti_ne_vem: false, zavarovalna_ob_smrti: { value: 74000, options: { floor: 0, ceil: 600000, step : 1000, showTicks: true, showTicksValues: true, ticksArray: [1000,100000,200000,300000,400000,500000,600000], translate: $scope.moneyFormat, } }, }, step3: { prihodki: { value: 1000, options: { floor: 0, ceil: 10000, onEnd: function(){ $scope.questions.step3.brezposeln = false; }, step: 100, showTicks: true, showTicksValues: true, ticksArray: [0,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000], translate: $scope.moneyFormat, } }, brezposeln: false, }, }; //finish screen $scope.isFinished = false; $scope.final_values = { death_sum: 0, //znesek, ki nastane ob smrti zavarovanca n: 0, //število let, ki bi zadostovalo, da se družina postavi na noge standard: 0, //Izračun zagotovitve življenjskega standarda za "n" število let family_sum: 0, //Izračun zavarovalne vsote, ki bi jo zapustili družini partner_n: 0, otrok_n: 0, dolgovi: 0, prihranki: 0, no_partner_no_child: false, tooltipPartner: "", tooltipChild: "", n_partner: false, n_otrok: false, }; //mark invalid question $scope.scrollToElmFind = function(elm){ $timeout(function(){ var elem = "[elm-find='"+ elm +"']"; if($(elem).length < 1) { console.log("Element not found!"); return; } //prevent error specto_scroll($(elem).offset().top, $scope.scrolling_speed, 'easeInOutQuint'); //scroll to start steps $(elem).addClass("invalid").shake({speed: 70}); $timeout(function(){ $(elem).removeClass("invalid"); }, 5000); }, 0); }; //NEXT STEP //validation $scope.canGoToSecond = function(){ var is_valid = { val: true, elm: null }; var req_radios = ["partner_je","otrok_je"]; if($scope.questions.step1["partner_je"] > 0) req_radios.push("partner_dela"); angular.forEach(req_radios, function(item, ind){ if($scope.questions.step1[item] < 0 && is_valid.val) { is_valid.val = false; is_valid.elm = item; } }); return is_valid; }; $scope.canGoToThird = function(){ var is_valid = { val: true, elm: null }; angular.forEach(["ima_kredit","drugo_premozenje","ze_zivljensko"], function(item, ind){ if($scope.questions.step2[item] < 0 && is_valid.val) { is_valid.val = false; is_valid.elm = item; } }); if($scope.questions.step2.prihranki_extra) if(isNaN(parseInt($scope.questions.step2.prihranki_extra_val))) { is_valid.val = false; is_valid.elm = "prihranki_extra_val"; } return is_valid; }; //go to $scope.scndStep = function(){ var valid = $scope.canGoToSecond(); if(valid.val) $scope.changeStep(2); else $scope.scrollToElmFind(valid.elm); }; $scope.thirdStep = function(){ var valid = $scope.canGoToThird(); if(valid.val) $scope.changeStep(3); else $scope.scrollToElmFind(valid.elm); }; //finish $scope.finalize = function(){ //reformat to int all that must be integer angular.forEach(["step1.starost","step1.partner_starost","step1.otrok_najmlajsi","step2.preostanek_kredita","step2.prihranki","step2.drugo_premozenje_val","step2.zavarovalna_ob_smrti","step3.prihodki"], function(item, ind){ var param = item.split("."); $scope.questions[param[0]][param[1]].value = parseInt($scope.questions[param[0]][param[1]].value); }); $scope.questions.step2.prihranki_extra_val = parseInt($scope.questions.step2.prihranki_extra_val); //calculate //znesek ob smrti zavarovanca /* $scope.final_values.death_sum = ($scope.questions.step2.ima_kredit > 0 ? $scope.questions.step2.preostanek_kredita.value : 0) - ($scope.questions.step2.prihranki_extra ? parseInt($scope.questions.step2.prihranki_extra_val) : $scope.questions.step2.prihranki.value) - ($scope.questions.step2.drugo_premozenje > 0 ? $scope.questions.step2.drugo_premozenje_val.value : 0) - ($scope.questions.step2.ze_zivljensko > 0 && !$scope.questions.step2.zavarovalna_ob_smrti_ne_vem ? $scope.questions.step2.zavarovalna_ob_smrti.value : 0); */ //n start var partner_n = 0; var otrok_n = 0; if($scope.questions.step1.partner_je > 0){ //ima partnerja? if($scope.questions.step1.partner_dela < 1){ if($scope.questions.step1.partner_starost.value < 35) { partner_n = 10; $scope.final_values.tooltipPartner = "
Za partnera koji finansijski ovisi o Vama posebno je važno da mu osigurate odgovarajuću nadoknadu za gubitak Vašeg prihoda u slučaju Vaše smrti. Budući da je Vaš partner u dobi od 35 do 45 godina i stoga je u zreloj dobi u kojoj su finansijske potrebe i obveze obično stabilne i teško ih je izmijeniti, osiguranje života se izrazito preporučuje. Možda biste htjeli razmotriti produženje razdoblja u kojem biste osigurali gubitak prihoda. Proizvod broja godina i Vaša godišnja neto plaća dodaje se razlici između dugova i štednje i uvećava proračun osigurane sume.
"; } else if($scope.questions.step1.partner_starost.value > 34 && $scope.questions.step1.partner_starost.value < 46){ partner_n = 7; $scope.final_values.tooltipPartner = "
Za partnera koji je finansijski ovisan o vama posebno je važno da mu osigurate odgovarajuću nadoknadu za gubitak vašeg prihoda u slučaju Vaše smrti. Vaš partner ima manje od 35 godina, što obično znači da pred sobom ima mnogo izazova i finansijskih obaveza (zajmovi, obrazovanje djece, briga za bolji kvalitet života ...). To je razlog zašto možete razmotriti duže razdoblje za koje biste osigurali nadoknadu za gubitak svojih prihoda. Proizvod broja godina osiguranog perioda i Vaše godišnje neto plate dodaje se razlici između dugova i štednje i uvećava proračun osigurane sume.
"; } else { partner_n = 5; $scope.final_values.tooltipPartner = "
Posebno je važno za partnera koji finansijski ovisi o Vama da mu osigurate odgovarajuću nadoknadu za gubitak Vašeg prihoda u slučaju Vaše smrti. S obzirom da je Vaš partner stariji od 45 godina, domaćinstvo možda već ima nešto manje finansijske obveze od mlađih ljudi. Ali čak i tokom ovog životnog razdoblja možete razmotriti produženje razdoblja u kojem biste osigurali nadoknadu za gubitak svog prihoda, jer se očekuje da se Vaš partner suočava sa svakodnevnim izazovima i finansijskim obvezama još dugo vremena. Proizvod ovog broja godina i Vaša godišnja neto plata dodaje se razlici između dugova i štednje za obračun osigurane sume.
"; } } else { partner_n = 3; $scope.final_values.tooltipPartner = "
Preporučeni minimalni period (broj godina) za koje bi se Vašem partneru osigurala naknada za Vaš prihod u slučaju Vaše smrti kako bi se on ili ona mogao finansijski oporaviti je tri godine. Stvarno trajanje ovog perioda zavisi od specifičnih potreba Vaše porodice (dospijeće kredita, starost djece ili drugi uzdržavani članovi porodice ...) Možete razgovarati s našim savjetnikom o potrebnom periodu za koje bi imalo smisla nadoknaditi gubitak Vašeg prihoda u slučaju smrti. Proizvod ovog broja godina i Vaše godišnje neto plate dodaje se razlici između dugova i štednje za obračun osigurane sume.
"; } } if($scope.questions.step1.otrok_je > 0){ //ima otroke? otrok_n = 18 - $scope.questions.step1.otrok_najmlajsi.value; $scope.final_values.tooltipChild = "
Ako dijete izgubi roditelja, isplata osiguranja  može mu osigurati finansijsku sigurnost u najosjetljivijim godinama, školovanju i pokriti ostale troškove odrastanja. Ako su djeca starija od 16 godina, period u kome se nadoknađuje gubitak prihoda, i na taj način osigurava finansijski oporavak porodice, je tri godine (preporučeni minimum). Proizvod ovog broja godina i Vaše godišnje neto plate dodaje se razlici između dugova i štednje za obračun osigurane sume.
"; if(otrok_n > 10) { otrok_n = 10; $scope.final_values.tooltipChild = "
Ako dijete izgubi roditelja, isplata osiguranja  može mu osigurati finansijsku sigurnost u najosjetljivijim godinama, školovanju i pokriti ostale troškove odrastanja. Ako su djeca starija od 16 godina, period u kome se nadoknađuje gubitak prihoda, i na taj način osigurava finansijski oporavak porodice, je tri godine (preporučeni minimum). Proizvod ovog broja godina i Vaše godišnje neto plate dodaje se razlici između dugova i štednje za obračun osigurane sume.
"; } else if(otrok_n < 3) otrok_n = 3; //minimalno 3 leta } $scope.final_values.partner_n = partner_n; $scope.final_values.otrok_n = otrok_n; //n final if($scope.questions.step1.otrok_je > 0){ //ima otroke? if($scope.questions.step1.partner_je > 0){ //ima partnerja? if($scope.questions.step1.partner_dela > 0) { $scope.final_values.n = otrok_n; $scope.final_values.n_otrok = true; } else { $scope.final_values.n = Math.max(otrok_n, partner_n); $scope.final_values.n_otrok = otrok_n == $scope.final_values.n; if(!$scope.final_values.n_otrok) $scope.final_values.n_partner = true; } } else { $scope.final_values.n = otrok_n; $scope.final_values.n_otrok = true; } } else { if($scope.questions.step1.partner_je > 0) { $scope.final_values.n = partner_n; $scope.final_values.n_partner = true; } else $scope.final_values.n = 1; } //življenjski standard $scope.final_values.standard = ($scope.questions.step3.brezposeln ? 0 : parseInt($scope.questions.step3.prihodki.value)) * 12 * $scope.final_values.n; //dolgovi & prihranki $scope.final_values.dolgovi = $scope.questions.step2.ima_kredit ? $scope.questions.step2.preostanek_kredita.value : 0; $scope.final_values.prihranki = ($scope.questions.step2.prihranki_extra ? parseInt($scope.questions.step2.prihranki_extra_val) : $scope.questions.step2.prihranki.value) + ($scope.questions.step2.drugo_premozenje > 0 ? $scope.questions.step2.drugo_premozenje_val.value : 0) + ($scope.questions.step2.ze_zivljensko > 0 && !$scope.questions.step2.zavarovalna_ob_smrti_ne_vem ? $scope.questions.step2.zavarovalna_ob_smrti.value : 0); $scope.final_values.death_sum = $scope.final_values.dolgovi - $scope.final_values.prihranki; //brez partnerja in otrok $scope.final_values.no_partner_no_child = $scope.questions.step1.partner_je < 1 && $scope.questions.step1.otrok_je < 1; //zapuščena zavarovalna vsota $scope.final_values.family_sum = $scope.final_values.death_sum + $scope.final_values.standard; $scope.isFinished = true; $timeout(function(){ specto_scroll($(".main").offset().top, $scope.scrolling_speed, 'easeInOutQuint'); //scroll to start steps }, 0); //send user values $http.post("https://zivljenje.triglav.si/9nasvetov", { questions: $scope.questions, final_values: $scope.final_values, action: "quiz_save-values" },{withCredentials: true}).then(function(response) { $.cookie('quiz_uid', response.data); }); }; if($scope.isStep(1)) { Analytics.trackEvent('Koliko bi bilo potrebno mojim najblizima', 'Kalkulator', 'Calculation started'); } }]); 'use strict'; angular.module('triglavQuiz') .controller('Risk', ['$scope', '$window', '$http', '$timeout', '$filter', '$interval', function ($scope, $window, $http, $timeout, $filter, $interval) { var self = this; self.moneyFormat = function(value){ return $filter("number")(value); }; self.last_step = 10; $scope.scrolling_speed = 600; $scope.scrollToTop = function(css){ $timeout(function(){ specto_scroll($(css || "main.main").offset().top, $scope.scrolling_speed, 'easeInOutQuint'); //scroll to start steps }, 0); }; $scope.too_jung = false; $scope.too_jung_text = ""; $scope.homeScreen = true; $scope.startQuiz = function(){ //start quiz $scope.homeScreen = false; $scope.changeStep(1); $scope.scrollToTop(); }; //STEPS $scope.stepNr = 0; $scope.isStep = function(step){ return step == $scope.stepNr; }; $scope.isStep_orGreater = function(step){ return step <= parseInt($scope.stepNr); }; $scope.changeStep = function(step, substep_check){ //change quiz step if(!self.canChangeStep["to_step_"+ step]){ console.log("Error. required check doesn't exist! step:"+ step); return false; } else if(self.canChangeStep["to_step_"+ step]()){ $scope.stepNr = substep_check ? self.canChangeStep["to_substep_"+ step]() : step; $scope.scrollToTop(); if($scope.isStep_orGreater(self.last_step)) self.finalizeQuiz(); } }; //check if can change step self.canChangeStep = { to_step_1: function(){ return true; }, to_step_2: function(){ var is_valid = true; $scope.too_jung = false; $scope.too_jung_text = ""; angular.forEach(["spol","starost","visina","teza"], function(item, ind){ if(!$scope.results[item] && is_valid){ is_valid = false; self.markQuestionInvalid(item); } }); if(is_valid){ //number required ranges if(parseInt($scope.results.starost) < 15){ is_valid = false; self.markQuestionInvalid("starost"); $scope.too_jung = true; $scope.too_jung_text = "Pozor, izračun je možen samo za osebe starejše od 14 let."; } else if(parseInt($scope.results.starost) > 99){ is_valid = false; self.markQuestionInvalid("starost"); $scope.too_jung = true; $scope.too_jung_text = "Pozor, izračun je možen samo za osebe mlajše od 99 let."; } if(parseInt($scope.results.visina) < 100 || parseInt($scope.results.visina) > 240){ is_valid = false; self.markQuestionInvalid("visina"); $scope.too_jung = true; $scope.too_jung_text = "Pozor, izračun je mogoč samo za osebe, ki so visoke od 100 cm do 250 cm."; } if(parseInt($scope.results.teza) < 35 || parseInt($scope.results.teza) > 300){ is_valid = false; self.markQuestionInvalid("teza"); $scope.too_jung = true; $scope.too_jung_text = "Pozor, izračun je možen samo za osebe, ki tehtajo od 35 kg do 300 kg."; } } return is_valid; }, to_step_3: function(){ var is_valid = $scope.results.ocena_zdravja.changed; if(!is_valid) self.markQuestionInvalid("ocena_zdravja"); return is_valid; }, to_step_4: function(){ var is_valid = $scope.results.jedilnik.length > 0; if(!is_valid) self.markQuestionInvalid("jedilnik"); return is_valid; }, to_step_5: function(){ var is_valid = $scope.results.na_poti.changed; if(!is_valid) self.markQuestionInvalid("na_poti"); return is_valid; }, to_step_6: function(){ var is_valid = $scope.results.prisotnost_stresa.value !== null; if(!is_valid) self.markQuestionInvalid("prisotnost_stresa"); return is_valid; }, to_step_7: function(){ var is_valid = $scope.results.spanje.value !== null; if(!is_valid) self.markQuestionInvalid("spanje"); return is_valid; }, to_step_8: function(){ var is_valid = $scope.results.rekreacija !== null; if(!is_valid) self.markQuestionInvalid("rekreacija"); return is_valid; }, to_step_8b: function(){ var is_valid = $scope.results.kadilec !== null; if(!is_valid) self.markQuestionInvalid("kadilec"); return is_valid; }, to_substep_8b: function(){ return $scope.results.kadilec > 0 ? "8b" : $scope.isStep_orGreater(9) ? 8 : 9; }, //substep special to_step_9: function(){ var is_valid = $scope.results.kadilec_kolicina.changed; if(!is_valid) self.markQuestionInvalid("kadilec_kolicina"); return is_valid; }, to_step_9b: function(){ var is_valid = $scope.results.alkohol !== null; if(!is_valid) self.markQuestionInvalid("alkohol"); return is_valid; }, to_substep_9b: function(){ return $scope.results.alkohol > 0 ? "9b" : 10; }, //substep special - last screen to_step_10: function(){ var is_valid = $scope.results.alkohol_kolicina.changed; if(!is_valid) self.markQuestionInvalid("alkohol_kolicina"); return is_valid; }, }; //mark element invalid self.markQuestionInvalid = function(elm){ $timeout(function(){ var elem = "[elm-find='"+ elm +"']"; if($(elem).length < 1) { console.log("Element not found!"); return; } //prevent error specto_scroll($(elem).offset().top, $scope.scrolling_speed, 'easeInOutQuint'); //scroll to start steps $(elem).addClass("invalid").shake({speed: 70}); $timeout(function(){ $(elem).removeClass("invalid"); }, 5000); }, 0); }; //RESULTS $scope.results = { //step 1 spol: "", starost: "", visina: "", teza: "", //step2 ocena_zdravja: { value: 4, changed: true, options: { floor: 0, ceil: 10, hideLimitLabels: false, translate: function(value, sliderId, label) { switch(label){ case "floor": return value +" (zelo slabo)"; break; case "ceil": return "(fantastično) "+ value; break; default: return value; } }, //onEnd: function(){ $scope.results.ocena_zdravja.changed = true; }, showTicks: true, getLegend: function(value, sliderId){ //show only active legend return $scope.results.ocena_zdravja.value == value && $scope.results.ocena_zdravja.value < $scope.results.ocena_zdravja.options.ceil && $scope.results.ocena_zdravja.value > 0 ? value : ""; }, } }, //step3 jedilnik: [], //step4 na_poti: { value: 15000, changed: true, options: { floor: 0, ceil: 45000, step: 100, hideLimitLabels: false, translate: function(value, sliderId, label) { switch(label){ case "ceil": return "45.000+"; break; default: return value; } }, //onEnd: function(){ $scope.results.na_poti.changed = true; }, showTicks: true, getLegend: function(value, sliderId){ //show only active legend return $scope.results.na_poti.value == value && $scope.results.na_poti.value < $scope.results.na_poti.options.ceil && $scope.results.na_poti.value > 0 ? self.moneyFormat(value) : ""; }, } }, //step5 prisotnost_stresa: { value: 5, options: { min: 0, max: 10, step: 1, value: 5, radius: 145, width: 4, handleSize: 23, circleShape: "half-top", sliderType: "min-range", mouseScrollAction: true, }, }, //step6 spanje: { value: 8, options: { min: 2, max: 14, step: 1, value: 8, radius: 100, width: 4, handleSize: 23, startAngle: 90, endAngle: 405, sliderType: "min-range", mouseScrollAction: true, } }, //step7 rekreacija: null, //step8 kadilec: null, //step 8b kadilec_kolicina: { value: 15, changed: true, percent: {}, calcPercent: function(){ $scope.results.kadilec_kolicina.percent.width = (Math.round( $scope.results.kadilec_kolicina.value / $scope.results.kadilec_kolicina.options.ceil * 10000 ) / 100) +"%"; }, options: { floor: 0, ceil: 60, hideLimitLabels: false, translate: function(value, sliderId, label) { switch(label){ case "ceil": return "60+"; break; default: return value; } }, onChange : function(){ $scope.results.kadilec_kolicina.calcPercent(); }, //onEnd: function(){ $scope.results.kadilec_kolicina.changed = true; }, showTicks: true, getLegend: function(value, sliderId){ //show only active legend return $scope.results.kadilec_kolicina.value == value && $scope.results.kadilec_kolicina.value < $scope.results.kadilec_kolicina.options.ceil && $scope.results.kadilec_kolicina.value > 0 ? value : ""; }, } }, //step9 alkohol: null, //step 8b alkohol_kolicina: { value: 3, changed: true, percent: {}, calcPercent: function(){ $scope.results.alkohol_kolicina.percent.width = (Math.round( $scope.results.alkohol_kolicina.value / $scope.results.alkohol_kolicina.options.ceil * 10000 ) / 100) +"%"; }, options: { floor: 0, ceil: 10, hideLimitLabels: false, translate: function(value, sliderId, label) { switch(label){ case "ceil": return "10+"; break; default: return value; } }, onChange : function(){ $scope.results.alkohol_kolicina.calcPercent(); }, //onEnd: function(){ $scope.results.kadilec_kolicina.changed = true; }, showTicks: true, getLegend: function(value, sliderId){ //show only active legend return $scope.results.alkohol_kolicina.value == value && $scope.results.alkohol_kolicina.value < $scope.results.alkohol_kolicina.options.ceil && $scope.results.alkohol_kolicina.value > 0 ? value : ""; }, } }, }; //calc percents $scope.results.kadilec_kolicina.calcPercent(); $scope.results.alkohol_kolicina.calcPercent(); //EXTRAS //jedilnik - step 3 $scope.menu_items = [ {name: "Pusto meso", icon: "icon-dry-meat", is_healthy: true}, {name: "Hitra prehrana", icon: "icon-fast-food", is_healthy: false}, {name: "Sladkarije", icon: "icon-sweets", is_healthy: false}, {name: "Stročnice", icon: "icon-beans", is_healthy: true}, {name: "Sadje", icon: "icon-fruit", is_healthy: true}, {name: "Zelenjava", icon: "icon-vegetable", is_healthy: true}, {name: "Sladke pijače", icon: "icon-juice", is_healthy: false}, {name: "Slani prigrizki", icon: "icon-salty-baverage", is_healthy: false}, {name: "Izdelki iz bele moke", icon: "icon-bread", is_healthy: false}, {name: "Voda", icon: "icon-water", is_healthy: true}, ]; //fill result array - jedilnik $scope.add_to_result_array = function(item, result_name){ if($scope.results[result_name].indexOf(item) > -1){ $scope.results[result_name].splice($scope.results[result_name].indexOf(item), 1); } else if($scope.results[result_name].length < 5) $scope.results[result_name].push(item); //max 5 jedi }; //rekreacija na teden - step 7 $scope.rekreacija_options = [ {name: "0", icon: "icon-recreation1", risk_factor: 10}, {name: "1-2", icon: "icon-recreation2", risk_factor: 5}, {name: "2-3", icon: "icon-recreation3", risk_factor: 3}, {name: "3-4", icon: "icon-recreation4", risk_factor: 1}, {name: "5 +", icon: "icon-recreation5", risk_factor: 0}, ]; /* RESULT SETTINGS */ $scope.filters = { spol: "all", starost: "all", itm: "all", }; $scope.all_filter_options = { spol: [{name: "Vsi", slug: "all"},{name: "Ženske", slug: "z", icon: "icon-female"},{name: "Moški", slug: "m", icon: "icon-male"},], starost: [ {name: "Vsi", slug: "all", range_min: "", range_max: ""}, {name: "15-24", slug: "1524", range_min: 15, range_max: 24, icon: "icon-age1"}, {name: "25-34", slug: "2534", range_min: 25, range_max: 34, icon: "icon-age2"}, {name: "35-44", slug: "3544", range_min: 35, range_max: 44, icon: "icon-age3"}, {name: "45-54", slug: "4554", range_min: 45, range_max: 54, icon: "icon-age4"}, {name: "55-64", slug: "5564", range_min: 55, range_max: 64, icon: "icon-age5"}, {name: "65 +", slug: "65+", range_min: 65, range_max: 200, icon: "icon-age6"}, ], itm: [ {name: "Vsi", slug: "all", range_min: "", range_max: ""}, {name: "< 18,50", slug: "min", range_min: 0, range_max: 18.50, icon: "icon-itm1"}, {name: "18,50-24,99", slug: "1825", range_min: 18.50, range_max: 24.99, icon: "icon-itm2"}, {name: "25-29,99", slug: "2530", range_min: 25, range_max: 29.99, icon: "icon-itm3"}, {name: "≥ 30,00", slug: "30+", range_min: 30, range_max: 1000, icon: "icon-itm4"}, ], }; $scope.changeFilter = function(filter, newVal){ $scope.filters[filter] = newVal; self.calcStatistics(); }; $scope.final_screen = { active: false, loading_results: true, is_form: false, }; /* FINALIZE */ $scope.final_values = { starost: 0, itm_value: 0, groups: { spol: "", starost: "", itm: "", }, singles: { itm: 0, zdravje: 0, jedilnik: 0, na_poti: 0, prisotnost_stresa: 0, spanje: 0, rekreacija: 0, kadilec: 0, alkohol: 0, }, sum: 0, }; $scope.shown_risk = 0; $scope.calc_risk = 0; $scope.risk_text = ""; $scope.radar_chart_values = { labels: ["ITM","Zdravje","Prehrana","Vožnja","Stres","Spanje","Šport","Kajenje","Alkohol"], datasets: [{ label: "label", backgroundColor: "rgba(237, 41, 57, 0.5)", borderColor: "rgba(237, 41, 57, 0.5)", borderJoinStyle: "round", lineTension: 0.1, data: [] }] }; $scope.statistics = { total: 0, itm: {avg: 0, jaz_css: {}, avg_css: {}}, zdravje: {avg: 0, jaz_css: {}, avg_css: {}}, jedilnik: {avg: 0, jaz_css: {}, avg_css: {}}, na_poti: {avg: 0, jaz_css: {}, avg_css: {}}, prisotnost_stresa: {avg: 0, jaz_css: {}, avg_css: {}}, spanje: {avg: 0, jaz_css: {}, avg_css: {}}, rekreacija: {avg: 0, jaz_css: {}, avg_css: {}}, kadilec: {avg: 0, jaz_css: {}, avg_css: {}}, alkohol: {avg: 0, jaz_css: {}, avg_css: {}}, }; self.statistics_result = {}; self.finalizeQuiz = function(){ $scope.final_values.itm_value = parseInt($scope.results.teza) / Math.pow(parseInt($scope.results.visina) / 100, 2); //itm value $scope.final_values.itm_value = Math.ceil($scope.final_values.itm_value * 100) / 100; //round to 2 decimals if($scope.final_values.itm_value > 1000) $scope.final_values.itm_value = 1000; //prevent error $scope.final_values.groups.spol = $scope.results.spol; angular.forEach($scope.all_filter_options.starost, function(item, ind){ if(item.slug){ //ignore all option if($scope.results.starost >= item.range_min && $scope.results.starost <= item.range_max) $scope.final_values.groups.starost = item.slug; } }); angular.forEach($scope.all_filter_options.itm, function(item, ind){ if(item.slug){ //ignore all option if($scope.final_values.itm_value >= item.range_min && $scope.final_values.itm_value <= item.range_max) $scope.final_values.groups.itm = item.slug; } }); $scope.final_values.starost = parseInt($scope.results.starost); //TOČKE if($scope.final_values.itm_value < 16) $scope.final_values.singles.itm = 8; else if($scope.final_values.itm_value < 17) $scope.final_values.singles.itm = 4; else if($scope.final_values.itm_value < 18.50) $scope.final_values.singles.itm = 2; else if($scope.final_values.itm_value < 25) $scope.final_values.singles.itm = 0; else if($scope.final_values.itm_value < 27.50) $scope.final_values.singles.itm = 2; else if($scope.final_values.itm_value < 30) $scope.final_values.singles.itm = 4; else if($scope.final_values.itm_value < 35) $scope.final_values.singles.itm = 6; else if($scope.final_values.itm_value < 40) $scope.final_values.singles.itm = 8; else $scope.final_values.singles.itm = 10; //zdravje $scope.final_values.singles.zdravje = Math.abs($scope.results.ocena_zdravja.value - 10); //jedilnik angular.forEach($scope.results.jedilnik, function(item, ind){ angular.forEach($scope.menu_items, function(original_itm, indx){ if(item === original_itm.name){ if(!original_itm.is_healthy) $scope.final_values.singles.jedilnik += 2; } }); }); //na_poti if($scope.results.na_poti.value <= 5000) $scope.final_values.singles.na_poti = 1; else if($scope.results.na_poti.value <= 10000) $scope.final_values.singles.na_poti = 2; else if($scope.results.na_poti.value <= 15000) $scope.final_values.singles.na_poti = 3; else if($scope.results.na_poti.value <= 20000) $scope.final_values.singles.na_poti = 4; else if($scope.results.na_poti.value <= 25000) $scope.final_values.singles.na_poti = 5; else if($scope.results.na_poti.value <= 30000) $scope.final_values.singles.na_poti = 6; else if($scope.results.na_poti.value <= 35000) $scope.final_values.singles.na_poti = 7; else if($scope.results.na_poti.value <= 40000) $scope.final_values.singles.na_poti = 8; else $scope.final_values.singles.na_poti = 9; //prisotnost_stresa $scope.final_values.singles.prisotnost_stresa = $scope.results.prisotnost_stresa.value; //spanje switch($scope.results.spanje.value){ case 2: $scope.final_values.singles.spanje = 10; break; case 3: $scope.final_values.singles.spanje = 8; break; case 12: case 4: $scope.final_values.singles.spanje = 6; break; case 11: case 5: $scope.final_values.singles.spanje = 4; break; case 10: case 6: $scope.final_values.singles.spanje = 2; break; case 9: case 8: case 7: $scope.final_values.singles.spanje = 0; break; default: console.log("error. Unknown sleep time value"); } //rekreacija angular.forEach($scope.rekreacija_options, function(original_itm, indx){ if($scope.results.rekreacija === original_itm.name) $scope.final_values.singles.rekreacija = original_itm.risk_factor; }); //kadilec if($scope.results.kadilec > 0){ if($scope.results.kadilec_kolicina.value < 3) $scope.final_values.singles.kadilec = 2; else if($scope.results.kadilec_kolicina.value < 6) $scope.final_values.singles.kadilec = 4; else if($scope.results.kadilec_kolicina.value < 11) $scope.final_values.singles.kadilec = 6; else if($scope.results.kadilec_kolicina.value < 21) $scope.final_values.singles.kadilec = 8; else $scope.final_values.singles.kadilec = 10; } //alkohol if($scope.results.alkohol > 0){ if($scope.results.alkohol_kolicina.value < 4) $scope.final_values.singles.alkohol = 2; else if($scope.results.alkohol_kolicina.value < 6) $scope.final_values.singles.alkohol = 4; else if($scope.results.alkohol_kolicina.value < 8) $scope.final_values.singles.alkohol = 6; else if($scope.results.alkohol_kolicina.value < 10) $scope.final_values.singles.alkohol = 8; else $scope.final_values.singles.alkohol = 10; } //sum angular.forEach($scope.final_values.singles, function(item, ind){ $scope.final_values.sum += item; }); //SUM TEKST if($scope.final_values.sum <= 30) $scope.risk_text = "Stopnja tveganja v vašem življenju je trenutno zelo nizka. Primeren življenjski slog in obvladovanje dejavnikov, ki tveganje zvišujejo, so prednosti, ki jih ohranjajte. A zavedati se je treba, da se na nekaterih področjih tveganje lahko kaj hitro poveča, zato priporočamo razmislek tudi o ustreznem zavarovanju."; else if($scope.final_values.sum <= 40) $scope.risk_text = "Indeks kaže, da je večina tveganj v vašem življenju trenutno nizka. Oglejte si, na katerih področjih bi lahko bili nevarnostim še manj izpostavljeni. Hkrati se je dobro zavedati, da se tveganjem nikoli ne morete v celoti izogniti, zato le ohranite zdrav življenjski slog. Smiselno pa se je tudi ustrezno zavarovati."; else if($scope.final_values.sum <= 50) $scope.risk_text = "Iz izračunanega indeksa se kaže, da na nekaterih področjih stopnja tveganja ni visoka, na drugih pa se že precej dviguje. Ker se tveganja s starostjo še povečujejo, je smiselno, da že danes razmislite, kje bi jih lahko učinkoviteje obvladovali in kako bi se lahko primerno zavarovali."; else if($scope.final_values.sum <= 60) $scope.risk_text = "Povprečni indeks tveganj v vašem primeru je nad 50, kar že kaže na višjo stopnjo nevarnosti, ki ste jim izpostavljeni. Bodite pozorni na področjih, kjer je stopnja najvišja, in razmislite o tem, kaj lahko v svojem življenjskem slogu spremenite. Izberite tudi primerno zavarovanje."; else if($scope.final_values.sum <= 70) $scope.risk_text = "Rezultat kaže, da je vaša izpostavljenost tveganjem že zelo visoka. Ker se ob vašem življenjskem slogu in vplivu drugih dejavnikov tveganje lahko hitro spremeni v neželen in potencialno tudi kritičen dogodek, poskrbite za spremembe in se tudi primerno zavarujte."; else $scope.risk_text = "Izračunani indeks kaže na vašo kritično izpostavljenost tveganjem, saj ta v več kategorijah dosega najvišjo raven. Nujna je korenita sprememba vašega življenjskega sloga, saj so tveganja že danes previsoka, z leti pa še naraščajo. Poskrbite tudi za primerno zavarovanje."; //radar chart angular.forEach($scope.final_values.singles, function(item, ind){ $scope.radar_chart_values.datasets[0].data.push(item); }); //reformat from 100 to 10 $scope.final_values.sum = $scope.final_values.sum / 10; //are requirements met for form? if($scope.results.kadilec < 1 && ($scope.final_values.itm_value >= 19 && $scope.final_values.itm_value <= 27) && $scope.final_values.singles.rekreacija < 10 && $scope.final_values.sum <= 3) $scope.final_screen.is_form = true; //Show final screen $scope.final_screen.active = true; //animate sum $timeout(function(){ self.animateRiskInterval = $interval(function(){ $scope.calc_risk += 0.1; $scope.calc_risk = Math.round($scope.calc_risk * 10) / 10; //prevent decimal bug $scope.shown_risk = ($scope.calc_risk +"").replace(".",","); if($scope.calc_risk == $scope.final_values.sum) { $interval.cancel(self.animateRiskInterval); } }, 30); }, 500); //save results + get statistics self.saveResults(); //console.log($scope.final_values); }; self.animateRiskInterval = null; self.saveResults = function(){ //calc jaz_css ofsets angular.forEach(["itm", "zdravje", "jedilnik", "na_poti", "prisotnost_stresa", "spanje", "rekreacija", "kadilec", "alkohol"], function(item, ind){ $scope.statistics[item].jaz_css = {left: ($scope.final_values.singles[item] * 10) +"%"}; }); //save result $http.post("//eos.triglav.si/webapp/svetovalnica/save_results.php", $scope.final_values).then(function(back){ $scope.statistics.total = back.data.results_nr; self.statistics_result = back.data; self.calcStatistics(); $scope.final_screen.loading_results = false; }); }; self.calcStatistics = function(){ var objekt = self.statistics_result[$scope.filters.spol][$scope.filters.starost][$scope.filters.itm]; //var total = objekt.nr; angular.forEach(["itm", "zdravje", "jedilnik", "na_poti", "prisotnost_stresa", "spanje", "rekreacija", "kadilec", "alkohol"], function(item, ind){ $scope.statistics[item].avg = Math.round(objekt[item] / objekt.nr * 10) / 10; if(isNaN($scope.statistics[item].avg)) $scope.statistics[item].avg = 0; $scope.statistics[item].avg_css = {left: ($scope.statistics[item].avg * 10) +"%"}; }); }; //sending form $scope.form_data = { name: "", email: "", tel: "", postcode: "", captcha: "", }; $scope.wrongCaptcha = false; $scope.resultFormButtonClick = false; $scope.visitedEmail = false; $scope.formSended = false; $scope.captchaUrl = 'https://eos2.triglav.si/zivljenje.triglav.si/captchaw.png'; $scope.sendForm = function(e){ e.preventDefault(); e.stopPropagation(); //send values /* MISSING VALIDATION FOR ALL */ $scope.resultFormButtonClick = true; $scope.resultForm.result_name.$setTouched(); $scope.resultForm.result_email.$setTouched(); $scope.resultForm.result_phone.$setTouched(); $scope.resultForm.result_captcha.$setTouched(); $scope.resultForm.result_postcode.$setTouched(); if($scope.resultForm.$valid) { $http({ method : "POST", url : "https://eos2.triglav.si/zivljenje.triglav.si/risk-save-values", headers: { 'Content-Type': 'application/json; charset=UTF-8' }, withCredentials: true, data: { form: $scope.form_data, result: $scope.final_values } }).then(function(back){ if (back.data == 'Wrong captcha') { $scope.wrongCaptchaAgent = true; $scope.captchaUrl = "https://eos2.triglav.si/zivljenje.triglav.si/captchaw.png?rand=" + Math.random().toString(); $scope.wrongCaptcha = true; } else if (back.data == 'OK'){ $scope.formSended = true; Analytics.trackEvent( 'Zivljenska zavarovanja', 'Aplikacija - Izracun tveganja', 'Uspesno oddano - informativni izracun' ); } }); } else { console.log("form not valid"); } }; }]); "use strict"; angular.module('triglavQuiz').controller('Newsletter', ['$scope', '$http', 'Analytics', function ($scope, $http, Analytics) { $scope.eml_add = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; $scope.newsletterResponseText = ""; $scope.formButtonClick = false; $scope.newsletterIsFinished = false; $scope.subscribeNewsletter = function() { $scope.formButtonClick = true; $scope.newsletterForm.email.$setTouched(); $scope.newsletterForm.personal_newsletter.$setTouched(); var d=new Date(); var datum=""+d.getDate()+"."+(d.getMonth()+1)+"."+d.getFullYear()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds(); var datum2=new Date().toISOString().substr(0, 19); if($scope.newsletterForm.$valid) { $http({ method : "POST", url : "https://gpw.eglasnik.si/i/submit_contact_v1-1.php", headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, data: 'ml_code=NMdIzLhJ5CM%3D' + '&sec_code=0xi3lv284u' + '&confirmation=0' + '&lang=SLO' + '&api_mode=RESTFUL' + '&contacteml=' + $scope.newsletterForm.email.$viewValue + '&sourceuser=' + datum2 + ";" + window.location + '&category=Q1pwooQfdhg%3D' + '&a01=' + '&a02=' + datum }).then(function(response) { if (response.data == 'ok') { $scope.newsletterIsFinished = true; if($.cookie("cookie_module_cat") == "11") { Analytics.trackEvent('Koliko bi bilo potrebno mojim najblizima', 'Newsletter', 'Signup successful'); } } else { $scope.newsletterResponseText = "Već ste prijavljeni."; } }) } else { console.log("form not valid"); } }; }]); "use strict"; angular.module('triglavQuiz').controller('Whitepaper', ['$scope', '$http', 'Analytics', function ($scope, $http, Analytics) { $scope.eml_add = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; $scope.whitepaperResponseText = ""; $scope.whitepaperFormButtonClick = false; $scope.wrongCaptcha = false; $scope.captchaZivljenje = "https://zivljenje.triglav.si/captcha.png"; $scope.whitepaperIsFinished = false; $scope.subscribeWhitepaper = function() { $scope.whitepaperFormButtonClick = true; $scope.whitepaperForm.email.$setTouched(); $scope.whitepaperForm.captcha.$setTouched(); $scope.whitepaperForm.whitepaper.$setTouched(); $scope.whitepaperForm.age.$setTouched(); var d=new Date(); var datum=""+d.getDate()+"."+(d.getMonth()+1)+"."+d.getFullYear()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds(); if($scope.whitepaperForm.$valid) { $http({ method : "POST", url : "https://zivljenje.triglav.si/9nasvetov", withCredentials: true, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, data: '&action=whitepaper' + '&email=' + $scope.whitepaperForm.email.$viewValue + '&captcha=' + $scope.whitepaperForm.captcha.$viewValue + '&whitepaper=' + $scope.whitepaperForm.whitepaper.$viewValue + '&personal_newsletter=' + $scope.whitepaperForm.personal_newsletter.$viewValue }).then(function(response) { if (response.data == 'Wrong captcha') { $scope.wrongCaptcha = true; $scope.captchaZivljenje = "https://zivljenje.triglav.si/captcha.png?rand="+ Math.random().toString(); } else if (response.data == 'OK'){ $scope.wrongCaptcha = false; //$scope.whitepaperResponseText = "Nasvete boste prejeli na e-naslov."; $scope.whitepaperIsFinished = true; if($.cookie("cookie_module_cat") == "10" || $.cookie("cookie_module_cat") == "11") { fbq('track', 'Contact'); Analytics.trackEvent('Zivljenska zavarovanja', 'Narocilo na e-knjizico', 'Uspesno oddano'); } } else { $scope.whitepaperResponseText = "Napaka pri pošiljanju."; } }) } else { console.log("form not valid"); } }; }]); "use strict"; angular.module('triglavQuiz').controller('AgentRequest_v2', ['$scope', '$http', 'Analytics', function ($scope, $http, Analytics) { $scope.eml_add_agent = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; $scope.agentResponseText = ""; $scope.agentFormButtonClick = false; $scope.wrongCaptchaAgent = false; $scope.captchaUrl = 'https://zivljenje.triglav.si/captcha.png'; $scope.agentRequestSend = function() { $scope.agentFormButtonClick = true; $scope.agentForm.name.$setTouched(); $scope.agentForm.email.$setTouched(); $scope.agentForm.phone.$setTouched(); $scope.agentForm.captcha.$setTouched(); if($scope.agentForm.$valid) { $http({ method : "POST", url : "https://zivljenje.triglav.si/9nasvetov", headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, withCredentials: true, data: '&action=agent_request_v2' + '&name=' + encodeURIComponent($scope.agentForm.name.$viewValue) + '&email=' + encodeURIComponent($scope.agentForm.email.$viewValue) + '&phoneNumber=' + encodeURIComponent($scope.agentForm.phone.$viewValue) + '&inputMessage=' + encodeURIComponent($scope.agentForm.more.$viewValue) + '&source=zivljenje.triglav.si' + '&receiver=' + '&jcaptcha=' + encodeURIComponent($scope.agentForm.captcha.$viewValue) }).then(function(response) { if (response.data == 'Wrong captcha') { $scope.wrongCaptchaAgent = true; $scope.captchaUrl = "https://zivljenje.triglav.si/captcha.png?rand=" + Math.random().toString(); } else if (response.data == 'OK'){ $scope.wrongCaptchaAgent = false; //$scope.agentResponseText = "OK."; if($.cookie("cookie_module_cat") == "10" || $.cookie("cookie_module_cat") == "11") { fbq('track', 'Lead'); Analytics.trackEvent( 'Zivljenska zavarovanja', 'Narocilo svetovalca', 'Uspesno oddano', { hitCallback: function () { window.location.href = '/wps/wcm/connect/zivljenje.triglav.si/home/narocite-svetovalca/hvala'; } } ); } else { window.location.href = '/wps/wcm/connect/zivljenje.triglav.si/home/narocite-svetovalca/hvala'; } } else { $scope.agentResponseText = "Napaka pri pošiljanju."; } }) } else { console.log("form not valid"); } }; $scope.changeCaptcha = function() { $scope.captchaUrl = "https://zivljenje.triglav.si/captcha.png?rand=" + Math.random().toString(); } }]); "use strict"; angular.module('triglavQuiz').controller('AgentRequestQuiz', ['$scope', '$http', 'Analytics', function ($scope, $http, Analytics) { $scope.eml_add_agent = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; $scope.agentResponseText = ""; $scope.agentFormButtonClick = false; $scope.wrongCaptchaAgent = false; $scope.captchaUrl = 'https://www.triglav.ba/zivljenje.triglav.si/captchaw.png'; $scope.agentRequestQuizSubmitted = false; $scope.agentRequestSend = function() { $scope.agentFormButtonClick = true; $scope.agentForm.name.$setTouched(); $scope.agentForm.email.$setTouched(); $scope.agentForm.phone.$setTouched(); $scope.agentForm.captcha.$setTouched(); $scope.agentForm.post.$setTouched(); $scope.agentForm.city.$setTouched(); if($scope.agentForm.$valid) { $http({ method : "POST", url : "https://www.triglav.ba/zivljenje.triglav.si/calculation-info-tosa", headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, withCredentials: true, data: '&name=' + encodeURIComponent($scope.agentForm.name.$viewValue) + '&email=' + encodeURIComponent($scope.agentForm.email.$viewValue) + '&phoneNumber=' + encodeURIComponent($scope.agentForm.phone.$viewValue) + '&jcaptcha=' + encodeURIComponent($scope.agentForm.captcha.$viewValue) + '&post=' + encodeURIComponent($scope.agentForm.post.$viewValue) + '&city=' + encodeURIComponent($scope.agentForm.city.$viewValue) + '&uid=' + $.cookie('quiz_uid') }).then(function(response) { if (response.data == 'Wrong captcha') { $scope.wrongCaptchaAgent = true; $scope.captchaUrl = "https://www.triglav.ba/zivljenje.triglav.si/captchaw.png?rand=" + Math.random().toString(); } else if (response.data == 'OK'){ $scope.wrongCaptchaAgent = false; $scope.agentRequestQuizSubmitted = true; Analytics.trackEvent( 'Koliko bi bilo potrebno mojim najblizima', 'Agent request form', 'Successfully sent' ); } else { $scope.agentResponseText = "Greška prilikom slanja."; } }) } else { console.log("form not valid"); } }; $scope.changeCaptcha = function() { $scope.captchaUrl = "https://zivljenje.triglav.si/captcha.png?rand=" + Math.random().toString(); } }]); "use strict"; angular.module('triglavQuiz').controller('VodnikZaStarse', ['$scope', '$http', 'Analytics', function ($scope, $http, Analytics) { $scope.eml_add_vodnik = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; $scope.vodnikResponseText = ""; $scope.vodnikFormButtonClick = false; $scope.wrongCaptchaVodnik = false; $scope.captchaUrl = 'https://zivljenje.triglav.si/captcha.png'; $scope.vodnikRequestSend = function() { $scope.vodnikFormButtonClick = true; $scope.vodnikForm.name.$setTouched(); $scope.vodnikForm.email.$setTouched(); $scope.vodnikForm.phone.$setTouched(); $scope.vodnikForm.postal_code.$setTouched(); $scope.vodnikForm.captcha.$setTouched(); if($scope.vodnikForm.$valid) { $http({ method : "POST", url : "https://zivljenje.triglav.si/9nasvetov", headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, withCredentials: true, data: '&action=vodnik-za-starse' + '&name=' + encodeURIComponent($scope.vodnikForm.name.$viewValue) + '&email=' + encodeURIComponent($scope.vodnikForm.email.$viewValue) + '&phoneNumber=' + encodeURIComponent($scope.vodnikForm.phone.$viewValue) + '&postal_code=' + encodeURIComponent($scope.vodnikForm.postal_code.$viewValue) + '&captcha=' + encodeURIComponent($scope.vodnikForm.captcha.$viewValue) }).then(function(response) { if (response.data == 'Wrong captcha') { $scope.wrongCaptchaVodnik = true; $scope.captchaUrl = "https://zivljenje.triglav.si/captcha.png?rand=" + Math.random().toString(); } else if (response.data == 'OK'){ $scope.wrongCaptchaVodnik = false; //$scope.vodnikResponseText = "OK."; if($.cookie("cookie_module_cat") == "10" || $.cookie("cookie_module_cat") == "11") { Analytics.trackEvent( 'Zivljenska zavarovanja', 'Vodnik za bodoce starse', 'Uspesno oddano', { hitCallback: function () { window.location.href = '/wps/wcm/connect/zivljenje.triglav.si/home/ugodnost/hvala'; } } ); } else { window.location.href = '/wps/wcm/connect/zivljenje.triglav.si/home/ugodnost/hvala'; } } else { $scope.vodnikResponseText = "Napaka pri pošiljanju."; } }) } else { console.log("form not valid"); } }; $scope.changeCaptcha = function() { $scope.captchaUrl = "https://zivljenje.triglav.si/captcha.png?rand=" + Math.random().toString(); } }]); "use strict"; // FASTCLICK $(function () { FastClick.attach(document.body); }); //******************************************** //******************************************** // 1.0 - READY //******************************************** $(document).ready(function () { $(".menu-img-title").each(function () { $(this).on("click", function () { if ($(this).parent().hasClass("is-active")) { $(this).parent().removeClass("is-active").find(".menu-main-nav").slideUp("250"); } else { $(this).parent().addClass("is-active").find(".menu-main-nav").slideDown("250"); } }); }); // OPEN FAQ $(".faq-title").each(function () { $(this).on("click", function () { if ($(this).parent().hasClass("is-open")) { $(this).parent().removeClass("is-open").find(".faq-content").slideUp("300"); } else { $(this).parent().addClass("is-open").find(".faq-content").slideDown("300"); } }); }); // Featured articles slider $('.why-slider').slick({ //centerMode: true, speed: 500, //centerPadding: '0px', slidesToShow: 1, slidesToScroll: 1, //adaptiveHeight: true, draggable: true, infinite: false, dots: true, fade: true, cssEase: 'ease-in', arrows: true, // appendArrows: $('.featured-slider-arrows'), prevArrow: '', nextArrow: '' }).on('beforeChange', function (event, slick, currentSlide, nextSlide) { //var currentSlide = nextSlide + 1; //var totalSlides = slick.slideCount; //$('.gallery-modal-counter').html(currentSlide + " / " + totalSlides); }); // SCROLL FROM FIRST SECTION ON HOMEPAGE TO THE SECOND $(".page-scroll").click(function () { $([document.documentElement, document.body]).animate({ scrollTop: $("#homepage-video").offset().top }, 2000); }); // FAKER INI var chooseCategorieIni = $(".choose-categorie select").specto_faker({ on_change: function on_change(newVal, jsEvent) { animateScreens($(".articles-list:not(.mfp-hide)"), ".articles-list.articles-" + newVal, true); }, animated: false }); //EQUAL HEIGHT $(function () { $('.equal-height').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); }); $(function () { $('.equal-height-title').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); }); $(function () { $('.equal-height-par').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); }); // OPEN CONTENT OF CATEGORIE $(".categorie-single .btn").on("click", function (e) { e.preventDefault(); var singleCategorieId = $(this).attr("id").replace(/[^\d]/g, ""); $(".sc-categories-content").addClass("categorie-open"); animateScreens(".categories-list", ".articles-tabs, .categories-email-subs, .sub-head", true); $(chooseCategorieIni[0]).find(".drop-selection div[rel='" + singleCategorieId + "']")[0].click(); console.log($(chooseCategorieIni[0]).find(".drop-value")); $(chooseCategorieIni[0]).find(".drop-value")[0].click(); }); // CLOSE CONTENT OF CATEGORIE $(".back-to-cat-list").on("click", function (e) { e.preventDefault(); $(".sc-categories-content").removeClass("categorie-open"); animateScreens(".articles-tabs", ".categories-list", true); fadeInEl(".categories-email-subs, .sub-head", true); }); }); // RESIZE WATCH $(window).resize(function () { $.fn.matchHeight._update(); }); //animacija prehodov med screeni function animateScreens(hidet, showt, noscroll) { $(hidet).animate({ opacity: "0" }, { duration: 200, always: function always() { $(this).addClass("mfp-hide"); $(showt).css({ opacity: "0" }).removeClass("mfp-hide").animate({ opacity: "1" }, { duration: 500, queue: false }); if (!noscroll) $("html,body").animate({ scrollTop: 0 }, { duration: 950, queue: false }); } }); return; } //single element fade function fadeInEl(el, fadeout) { if (!fadeout) $(el).css({ opacity: "0" }).removeClass("mfp-hide").animate({ opacity: "1" }, { duration: 200, queue: false });else $(el).animate({ opacity: "0" }, { duration: 200, queue: false, always: function always() { $(this).addClass("mfp-hide").removeAttr("style"); } }); } //******************************************** // Return Window Width function win_width() { return $(window).width(); } //******************************************** // Return Window Height function win_height() { return $(window).outerHeight(); } //******************************************** // Return Header Height function header_height() { return $('.header-main').outerHeight(); } //******************************************** // 1.0 - READY //******************************************** $(document).ready(function () { // Header Dropdown // headerDropdown(); // Round slide //roundSliderInit(); }); //******************************************** // 2.0 - WINDOW LOAD //******************************************** $(window).on('load', function () { // Slickslider // slickSlidersInit(); // Match height added to class equal-height $('.equal-height').matchHeight(); $('.equal-height-inner').matchHeight(); $('.equal-height-not-by-row').matchHeight({ byRow: false }); }); // WINDOW RESIZE $(window).on('resize', function () { /* $(".ui-datepicker").css({ top: $("#inputTerminDate").offset().top + 41, left: $("#inputTerminDate").offset().left }); */ });