"use strict"; !function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof exports ? t(require("jquery")) : t(jQuery) }(function (a) { var r = function (t, i) { this.$element = a(t), this.options = a.extend({}, r.DEFAULTS, this.dataOptions(), i), this.init() }; r.DEFAULTS = { from: 0, to: 0, speed: 1e3, refreshInterval: 100, decimals: 0, formatter: function (t, i) { return t.toFixed(i.decimals) }, onUpdate: null, onComplete: null }, r.prototype.init = function () { this.value = this.options.from, this.loops = Math.ceil(this.options.speed / this.options.refreshInterval), this.loopCount = 0, this.increment = (this.options.to - this.options.from) / this.loops }, r.prototype.dataOptions = function () { var t = { from: this.$element.data("from"), to: this.$element.data("to"), speed: this.$element.data("speed"), refreshInterval: this.$element.data("refresh-interval"), decimals: this.$element.data("decimals") }, i = Object.keys(t); for (var e in i) { var s = i[e]; void 0 === t[s] && delete t[s] } return t }, r.prototype.update = function () { this.value += this.increment, this.loopCount++ , this.render(), "function" == typeof this.options.onUpdate && this.options.onUpdate.call(this.$element, this.value), this.loopCount >= this.loops && (clearInterval(this.interval), this.value = this.options.to, "function" == typeof this.options.onComplete && this.options.onComplete.call(this.$element, this.value)) }, r.prototype.render = function () { var t = this.options.formatter.call(this.$element, this.value, this.options); this.$element.text(t) }, r.prototype.restart = function () { this.stop(), this.init(), this.start() }, r.prototype.start = function () { this.stop(), this.render(), this.interval = setInterval(this.update.bind(this), this.options.refreshInterval) }, r.prototype.stop = function () { this.interval && clearInterval(this.interval) }, r.prototype.toggle = function () { this.interval ? this.stop() : this.start() }, a.fn.countTo = function (n) { return this.each(function () { var t = a(this), i = t.data("countTo"), e = "object" == typeof n ? n : {}, s = "string" == typeof n ? n : "start"; (!i || "object" == typeof n) && (i && i.stop(), t.data("countTo", i = new r(this, e))), i[s].call(i) }) } }), function (t) { if ("function" == typeof define && define.amd) define(["jquery"], t); else if ("object" == typeof module && module.exports) { var i = require("jquery"); t(i), module.exports = i } else t(jQuery) }(function (f) { function r(t) { this.init(t) } r.prototype = { value: 0, size: 100, startAngle: -Math.PI, thickness: "auto", fill: { gradient: ["#3aeabb", "#fdd250"] }, emptyFill: "rgba(0, 0, 0, .1)", animation: { duration: 1200, easing: "circleProgressEasing" }, animationStartValue: 0, reverse: !1, lineCap: "butt", insertMode: "prepend", constructor: r, el: null, canvas: null, ctx: null, radius: 0, arcFill: null, lastFrameValue: 0, init: function (t) { f.extend(this, t), this.radius = this.size / 2, this.initWidget(), this.initFill(), this.draw(), this.el.trigger("circle-inited") }, initWidget: function () { this.canvas || (this.canvas = f("<canvas>")["prepend" == this.insertMode ? "prependTo" : "appendTo"](this.el)[0]); var t = this.canvas; if (t.width = this.size, t.height = this.size, this.ctx = t.getContext("2d"), 1 < window.devicePixelRatio) { var i = window.devicePixelRatio; t.style.width = t.style.height = this.size + "px", t.width = t.height = this.size * i, this.ctx.scale(i, i) } }, initFill: function () { var i, e = this, t = this.fill, s = this.ctx, n = this.size; if (!t) throw Error("The fill is not specified!"); if ("string" == typeof t && (t = { color: t }), t.color && (this.arcFill = t.color), t.gradient) { var a = t.gradient; if (1 == a.length) this.arcFill = a[0]; else if (1 < a.length) { for (var r = t.gradientAngle || 0, o = t.gradientDirection || [n / 2 * (1 - Math.cos(r)), n / 2 * (1 + Math.sin(r)), n / 2 * (1 + Math.cos(r)), n / 2 * (1 - Math.sin(r))], l = s.createLinearGradient.apply(s, o), h = 0; h < a.length; h++) { var c = a[h], d = h / (a.length - 1); f.isArray(c) && (d = c[1], c = c[0]), l.addColorStop(d, c) } this.arcFill = l } } t.image && (t.image instanceof Image ? i = t.image : (i = new Image).src = t.image, i.complete ? u() : i.onload = u); function u() { var t = f("<canvas>")[0]; t.width = e.size, t.height = e.size, t.getContext("2d").drawImage(i, 0, 0, n, n), e.arcFill = e.ctx.createPattern(t, "no-repeat"), e.drawFrame(e.lastFrameValue) } }, draw: function () { this.animation ? this.drawAnimated(this.value) : this.drawFrame(this.value) }, drawFrame: function (t) { this.lastFrameValue = t, this.ctx.clearRect(0, 0, this.size, this.size), this.drawEmptyArc(t), this.drawArc(t) }, drawArc: function (t) { if (0 !== t) { var i = this.ctx, e = this.radius, s = this.getThickness(), n = this.startAngle; i.save(), i.beginPath(), this.reverse ? i.arc(e, e, e - s / 2, n - 2 * Math.PI * t, n) : i.arc(e, e, e - s / 2, n, n + 2 * Math.PI * t), i.lineWidth = s, i.lineCap = this.lineCap, i.strokeStyle = this.arcFill, i.stroke(), i.restore() } }, drawEmptyArc: function (t) { var i = this.ctx, e = this.radius, s = this.getThickness(), n = this.startAngle; t < 1 && (i.save(), i.beginPath(), t <= 0 ? i.arc(e, e, e - s / 2, 0, 2 * Math.PI) : this.reverse ? i.arc(e, e, e - s / 2, n, n - 2 * Math.PI * t) : i.arc(e, e, e - s / 2, n + 2 * Math.PI * t, n), i.lineWidth = s, i.strokeStyle = this.emptyFill, i.stroke(), i.restore()) }, drawAnimated: function (e) { var s = this, n = this.el, t = f(this.canvas); t.stop(!0, !1), n.trigger("circle-animation-start"), t.css({ animationProgress: 0 }).animate({ animationProgress: 1 }, f.extend({}, this.animation, { step: function (t) { var i = s.animationStartValue * (1 - t) + e * t; s.drawFrame(i), n.trigger("circle-animation-progress", [t, i]) } })).promise().always(function () { n.trigger("circle-animation-end") }) }, getThickness: function () { return f.isNumeric(this.thickness) ? this.thickness : this.size / 14 }, getValue: function () { return this.value }, setValue: function (t) { this.animation && (this.animationStartValue = this.lastFrameValue), this.value = t, this.draw() } }, f.circleProgress = { defaults: r.prototype }, f.easing.circleProgressEasing = function (t) { return t < .5 ? .5 * (t *= 2) * t * t : 1 - .5 * (t = 2 - 2 * t) * t * t }, f.fn.circleProgress = function (n, t) { var a = "circle-progress", i = this.data(a); if ("widget" == n) { if (!i) throw Error('Calling "widget" method on not initialized instance is forbidden'); return i.canvas } if ("value" == n) { if (!i) throw Error('Calling "value" method on not initialized instance is forbidden'); if (void 0 === t) return i.getValue(); var e = t; return this.each(function () { f(this).data(a).setValue(e) }) } return this.each(function () { var t = f(this), i = t.data(a), e = f.isPlainObject(n) ? n : {}; if (i) i.init(e); else { var s = f.extend({}, t.data()); "string" == typeof s.fill && (s.fill = JSON.parse(s.fill)), "string" == typeof s.animation && (s.animation = JSON.parse(s.animation)), (e = f.extend(s, e)).el = t, i = new r(e), t.data(a, i) } }) } }), function (i) { i.fn.downCount = function (t, h) { var c = i.extend({ date: null, offset: null }, t); c.date || i.error("Date is not defined."), Date.parse(c.date) || i.error("Incorrect date format, it should look like this, 12/24/2012 12:00:00."); var d = this, u = function () { var t = new Date, i = t.getTime() + 6e4 * t.getTimezoneOffset(); return new Date(i + 36e5 * c.offset) }; var f = setInterval(function () { var t = new Date(c.date) - u(); if (t < 0) return clearInterval(f), void (h && "function" == typeof h && h()); var i = Math.floor(t / 864e5), e = Math.floor(t % 864e5 / 36e5), s = Math.floor(t % 36e5 / 6e4), n = Math.floor(t % 6e4 / 1e3), a = 1 === (i = 2 <= String(i).length ? i : "0" + i) ? "day" : "days", r = 1 === (e = 2 <= String(e).length ? e : "0" + e) ? "hour" : "hours", o = 1 === (s = 2 <= String(s).length ? s : "0" + s) ? "minute" : "minutes", l = 1 === (n = 2 <= String(n).length ? n : "0" + n) ? "second" : "seconds"; d.find(".days").text(i), d.find(".hours").text(e), d.find(".minutes").text(s), d.find(".seconds").text(n), d.find(".days_ref").text(a), d.find(".hours_ref").text(r), d.find(".minutes_ref").text(o), d.find(".seconds_ref").text(l) }, 1e3) } }(jQuery), function (o) { o(document).ready(function () { o("[data-time].countdown").each(function (t) { o(this).downCount({ date: o(this).attr("data-time"), offset: o(this).attr("data-utc-offset") }) }), o(window).scroll(function () { o(".counter").each(function () { if (isScrollView(this)) { var t = o(this).attr("data-trigger"), e = o(this).attr("data-separator"); void 0 === e && (e = "."), (isEmpty(t) || "scroll" == t) && (o(this).countTo({ formatter: function (t, i) { return t.toFixed(i.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, e) } }), o(this).attr("data-trigger", "null")) } }), o("[data-progress].progress-bar").each(function () { if (isScrollView(this)) { var t = o(this).attr("data-trigger"); (isEmpty(t) || "scroll" == t) && (o(this).css("width", 0), o(this).css("width", o(this).attr("data-progress") + "%"), o(this).attr("data-trigger", "null")) } }), o("[data-progress].progress-circle").each(function () { if (isScrollView(this)) { var t = o(this).attr("data-trigger"); (isEmpty(t) || "scroll" == t) && (o(this).progressCircle(), o(this).attr("data-trigger", "null")) } }) }) }), o.fn.progressCircle = function () { var t = o(this).attr("data-options"), i = o(this).attr("data-size"), e = o(this).attr("data-color"), s = o(this).attr("data-unit"), n = o(this).attr("data-thickness"); n = o(this).attr("data-thickness"); isEmpty(e) && (e = "#565656"), isEmpty(n) && (n = 2), (isEmpty(i) || "auto" == i) && (i = o(this).outerWidth()), null == s && (s = "%"); var a = { value: parseInt(o(this).attr("data-progress"), 10) / 100, size: i, fill: { gradient: [e, e] }, thickness: n, startAngle: -Math.PI / 2 }; isEmpty(t) || (t.split(","), a = getOptionsString(t, a)), o(this).circleProgress(a); var r = o(this).find(".inner-circle .counter-circle"); r && (o(this).find(".inner-circle").css("display", "table"), o(this).on("circle-animation-progress", function (t, i, e) { o(r).html(parseInt(100 * e.toFixed(2), 10) + " " + s) })) } }(jQuery);