!function () { "use strict"; function t(o) { if (!o) throw new Error("No options passed to Waypoint constructor"); if (!o.element) throw new Error("No element option passed to Waypoint constructor"); if (!o.handler) throw new Error("No handler option passed to Waypoint constructor"); this.key = "waypoint-" + e, this.options = t.Adapter.extend({}, t.defaults, o), this.element = this.options.element, this.adapter = new t.Adapter(this.element), this.callback = o.handler, this.axis = this.options.horizontal ? "horizontal" : "vertical", this.enabled = this.options.enabled, this.triggerPoint = null, this.group = t.Group.findOrCreate({ name: this.options.group, axis: this.axis }), this.context = t.Context.findOrCreateByElement(this.options.context), t.offsetAliases[this.options.offset] && (this.options.offset = t.offsetAliases[this.options.offset]), this.group.add(this), this.context.add(this), i[this.key] = this, e += 1 } var e = 0, i = {}; t.prototype.queueTrigger = function (t) { this.group.queueTrigger(this, t) }, t.prototype.trigger = function (t) { this.enabled && this.callback && this.callback.apply(this, t) }, t.prototype.destroy = function () { this.context.remove(this), this.group.remove(this), delete i[this.key] }, t.prototype.disable = function () { return this.enabled = !1, this }, t.prototype.enable = function () { return this.context.refresh(), this.enabled = !0, this }, t.prototype.next = function () { return this.group.next(this) }, t.prototype.previous = function () { return this.group.previous(this) }, t.invokeAll = function (t) { var e = []; for (var o in i) e.push(i[o]); for (var s = 0, n = e.length; n > s; s++)e[s][t]() }, t.destroyAll = function () { t.invokeAll("destroy") }, t.disableAll = function () { t.invokeAll("disable") }, t.enableAll = function () { t.Context.refreshAll(); for (var e in i) i[e].enabled = !0; return this }, t.refreshAll = function () { t.Context.refreshAll() }, t.viewportHeight = function () { return window.innerHeight || document.documentElement.clientHeight }, t.viewportWidth = function () { return document.documentElement.clientWidth }, t.adapters = [], t.defaults = { context: window, continuous: !0, enabled: !0, group: "default", horizontal: !1, offset: 0 }, t.offsetAliases = { "bottom-in-view": function () { return this.context.innerHeight() - this.adapter.outerHeight() }, "right-in-view": function () { return this.context.innerWidth() - this.adapter.outerWidth() } }, window.Waypoint = t }(), function () { "use strict"; function t(s) { this.element = s, this.Adapter = o.Adapter, this.adapter = new this.Adapter(s), this.key = "waypoint-context-" + e, this.didScroll = !1, this.didResize = !1, this.oldScroll = { x: this.adapter.scrollLeft(), y: this.adapter.scrollTop() }, this.waypoints = { vertical: {}, horizontal: {} }, s.waypointContextKey = this.key, i[s.waypointContextKey] = this, e += 1, o.windowContext || (o.windowContext = !0, o.windowContext = new t(window)), this.createThrottledScrollHandler(), this.createThrottledResizeHandler() } var e = 0, i = {}, o = window.Waypoint, s = window.onload; t.prototype.add = function (t) { var e = t.options.horizontal ? "horizontal" : "vertical"; this.waypoints[e][t.key] = t, this.refresh() }, t.prototype.checkEmpty = function () { var t = this.Adapter.isEmptyObject(this.waypoints.horizontal), e = this.Adapter.isEmptyObject(this.waypoints.vertical), o = this.element == this.element.window; t && e && !o && (this.adapter.off(".waypoints"), delete i[this.key]) }, t.prototype.createThrottledResizeHandler = function () { function t() { e.handleResize(), e.didResize = !1 } var e = this; this.adapter.on("resize.waypoints", function () { e.didResize || (e.didResize = !0, o.requestAnimationFrame(t)) }) }, t.prototype.createThrottledScrollHandler = function () { function t() { e.handleScroll(), e.didScroll = !1 } var e = this; this.adapter.on("scroll.waypoints", function () { (!e.didScroll || o.isTouch) && (e.didScroll = !0, o.requestAnimationFrame(t)) }) }, t.prototype.handleResize = function () { o.Context.refreshAll() }, t.prototype.handleScroll = function () { var t = {}, e = { horizontal: { newScroll: this.adapter.scrollLeft(), oldScroll: this.oldScroll.x, forward: "right", backward: "left" }, vertical: { newScroll: this.adapter.scrollTop(), oldScroll: this.oldScroll.y, forward: "down", backward: "up" } }; for (var i in e) { var o = e[i], s = o.newScroll > o.oldScroll ? o.forward : o.backward; for (var n in this.waypoints[i]) { var r = this.waypoints[i][n]; if (null !== r.triggerPoint) { var a = o.oldScroll < r.triggerPoint, h = o.newScroll >= r.triggerPoint; (a && h || !a && !h) && (r.queueTrigger(s), t[r.group.id] = r.group) } } } for (var l in t) t[l].flushTriggers(); this.oldScroll = { x: e.horizontal.newScroll, y: e.vertical.newScroll } }, t.prototype.innerHeight = function () { return this.element == this.element.window ? o.viewportHeight() : this.adapter.innerHeight() }, t.prototype.remove = function (t) { delete this.waypoints[t.axis][t.key], this.checkEmpty() }, t.prototype.innerWidth = function () { return this.element == this.element.window ? o.viewportWidth() : this.adapter.innerWidth() }, t.prototype.destroy = function () { var t = []; for (var e in this.waypoints) for (var i in this.waypoints[e]) t.push(this.waypoints[e][i]); for (var o = 0, s = t.length; s > o; o++)t[o].destroy() }, t.prototype.refresh = function () { var t, e = this.element == this.element.window, i = e ? void 0 : this.adapter.offset(), s = {}; this.handleScroll(), t = { horizontal: { contextOffset: e ? 0 : i.left, contextScroll: e ? 0 : this.oldScroll.x, contextDimension: this.innerWidth(), oldScroll: this.oldScroll.x, forward: "right", backward: "left", offsetProp: "left" }, vertical: { contextOffset: e ? 0 : i.top, contextScroll: e ? 0 : this.oldScroll.y, contextDimension: this.innerHeight(), oldScroll: this.oldScroll.y, forward: "down", backward: "up", offsetProp: "top" } }; for (var n in t) { var r = t[n]; for (var a in this.waypoints[n]) { var h, l, p, c, d, u = this.waypoints[n][a], m = u.options.offset, f = u.triggerPoint, g = 0, w = null == f; u.element !== u.element.window && (g = u.adapter.offset()[r.offsetProp]), "function" == typeof m ? m = m.apply(u) : "string" == typeof m && (m = parseFloat(m), u.options.offset.indexOf("%") > -1 && (m = Math.ceil(r.contextDimension * m / 100))), h = r.contextScroll - r.contextOffset, u.triggerPoint = Math.floor(g + h - m), l = f < r.oldScroll, p = u.triggerPoint >= r.oldScroll, c = l && p, d = !l && !p, !w && c ? (u.queueTrigger(r.backward), s[u.group.id] = u.group) : !w && d ? (u.queueTrigger(r.forward), s[u.group.id] = u.group) : w && r.oldScroll >= u.triggerPoint && (u.queueTrigger(r.forward), s[u.group.id] = u.group) } } return o.requestAnimationFrame(function () { for (var t in s) s[t].flushTriggers() }), this }, t.findOrCreateByElement = function (e) { return t.findByElement(e) || new t(e) }, t.refreshAll = function () { for (var t in i) i[t].refresh() }, t.findByElement = function (t) { return i[t.waypointContextKey] }, window.onload = function () { s && s(), t.refreshAll() }, o.requestAnimationFrame = function (t) { (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (t) { window.setTimeout(t, 1e3 / 60) }).call(window, t) }, o.Context = t }(), function () { "use strict"; function t(t, e) { return t.triggerPoint - e.triggerPoint } function e(t, e) { return e.triggerPoint - t.triggerPoint } function i(t) { this.name = t.name, this.axis = t.axis, this.id = this.name + "-" + this.axis, this.waypoints = [], this.clearTriggerQueues(), o[this.axis][this.name] = this } var o = { vertical: {}, horizontal: {} }, s = window.Waypoint; i.prototype.add = function (t) { this.waypoints.push(t) }, i.prototype.clearTriggerQueues = function () { this.triggerQueues = { up: [], down: [], left: [], right: [] } }, i.prototype.flushTriggers = function () { for (var i in this.triggerQueues) { var o = this.triggerQueues[i], s = "up" === i || "left" === i; o.sort(s ? e : t); for (var n = 0, r = o.length; r > n; n += 1) { var a = o[n]; (a.options.continuous || n === o.length - 1) && a.trigger([i]) } } this.clearTriggerQueues() }, i.prototype.next = function (e) { this.waypoints.sort(t); var i = s.Adapter.inArray(e, this.waypoints); return i === this.waypoints.length - 1 ? null : this.waypoints[i + 1] }, i.prototype.previous = function (e) { this.waypoints.sort(t); var i = s.Adapter.inArray(e, this.waypoints); return i ? this.waypoints[i - 1] : null }, i.prototype.queueTrigger = function (t, e) { this.triggerQueues[e].push(t) }, i.prototype.remove = function (t) { var e = s.Adapter.inArray(t, this.waypoints); e > -1 && this.waypoints.splice(e, 1) }, i.prototype.first = function () { return this.waypoints[0] }, i.prototype.last = function () { return this.waypoints[this.waypoints.length - 1] }, i.findOrCreate = function (t) { return o[t.axis][t.name] || new i(t) }, s.Group = i }(), function () { "use strict"; function t(t) { this.$element = e(t) } var e = window.jQuery, i = window.Waypoint; e.each(["innerHeight", "innerWidth", "off", "offset", "on", "outerHeight", "outerWidth", "scrollLeft", "scrollTop"], function (e, i) { t.prototype[i] = function () { var t = Array.prototype.slice.call(arguments); return this.$element[i].apply(this.$element, t) } }), e.each(["extend", "inArray", "isEmptyObject"], function (i, o) { t[o] = e[o] }), i.adapters.push({ name: "jquery", Adapter: t }), i.Adapter = t }(), function () { "use strict"; function t(t) { return function () { var i = [], o = arguments[0]; return t.isFunction(arguments[0]) && (o = t.extend({}, arguments[1]), o.handler = arguments[0]), this.each(function () { var s = t.extend({}, o, { element: this }); "string" == typeof s.context && (s.context = t(this).closest(s.context)[0]), i.push(new e(s)) }), i } } var e = window.Waypoint; window.jQuery && (window.jQuery.fn.waypoint = t(window.jQuery)), window.Zepto && (window.Zepto.fn.waypoint = t(window.Zepto)) }(), function (t) { t.fn.hoverIntent = function (e, i, o) { var s = { interval: 100, sensitivity: 7, timeout: 0 }; s = "object" == typeof e ? t.extend(s, e) : t.isFunction(i) ? t.extend(s, { over: e, out: i, selector: o }) : t.extend(s, { over: e, out: e, selector: i }); var n, r, a, h, l = function (t) { n = t.pageX, r = t.pageY }, p = function (e, i) { if (i.hoverIntent_t = clearTimeout(i.hoverIntent_t), Math.abs(a - n) + Math.abs(h - r) < s.sensitivity) return t(i).off("mousemove.hoverIntent", l), i.hoverIntent_s = 1, s.over.apply(i, [e]); a = n, h = r, i.hoverIntent_t = setTimeout(function () { p(e, i) }, s.interval) }, c = function (e) { var i = jQuery.extend({}, e), o = this; o.hoverIntent_t && (o.hoverIntent_t = clearTimeout(o.hoverIntent_t)), "mouseenter" == e.type ? (a = i.pageX, h = i.pageY, t(o).on("mousemove.hoverIntent", l), 1 != o.hoverIntent_s && (o.hoverIntent_t = setTimeout(function () { p(i, o) }, s.interval))) : (t(o).off("mousemove.hoverIntent", l), 1 == o.hoverIntent_s && (o.hoverIntent_t = setTimeout(function () { !function (t, e) { e.hoverIntent_t = clearTimeout(e.hoverIntent_t), e.hoverIntent_s = 0, s.out.apply(e, [t]) }(i, o) }, s.timeout))) }; return this.on({ "mouseenter.hoverIntent": c, "mouseleave.hoverIntent": c }, s.selector) } }(jQuery), function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof module && module.exports ? module.exports = function (e, i) { return void 0 === i && (i = "undefined" != typeof window ? require("jquery") : require("jquery")(e)), t(i), i } : t(jQuery) }(function (t) { "use strict"; var e = 0; t.fn.TouchSpin = function (i) { var o = { min: 0, max: 100, initval: "", replacementval: "", step: 1, decimals: 0, stepinterval: 100, forcestepdivisibility: "round", stepintervaldelay: 500, verticalbuttons: !1, verticalup: "+", verticaldown: "-", verticalupclass: "", verticaldownclass: "", prefix: "", postfix: "", prefix_extraclass: "", postfix_extraclass: "", booster: !0, boostat: 10, maxboostedstep: !1, mousewheel: !0, buttondown_class: "btn btn-primary", buttonup_class: "btn btn-primary", buttondown_txt: "-", buttonup_txt: "+", callback_before_calculation: function (t) { return t }, callback_after_calculation: function (t) { return t } }, s = { min: "min", max: "max", initval: "init-val", replacementval: "replacement-val", step: "step", decimals: "decimals", stepinterval: "step-interval", verticalbuttons: "vertical-buttons", verticalupclass: "vertical-up-class", verticaldownclass: "vertical-down-class", forcestepdivisibility: "force-step-divisibility", stepintervaldelay: "step-interval-delay", prefix: "prefix", postfix: "postfix", prefix_extraclass: "prefix-extra-class", postfix_extraclass: "postfix-extra-class", booster: "booster", boostat: "boostat", maxboostedstep: "max-boosted-step", mousewheel: "mouse-wheel", buttondown_class: "button-down-class", buttonup_class: "button-up-class", buttondown_txt: "button-down-txt", buttonup_txt: "button-up-txt" }; return this.each(function () { function n() { "" === u.prefix && (m = w.prefix.detach()), "" === u.postfix && (f = w.postfix.detach()) } function r() { var t, e, i; "" !== (t = u.callback_before_calculation(_.val())) ? 0 < u.decimals && "." === t || (e = parseFloat(t), isNaN(e) && (e = "" !== u.replacementval ? u.replacementval : 0), (i = e).toString() !== t && (i = e), null !== u.min && e < u.min && (i = u.min), null !== u.max && e > u.max && (i = u.max), i = function (t) { switch (u.forcestepdivisibility) { case "round": return (Math.round(t / u.step) * u.step).toFixed(u.decimals); case "floor": return (Math.floor(t / u.step) * u.step).toFixed(u.decimals); case "ceil": return (Math.ceil(t / u.step) * u.step).toFixed(u.decimals); default: return t } }(i), Number(t).toString() !== i.toString() && (_.val(i), _.trigger("change"))) : "" !== u.replacementval && (_.val(u.replacementval), _.trigger("change")) } function a() { if (u.booster) { var t = Math.pow(2, Math.floor(T / u.boostat)) * u.step; return u.maxboostedstep && t > u.maxboostedstep && (t = u.maxboostedstep, v = Math.round(v / t) * t), Math.max(u.step, t) } return u.step } function h() { r(), v = parseFloat(u.callback_before_calculation(w.input.val())), isNaN(v) && (v = 0); var t = v, e = a(); v += e, null !== u.max && v > u.max && (v = u.max, _.trigger("touchspin.on.max"), d()), w.input.val(u.callback_after_calculation(Number(v).toFixed(u.decimals))), t !== v && _.trigger("change") } function l() { r(), v = parseFloat(u.callback_before_calculation(w.input.val())), isNaN(v) && (v = 0); var t = v, e = a(); v -= e, null !== u.min && v < u.min && (v = u.min, _.trigger("touchspin.on.min"), d()), w.input.val(u.callback_after_calculation(Number(v).toFixed(u.decimals))), t !== v && _.trigger("change") } function p() { d(), T = 0, W = "down", _.trigger("touchspin.on.startspin"), _.trigger("touchspin.on.startdownspin"), x = setTimeout(function () { y = setInterval(function () { T++, l() }, u.stepinterval) }, u.stepintervaldelay) } function c() { d(), T = 0, W = "up", _.trigger("touchspin.on.startspin"), _.trigger("touchspin.on.startupspin"), b = setTimeout(function () { z = setInterval(function () { T++, h() }, u.stepinterval) }, u.stepintervaldelay) } function d() { switch (clearTimeout(x), clearTimeout(b), clearInterval(y), clearInterval(z), W) { case "up": _.trigger("touchspin.on.stopupspin"), _.trigger("touchspin.on.stopspin"); break; case "down": _.trigger("touchspin.on.stopdownspin"), _.trigger("touchspin.on.stopspin") }T = 0, W = !1 } var u, m, f, g, w, v, y, z, x, b, _ = t(this), C = _.data(), T = 0, W = !1; !function () { if (!_.data("alreadyinitialized")) { if (_.data("alreadyinitialized", !0), e += 1, _.data("spinnerid", e), !_.is("input")) return console.log("Must be an input."); "" !== (u = t.extend({}, o, C, (a = {}, t.each(s, function (t, e) { var i = "bts-" + e; _.is("[data-" + i + "]") && (a[t] = _.data(i)) }), a), i)).initval && "" === _.val() && _.val(u.initval), r(), function () { var e = _.val(), i = _.parent(); "" !== e && (e = u.callback_after_calculation(Number(e).toFixed(u.decimals))), _.data("initvalue", e).val(e), _.addClass("form-control"), i.hasClass("input-group") ? function (e) { e.addClass("bootstrap-touchspin"); var i, o, s = _.prev(), n = _.next(), r = '' + u.prefix + "", a = '' + u.postfix + ""; s.hasClass("input-group-btn") || s.hasClass("input-group-prepend") ? (i = '", s.append(i)) : (i = '", t(i).insertBefore(_)), n.hasClass("input-group-btn") || n.hasClass("input-group-append") ? (o = '", n.prepend(o)) : (o = '", t(o).insertAfter(_)), t(r).insertBefore(_), t(a).insertAfter(_), g = e }(i) : function () { var e, i = ""; _.hasClass("input-sm") && (i = "input-group-sm"), _.hasClass("input-lg") && (i = "input-group-lg"), e = u.verticalbuttons ? '
' + u.prefix + '' + u.postfix + '
" : '
' + u.prefix + '' + u.postfix + '
", g = t(e).insertBefore(_), t(".bootstrap-touchspin-prefix", g).after(_), _.hasClass("input-sm") ? g.addClass("input-group-sm") : _.hasClass("input-lg") && g.addClass("input-group-lg") }() }(), w = { down: t(".bootstrap-touchspin-down", g), up: t(".bootstrap-touchspin-up", g), input: t("input", g), prefix: t(".bootstrap-touchspin-prefix", g).addClass(u.prefix_extraclass), postfix: t(".bootstrap-touchspin-postfix", g).addClass(u.postfix_extraclass) }, n(), _.on("keydown.touchspin", function (t) { var e = t.keyCode || t.which; 38 === e ? ("up" !== W && (h(), c()), t.preventDefault()) : 40 === e && ("down" !== W && (l(), p()), t.preventDefault()) }), _.on("keyup.touchspin", function (t) { var e = t.keyCode || t.which; 38 === e ? d() : 40 === e && d() }), _.on("blur.touchspin", function () { r(), _.val(u.callback_after_calculation(_.val())) }), w.down.on("keydown", function (t) { var e = t.keyCode || t.which; 32 !== e && 13 !== e || ("down" !== W && (l(), p()), t.preventDefault()) }), w.down.on("keyup.touchspin", function (t) { var e = t.keyCode || t.which; 32 !== e && 13 !== e || d() }), w.up.on("keydown.touchspin", function (t) { var e = t.keyCode || t.which; 32 !== e && 13 !== e || ("up" !== W && (h(), c()), t.preventDefault()) }), w.up.on("keyup.touchspin", function (t) { var e = t.keyCode || t.which; 32 !== e && 13 !== e || d() }), w.down.on("mousedown.touchspin", function (t) { w.down.off("touchstart.touchspin"), _.is(":disabled") || (l(), p(), t.preventDefault(), t.stopPropagation()) }), w.down.on("touchstart.touchspin", function (t) { w.down.off("mousedown.touchspin"), _.is(":disabled") || (l(), p(), t.preventDefault(), t.stopPropagation()) }), w.up.on("mousedown.touchspin", function (t) { w.up.off("touchstart.touchspin"), _.is(":disabled") || (h(), c(), t.preventDefault(), t.stopPropagation()) }), w.up.on("touchstart.touchspin", function (t) { w.up.off("mousedown.touchspin"), _.is(":disabled") || (h(), c(), t.preventDefault(), t.stopPropagation()) }), w.up.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin", function (t) { W && (t.stopPropagation(), d()) }), w.down.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin", function (t) { W && (t.stopPropagation(), d()) }), w.down.on("mousemove.touchspin touchmove.touchspin", function (t) { W && (t.stopPropagation(), t.preventDefault()) }), w.up.on("mousemove.touchspin touchmove.touchspin", function (t) { W && (t.stopPropagation(), t.preventDefault()) }), _.on("mousewheel.touchspin DOMMouseScroll.touchspin", function (t) { if (u.mousewheel && _.is(":focus")) { var e = t.originalEvent.wheelDelta || -t.originalEvent.deltaY || -t.originalEvent.detail; t.stopPropagation(), t.preventDefault(), e < 0 ? l() : h() } }), _.on("touchspin.destroy", function () { var e; e = _.parent(), d(), _.off(".touchspin"), e.hasClass("bootstrap-touchspin-injected") ? (_.siblings().remove(), _.unwrap()) : (t(".bootstrap-touchspin-injected", e).remove(), e.removeClass("bootstrap-touchspin")), _.data("alreadyinitialized", !1) }), _.on("touchspin.uponce", function () { d(), h() }), _.on("touchspin.downonce", function () { d(), l() }), _.on("touchspin.startupspin", function () { c() }), _.on("touchspin.startdownspin", function () { p() }), _.on("touchspin.stopspin", function () { d() }), _.on("touchspin.updatesettings", function (e, i) { !function (e) { (function (e) { if (u = t.extend({}, u, e), e.postfix) { 0 === _.parent().find(".bootstrap-touchspin-postfix").length && f.insertAfter(_), _.parent().find(".bootstrap-touchspin-postfix .input-group-text").text(e.postfix) } if (e.prefix) { 0 === _.parent().find(".bootstrap-touchspin-prefix").length && m.insertBefore(_), _.parent().find(".bootstrap-touchspin-prefix .input-group-text").text(e.prefix) } n() })(e), r(); var i = w.input.val(); "" !== i && (i = Number(u.callback_before_calculation(w.input.val())), w.input.val(u.callback_after_calculation(Number(i).toFixed(u.decimals)))) }(i) }); var a } }() }) } }), function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : t("object" == typeof exports ? require("jquery") : jQuery) }(function (t) { var e = function (i, o) { this.$element = t(i), this.options = t.extend({}, e.DEFAULTS, this.dataOptions(), o), this.init() }; e.DEFAULTS = { from: 0, to: 0, speed: 1e3, refreshInterval: 100, decimals: 0, formatter: function (t, e) { return t.toFixed(e.decimals) }, onUpdate: null, onComplete: null }, e.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 }, e.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") }, e = Object.keys(t); for (var i in e) { var o = e[i]; void 0 === t[o] && delete t[o] } return t }, e.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)) }, e.prototype.render = function () { var t = this.options.formatter.call(this.$element, this.value, this.options); this.$element.text(t) }, e.prototype.restart = function () { this.stop(), this.init(), this.start() }, e.prototype.start = function () { this.stop(), this.render(), this.interval = setInterval(this.update.bind(this), this.options.refreshInterval) }, e.prototype.stop = function () { this.interval && clearInterval(this.interval) }, e.prototype.toggle = function () { this.interval ? this.stop() : this.start() }, t.fn.countTo = function (i) { return this.each(function () { var o = t(this), s = o.data("countTo"), n = "object" == typeof i ? i : {}, r = "string" == typeof i ? i : "start"; (!s || "object" == typeof i) && (s && s.stop(), o.data("countTo", s = new e(this, n))), s[r].call(s) }) } }), function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : t("object" == typeof exports ? require("jquery") : window.jQuery || window.Zepto) }(function (t) { var e, i, o, s, n, r, a = "Close", h = "BeforeClose", l = "MarkupParse", p = "Open", c = "Change", d = "mfp", u = "." + d, m = "mfp-ready", f = "mfp-removing", g = "mfp-prevent-close", w = function () { }, v = !!window.jQuery, y = t(window), z = function (t, i) { e.ev.on(d + t + u, i) }, x = function (e, i, o, s) { var n = document.createElement("div"); return n.className = "mfp-" + e, o && (n.innerHTML = o), s ? i && i.appendChild(n) : (n = t(n), i && n.appendTo(i)), n }, b = function (i, o) { e.ev.triggerHandler(d + i, o), e.st.callbacks && (i = i.charAt(0).toLowerCase() + i.slice(1), e.st.callbacks[i] && e.st.callbacks[i].apply(e, t.isArray(o) ? o : [o])) }, _ = function (i) { return i === r && e.currTemplate.closeBtn || (e.currTemplate.closeBtn = t(e.st.closeMarkup.replace("%title%", e.st.tClose)), r = i), e.currTemplate.closeBtn }, C = function () { t.magnificPopup.instance || ((e = new w).init(), t.magnificPopup.instance = e) }; w.prototype = { constructor: w, init: function () { var i = navigator.appVersion; e.isLowIE = e.isIE8 = document.all && !document.addEventListener, e.isAndroid = /android/gi.test(i), e.isIOS = /iphone|ipad|ipod/gi.test(i), e.supportsTransition = function () { var t = document.createElement("p").style, e = ["ms", "O", "Moz", "Webkit"]; if (void 0 !== t.transition) return !0; for (; e.length;)if (e.pop() + "Transition" in t) return !0; return !1 }(), e.probablyMobile = e.isAndroid || e.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), o = t(document), e.popupsCache = {} }, open: function (i) { var s; if (!1 === i.isObj) { e.items = i.items.toArray(), e.index = 0; var r, a = i.items; for (s = 0; s < a.length; s++)if ((r = a[s]).parsed && (r = r.el[0]), r === i.el[0]) { e.index = s; break } } else e.items = t.isArray(i.items) ? i.items : [i.items], e.index = i.index || 0; { if (!e.isOpen) { e.types = [], n = "", i.mainEl && i.mainEl.length ? e.ev = i.mainEl.eq(0) : e.ev = o, i.key ? (e.popupsCache[i.key] || (e.popupsCache[i.key] = {}), e.currTemplate = e.popupsCache[i.key]) : e.currTemplate = {}, e.st = t.extend(!0, {}, t.magnificPopup.defaults, i), e.fixedContentPos = "auto" === e.st.fixedContentPos ? !e.probablyMobile : e.st.fixedContentPos, e.st.modal && (e.st.closeOnContentClick = !1, e.st.closeOnBgClick = !1, e.st.showCloseBtn = !1, e.st.enableEscapeKey = !1), e.bgOverlay || (e.bgOverlay = x("bg").on("click" + u, function () { e.close() }), e.wrap = x("wrap").attr("tabindex", -1).on("click" + u, function (t) { e._checkIfClose(t.target) && e.close() }), e.container = x("container", e.wrap)), e.contentContainer = x("content"), e.st.preloader && (e.preloader = x("preloader", e.container, e.st.tLoading)); var h = t.magnificPopup.modules; for (s = 0; s < h.length; s++) { var c = h[s]; c = c.charAt(0).toUpperCase() + c.slice(1), e["init" + c].call(e) } b("BeforeOpen"), e.st.showCloseBtn && (e.st.closeBtnInside ? (z(l, function (t, e, i, o) { i.close_replaceWith = _(o.type) }), n += " mfp-close-btn-in") : e.wrap.append(_())), e.st.alignTop && (n += " mfp-align-top"), e.fixedContentPos ? e.wrap.css({ overflow: e.st.overflowY, overflowX: "hidden", overflowY: e.st.overflowY }) : e.wrap.css({ top: y.scrollTop(), position: "absolute" }), (!1 === e.st.fixedBgPos || "auto" === e.st.fixedBgPos && !e.fixedContentPos) && e.bgOverlay.css({ height: o.height(), position: "absolute" }), e.st.enableEscapeKey && o.on("keyup" + u, function (t) { 27 === t.keyCode && e.close() }), y.on("resize" + u, function () { e.updateSize() }), e.st.closeOnContentClick || (n += " mfp-auto-cursor"), n && e.wrap.addClass(n); var d = e.wH = y.height(), f = {}; if (e.fixedContentPos && e._hasScrollBar(d)) { var g = e._getScrollbarSize(); g && (f.marginRight = g) } e.fixedContentPos && (e.isIE7 ? t("body, html").css("overflow", "hidden") : f.overflow = "hidden"); var w = e.st.mainClass; return e.isIE7 && (w += " mfp-ie7"), w && e._addClassToMFP(w), e.updateItemHTML(), b("BuildControls"), t("html").css(f), e.bgOverlay.add(e.wrap).prependTo(e.st.prependTo || t(document.body)), e._lastFocusedEl = document.activeElement, setTimeout(function () { e.content ? (e._addClassToMFP(m), e._setFocus()) : e.bgOverlay.addClass(m), o.on("focusin" + u, e._onFocusIn) }, 16), e.isOpen = !0, e.updateSize(d), b(p), i } e.updateItemHTML() } }, close: function () { e.isOpen && (b(h), e.isOpen = !1, e.st.removalDelay && !e.isLowIE && e.supportsTransition ? (e._addClassToMFP(f), setTimeout(function () { e._close() }, e.st.removalDelay)) : e._close()) }, _close: function () { b(a); var i = f + " " + m + " "; if (e.bgOverlay.detach(), e.wrap.detach(), e.container.empty(), e.st.mainClass && (i += e.st.mainClass + " "), e._removeClassFromMFP(i), e.fixedContentPos) { var s = { marginRight: "" }; e.isIE7 ? t("body, html").css("overflow", "") : s.overflow = "", t("html").css(s) } o.off("keyup.mfp focusin" + u), e.ev.off(u), e.wrap.attr("class", "mfp-wrap").removeAttr("style"), e.bgOverlay.attr("class", "mfp-bg"), e.container.attr("class", "mfp-container"), !e.st.showCloseBtn || e.st.closeBtnInside && !0 !== e.currTemplate[e.currItem.type] || e.currTemplate.closeBtn && e.currTemplate.closeBtn.detach(), e.st.autoFocusLast && e._lastFocusedEl && t(e._lastFocusedEl).focus(), e.currItem = null, e.content = null, e.currTemplate = null, e.prevHeight = 0, b("AfterClose") }, updateSize: function (t) { if (e.isIOS) { var i = document.documentElement.clientWidth / window.innerWidth, o = window.innerHeight * i; e.wrap.css("height", o), e.wH = o } else e.wH = t || y.height(); e.fixedContentPos || e.wrap.css("height", e.wH), b("Resize") }, updateItemHTML: function () { var i = e.items[e.index]; e.contentContainer.detach(), e.content && e.content.detach(), i.parsed || (i = e.parseEl(e.index)); var o = i.type; if (b("BeforeChange", [e.currItem ? e.currItem.type : "", o]), e.currItem = i, !e.currTemplate[o]) { var n = !!e.st[o] && e.st[o].markup; b("FirstMarkupParse", n), e.currTemplate[o] = !n || t(n) } s && s !== i.type && e.container.removeClass("mfp-" + s + "-holder"); var r = e["get" + o.charAt(0).toUpperCase() + o.slice(1)](i, e.currTemplate[o]); e.appendContent(r, o), i.preloaded = !0, b(c, i), s = i.type, e.container.prepend(e.contentContainer), b("AfterChange") }, appendContent: function (t, i) { e.content = t, t ? e.st.showCloseBtn && e.st.closeBtnInside && !0 === e.currTemplate[i] ? e.content.find(".mfp-close").length || e.content.append(_()) : e.content = t : e.content = "", b("BeforeAppend"), e.container.addClass("mfp-" + i + "-holder"), e.contentContainer.append(e.content) }, parseEl: function (i) { var o, s = e.items[i]; if (s.tagName ? s = { el: t(s) } : (o = s.type, s = { data: s, src: s.src }), s.el) { for (var n = e.types, r = 0; r < n.length; r++)if (s.el.hasClass("mfp-" + n[r])) { o = n[r]; break } s.src = s.el.attr("data-mfp-src"), s.src || (s.src = s.el.attr("href")) } return s.type = o || e.st.type || "inline", s.index = i, s.parsed = !0, e.items[i] = s, b("ElementParse", s), e.items[i] }, addGroup: function (t, i) { var o = function (o) { o.mfpEl = this, e._openClick(o, t, i) }; i || (i = {}); var s = "click.magnificPopup"; i.mainEl = t, i.items ? (i.isObj = !0, t.off(s).on(s, o)) : (i.isObj = !1, i.delegate ? t.off(s).on(s, i.delegate, o) : (i.items = t, t.off(s).on(s, o))) }, _openClick: function (i, o, s) { if ((void 0 !== s.midClick ? s.midClick : t.magnificPopup.defaults.midClick) || !(2 === i.which || i.ctrlKey || i.metaKey || i.altKey || i.shiftKey)) { var n = void 0 !== s.disableOn ? s.disableOn : t.magnificPopup.defaults.disableOn; if (n) if (t.isFunction(n)) { if (!n.call(e)) return !0 } else if (y.width() < n) return !0; i.type && (i.preventDefault(), e.isOpen && i.stopPropagation()), s.el = t(i.mfpEl), s.delegate && (s.items = o.find(s.delegate)), e.open(s) } }, updateStatus: function (t, o) { if (e.preloader) { i !== t && e.container.removeClass("mfp-s-" + i), o || "loading" !== t || (o = e.st.tLoading); var s = { status: t, text: o }; b("UpdateStatus", s), t = s.status, o = s.text, e.preloader.html(o), e.preloader.find("a").on("click", function (t) { t.stopImmediatePropagation() }), e.container.addClass("mfp-s-" + t), i = t } }, _checkIfClose: function (i) { if (!t(i).hasClass(g)) { var o = e.st.closeOnContentClick, s = e.st.closeOnBgClick; if (o && s) return !0; if (!e.content || t(i).hasClass("mfp-close") || e.preloader && i === e.preloader[0]) return !0; if (i === e.content[0] || t.contains(e.content[0], i)) { if (o) return !0 } else if (s && t.contains(document, i)) return !0; return !1 } }, _addClassToMFP: function (t) { e.bgOverlay.addClass(t), e.wrap.addClass(t) }, _removeClassFromMFP: function (t) { this.bgOverlay.removeClass(t), e.wrap.removeClass(t) }, _hasScrollBar: function (t) { return (e.isIE7 ? o.height() : document.body.scrollHeight) > (t || y.height()) }, _setFocus: function () { (e.st.focus ? e.content.find(e.st.focus).eq(0) : e.wrap).focus() }, _onFocusIn: function (i) { return i.target === e.wrap[0] || t.contains(e.wrap[0], i.target) ? void 0 : (e._setFocus(), !1) }, _parseMarkup: function (e, i, o) { var s; o.data && (i = t.extend(o.data, i)), b(l, [e, i, o]), t.each(i, function (i, o) { if (void 0 === o || !1 === o) return !0; if ((s = i.split("_")).length > 1) { var n = e.find(u + "-" + s[0]); if (n.length > 0) { var r = s[1]; "replaceWith" === r ? n[0] !== o[0] && n.replaceWith(o) : "img" === r ? n.is("img") ? n.attr("src", o) : n.replaceWith(t("").attr("src", o).attr("class", n.attr("class"))) : n.attr(s[1], o) } } else e.find(u + "-" + i).html(o) }) }, _getScrollbarSize: function () { if (void 0 === e.scrollbarSize) { var t = document.createElement("div"); t.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(t), e.scrollbarSize = t.offsetWidth - t.clientWidth, document.body.removeChild(t) } return e.scrollbarSize } }, t.magnificPopup = { instance: null, proto: w.prototype, modules: [], open: function (e, i) { return C(), e = e ? t.extend(!0, {}, e) : {}, e.isObj = !0, e.index = i || 0, this.instance.open(e) }, close: function () { return t.magnificPopup.instance && t.magnificPopup.instance.close() }, registerModule: function (e, i) { i.options && (t.magnificPopup.defaults[e] = i.options), t.extend(this.proto, i.proto), this.modules.push(e) }, defaults: { disableOn: 0, key: null, midClick: !1, mainClass: "", preloader: !0, focus: "", closeOnContentClick: !1, closeOnBgClick: !0, closeBtnInside: !0, showCloseBtn: !0, enableEscapeKey: !0, modal: !1, alignTop: !1, removalDelay: 0, prependTo: null, fixedContentPos: "auto", fixedBgPos: "auto", overflowY: "auto", closeMarkup: '', tClose: "Close (Esc)", tLoading: "", autoFocusLast: !0 } }, t.fn.magnificPopup = function (i) { C(); var o = t(this); if ("string" == typeof i) if ("open" === i) { var s, n = v ? o.data("magnificPopup") : o[0].magnificPopup, r = parseInt(arguments[1], 10) || 0; n.items ? s = n.items[r] : (s = o, n.delegate && (s = s.find(n.delegate)), s = s.eq(r)), e._openClick({ mfpEl: s }, o, n) } else e.isOpen && e[i].apply(e, Array.prototype.slice.call(arguments, 1)); else i = t.extend(!0, {}, i), v ? o.data("magnificPopup", i) : o[0].magnificPopup = i, e.addGroup(o, i); return o }; var T, W, S, k = "inline", L = function () { S && (W.after(S.addClass(T)).detach(), S = null) }; t.magnificPopup.registerModule(k, { options: { hiddenClass: "hide", markup: "", tNotFound: "Content not found" }, proto: { initInline: function () { e.types.push(k), z(a + "." + k, function () { L() }) }, getInline: function (i, o) { if (L(), i.src) { var s = e.st.inline, n = t(i.src); if (n.length) { var r = n[0].parentNode; r && r.tagName && (W || (T = s.hiddenClass, W = x(T), T = "mfp-" + T), S = n.after(W).detach().removeClass(T)), e.updateStatus("ready") } else e.updateStatus("error", s.tNotFound), n = t("
"); return i.inlineElement = n, n } return e.updateStatus("ready"), e._parseMarkup(o, {}, i), o } } }); var H, I = "ajax", $ = function () { H && t(document.body).removeClass(H) }, O = function () { $(), e.req && e.req.abort() }; t.magnificPopup.registerModule(I, { options: { settings: null, cursor: "mfp-ajax-cur", tError: 'The content could not be loaded.' }, proto: { initAjax: function () { e.types.push(I), H = e.st.ajax.cursor, z(a + "." + I, O), z("BeforeChange." + I, O) }, getAjax: function (i) { H && t(document.body).addClass(H), e.updateStatus("loading"); var o = t.extend({ url: i.src, success: function (o, s, n) { var r = { data: o, xhr: n }; b("ParseAjax", r), e.appendContent(t(r.data), I), i.finished = !0, $(), e._setFocus(), setTimeout(function () { e.wrap.addClass(m) }, 16), e.updateStatus("ready"), b("AjaxContentAdded") }, error: function () { $(), i.finished = i.loadError = !0, e.updateStatus("error", e.st.ajax.tError.replace("%url%", i.src)) } }, e.st.ajax.settings); return e.req = t.ajax(o), "" } } }); var P; t.magnificPopup.registerModule("image", { options: { markup: '
', cursor: "mfp-zoom-out-cur", titleSrc: "title", verticalFit: !0, tError: 'The image could not be loaded.' }, proto: { initImage: function () { var i = e.st.image, o = ".image"; e.types.push("image"), z(p + o, function () { "image" === e.currItem.type && i.cursor && t(document.body).addClass(i.cursor) }), z(a + o, function () { i.cursor && t(document.body).removeClass(i.cursor), y.off("resize" + u) }), z("Resize" + o, e.resizeImage), e.isLowIE && z("AfterChange", e.resizeImage) }, resizeImage: function () { var t = e.currItem; if (t && t.img && e.st.image.verticalFit) { var i = 0; e.isLowIE && (i = parseInt(t.img.css("padding-top"), 10) + parseInt(t.img.css("padding-bottom"), 10)), t.img.css("max-height", e.wH - i) } }, _onImageHasSize: function (t) { t.img && (t.hasSize = !0, P && clearInterval(P), t.isCheckingImgSize = !1, b("ImageHasSize", t), t.imgHidden && (e.content && e.content.removeClass("mfp-loading"), t.imgHidden = !1)) }, findImageSize: function (t) { var i = 0, o = t.img[0], s = function (n) { P && clearInterval(P), P = setInterval(function () { return o.naturalWidth > 0 ? void e._onImageHasSize(t) : (i > 200 && clearInterval(P), void (3 === ++i ? s(10) : 40 === i ? s(50) : 100 === i && s(500))) }, n) }; s(1) }, getImage: function (i, o) { var s = 0, n = function () { i && (i.img[0].complete ? (i.img.off(".mfploader"), i === e.currItem && (e._onImageHasSize(i), e.updateStatus("ready")), i.hasSize = !0, i.loaded = !0, b("ImageLoadComplete")) : 200 > ++s ? setTimeout(n, 100) : r()) }, r = function () { i && (i.img.off(".mfploader"), i === e.currItem && (e._onImageHasSize(i), e.updateStatus("error", a.tError.replace("%url%", i.src))), i.hasSize = !0, i.loaded = !0, i.loadError = !0) }, a = e.st.image, h = o.find(".mfp-img"); if (h.length) { var l = document.createElement("img"); l.className = "mfp-img", i.el && i.el.find("img").length && (l.alt = i.el.find("img").attr("alt")), i.img = t(l).on("load.mfploader", n).on("error.mfploader", r), l.src = i.src, h.is("img") && (i.img = i.img.clone()), (l = i.img[0]).naturalWidth > 0 ? i.hasSize = !0 : l.width || (i.hasSize = !1) } return e._parseMarkup(o, { title: function (i) { if (i.data && void 0 !== i.data.title) return i.data.title; var o = e.st.image.titleSrc; if (o) { if (t.isFunction(o)) return o.call(e, i); if (i.el) return i.el.attr(o) || "" } return "" }(i), img_replaceWith: i.img }, i), e.resizeImage(), i.hasSize ? (P && clearInterval(P), i.loadError ? (o.addClass("mfp-loading"), e.updateStatus("error", a.tError.replace("%url%", i.src))) : (o.removeClass("mfp-loading"), e.updateStatus("ready")), o) : (e.updateStatus("loading"), i.loading = !0, i.hasSize || (i.imgHidden = !0, o.addClass("mfp-loading"), e.findImageSize(i)), o) } } }); var E; t.magnificPopup.registerModule("zoom", { options: { enabled: !1, easing: "ease-in-out", duration: 300, opener: function (t) { return t.is("img") ? t : t.find("img") } }, proto: { initZoom: function () { var t, i = e.st.zoom, o = ".zoom"; if (i.enabled && e.supportsTransition) { var s, n, r = i.duration, l = function (t) { var e = t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"), o = "all " + i.duration / 1e3 + "s " + i.easing, s = { position: "fixed", zIndex: 9999, left: 0, top: 0, "-webkit-backface-visibility": "hidden" }, n = "transition"; return s["-webkit-" + n] = s["-moz-" + n] = s["-o-" + n] = s[n] = o, e.css(s), e }, p = function () { e.content.css("visibility", "visible") }; z("BuildControls" + o, function () { if (e._allowZoom()) { if (clearTimeout(s), e.content.css("visibility", "hidden"), !(t = e._getItemToZoom())) return void p(); (n = l(t)).css(e._getOffset()), e.wrap.append(n), s = setTimeout(function () { n.css(e._getOffset(!0)), s = setTimeout(function () { p(), setTimeout(function () { n.remove(), t = n = null, b("ZoomAnimationEnded") }, 16) }, r) }, 16) } }), z(h + o, function () { if (e._allowZoom()) { if (clearTimeout(s), e.st.removalDelay = r, !t) { if (!(t = e._getItemToZoom())) return; n = l(t) } n.css(e._getOffset(!0)), e.wrap.append(n), e.content.css("visibility", "hidden"), setTimeout(function () { n.css(e._getOffset()) }, 16) } }), z(a + o, function () { e._allowZoom() && (p(), n && n.remove(), t = null) }) } }, _allowZoom: function () { return "image" === e.currItem.type }, _getItemToZoom: function () { return !!e.currItem.hasSize && e.currItem.img }, _getOffset: function (i) { var o, s = (o = i ? e.currItem.img : e.st.zoom.opener(e.currItem.el || e.currItem)).offset(), n = parseInt(o.css("padding-top"), 10), r = parseInt(o.css("padding-bottom"), 10); s.top -= t(window).scrollTop() - n; var a = { width: o.width(), height: (v ? o.innerHeight() : o[0].offsetHeight) - r - n }; return void 0 === E && (E = void 0 !== document.createElement("p").style.MozTransform), E ? a["-moz-transform"] = a.transform = "translate(" + s.left + "px," + s.top + "px)" : (a.left = s.left, a.top = s.top), a } } }); var A = "iframe", M = function (t) { if (e.currTemplate[A]) { var i = e.currTemplate[A].find("iframe"); i.length && (t || (i[0].src = "//about:blank"), e.isIE8 && i.css("display", t ? "block" : "none")) } }; t.magnificPopup.registerModule(A, { options: { markup: '
', srcAction: "iframe_src", patterns: { youtube: { index: "youtube.com", id: "v=", src: "//www.youtube.com/embed/%id%?autoplay=1" }, vimeo: { index: "vimeo.com/", id: "/", src: "//player.vimeo.com/video/%id%?autoplay=1" }, gmaps: { index: "//maps.google.", src: "%id%&output=embed" } } }, proto: { initIframe: function () { e.types.push(A), z("BeforeChange", function (t, e, i) { e !== i && (e === A ? M() : i === A && M(!0)) }), z(a + "." + A, function () { M() }) }, getIframe: function (i, o) { var s = i.src, n = e.st.iframe; t.each(n.patterns, function () { return s.indexOf(this.index) > -1 ? (this.id && (s = "string" == typeof this.id ? s.substr(s.lastIndexOf(this.id) + this.id.length, s.length) : this.id.call(this, s)), s = this.src.replace("%id%", s), !1) : void 0 }); var r = {}; return n.srcAction && (r[n.srcAction] = s), e._parseMarkup(o, r, i), e.updateStatus("ready"), o } } }); var j = function (t) { var i = e.items.length; return t > i - 1 ? t - i : 0 > t ? i + t : t }, B = function (t, e, i) { return t.replace(/%curr%/gi, e + 1).replace(/%total%/gi, i) }; t.magnificPopup.registerModule("gallery", { options: { enabled: !1, arrowMarkup: '', preload: [0, 2], navigateByImgClick: !0, arrows: !0, tPrev: "Previous (Left arrow key)", tNext: "Next (Right arrow key)", tCounter: "%curr% of %total%" }, proto: { initGallery: function () { var i = e.st.gallery, s = ".mfp-gallery"; return e.direction = !0, !(!i || !i.enabled) && (n += " mfp-gallery", z(p + s, function () { i.navigateByImgClick && e.wrap.on("click" + s, ".mfp-img", function () { return e.items.length > 1 ? (e.next(), !1) : void 0 }), o.on("keydown" + s, function (t) { 37 === t.keyCode ? e.prev() : 39 === t.keyCode && e.next() }) }), z("UpdateStatus" + s, function (t, i) { i.text && (i.text = B(i.text, e.currItem.index, e.items.length)) }), z(l + s, function (t, o, s, n) { var r = e.items.length; s.counter = r > 1 ? B(i.tCounter, n.index, r) : "" }), z("BuildControls" + s, function () { if (e.items.length > 1 && i.arrows && !e.arrowLeft) { var o = i.arrowMarkup, s = e.arrowLeft = t(o.replace(/%title%/gi, i.tPrev).replace(/%dir%/gi, "left")).addClass(g), n = e.arrowRight = t(o.replace(/%title%/gi, i.tNext).replace(/%dir%/gi, "right")).addClass(g); s.click(function () { e.prev() }), n.click(function () { e.next() }), e.container.append(s.add(n)) } }), z(c + s, function () { e._preloadTimeout && clearTimeout(e._preloadTimeout), e._preloadTimeout = setTimeout(function () { e.preloadNearbyImages(), e._preloadTimeout = null }, 16) }), void z(a + s, function () { o.off(s), e.wrap.off("click" + s), e.arrowRight = e.arrowLeft = null })) }, next: function () { e.direction = !0, e.index = j(e.index + 1), e.updateItemHTML() }, prev: function () { e.direction = !1, e.index = j(e.index - 1), e.updateItemHTML() }, goTo: function (t) { e.direction = t >= e.index, e.index = t, e.updateItemHTML() }, preloadNearbyImages: function () { var t, i = e.st.gallery.preload, o = Math.min(i[0], e.items.length), s = Math.min(i[1], e.items.length); for (t = 1; t <= (e.direction ? s : o); t++)e._preloadItem(e.index + t); for (t = 1; t <= (e.direction ? o : s); t++)e._preloadItem(e.index - t) }, _preloadItem: function (i) { if (i = j(i), !e.items[i].preloaded) { var o = e.items[i]; o.parsed || (o = e.parseEl(i)), b("LazyLoad", o), "image" === o.type && (o.img = t('').on("load.mfploader", function () { o.hasSize = !0 }).on("error.mfploader", function () { o.hasSize = !0, o.loadError = !0, b("LazyLoadError", o) }).attr("src", o.src)), o.preloaded = !0 } } } }); var D = "retina"; t.magnificPopup.registerModule(D, { options: { replaceSrc: function (t) { return t.src.replace(/\.\w+$/, function (t) { return "@2x" + t }) }, ratio: 1 }, proto: { initRetina: function () { if (window.devicePixelRatio > 1) { var t = e.st.retina, i = t.ratio; (i = isNaN(i) ? i() : i) > 1 && (z("ImageHasSize." + D, function (t, e) { e.img.css({ "max-width": e.img[0].naturalWidth / i, width: "100%" }) }), z("ElementParse." + D, function (e, o) { o.src = t.replaceSrc(o, i) })) } } } }), C() }), function (t, e, i, o) { function s(e, i) { this.settings = null, this.options = t.extend({}, s.Defaults, i), this.$element = t(e), this._handlers = {}, this._plugins = {}, this._supress = {}, this._current = null, this._speed = null, this._coordinates = [], this._breakpoint = null, this._width = null, this._items = [], this._clones = [], this._mergers = [], this._widths = [], this._invalidated = {}, this._pipe = [], this._drag = { time: null, target: null, pointer: null, stage: { start: null, current: null }, direction: null }, this._states = { current: {}, tags: { initializing: ["busy"], animating: ["busy"], dragging: ["interacting"] } }, t.each(["onResize", "onThrottledResize"], t.proxy(function (e, i) { this._handlers[i] = t.proxy(this[i], this) }, this)), t.each(s.Plugins, t.proxy(function (t, e) { this._plugins[t.charAt(0).toLowerCase() + t.slice(1)] = new e(this) }, this)), t.each(s.Workers, t.proxy(function (e, i) { this._pipe.push({ filter: i.filter, run: t.proxy(i.run, this) }) }, this)), this.setup(), this.initialize() } s.Defaults = { items: 3, loop: !1, center: !1, rewind: !1, checkVisibility: !0, mouseDrag: !0, touchDrag: !0, pullDrag: !0, freeDrag: !1, margin: 0, stagePadding: 0, merge: !1, mergeFit: !0, autoWidth: !1, startPosition: 0, rtl: !1, smartSpeed: 250, fluidSpeed: !1, dragEndSpeed: !1, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: e, fallbackEasing: "swing", slideTransition: "", info: !1, nestedItemSelector: !1, itemElement: "div", stageElement: "div", refreshClass: "owl-refresh", loadedClass: "owl-loaded", loadingClass: "owl-loading", rtlClass: "owl-rtl", responsiveClass: "owl-responsive", dragClass: "owl-drag", itemClass: "owl-item", stageClass: "owl-stage", stageOuterClass: "owl-stage-outer", grabClass: "owl-grab" }, s.Width = { Default: "default", Inner: "inner", Outer: "outer" }, s.Type = { Event: "event", State: "state" }, s.Plugins = {}, s.Workers = [{ filter: ["width", "settings"], run: function () { this._width = this.$element.width() } }, { filter: ["width", "items", "settings"], run: function (t) { t.current = this._items && this._items[this.relative(this._current)] } }, { filter: ["items", "settings"], run: function () { this.$stage.children(".cloned").remove() } }, { filter: ["width", "items", "settings"], run: function (t) { var e = this.settings.margin || "", i = !this.settings.autoWidth, o = this.settings.rtl, s = { width: "auto", "margin-left": o ? e : "", "margin-right": o ? "" : e }; !i && this.$stage.children().css(s), t.css = s } }, { filter: ["width", "items", "settings"], run: function (t) { var e = (this.width() / this.settings.items).toFixed(3) - this.settings.margin, i = null, o = this._items.length, s = !this.settings.autoWidth, n = []; for (t.items = { merge: !1, width: e }; o--;)i = this._mergers[o], i = this.settings.mergeFit && Math.min(i, this.settings.items) || i, t.items.merge = i > 1 || t.items.merge, n[o] = s ? e * i : this._items[o].width(); this._widths = n } }, { filter: ["items", "settings"], run: function () { var e = [], i = this._items, o = this.settings, s = Math.max(2 * o.items, 4), n = 2 * Math.ceil(i.length / 2), r = o.loop && i.length ? o.rewind ? s : Math.max(s, n) : 0, a = "", h = ""; for (r /= 2; r > 0;)e.push(this.normalize(e.length / 2, !0)), a += i[e[e.length - 1]][0].outerHTML, e.push(this.normalize(i.length - 1 - (e.length - 1) / 2, !0)), h = i[e[e.length - 1]][0].outerHTML + h, r -= 1; this._clones = e, t(a).addClass("cloned").appendTo(this.$stage), t(h).addClass("cloned").prependTo(this.$stage) } }, { filter: ["width", "items", "settings"], run: function () { for (var t = this.settings.rtl ? 1 : -1, e = this._clones.length + this._items.length, i = -1, o = 0, s = 0, n = []; ++i < e;)o = n[i - 1] || 0, s = this._widths[this.relative(i)] + this.settings.margin, n.push(o + s * t); this._coordinates = n } }, { filter: ["width", "items", "settings"], run: function () { var t = this.settings.stagePadding, e = this._coordinates, i = { width: Math.ceil(Math.abs(e[e.length - 1])) + 2 * t, "padding-left": t || "", "padding-right": t || "" }; this.$stage.css(i) } }, { filter: ["width", "items", "settings"], run: function (t) { var e = this._coordinates.length, i = !this.settings.autoWidth, o = this.$stage.children(); if (i && t.items.merge) for (; e--;)t.css.width = this._widths[this.relative(e)], o.eq(e).css(t.css); else i && (t.css.width = t.items.width, o.css(t.css)) } }, { filter: ["items"], run: function () { this._coordinates.length < 1 && this.$stage.removeAttr("style") } }, { filter: ["width", "items", "settings"], run: function (t) { t.current = t.current ? this.$stage.children().index(t.current) : 0, t.current = Math.max(this.minimum(), Math.min(this.maximum(), t.current)), this.reset(t.current) } }, { filter: ["position"], run: function () { this.animate(this.coordinates(this._current)) } }, { filter: ["width", "position", "items", "settings"], run: function () { var t, e, i, o, s = this.settings.rtl ? 1 : -1, n = 2 * this.settings.stagePadding, r = this.coordinates(this.current()) + n, a = r + this.width() * s, h = []; for (i = 0, o = this._coordinates.length; i < o; i++)t = this._coordinates[i - 1] || 0, e = Math.abs(this._coordinates[i]) + n * s, (this.op(t, "<=", r) && this.op(t, ">", a) || this.op(e, "<", r) && this.op(e, ">", a)) && h.push(i); this.$stage.children(".active").removeClass("active"), this.$stage.children(":eq(" + h.join("), :eq(") + ")").addClass("active"), this.$stage.children(".center").removeClass("center"), this.settings.center && this.$stage.children().eq(this.current()).addClass("center") } }], s.prototype.initializeStage = function () { this.$stage = this.$element.find("." + this.settings.stageClass), this.$stage.length || (this.$element.addClass(this.options.loadingClass), this.$stage = t("<" + this.settings.stageElement + ">", { class: this.settings.stageClass }).wrap(t("
", { class: this.settings.stageOuterClass })), this.$element.append(this.$stage.parent())) }, s.prototype.initializeItems = function () { var e = this.$element.find(".owl-item"); if (e.length) return this._items = e.get().map(function (e) { return t(e) }), this._mergers = this._items.map(function () { return 1 }), void this.refresh(); this.replace(this.$element.children().not(this.$stage.parent())), this.isVisible() ? this.refresh() : this.invalidate("width"), this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass) }, s.prototype.initialize = function () { if (this.enter("initializing"), this.trigger("initialize"), this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl), this.settings.autoWidth && !this.is("pre-loading")) { var t, e, i; t = this.$element.find("img"), e = this.settings.nestedItemSelector ? "." + this.settings.nestedItemSelector : o, i = this.$element.children(e).width(), t.length && i <= 0 && this.preloadAutoWidthImages(t) } this.initializeStage(), this.initializeItems(), this.registerEventHandlers(), this.leave("initializing"), this.trigger("initialized") }, s.prototype.isVisible = function () { return !this.settings.checkVisibility || this.$element.is(":visible") }, s.prototype.setup = function () { var e = this.viewport(), i = this.options.responsive, o = -1, s = null; i ? (t.each(i, function (t) { t <= e && t > o && (o = Number(t)) }), "function" == typeof (s = t.extend({}, this.options, i[o])).stagePadding && (s.stagePadding = s.stagePadding()), delete s.responsive, s.responsiveClass && this.$element.attr("class", this.$element.attr("class").replace(new RegExp("(" + this.options.responsiveClass + "-)\\S+\\s", "g"), "$1" + o))) : s = t.extend({}, this.options), this.trigger("change", { property: { name: "settings", value: s } }), this._breakpoint = o, this.settings = s, this.invalidate("settings"), this.trigger("changed", { property: { name: "settings", value: this.settings } }) }, s.prototype.optionsLogic = function () { this.settings.autoWidth && (this.settings.stagePadding = !1, this.settings.merge = !1) }, s.prototype.prepare = function (e) { var i = this.trigger("prepare", { content: e }); return i.data || (i.data = t("<" + this.settings.itemElement + "/>").addClass(this.options.itemClass).append(e)), this.trigger("prepared", { content: i.data }), i.data }, s.prototype.update = function () { for (var e = 0, i = this._pipe.length, o = t.proxy(function (t) { return this[t] }, this._invalidated), s = {}; e < i;)(this._invalidated.all || t.grep(this._pipe[e].filter, o).length > 0) && this._pipe[e].run(s), e++; this._invalidated = {}, !this.is("valid") && this.enter("valid") }, s.prototype.width = function (t) { switch (t = t || s.Width.Default) { case s.Width.Inner: case s.Width.Outer: return this._width; default: return this._width - 2 * this.settings.stagePadding + this.settings.margin } }, s.prototype.refresh = function () { this.enter("refreshing"), this.trigger("refresh"), this.setup(), this.optionsLogic(), this.$element.addClass(this.options.refreshClass), this.update(), this.$element.removeClass(this.options.refreshClass), this.leave("refreshing"), this.trigger("refreshed") }, s.prototype.onThrottledResize = function () { e.clearTimeout(this.resizeTimer), this.resizeTimer = e.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate) }, s.prototype.onResize = function () { return !!this._items.length && this._width !== this.$element.width() && !!this.isVisible() && (this.enter("resizing"), this.trigger("resize").isDefaultPrevented() ? (this.leave("resizing"), !1) : (this.invalidate("width"), this.refresh(), this.leave("resizing"), void this.trigger("resized"))) }, s.prototype.registerEventHandlers = function () { t.support.transition && this.$stage.on(t.support.transition.end + ".owl.core", t.proxy(this.onTransitionEnd, this)), !1 !== this.settings.responsive && this.on(e, "resize", this._handlers.onThrottledResize), this.settings.mouseDrag && (this.$element.addClass(this.options.dragClass), this.$stage.on("mousedown.owl.core", t.proxy(this.onDragStart, this)), this.$stage.on("dragstart.owl.core selectstart.owl.core", function () { return !1 })), this.settings.touchDrag && (this.$stage.on("touchstart.owl.core", t.proxy(this.onDragStart, this)), this.$stage.on("touchcancel.owl.core", t.proxy(this.onDragEnd, this))) }, s.prototype.onDragStart = function (e) { var o = null; 3 !== e.which && (t.support.transform ? (o = this.$stage.css("transform").replace(/.*\(|\)| /g, "").split(","), o = { x: o[16 === o.length ? 12 : 4], y: o[16 === o.length ? 13 : 5] }) : (o = this.$stage.position(), o = { x: this.settings.rtl ? o.left + this.$stage.width() - this.width() + this.settings.margin : o.left, y: o.top }), this.is("animating") && (t.support.transform ? this.animate(o.x) : this.$stage.stop(), this.invalidate("position")), this.$element.toggleClass(this.options.grabClass, "mousedown" === e.type), this.speed(0), this._drag.time = (new Date).getTime(), this._drag.target = t(e.target), this._drag.stage.start = o, this._drag.stage.current = o, this._drag.pointer = this.pointer(e), t(i).on("mouseup.owl.core touchend.owl.core", t.proxy(this.onDragEnd, this)), t(i).one("mousemove.owl.core touchmove.owl.core", t.proxy(function (e) { var o = this.difference(this._drag.pointer, this.pointer(e)); t(i).on("mousemove.owl.core touchmove.owl.core", t.proxy(this.onDragMove, this)), Math.abs(o.x) < Math.abs(o.y) && this.is("valid") || (e.preventDefault(), this.enter("dragging"), this.trigger("drag")) }, this))) }, s.prototype.onDragMove = function (t) { var e = null, i = null, o = null, s = this.difference(this._drag.pointer, this.pointer(t)), n = this.difference(this._drag.stage.start, s); this.is("dragging") && (t.preventDefault(), this.settings.loop ? (e = this.coordinates(this.minimum()), i = this.coordinates(this.maximum() + 1) - e, n.x = ((n.x - e) % i + i) % i + e) : (e = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()), i = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()), o = this.settings.pullDrag ? -1 * s.x / 5 : 0, n.x = Math.max(Math.min(n.x, e + o), i + o)), this._drag.stage.current = n, this.animate(n.x)) }, s.prototype.onDragEnd = function (e) { var o = this.difference(this._drag.pointer, this.pointer(e)), s = this._drag.stage.current, n = o.x > 0 ^ this.settings.rtl ? "left" : "right"; t(i).off(".owl.core"), this.$element.removeClass(this.options.grabClass), (0 !== o.x && this.is("dragging") || !this.is("valid")) && (this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed), this.current(this.closest(s.x, 0 !== o.x ? n : this._drag.direction)), this.invalidate("position"), this.update(), this._drag.direction = n, (Math.abs(o.x) > 3 || (new Date).getTime() - this._drag.time > 300) && this._drag.target.one("click.owl.core", function () { return !1 })), this.is("dragging") && (this.leave("dragging"), this.trigger("dragged")) }, s.prototype.closest = function (e, i) { var s = -1, n = this.width(), r = this.coordinates(); return this.settings.freeDrag || t.each(r, t.proxy(function (t, a) { return "left" === i && e > a - 30 && e < a + 30 ? s = t : "right" === i && e > a - n - 30 && e < a - n + 30 ? s = t + 1 : this.op(e, "<", a) && this.op(e, ">", r[t + 1] !== o ? r[t + 1] : a - n) && (s = "left" === i ? t + 1 : t), -1 === s }, this)), this.settings.loop || (this.op(e, ">", r[this.minimum()]) ? s = e = this.minimum() : this.op(e, "<", r[this.maximum()]) && (s = e = this.maximum())), s }, s.prototype.animate = function (e) { var i = this.speed() > 0; this.is("animating") && this.onTransitionEnd(), i && (this.enter("animating"), this.trigger("translate")), t.support.transform3d && t.support.transition ? this.$stage.css({ transform: "translate3d(" + e + "px,0px,0px)", transition: this.speed() / 1e3 + "s" + (this.settings.slideTransition ? " " + this.settings.slideTransition : "") }) : i ? this.$stage.animate({ left: e + "px" }, this.speed(), this.settings.fallbackEasing, t.proxy(this.onTransitionEnd, this)) : this.$stage.css({ left: e + "px" }) }, s.prototype.is = function (t) { return this._states.current[t] && this._states.current[t] > 0 }, s.prototype.current = function (t) { if (t === o) return this._current; if (0 === this._items.length) return o; if (t = this.normalize(t), this._current !== t) { var e = this.trigger("change", { property: { name: "position", value: t } }); e.data !== o && (t = this.normalize(e.data)), this._current = t, this.invalidate("position"), this.trigger("changed", { property: { name: "position", value: this._current } }) } return this._current }, s.prototype.invalidate = function (e) { return "string" === t.type(e) && (this._invalidated[e] = !0, this.is("valid") && this.leave("valid")), t.map(this._invalidated, function (t, e) { return e }) }, s.prototype.reset = function (t) { (t = this.normalize(t)) !== o && (this._speed = 0, this._current = t, this.suppress(["translate", "translated"]), this.animate(this.coordinates(t)), this.release(["translate", "translated"])) }, s.prototype.normalize = function (t, e) { var i = this._items.length, s = e ? 0 : this._clones.length; return !this.isNumeric(t) || i < 1 ? t = o : (t < 0 || t >= i + s) && (t = ((t - s / 2) % i + i) % i + s / 2), t }, s.prototype.relative = function (t) { return t -= this._clones.length / 2, this.normalize(t, !0) }, s.prototype.maximum = function (t) { var e, i, o, s = this.settings, n = this._coordinates.length; if (s.loop) n = this._clones.length / 2 + this._items.length - 1; else if (s.autoWidth || s.merge) { if (e = this._items.length) for (i = this._items[--e].width(), o = this.$element.width(); e-- && !((i += this._items[e].width() + this.settings.margin) > o);); n = e + 1 } else n = s.center ? this._items.length - 1 : this._items.length - s.items; return t && (n -= this._clones.length / 2), Math.max(n, 0) }, s.prototype.minimum = function (t) { return t ? 0 : this._clones.length / 2 }, s.prototype.items = function (t) { return t === o ? this._items.slice() : (t = this.normalize(t, !0), this._items[t]) }, s.prototype.mergers = function (t) { return t === o ? this._mergers.slice() : (t = this.normalize(t, !0), this._mergers[t]) }, s.prototype.clones = function (e) { var i = this._clones.length / 2, s = i + this._items.length, n = function (t) { return t % 2 == 0 ? s + t / 2 : i - (t + 1) / 2 }; return e === o ? t.map(this._clones, function (t, e) { return n(e) }) : t.map(this._clones, function (t, i) { return t === e ? n(i) : null }) }, s.prototype.speed = function (t) { return t !== o && (this._speed = t), this._speed }, s.prototype.coordinates = function (e) { var i, s = 1, n = e - 1; return e === o ? t.map(this._coordinates, t.proxy(function (t, e) { return this.coordinates(e) }, this)) : (this.settings.center ? (this.settings.rtl && (s = -1, n = e + 1), i = this._coordinates[e], i += (this.width() - i + (this._coordinates[n] || 0)) / 2 * s) : i = this._coordinates[n] || 0, i = Math.ceil(i)) }, s.prototype.duration = function (t, e, i) { return 0 === i ? 0 : Math.min(Math.max(Math.abs(e - t), 1), 6) * Math.abs(i || this.settings.smartSpeed) }, s.prototype.to = function (t, e) { var i = this.current(), o = null, s = t - this.relative(i), n = (s > 0) - (s < 0), r = this._items.length, a = this.minimum(), h = this.maximum(); this.settings.loop ? (!this.settings.rewind && Math.abs(s) > r / 2 && (s += -1 * n * r), t = i + s, (o = ((t - a) % r + r) % r + a) !== t && o - s <= h && o - s > 0 && (i = o - s, t = o, this.reset(i))) : this.settings.rewind ? (h += 1, t = (t % h + h) % h) : t = Math.max(a, Math.min(h, t)), this.speed(this.duration(i, t, e)), this.current(t), this.isVisible() && this.update() }, s.prototype.next = function (t) { t = t || !1, this.to(this.relative(this.current()) + 1, t) }, s.prototype.prev = function (t) { t = t || !1, this.to(this.relative(this.current()) - 1, t) }, s.prototype.onTransitionEnd = function (t) { if (t !== o && (t.stopPropagation(), (t.target || t.srcElement || t.originalTarget) !== this.$stage.get(0))) return !1; this.leave("animating"), this.trigger("translated") }, s.prototype.viewport = function () { var o; return this.options.responsiveBaseElement !== e ? o = t(this.options.responsiveBaseElement).width() : e.innerWidth ? o = e.innerWidth : i.documentElement && i.documentElement.clientWidth ? o = i.documentElement.clientWidth : console.warn("Can not detect viewport width."), o }, s.prototype.replace = function (e) { this.$stage.empty(), this._items = [], e && (e = e instanceof jQuery ? e : t(e)), this.settings.nestedItemSelector && (e = e.find("." + this.settings.nestedItemSelector)), e.filter(function () { return 1 === this.nodeType }).each(t.proxy(function (t, e) { e = this.prepare(e), this.$stage.append(e), this._items.push(e), this._mergers.push(1 * e.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1) }, this)), this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0), this.invalidate("items") }, s.prototype.add = function (e, i) { var s = this.relative(this._current); i = i === o ? this._items.length : this.normalize(i, !0), e = e instanceof jQuery ? e : t(e), this.trigger("add", { content: e, position: i }), e = this.prepare(e), 0 === this._items.length || i === this._items.length ? (0 === this._items.length && this.$stage.append(e), 0 !== this._items.length && this._items[i - 1].after(e), this._items.push(e), this._mergers.push(1 * e.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)) : (this._items[i].before(e), this._items.splice(i, 0, e), this._mergers.splice(i, 0, 1 * e.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)), this._items[s] && this.reset(this._items[s].index()), this.invalidate("items"), this.trigger("added", { content: e, position: i }) }, s.prototype.remove = function (t) { (t = this.normalize(t, !0)) !== o && (this.trigger("remove", { content: this._items[t], position: t }), this._items[t].remove(), this._items.splice(t, 1), this._mergers.splice(t, 1), this.invalidate("items"), this.trigger("removed", { content: null, position: t })) }, s.prototype.preloadAutoWidthImages = function (e) { e.each(t.proxy(function (e, i) { this.enter("pre-loading"), i = t(i), t(new Image).one("load", t.proxy(function (t) { i.attr("src", t.target.src), i.css("opacity", 1), this.leave("pre-loading"), !this.is("pre-loading") && !this.is("initializing") && this.refresh() }, this)).attr("src", i.attr("src") || i.attr("data-src") || i.attr("data-src-retina")) }, this)) }, s.prototype.destroy = function () { this.$element.off(".owl.core"), this.$stage.off(".owl.core"), t(i).off(".owl.core"), !1 !== this.settings.responsive && (e.clearTimeout(this.resizeTimer), this.off(e, "resize", this._handlers.onThrottledResize)); for (var o in this._plugins) this._plugins[o].destroy(); this.$stage.children(".cloned").remove(), this.$stage.unwrap(), this.$stage.children().contents().unwrap(), this.$stage.children().unwrap(), this.$stage.remove(), this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class", this.$element.attr("class").replace(new RegExp(this.options.responsiveClass + "-\\S+\\s", "g"), "")).removeData("owl.carousel") }, s.prototype.op = function (t, e, i) { var o = this.settings.rtl; switch (e) { case "<": return o ? t > i : t < i; case ">": return o ? t < i : t > i; case ">=": return o ? t <= i : t >= i; case "<=": return o ? t >= i : t <= i } }, s.prototype.on = function (t, e, i, o) { t.addEventListener ? t.addEventListener(e, i, o) : t.attachEvent && t.attachEvent("on" + e, i) }, s.prototype.off = function (t, e, i, o) { t.removeEventListener ? t.removeEventListener(e, i, o) : t.detachEvent && t.detachEvent("on" + e, i) }, s.prototype.trigger = function (e, i, o, n, r) { var a = { item: { count: this._items.length, index: this.current() } }, h = t.camelCase(t.grep(["on", e, o], function (t) { return t }).join("-").toLowerCase()), l = t.Event([e, "owl", o || "carousel"].join(".").toLowerCase(), t.extend({ relatedTarget: this }, a, i)); return this._supress[e] || (t.each(this._plugins, function (t, e) { e.onTrigger && e.onTrigger(l) }), this.register({ type: s.Type.Event, name: e }), this.$element.trigger(l), this.settings && "function" == typeof this.settings[h] && this.settings[h].call(this, l)), l }, s.prototype.enter = function (e) { t.each([e].concat(this._states.tags[e] || []), t.proxy(function (t, e) { this._states.current[e] === o && (this._states.current[e] = 0), this._states.current[e]++ }, this)) }, s.prototype.leave = function (e) { t.each([e].concat(this._states.tags[e] || []), t.proxy(function (t, e) { this._states.current[e]-- }, this)) }, s.prototype.register = function (e) { if (e.type === s.Type.Event) { if (t.event.special[e.name] || (t.event.special[e.name] = {}), !t.event.special[e.name].owl) { var i = t.event.special[e.name]._default; t.event.special[e.name]._default = function (t) { return !i || !i.apply || t.namespace && -1 !== t.namespace.indexOf("owl") ? t.namespace && t.namespace.indexOf("owl") > -1 : i.apply(this, arguments) }, t.event.special[e.name].owl = !0 } } else e.type === s.Type.State && (this._states.tags[e.name] ? this._states.tags[e.name] = this._states.tags[e.name].concat(e.tags) : this._states.tags[e.name] = e.tags, this._states.tags[e.name] = t.grep(this._states.tags[e.name], t.proxy(function (i, o) { return t.inArray(i, this._states.tags[e.name]) === o }, this))) }, s.prototype.suppress = function (e) { t.each(e, t.proxy(function (t, e) { this._supress[e] = !0 }, this)) }, s.prototype.release = function (e) { t.each(e, t.proxy(function (t, e) { delete this._supress[e] }, this)) }, s.prototype.pointer = function (t) { var i = { x: null, y: null }; return t = t.originalEvent || t || e.event, (t = t.touches && t.touches.length ? t.touches[0] : t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t).pageX ? (i.x = t.pageX, i.y = t.pageY) : (i.x = t.clientX, i.y = t.clientY), i }, s.prototype.isNumeric = function (t) { return !isNaN(parseFloat(t)) }, s.prototype.difference = function (t, e) { return { x: t.x - e.x, y: t.y - e.y } }, t.fn.owlCarousel = function (e) { var i = Array.prototype.slice.call(arguments, 1); return this.each(function () { var o = t(this), n = o.data("owl.carousel"); n || (n = new s(this, "object" == typeof e && e), o.data("owl.carousel", n), t.each(["next", "prev", "to", "destroy", "refresh", "replace", "add", "remove"], function (e, i) { n.register({ type: s.Type.Event, name: i }), n.$element.on(i + ".owl.carousel.core", t.proxy(function (t) { t.namespace && t.relatedTarget !== this && (this.suppress([i]), n[i].apply(this, [].slice.call(arguments, 1)), this.release([i])) }, n)) })), "string" == typeof e && "_" !== e.charAt(0) && n[e].apply(n, i) }) }, t.fn.owlCarousel.Constructor = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { var s = function (e) { this._core = e, this._interval = null, this._visible = null, this._handlers = { "initialized.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.autoRefresh && this.watch() }, this) }, this._core.options = t.extend({}, s.Defaults, this._core.options), this._core.$element.on(this._handlers) }; s.Defaults = { autoRefresh: !0, autoRefreshInterval: 500 }, s.prototype.watch = function () { this._interval || (this._visible = this._core.isVisible(), this._interval = e.setInterval(t.proxy(this.refresh, this), this._core.settings.autoRefreshInterval)) }, s.prototype.refresh = function () { this._core.isVisible() !== this._visible && (this._visible = !this._visible, this._core.$element.toggleClass("owl-hidden", !this._visible), this._visible && this._core.invalidate("width") && this._core.refresh()) }, s.prototype.destroy = function () { var t, i; e.clearInterval(this._interval); for (t in this._handlers) this._core.$element.off(t, this._handlers[t]); for (i in Object.getOwnPropertyNames(this)) "function" != typeof this[i] && (this[i] = null) }, t.fn.owlCarousel.Constructor.Plugins.AutoRefresh = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { var s = function (e) { this._core = e, this._loaded = [], this._handlers = { "initialized.owl.carousel change.owl.carousel resized.owl.carousel": t.proxy(function (e) { if (e.namespace && this._core.settings && this._core.settings.lazyLoad && (e.property && "position" == e.property.name || "initialized" == e.type)) { var i = this._core.settings, o = i.center && Math.ceil(i.items / 2) || i.items, s = i.center && -1 * o || 0, n = (e.property && void 0 !== e.property.value ? e.property.value : this._core.current()) + s, r = this._core.clones().length, a = t.proxy(function (t, e) { this.load(e) }, this); for (i.lazyLoadEager > 0 && (o += i.lazyLoadEager, i.loop && (n -= i.lazyLoadEager, o++)); s++ < o;)this.load(r / 2 + this._core.relative(n)), r && t.each(this._core.clones(this._core.relative(n)), a), n++ } }, this) }, this._core.options = t.extend({}, s.Defaults, this._core.options), this._core.$element.on(this._handlers) }; s.Defaults = { lazyLoad: !1, lazyLoadEager: 0 }, s.prototype.load = function (i) { var o = this._core.$stage.children().eq(i), s = o && o.find(".owl-lazy"); !s || t.inArray(o.get(0), this._loaded) > -1 || (s.each(t.proxy(function (i, o) { var s, n = t(o), r = e.devicePixelRatio > 1 && n.attr("data-src-retina") || n.attr("data-src") || n.attr("data-srcset"); this._core.trigger("load", { element: n, url: r }, "lazy"), n.is("img") ? n.one("load.owl.lazy", t.proxy(function () { n.css("opacity", 1), this._core.trigger("loaded", { element: n, url: r }, "lazy") }, this)).attr("src", r) : n.is("source") ? n.one("load.owl.lazy", t.proxy(function () { this._core.trigger("loaded", { element: n, url: r }, "lazy") }, this)).attr("srcset", r) : (s = new Image, s.onload = t.proxy(function () { n.css({ "background-image": 'url("' + r + '")', opacity: "1" }), this._core.trigger("loaded", { element: n, url: r }, "lazy") }, this), s.src = r) }, this)), this._loaded.push(o.get(0))) }, s.prototype.destroy = function () { var t, e; for (t in this.handlers) this._core.$element.off(t, this.handlers[t]); for (e in Object.getOwnPropertyNames(this)) "function" != typeof this[e] && (this[e] = null) }, t.fn.owlCarousel.Constructor.Plugins.Lazy = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { var s = function (i) { this._core = i, this._previousHeight = null, this._handlers = { "initialized.owl.carousel refreshed.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.autoHeight && this.update() }, this), "changed.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.autoHeight && "position" === t.property.name && this.update() }, this), "loaded.owl.lazy": t.proxy(function (t) { t.namespace && this._core.settings.autoHeight && t.element.closest("." + this._core.settings.itemClass).index() === this._core.current() && this.update() }, this) }, this._core.options = t.extend({}, s.Defaults, this._core.options), this._core.$element.on(this._handlers), this._intervalId = null; var o = this; t(e).on("load", function () { o._core.settings.autoHeight && o.update() }), t(e).resize(function () { o._core.settings.autoHeight && (null != o._intervalId && clearTimeout(o._intervalId), o._intervalId = setTimeout(function () { o.update() }, 250)) }) }; s.Defaults = { autoHeight: !1, autoHeightClass: "owl-height" }, s.prototype.update = function () { var e = this._core._current, i = e + this._core.settings.items, o = this._core.settings.lazyLoad, s = this._core.$stage.children().toArray().slice(e, i), n = [], r = 0; t.each(s, function (e, i) { n.push(t(i).height()) }), (r = Math.max.apply(null, n)) <= 1 && o && this._previousHeight && (r = this._previousHeight), this._previousHeight = r, this._core.$stage.parent().height(r).addClass(this._core.settings.autoHeightClass) }, s.prototype.destroy = function () { var t, e; for (t in this._handlers) this._core.$element.off(t, this._handlers[t]); for (e in Object.getOwnPropertyNames(this)) "function" != typeof this[e] && (this[e] = null) }, t.fn.owlCarousel.Constructor.Plugins.AutoHeight = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { var s = function (e) { this._core = e, this._videos = {}, this._playing = null, this._handlers = { "initialized.owl.carousel": t.proxy(function (t) { t.namespace && this._core.register({ type: "state", name: "playing", tags: ["interacting"] }) }, this), "resize.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.video && this.isInFullScreen() && t.preventDefault() }, this), "refreshed.owl.carousel": t.proxy(function (t) { t.namespace && this._core.is("resizing") && this._core.$stage.find(".cloned .owl-video-frame").remove() }, this), "changed.owl.carousel": t.proxy(function (t) { t.namespace && "position" === t.property.name && this._playing && this.stop() }, this), "prepared.owl.carousel": t.proxy(function (e) { if (e.namespace) { var i = t(e.content).find(".owl-video"); i.length && (i.css("display", "none"), this.fetch(i, t(e.content))) } }, this) }, this._core.options = t.extend({}, s.Defaults, this._core.options), this._core.$element.on(this._handlers), this._core.$element.on("click.owl.video", ".owl-video-play-icon", t.proxy(function (t) { this.play(t) }, this)) }; s.Defaults = { video: !1, videoHeight: !1, videoWidth: !1 }, s.prototype.fetch = function (t, e) { var i = t.attr("data-vimeo-id") ? "vimeo" : t.attr("data-vzaar-id") ? "vzaar" : "youtube", o = t.attr("data-vimeo-id") || t.attr("data-youtube-id") || t.attr("data-vzaar-id"), s = t.attr("data-width") || this._core.settings.videoWidth, n = t.attr("data-height") || this._core.settings.videoHeight, r = t.attr("href"); if (!r) throw new Error("Missing video URL."); if ((o = r.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu") > -1) i = "youtube"; else if (o[3].indexOf("vimeo") > -1) i = "vimeo"; else { if (!(o[3].indexOf("vzaar") > -1)) throw new Error("Video URL not supported."); i = "vzaar" } o = o[6], this._videos[r] = { type: i, id: o, width: s, height: n }, e.attr("data-video", r), this.thumbnail(t, this._videos[r]) }, s.prototype.thumbnail = function (e, i) { var o, s, n, r = i.width && i.height ? "width:" + i.width + "px;height:" + i.height + "px;" : "", a = e.find("img"), h = "src", l = "", p = this._core.settings, c = function (i) { s = '
', o = p.lazyLoad ? t("
", { class: "owl-video-tn " + l, srcType: i }) : t("
", { class: "owl-video-tn", style: "opacity:1;background-image:url(" + i + ")" }), e.after(o), e.after(s) }; if (e.wrap(t("
", { class: "owl-video-wrapper", style: r })), this._core.settings.lazyLoad && (h = "data-src", l = "owl-lazy"), a.length) return c(a.attr(h)), a.remove(), !1; "youtube" === i.type ? (n = "//img.youtube.com/vi/" + i.id + "/hqdefault.jpg", c(n)) : "vimeo" === i.type ? t.ajax({ type: "GET", url: "//vimeo.com/api/v2/video/" + i.id + ".json", jsonp: "callback", dataType: "jsonp", success: function (t) { n = t[0].thumbnail_large, c(n) } }) : "vzaar" === i.type && t.ajax({ type: "GET", url: "//vzaar.com/api/videos/" + i.id + ".json", jsonp: "callback", dataType: "jsonp", success: function (t) { n = t.framegrab_url, c(n) } }) }, s.prototype.stop = function () { this._core.trigger("stop", null, "video"), this._playing.find(".owl-video-frame").remove(), this._playing.removeClass("owl-video-playing"), this._playing = null, this._core.leave("playing"), this._core.trigger("stopped", null, "video") }, s.prototype.play = function (e) { var i, o = t(e.target).closest("." + this._core.settings.itemClass), s = this._videos[o.attr("data-video")], n = s.width || "100%", r = s.height || this._core.$stage.height(); this._playing || (this._core.enter("playing"), this._core.trigger("play", null, "video"), o = this._core.items(this._core.relative(o.index())), this._core.reset(o.index()), (i = t('')).attr("height", r), i.attr("width", n), "youtube" === s.type ? i.attr("src", "//www.youtube.com/embed/" + s.id + "?autoplay=1&rel=0&v=" + s.id) : "vimeo" === s.type ? i.attr("src", "//player.vimeo.com/video/" + s.id + "?autoplay=1") : "vzaar" === s.type && i.attr("src", "//view.vzaar.com/" + s.id + "/player?autoplay=true"), t(i).wrap('
').insertAfter(o.find(".owl-video")), this._playing = o.addClass("owl-video-playing")) }, s.prototype.isInFullScreen = function () { var e = i.fullscreenElement || i.mozFullScreenElement || i.webkitFullscreenElement; return e && t(e).parent().hasClass("owl-video-frame") }, s.prototype.destroy = function () { var t, e; this._core.$element.off("click.owl.video"); for (t in this._handlers) this._core.$element.off(t, this._handlers[t]); for (e in Object.getOwnPropertyNames(this)) "function" != typeof this[e] && (this[e] = null) }, t.fn.owlCarousel.Constructor.Plugins.Video = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { var s = function (e) { this.core = e, this.core.options = t.extend({}, s.Defaults, this.core.options), this.swapping = !0, this.previous = o, this.next = o, this.handlers = { "change.owl.carousel": t.proxy(function (t) { t.namespace && "position" == t.property.name && (this.previous = this.core.current(), this.next = t.property.value) }, this), "drag.owl.carousel dragged.owl.carousel translated.owl.carousel": t.proxy(function (t) { t.namespace && (this.swapping = "translated" == t.type) }, this), "translate.owl.carousel": t.proxy(function (t) { t.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn) && this.swap() }, this) }, this.core.$element.on(this.handlers) }; s.Defaults = { animateOut: !1, animateIn: !1 }, s.prototype.swap = function () { if (1 === this.core.settings.items && t.support.animation && t.support.transition) { this.core.speed(0); var e, i = t.proxy(this.clear, this), o = this.core.$stage.children().eq(this.previous), s = this.core.$stage.children().eq(this.next), n = this.core.settings.animateIn, r = this.core.settings.animateOut; this.core.current() !== this.previous && (r && (e = this.core.coordinates(this.previous) - this.core.coordinates(this.next), o.one(t.support.animation.end, i).css({ left: e + "px" }).addClass("animated owl-animated-out").addClass(r)), n && s.one(t.support.animation.end, i).addClass("animated owl-animated-in").addClass(n)) } }, s.prototype.clear = function (e) { t(e.target).css({ left: "" }).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut), this.core.onTransitionEnd() }, s.prototype.destroy = function () { var t, e; for (t in this.handlers) this.core.$element.off(t, this.handlers[t]); for (e in Object.getOwnPropertyNames(this)) "function" != typeof this[e] && (this[e] = null) }, t.fn.owlCarousel.Constructor.Plugins.Animate = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { var s = function (e) { this._core = e, this._call = null, this._time = 0, this._timeout = 0, this._paused = !0, this._handlers = { "changed.owl.carousel": t.proxy(function (t) { t.namespace && "settings" === t.property.name ? this._core.settings.autoplay ? this.play() : this.stop() : t.namespace && "position" === t.property.name && this._paused && (this._time = 0) }, this), "initialized.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.autoplay && this.play() }, this), "play.owl.autoplay": t.proxy(function (t, e, i) { t.namespace && this.play(e, i) }, this), "stop.owl.autoplay": t.proxy(function (t) { t.namespace && this.stop() }, this), "mouseover.owl.autoplay": t.proxy(function () { this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() }, this), "mouseleave.owl.autoplay": t.proxy(function () { this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.play() }, this), "touchstart.owl.core": t.proxy(function () { this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() }, this), "touchend.owl.core": t.proxy(function () { this._core.settings.autoplayHoverPause && this.play() }, this) }, this._core.$element.on(this._handlers), this._core.options = t.extend({}, s.Defaults, this._core.options) }; s.Defaults = { autoplay: !1, autoplayTimeout: 5e3, autoplayHoverPause: !1, autoplaySpeed: !1 }, s.prototype._next = function (o) { this._call = e.setTimeout(t.proxy(this._next, this, o), this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()), this._core.is("interacting") || i.hidden || this._core.next(o || this._core.settings.autoplaySpeed) }, s.prototype.read = function () { return (new Date).getTime() - this._time }, s.prototype.play = function (i, o) { var s; this._core.is("rotating") || this._core.enter("rotating"), i = i || this._core.settings.autoplayTimeout, s = Math.min(this._time % (this._timeout || i), i), this._paused ? (this._time = this.read(), this._paused = !1) : e.clearTimeout(this._call), this._time += this.read() % i - s, this._timeout = i, this._call = e.setTimeout(t.proxy(this._next, this, o), i - s) }, s.prototype.stop = function () { this._core.is("rotating") && (this._time = 0, this._paused = !0, e.clearTimeout(this._call), this._core.leave("rotating")) }, s.prototype.pause = function () { this._core.is("rotating") && !this._paused && (this._time = this.read(), this._paused = !0, e.clearTimeout(this._call)) }, s.prototype.destroy = function () { var t, e; this.stop(); for (t in this._handlers) this._core.$element.off(t, this._handlers[t]); for (e in Object.getOwnPropertyNames(this)) "function" != typeof this[e] && (this[e] = null) }, t.fn.owlCarousel.Constructor.Plugins.autoplay = s }(window.Zepto || window.jQuery, window, document), function (t, e, i, o) { "use strict"; var s = function (e) { this._core = e, this._initialized = !1, this._pages = [], this._controls = {}, this._templates = [], this.$element = this._core.$element, this._overrides = { next: this._core.next, prev: this._core.prev, to: this._core.to }, this._handlers = { "prepared.owl.carousel": t.proxy(function (e) { e.namespace && this._core.settings.dotsData && this._templates.push('
' + t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot") + "
") }, this), "added.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.dotsData && this._templates.splice(t.position, 0, this._templates.pop()) }, this), "remove.owl.carousel": t.proxy(function (t) { t.namespace && this._core.settings.dotsData && this._templates.splice(t.position, 1) }, this), "changed.owl.carousel": t.proxy(function (t) { t.namespace && "position" == t.property.name && this.draw() }, this), "initialized.owl.carousel": t.proxy(function (t) { t.namespace && !this._initialized && (this._core.trigger("initialize", null, "navigation"), this.initialize(), this.update(), this.draw(), this._initialized = !0, this._core.trigger("initialized", null, "navigation")) }, this), "refreshed.owl.carousel": t.proxy(function (t) { t.namespace && this._initialized && (this._core.trigger("refresh", null, "navigation"), this.update(), this.draw(), this._core.trigger("refreshed", null, "navigation")) }, this) }, this._core.options = t.extend({}, s.Defaults, this._core.options), this.$element.on(this._handlers) }; s.Defaults = { nav: !1, navText: ['', ''], navSpeed: !1, navElement: 'button type="button" role="presentation"', navContainer: !1, navContainerClass: "owl-nav", navClass: ["owl-prev", "owl-next"], slideBy: 1, dotClass: "owl-dot", dotsClass: "owl-dots", dots: !0, dotsEach: !1, dotsData: !1, dotsSpeed: !1, dotsContainer: !1 }, s.prototype.initialize = function () { var e, i = this._core.settings; this._controls.$relative = (i.navContainer ? t(i.navContainer) : t("
").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"), this._controls.$previous = t("<" + i.navElement + ">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click", t.proxy(function (t) { this.prev(i.navSpeed) }, this)), this._controls.$next = t("<" + i.navElement + ">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click", t.proxy(function (t) { this.next(i.navSpeed) }, this)), i.dotsData || (this._templates = [t('\t
'; $(".dropdown-cart-products").append(o) }), $(".dropdown-cart-total,.dropdown-cart-action").show(), $(".cart-count").html(a).show(), $("#carro-subtotal").html(e.subtotal), 0 < e.descuento ? $("#carro-descuento").html(e.descuento_format).closest("tr").show() : $("#carro-descuento").closest("tr").hide(), $("#carro-despacho").html(e.despacho), $("#carro-total").html(e.total)) : ($(".dropdown-cart-total,.dropdown-cart-action").hide(), $(".cart-count").html(0).hide(), $("#carro-subtotal").html(0), $("#carro-descuento").html(0).hide(), $("#carro-despacho").html(0), $("#carro-total").html(0), $(".dropdown-cart-products").append('

El carro está vacío

')) }) } !function (i) { "use strict"; var n = { initialised: !1, mobile: !1, init: function () { this.initialised || (this.initialised = !0, this.checkMobile(), this.headerSearchToggle(), this.mMenuIcons(), this.menuToggle(), this.mobileMenu(), this.stickyHeader(), this.scrollToTop(), this.quantityInputs(), this.countTo(), this.tooltip(), this.popover(), this.changePassToggle(), this.changeBillToggle(), this.catAccordion(), this.ajaxLoadProduct(), this.toggleFilter(), this.toggleSidebar(), this.productTabSroll(), this.scrollToElement(), this.windowClick(), i.fn.superfish && this.menuInit(), i.fn.owlCarousel && this.owlCarousels(), "object" == typeof noUiSlider && this.filterSlider(), i.fn.themeSticky && this.stickySidebar(), i.fn.magnificPopup && this.lightBox(), i.fn.Morphext && this.wordRotate()) }, checkMobile: function () { /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? this.mobile = !0 : this.mobile = !1 }, menuInit: function () { i(".menu").superfish({ popUpSelector: "ul, .megamenu", hoverClass: "show", delay: 0, speed: 80, speedOut: 80, autoArrows: !0 }) }, headerSearchToggle: function () { i(".search-toggle").on("click", function (e) { i(".header-search-wrapper").toggleClass("show"), e.preventDefault() }), i("body").on("click", function (e) { i(".header-search-wrapper").hasClass("show") && (i(".header-search-wrapper").removeClass("show"), i("body").removeClass("is-search-active")) }), i(".header-search").on("click", function (e) { e.stopPropagation() }) }, menuToggle: function () { i(".menu-toggler").on("click", function (e) { e.preventDefault(), 992 <= i(window).width() ? i(this).hasClass("no-toggle") || i(".main-dropdown-menu").toggleClass("show") : i("body").toggleClass("mmenu-active"), e.preventDefault() }), i(".mobile-menu-overlay, .mobile-menu-close").on("click", function (e) { i("body").removeClass("mmenu-active"), e.preventDefault() }) }, mMenuIcons: function () { i(".mobile-menu").find("li").each(function () { var e = i(this); e.find("ul").length && i("", { class: "mmenu-btn" }).appendTo(e.children("a")) }) }, mobileMenu: function () { i(".mmenu-btn").on("click", function (e) { var t = i(this).closest("li"), o = t.find("ul").eq(0); t.hasClass("open") ? o.slideUp(300, function () { t.removeClass("open") }) : o.slideDown(300, function () { t.addClass("open") }), e.stopPropagation(), e.preventDefault() }) }, stickyHeader: function () { i("main").find(".sticky-header").each(function () { new Waypoint.Sticky({ element: i(this), stuckClass: "fixed-nav" }) }) }, owlCarousels: function () { var e = { loop: !0, margin: 0, responsiveClass: !0, nav: !1, navText: ['', ''], dots: !0, autoplay: !0, autoplayTimeout: 15e3, items: 1 }, t = i(".home-slider"); t.owlCarousel(i.extend(!0, {}, e, { lazyLoad: !0, nav: !0, dots: !1, autoplayTimeout: 2e4, animateOut: "fadeOut" })), t.on("loaded.owl.lazy", function (e) { i(e.element).closest(".home-slider").addClass("loaded") }), i(".column-slider").each(function () { i(this).owlCarousel(i.extend(!0, {}, e, { margin: 2, lazyLoad: !0, responsive: { 0: { items: 2 }, 992: { items: 3 } } })) }), i(".products-carousel").owlCarousel(i.extend(!0, {}, e, { loop: !1, margin: 30, nav: !0, dots: !1, autoplay: !1, responsive: { 0: { items: 2 }, 768: { items: 3 }, 992: { items: 4 } } })), i(".blog-carousel").owlCarousel(i.extend(!0, {}, e, { loop: !1, margin: 30, nav: !0, dots: !1, autoplay: !0, responsive: { 0: { items: 1 }, 768: { items: 2 } } })), i(".featured-products").owlCarousel(i.extend(!0, {}, e, { loop: !0, margin: 30, navText: ['', ''], autoplay: !0, responsive: { 0: { items: 2 }, 768: { items: 3, margin: 15 }, 992: { items: 5 } } })), i(".widget-featured-products").owlCarousel(i.extend(!0, {}, e, { lazyLoad: !0, nav: !0, dots: !1, autoHeight: !0 })), i(".testimonials-carousel").owlCarousel(i.extend(!0, {}, e, { lazyLoad: !0, autoHeight: !0, responsive: { 0: { items: 1 }, 992: { items: 2 } } })), i(".entry-slider").each(function () { i(this).owlCarousel(i.extend(!0, {}, e, { margin: 2, lazyLoad: !0, navText: ['', ''] })) }), i(".related-posts-carousel").owlCarousel(i.extend(!0, {}, e, { loop: !1, margin: 30, navText: ['', ''], autoplay: !1, responsive: { 0: { items: 1 }, 480: { items: 2 }, 1200: { items: 3 } } })), i(".boxed-slider").owlCarousel(i.extend(!0, {}, e, { lazyLoad: !0, navText: ['', ''], autoplayTimeout: 2e4, animateOut: "fadeOut" })), i(".boxed-slider").on("loaded.owl.lazy", function (e) { i(e.element).closest(".boxed-slider").addClass("loaded") }), i(".product-single-default .product-single-carousel").owlCarousel(i.extend(!0, {}, e, { nav: !0, dotsContainer: "#carousel-custom-dots", autoplay: !1, onInitialized: function () { if (i(".mfp-container .product-single-image")[0]) { var e = this.$element; i.fn.elevateZoom && e.find("img").each(function () { var e = i(this), t = { responsive: !0, zoomWindowFadeIn: 350, zoomWindowFadeOut: 200, borderSize: 0, zoomContainer: e.parent(), zoomType: "inner", cursor: "grab" }; e.elevateZoom(t) }) } } })), i(".product-single-extended .product-single-carousel").owlCarousel(i.extend(!0, {}, e, { dots: !1, autoplay: !1, responsive: { 0: { items: 1 }, 480: { items: 2 }, 1200: { items: 3 } } })), i("#carousel-custom-dots .owl-dot").click(function () { i(".product-single-carousel").trigger("to.owl.carousel", [i(this).index(), 300]) }) }, filterSlider: function () { var e = document.getElementById("price-slider"); if (null != e) { noUiSlider.create(e, { start: [i("#price-slider").data("inicio"), i("#price-slider").data("termino")], connect: !0, step: i("#price-slider").data("rango"), range: { min: i("#price-slider").data("min"), max: i("#price-slider").data("max") } }), e.noUiSlider.on("update", function (e, t) { e = e.map(function (e) { return e }); i("#filter-input-inicio").val(e[0]), i("#filter-input-termino").val(e[1]), i("#filter-price-range").text(e.join(" - ")) }); var t = document.getElementById("price-slider-2"); null != t && (noUiSlider.create(t, { start: [i("#price-slider-2").data("inicio"), i("#price-slider-2").data("termino")], connect: !0, step: i("#price-slider-2").data("rango"), range: { min: i("#price-slider-2").data("min"), max: i("#price-slider-2").data("max") } }), t.noUiSlider.on("update", function (e, t) { e = e.map(function (e) { return e }); i("#filter2-input-inicio").val(e[0]), i("#filter2-input-termino").val(e[1]), i("#filter2-price-range").text(e.join(" - ")) })) } }, stickySidebar: function () { i(".sidebar-wrapper, .sticky-slider").themeSticky({ autoInit: !0, minWidth: 991, containerSelector: ".row, .container", autoFit: !0, paddingOffsetBottom: 10, paddingOffsetTop: 20 }) }, countTo: function () { i.fn.countTo ? i.fn.waypoint ? i(".count").waypoint(function () { i(this.element).countTo() }, { offset: "90%", triggerOnce: !0 }) : i(".count").countTo() : i(".count").each(function () { var e = i(this), t = e.data("to"); e.text(t) }) }, tooltip: function () { i.fn.tooltip && i('[data-toggle="tooltip"]').tooltip({ trigger: "hover focus" }) }, popover: function () { i.fn.popover && i('[data-toggle="popover"]').popover({ trigger: "focus" }) }, changePassToggle: function () { i("#change-pass-checkbox").on("change", function () { i("#account-chage-pass").toggleClass("show"), i("#change-pass-checkbox").is(":checked") ? i("#acc-pass2,#acc-pass3").prop("disabled", !1) : i("#acc-pass2,#acc-pass3").prop("disabled", !0) }) }, changeBillToggle: function () { i("#change-bill-address").on("change", function () { i("#checkout-shipping-address").toggleClass("show"), i("#new-checkout-address").toggleClass("show") }) }, catAccordion: function () { i(".catAccordion").on("shown.bs.collapse", function (e) { var t = i(e.target).closest("li"); t.hasClass("open") || t.addClass("open") }).on("hidden.bs.collapse", function (e) { var t = i(e.target).closest("li"); t.hasClass("open") && t.removeClass("open") }) }, scrollBtnAppear: function () { 400 <= i(window).scrollTop() ? i("#scroll-top").addClass("fixed") : i("#scroll-top").removeClass("fixed"), i(".scroll-pagar")[0] && (100 <= i(window).scrollTop() ? i(".scroll-pagar").removeClass("oculto") : i(".scroll-pagar").addClass("oculto")) }, scrollToTop: function () { i("#scroll-top").on("click", function (e) { i("html, body").animate({ scrollTop: 0 }, 1200), e.preventDefault() }) }, lightBox: function () { var o = [], a = 0 === i(".product-single-carousel .owl-item:not(.cloned) img").length ? i(".product-single-gallery img") : i(".product-single-carousel .owl-item:not(.cloned) img"); a.each(function () { o.push({ src: i(this).attr("data-zoom-image") }) }), i(".prod-full-screen").click(function (e) { var t; t = e.currentTarget.closest(".product-slider-container") ? (i(".product-single-carousel").data("owl.carousel").current() + a.length - Math.ceil(a.length / 2)) % a.length : i(e.currentTarget).closest(".product-item").index(), i.magnificPopup.open({ items: o, navigateByImgClick: !0, type: "image", gallery: { enabled: !0 }, image: { titleSrc: function (e) { return "

Mover o deslizar imagen para hacer zoom

" } }, callbacks: { open: function () { i.fn.elevateZoom && i(".mfp-figure").find("img").each(function () { var e = i(this), t = { responsive: !0, scrollZoom: !0, borderSize: 0, zoomContainer: e.parent(), zoomType: "inner", cursor: "move" }; e.elevateZoom(t) }) }, close: function () { } } }, t) }), i(".open-imagen").magnificPopup({ type: "image" }), i(document).on("click", ".popup-cart", function (e) { e.preventDefault(), n.ajaxLoading(); var t = i(this); i.magnificPopup.open({ type: "ajax", mainClass: "mfp-ajax-product", tLoading: "", preloader: !1, removalDelay: 350, items: { src: "/producto/m/" + t.data("slug") }, callbacks: { ajaxContentAdded: function () { var e = "#" + t.data("slug"); view_item_modal(); modal_item_medida = 2, 2 == (modal_count_medidas = $(".mfp-wrap .select-medida option").length) && $(".mfp-wrap #agregar-medida").remove(); history.pushState(null, null, e), n.owlCarousels(), n.quantityInputs(), Validacion.Post(i(".product-quick-view .formulario")) }, beforeClose: function () { i(".ajaxOverlay").remove(), history.pushState("", document.title, window.location.pathname) }, ajax: { settings: null, tError: "No cargado" } } }) }) }, productTabSroll: function () { i(".rating-link").on("click", function (e) { if (i(".product-single-tabs").length) i("#product-tab-reviews").tab("show"); else { if (!i(".product-single-collapse").length) return; i("#product-reviews-content").collapse("show") } i("#product-reviews-content").length && setTimeout(function () { var e = i("#product-reviews-content").offset().top - 60; i("html, body").stop().animate({ scrollTop: e }, 800) }, 250), e.preventDefault() }) }, quantityInputs: function () { i.fn.TouchSpin && (i(".vertical-quantity").TouchSpin({ verticalbuttons: !0, verticalup: "", verticaldown: "", verticalupclass: "icon-up-dir", verticaldownclass: "icon-down-dir", buttondown_class: "btn btn-outline", buttonup_class: "btn btn-outline", initval: 1, min: 1 }), i(".horizontal-quantity").TouchSpin({ verticalbuttons: !1, buttonup_txt: "", buttondown_txt: "", buttondown_class: "btn btn-outline btn-down-icon", buttonup_class: "btn btn-outline btn-up-icon", initval: 1, min: 1 })) }, ajaxLoading: function () { i("body").append("
") }, wordRotate: function () { i(".word-rotater").each(function () { i(this).Morphext({ animation: "bounceIn", separator: ",", speed: 2e3 }) }) }, ajaxLoadProduct: function () { var o = 0; a.click(function (e) { e.preventDefault(), i(this).text("Loading ..."), i.ajax({ url: "ajax/category-ajax-products.html", success: function (e) { var t = i(e); setTimeout(function () { t.appendTo(".product-ajax-grid"), a.text("Load More"), 2 <= ++o && a.hide() }, 350) }, failure: function () { a.text("Sorry something went wrong.") } }) }) }, toggleFilter: function () { i(".filter-toggle a").click(function (e) { e.preventDefault(), i(".filter-toggle").toggleClass("opened"), i("main").toggleClass("sidebar-opened") }), i(".sidebar-overlay").click(function (e) { i(".filter-toggle").removeClass("opened"), i("main").removeClass("sidebar-opened") }), i(".sort-menu-trigger").click(function (e) { e.preventDefault(), i(".select-custom").removeClass("opened"), i(e.target).closest(".select-custom").toggleClass("opened") }) }, toggleSidebar: function () { i(".sidebar-toggle").click(function () { i("main").toggleClass("sidebar-opened") }) }, scrollToElement: function () { i('.scrolling-box a[href^="#"]').on("click", function (e) { var t = i(this.getAttribute("href")); t.length && (e.preventDefault(), i("html, body").stop().animate({ scrollTop: t.offset().top - 90 }, 700)) }) }, windowClick: function () { i(document).click(function (e) { i(e.target).closest(".toolbox-item.select-custom").length || i(".select-custom").removeClass("opened") }) } }, a = i(".loadmore .btn"); jQuery(document).ready(function () { n.init() }), i(window).on("load", function () { n.scrollBtnAppear() }), i(window).on("scroll", function () { n.scrollBtnAppear() }) }(jQuery), $(function () { new LazyLoad({ elements_selector: ".lazy" }); $(".formulario")[0] && $(".formulario").each(function () { Validacion.Post($(this)) }), $("#msg_tipo")[0] && mensaje($("#msg_tipo").val(), $("#msg_title").val(), $("#msg_text").val()), reload_carro(), $(document).on("click", ".eliminar-carro", function (e) { var t = $(this); t.attr("disabled", !0), $.ajax({ url: "/carro-de-compras/eliminar", type: "POST", data: { id: t.data("id"), medida: t.data("medida"), url: window.location.pathname }, dataType: "json" }).done(function (e) { e.reload_carro ? (reload_carro(), mensaje("green", "PERFECTO", e.msg), t.attr("disabled", !1)) : window.location.reload() }).fail(function (e) { mensaje("danger", "ERROR", "No se pudo eliminar el producto."), t.attr("disabled", !1) }) }), $(".widget-order-summary")[0] && $(document).scroll(function () { var e = $(document).scrollTop(); $(".fixed-resumen").css("width", $(".sidebar").width()), 250 <= e ? $(".widget-order-summary").addClass("fixed-resumen") : $(".widget-order-summary").removeClass("fixed-resumen") }), $(".mobile-menu-toggle").click(function () { $(".widget-featured-products").empty() }), $(document).on("shown.bs.tab", 'a[data-toggle="tab"]', function (e) { "tab-nueva" == $(this).attr("id") ? ($("#anterior select").prop("disabled", !0), $("#nueva input,#nueva select").prop("disabled", !1)) : "tab-anterior" == $(this).attr("id") && ($("#anterior select").prop("disabled", !1), $("#nueva input,#nueva select").prop("disabled", !0)) }), $("#oficinas-tab")[0] && ($("#oficinas-tab a.active").trigger("click"), "#nueva" == $("#oficinas-tab a.active").attr("href") ? ($("#anterior select").prop("disabled", !0), $("#nueva input,#nueva select").prop("disabled", !1)) : "#anterior" == $("#oficinas-tab a.active").attr("href") && ($("#anterior select").prop("disabled", !1), $("#nueva input,#nueva select").prop("disabled", !0)), $($("#oficinas-tab a.active").attr("href")).addClass("show active")), $("#buscar-mobile,#buscar-desktop").submit(function (e) { e.preventDefault(); var t = $(this), o = t.find("input").val(); $("#" + t.data("box")).empty(), $("#" + t.data("box")).html('
'), 2 < o.length ? (t.find(":submit").prop("disabled", !0), $.ajax({ url: "/buscar", type: "POST", data: { t: o, l: t.data("limit") }, dataType: "json" }).done(function (e) { var o = ""; 0 < e.resultados.length ? $.each(e.resultados, function (e, t) { o += '
' + t.NOMBRE + '

' + t.NOMBRE + '

" }) : o = '
No se encontraron insumos
', $("#" + t.data("box")).empty().append(o), t.find(":submit").prop("disabled", !1) })) : ($("#" + t.data("box")).empty(), mensaje("warning", "Atención", "Ingresar mínimo 3 letras")) }), $("#despacho_region").change(function () { var e = $(this).val(); $("#despacho_comuna").empty().prop("disabled", !0), $.ajax({ url: "/carro-de-compras/get-comunas", type: "POST", data: { region: e }, dataType: "json" }).done(function (e) { var o = ''; $.each(e.comunas, function (e, t) { o += '" }), $("#despacho_comuna").html(o), "" != $("#despacho_comuna").data("id") && $('#despacho_comuna option[value="' + $("#despacho_comuna").data("id") + '"]').trigger("change").prop("selected", !0), !1 !== e.comunas && $("#despacho_comuna").prop("disabled", !1) }) }), $(document).on("change", "#despacho_comuna", function () { }), $("#despacho_comuna")[0] && "" != $("#despacho_comuna").data("region") && $("#despacho_region :selected").trigger("change"), $(".eliminar-direccion").click(function (e) { e.preventDefault(); var t = $(this).data("id"); $.ajax({ url: "/mi-cuenta/eliminar-direccion/", type: "POST", data: { id: t }, dataType: "json" }).done(function (e) { e.result ? window.location.reload() : mensaje("error", "", e.msg) }) }), Validacion.Post($(".formulario-producto")), $(".formulario-registro")[0] && ($(".formulario-registro").submit(function (e) { e.preventDefault() }), Validacion.Post($(".formulario-registro"))) }), $(window).on("popstate", function () { $.magnificPopup.close() }); var Validacion = { Post: function (e, t) { !function (t) { t.validate({ ignore: ":hidden:not(select)", highlight: function (e, t) { $(e).closest(".form-group").addClass("has-error").removeClass("has-success") }, unhighlight: function (e, t) { $(e).closest(".form-group").removeClass("has-error").addClass("has-success") }, submitHandler: function (e) { t.find(":submit").prop("disabled", !0), t.find(".icono-loading").show(), $.ajax({ url: t.data("url"), type: "POST", data: t.serialize(), dataType: "json" }).done(function (e) { if (e.result) { if (e.reload) return window.location.reload(), !0; if (e.reset) $('.formulario-newsletter')[0].reset(), mensaje("green", "EXCELENTE", "Tu Email ha sido registradro."), $('.formulario-newsletter').find(":submit").prop("disabled", !1), !0; if (e.redirect) return window.location.href = e.redirect, !0; e.reload_carro ? (reload_carro(),gtm_add_cart()) : e.empty_form && ($("#form-fixed")[0].reset(), t.find(".icono-loading").hide()), mensaje(e.tipo, e.title, e.msg), t.find(":submit").prop("disabled", !1), t.find(".icono-loading").hide() } else mensaje("red", "ERROR", e.msg ? e.msg : "No se obtuvo respuesta del servidor"), t.find(":submit").prop("disabled", !1), t.find(".icono-loading").hide() }).fail(function (e) { mensaje("red", "ERROR", "No se pudo procesar el formulario"), t.find(":submit").prop("disabled", !1), t.find(".icono-loading").hide() }) }, invalidHandler: function (e) { mensaje("red", "ERROR", "Hay campos obligatorios que están vacios o son inválidos"), t.find(":submit").prop("disabled", !1), t.find(".icono-loading").hide() } }) }(e) } }; $(function () { $("#mostrar-form-fixed").click(function (e) { e.preventDefault(), $("#form-fixed").slideToggle("slow") }); var e = $(".has-children .sub-menu-toggle"); $(".slideable-menu .slideable-submenu .back-btn").on("click", function (e) { var t = $(this).parent(), o = $(this).parent().parent().siblings().parent(), a = $(this).parents(".menu"), i = $(".slideable-menu .menu").attr("data-initial-height"); t.removeClass("in-view"), o.removeClass("off-view"), "menu" === o.attr("class") ? a.css("height", i) : a.css("height", o.height()), e.preventDefault() }), e.on("click", function (e) { var t = $(this).parent().parent().parent(), o = $(this).parents(".menu"); return t.addClass("off-view"), $(this).parent().parent().find("> .slideable-submenu").addClass("in-view"), o.css("height", $(this).parent().parent().find("> .slideable-submenu").height()), e.preventDefault(), !1 }), $(".mobile-menu-toggle").click(function () { $(this).toggleClass("active"), $(this).find(".icon-menu").toggleClass("icon-x"), $(".mobile-menu").toggleClass("open") }) }), $(document).ready(function () { if ($(window).scroll(function () { 120 < $(window).scrollTop() ? $(".header-bottom").addClass("header-fixed") : $(".header-bottom").removeClass("header-fixed") }), "" != $(".mobile-menu").data("sid")) { var e = $(".mobile-menu").data("sid"), t = $(".mobile-menu").data("cid"); $('.mobile-menu li[data-sup="' + e + '"]').addClass("open").find("ul").addClass("d-block"), $('.mobile-menu li[data-sup="' + e + '"] ul li[data-cat="' + t + '"]').addClass("active"), $('.menu-vertical li[data-sup="' + e + '"]').addClass("active"), $('.menu-vertical li[data-sup="' + e + '"] ul li[data-cat="' + t + '"]').addClass("active") } $(".form-cantidad").change(function () { var e = $(this); a(function () { $("button").attr("disabled", !0), $.ajax({ url: "/carro-de-compras/actualizar", type: "POST", data: { producto: e.data("producto"), medida: e.data("medida"), cantidad: e.val() }, dataType: "json" }).done(function (e) { e.result ? window.location.reload() : (mensaje("red", "ERROR", e.msg), $("button").attr("disabled", !1)) }).fail(function (e) { mensaje("red", "ERROR", "No se pudo eliminar el producto"), $("button").attr("disabled", !1) }) }, 800) }), $(".btn-comentario").click(function () { var e = $(this).closest(".box-textarea").find("textarea"); a(function () { $("button").attr("disabled", !0), $.ajax({ url: "/carro-de-compras/guardar-comentario", type: "POST", data: { producto: e.data("producto"), medida: e.data("medida"), comentario: e.val() }, dataType: "json" }).done(function (e) { e.result ? mensaje("green", "OK", e.msg) : mensaje("red", "ERROR", e.msg), $("button").attr("disabled", !1) }).fail(function (e) { mensaje("red", "ERROR", "No se pudo eliminar el producto"), $("button").attr("disabled", !1) }) }, 500) }); var o, a = (o = 0, function (e, t) { clearTimeout(o), o = setTimeout(e, t) }); $(".btn-vaciar").click(function () { $(this).hide(), $(".box-vaciar").fadeIn("slow") }), $(".btn-vaciar-cancelar").click(function () { $(".box-vaciar").hide(), $(".btn-vaciar").fadeIn("slow") }), $(".btn-vaciar-confirmar").click(function () { window.location.href = "/carro-de-compras/vaciar" }), $(".popup-terminos")[0] && $(".popup-terminos").magnificPopup({ type: "iframe" }) }); var modal_item_medida = 0, modal_count_medidas = 0; function number_format(e, o, a, r) { e = (e + "").replace(/[^0-9+\-Ee.]/g, ""); var p, i, d, t = isFinite(+e) ? +e : 0, n = isFinite(+o) ? Math.abs(o) : 0, c = void 0 === r ? "," : r, m = void 0 === a ? "." : a, u = ""; return 3 < (u = (n ? (p = t, i = n, d = Math.pow(10, i), "" + Math.round(p * d) / d) : "" + Math.round(t)).split("."))[0].length && (u[0] = u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, c)), (u[1] || "").length < n && (u[1] = u[1] || "", u[1] += new Array(n - u[1].length + 1).join("0")), u.join(m) } $(function () { $(document).on("change", "#medida", function () { var e = $(this).val(), o = $('#medida option[value="' + e + '"]').data("precio"), a = $('#medida option[value="' + e + '"]').data("oferta"); $("#precios .old-price").empty(), $("#precios .product-price").empty(), "" != a ? ($("#precios .old-price").append("$" + number_format(o, 0, ".", ".")), $("#precios .product-price").append("$" + number_format(a, 0, ".", "."))) : $("#precios .product-price").append("$" + number_format(o, 0, ".", ".")) }), $(document).on("change", "#modal-medida", function () { var e = $(this).val(), o = $('#modal-medida option[value="' + e + '"]').data("precio"), a = $('#modal-medida option[value="' + e + '"]').data("oferta"); $("#modal-precios .old-price").empty(), $("#modal-precios .product-price").empty(), "" != a ? ($("#modal-precios .old-price").append("$" + number_format(o, 0, ".", ".")), $("#modal-precios .product-price").append("$" + number_format(a, 0, ".", "."))) : $("#modal-precios .product-price").append("$" + number_format(o, 0, ".", ".")) }) }); $(function () { var t = 2, e = $(".select-medida option").length - 1; 1 == e && $("#agregar-medida").remove(), $("#agregar-medida").click(function () { var n = $(".primer-elemento-medida").clone(); n.removeClass("primer-elemento-medida"), n.find(".select-medida").attr("name", "medida[" + t + "]").find("option:first").prop("selected", !0), n.find("input").attr("name", "cantidad[" + t + "]").val(1), n.find(".input-group-btn ").remove(), n.find(".horizontal-quantity").TouchSpin({ verticalbuttons: !1, buttonup_txt: "", buttondown_txt: "", buttondown_class: "btn btn-outline btn-down-icon", buttonup_class: "btn btn-outline btn-up-icon", initval: 1, min: 1 }), n.find(".eliminar-elemento-medida").empty().append(''), $("table.listado-medidas tbody").append(n), t++, 1 == --e && $("#agregar-medida").prop("disabled", !0) }), $(document).on("click", ".eliminar-medida", function () { $(this).closest("tr").remove(), ++e && $("#agregar-medida").prop("disabled", !1) }), $(document).on("click", ".mfp-wrap #agregar-medida", function () { var t = $(".mfp-wrap .primer-elemento-medida").clone(); t.removeClass("primer-elemento-medida"), t.find(".select-medida").attr("name", "medida[" + modal_item_medida + "]").find("option:first").prop("selected", !0), t.find("input").attr("name", "cantidad[" + modal_item_medida + "]").val(1), t.find(".input-group-btn ").remove(), t.find(".horizontal-quantity").TouchSpin({ verticalbuttons: !1, buttonup_txt: "", buttondown_txt: "", buttondown_class: "btn btn-outline btn-down-icon", buttonup_class: "btn btn-outline btn-up-icon", initval: 1, min: 1 }), t.find(".eliminar-elemento-medida").empty().append(''), $(".mfp-wrap table.listado-medidas tbody").append(t), modal_item_medida++, modal_count_medidas--, 2 == modal_count_medidas && $(".mfp-wrap #agregar-medida").prop("disabled", !0) }), $(document).on("click", ".mfp-wrap .eliminar-medida", function () { $(this).closest("tr").remove(), modal_count_medidas++, modal_count_medidas && $(".mfp-wrap #agregar-medida").prop("disabled", !1) }) }); function gtm_add_cart() { dataLayer.push({ ecommerce: null }); dataLayer.push({ event: "add_to_cart", ecommerce: { currency: "CLP", value: parseInt($('#gtm-precio').val()), items: [{ item_id: $('#gtm-id').val(), item_name: $('#gtm-nombre').val(), item_brand: "Mis Joyas", item_category: $('#gtm-categoria').val(), item_category2: $('#gtm-subcategoria').val(), price: parseInt($('#gtm-precio').val()), }] } }); } function view_item_modal() { dataLayer.push({ ecommerce: null }); dataLayer.push({ event: "view_item", ecommerce: { currency: "CLP", value: parseInt($('#modal-gtm-precio').val()), items: { item_id: $('#modal-gtm-id').val(), item_name: $('#modal-gtm-nombre').val(), item_brand: "Mis Joyas", item_category: $('#modal-gtm-categoria').val(), item_category2: $('#modal-gtm-subcategoria').val(), price: parseInt($('#modal-gtm-precio').val()), } } }); console.log($('#modal-gtm-id').val()) }