"); var d = e.extend({ top: 0, bottom: 0 }, t.padding || {}), u = parseInt(a.parent().parent().css("padding-top")), m = parseInt(a.parent().parent().css("padding-bottom")); t.autoInit && (e("#header").hasClass("header-side") ? (d.top = 0, e(".page-top.fixed-pos").length && (d.top += e(".page-top.fixed-pos").height())) : d.top = 0, void 0 !== t.paddingOffsetTop ? d.top += parseInt(t.paddingOffsetTop, 10) : d.top += 0, void 0 !== t.paddingOffsetBottom ? d.bottom = parseInt(t.paddingOffsetBottom, 10) : d.bottom = 0); var f = a.css("border-bottom"), g = a.outerHeight(); a.css("border-bottom", "1px solid transparent"); var w = a.outerHeight() - g - 1; a.css("border-bottom", f), a.css({ width: a.outerWidth() <= a.parent().width() ? a.outerWidth() : a.parent().width() }), a.parent().css("height", a.outerHeight() + w), !t.autoFit && !t.fitToBottom || a.outerHeight() <= r.height() ? a.data("themePin", { pad: d, from: (t.containerSelector ? p.top : l.top) - d.top + u, pb: m, parentTop: c.top - u, offset: w }) : a.data("themePin", { pad: d, fromFitTop: (t.containerSelector ? p.top : l.top) - d.top + u, from: (t.containerSelector ? p.top : l.top) + a.outerHeight() - e(window).height() + u, pb: m, parentTop: c.top - u, offset: w }) } } } }, p = function () { if (!n) { i = r.scrollTop(); for (var l = window.innerHeight || r.height(), p = 0, c = s.length; p < c; p++) { var d, u = e(s[p]), m = u.data("themePin"), f = m.to; if (m) { var g = t.containerSelector ? u.closest(t.containerSelector).length ? u.closest(t.containerSelector) : e(t.containerSelector) : e(document.body), w = u.outerHeight() + m.pad.top <= l; if (m.end = g.offset().top + g.height(), w ? m.to = g.offset().top + g.height() - u.outerHeight() - m.pad.bottom - m.pb : (m.to = g.offset().top + g.height() - l - m.pb, m.to2 = g.height() - u.outerHeight() - m.pad.bottom - m.pb), w) { var v = m.from - m.pad.bottom, y = m.to - m.pad.top - m.offset; if (void 0 !== m.fromFitTop && m.fromFitTop && (v = m.fromFitTop - m.pad.bottom), v + u.outerHeight() > m.end || v >= y) { u.css({ position: "", top: "", left: "" }), t.activeClass && u.removeClass(t.activeClass), u.removeClass("sticky-transition"), u.removeClass("sticky-absolute"); continue } i > v && i < y ? (!("fixed" == u.css("position")) && u.css({ left: u.offset().left, top: m.pad.top }).css("position", "fixed"), t.activeClass && u.addClass(t.activeClass), u.removeClass("sticky-transition"), u.removeClass("sticky-absolute")) : i >= y ? (u.css({ left: "", top: y - m.parentTop + m.pad.top }).css("position", "absolute"), t.activeClass && u.addClass(t.activeClass), u.hasClass("sticky-absolute") && u.addClass("sticky-transition"), u.addClass("sticky-absolute")) : (u.css({ position: "", top: "", left: "" }), t.activeClass && u.removeClass(t.activeClass), u.removeClass("sticky-transition"), u.removeClass("sticky-absolute")) } else if (f != m.to && (a[p] = h[p] = !1), u.height() + m.pad.top + m.pad.bottom > l || a[p] || h[p]) { var z = parseInt(u.parent().parent().css("padding-top")); i + m.pad.top - z <= m.parentTop ? (u.css({ position: "", top: "", bottom: "", left: "" }), a[p] = h[p] = !1) : i >= m.to ? (u.css({ left: "", top: m.to2, bottom: "" }).css("position", "absolute"), t.activeClass && u.addClass(t.activeClass), u.hasClass("sticky-absolute") && u.addClass("sticky-transition"), u.addClass("sticky-absolute")) : i >= o ? a[p] ? (a[p] = !1, d = u.offset().top - m.parentTop, u.css({ left: "", top: d, bottom: "" }).css("position", "absolute"), t.activeClass && u.addClass(t.activeClass), u.hasClass("sticky-absolute") && u.addClass("sticky-transition"), u.addClass("sticky-absolute")) : !h[p] && u.height() + u.offset().top + m.pad.bottom < i + l && (h[p] = !0, !("fixed" == u.css("position")) && u.css({ left: u.offset().left, bottom: m.pad.bottom, top: "" }).css("position", "fixed"), t.activeClass && u.addClass(t.activeClass), u.removeClass("sticky-transition"), u.removeClass("sticky-absolute")) : i < o && (h[p] ? (h[p] = !1, d = u.offset().top - m.parentTop, u.css({ left: "", top: d, bottom: "" }).css("position", "absolute"), t.activeClass && u.addClass(t.activeClass), u.hasClass("sticky-absolute") && u.addClass("sticky-transition"), u.addClass("sticky-absolute")) : !a[p] && u.offset().top >= i + m.pad.top && (a[p] = !0, !("fixed" == u.css("position")) && u.css({ left: u.offset().left, top: m.pad.top, bottom: "" }).css("position", "fixed"), t.activeClass && u.addClass(t.activeClass), u.removeClass("sticky-transition"), u.removeClass("sticky-absolute"))) } else i >= m.parentTop - m.pad.top ? u.css({ position: "fixed", top: m.pad.top }) : u.css({ position: "", top: "", bottom: "", left: "" }), a[p] = h[p] = !1 } } o = i } }, c = function () { l(), p() }; return this.each(function () { var t = e(this), i = e(this).data("themePin") || {}; i && i.update || (s.push(t), e("img", this).one("load", l), i.update = c, e(this).data("themePin", i), a.push(!1), h.push(!1)) }), e(window).on("smartresize", function () { l(), p() }), e(window).on("touchmove scroll", p), l(), e(this).bind("recalc.pin", function () { l(), p() }), this }, t = t || {}; var i = function (t, e) { return this.initialize(t, e) }; i.defaults = { autoInit: !1, minWidth: 767, activeClass: "sticky-active", padding: { top: 0, bottom: 0 }, offsetTop: 0, offsetBottom: 0, autoFit: !1, fitToBottom: !1 }, i.prototype = { initialize: function (t, e) { return t.data("__sticky") ? this : (this.$el = t, this.setData().setOptions(e).build(), this) }, setData: function () { return this.$el.data("__sticky", this), this }, setOptions: function (t) { return this.options = e.extend(!0, {}, i.defaults, t, { wrapper: this.$el }), this }, build: function () { if (!e.isFunction(e.fn.themePin)) return this; var t = this.options.wrapper; return t.themePin(this.options), e(window).on("resize", function () { setTimeout(function () { t.trigger("recalc.pin") }, 800); var e = t.parent(); t.outerWidth(e.width()), "fixed" == t.css("position") && t.css("left", e.offset().left) }), this } }, e.extend(t, { Sticky: i }), e.fn.themeSticky = function (i) { return this.map(function () { var o = e(this); return o.data("__sticky") ? (o.trigger("recalc.pin"), setTimeout(function () { o.trigger("recalc.pin") }, 800), o.data("__sticky")) : new t.Sticky(o, i) }) } }.apply(this, [window.theme, jQuery]);
/*
* iziToast | v1.4.0
* http://izitoast.marcelodolce.com
* by Marcelo Dolce.
*/
!function (t, e) { "function" == typeof define && define.amd ? define([], e(t)) : "object" == typeof exports ? module.exports = e(t) : t.iziToast = e(t) }("undefined" != typeof global ? global : window || this.window || this.global, function (t) { "use strict"; var e = {}, n = "iziToast", o = (document.querySelector("body"), !!/Mobi/.test(navigator.userAgent)), i = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), s = "undefined" != typeof InstallTrigger, a = "ontouchstart" in document.documentElement, r = ["bottomRight", "bottomLeft", "bottomCenter", "topRight", "topLeft", "topCenter", "center"], l = { info: { color: "blue", icon: "ico-info" }, success: { color: "green", icon: "ico-success" }, warning: { color: "orange", icon: "ico-warning" }, error: { color: "red", icon: "ico-error" }, question: { color: "yellow", icon: "ico-question" } }, d = 568, c = {}; e.children = {}; var u = { id: null, "class": "", title: "", titleColor: "", titleSize: "", titleLineHeight: "", message: "", messageColor: "", messageSize: "", messageLineHeight: "", backgroundColor: "", theme: "light", color: "", icon: "", iconText: "", iconColor: "", iconUrl: null, image: "", imageWidth: 50, maxWidth: null, zindex: null, layout: 1, balloon: !1, close: !0, closeOnEscape: !1, closeOnClick: !1, displayMode: 0, position: "bottomRight", target: "", targetFirst: !0, timeout: 5e3, rtl: !1, animateInside: !0, drag: !0, pauseOnHover: !0, resetOnHover: !1, progressBar: !0, progressBarColor: "", progressBarEasing: "linear", overlay: !1, overlayClose: !1, overlayColor: "rgba(0, 0, 0, 0.6)", transitionIn: "fadeInUp", transitionOut: "fadeOut", transitionInMobile: "fadeInUp", transitionOutMobile: "fadeOutDown", buttons: {}, inputs: {}, onOpening: function () { }, onOpened: function () { }, onClosing: function () { }, onClosed: function () { } }; if ("remove" in Element.prototype || (Element.prototype.remove = function () { this.parentNode && this.parentNode.removeChild(this) }), "function" != typeof window.CustomEvent) { var p = function (t, e) { e = e || { bubbles: !1, cancelable: !1, detail: void 0 }; var n = document.createEvent("CustomEvent"); return n.initCustomEvent(t, e.bubbles, e.cancelable, e.detail), n }; p.prototype = window.Event.prototype, window.CustomEvent = p } var m = function (t, e, n) { if ("[object Object]" === Object.prototype.toString.call(t)) for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.call(n, t[o], o, t); else if (t) for (var i = 0, s = t.length; s > i; i++)e.call(n, t[i], i, t) }, g = function (t, e) { var n = {}; return m(t, function (e, o) { n[o] = t[o] }), m(e, function (t, o) { n[o] = e[o] }), n }, f = function (t) { var e = document.createDocumentFragment(), n = document.createElement("div"); for (n.innerHTML = t; n.firstChild;)e.appendChild(n.firstChild); return e }, v = function (t) { var e = btoa(encodeURIComponent(t)); return e.replace(/=/g, "") }, y = function (t) { return "#" == t.substring(0, 1) || "rgb" == t.substring(0, 3) || "hsl" == t.substring(0, 3) }, h = function (t) { try { return btoa(atob(t)) == t } catch (e) { return !1 } }, b = function () { return { move: function (t, e, o, a) { var r, l = .3, d = 180; 0 !== a && (t.classList.add(n + "-dragged"), t.style.transform = "translateX(" + a + "px)", a > 0 ? (r = (d - a) / d, l > r && e.hide(g(o, { transitionOut: "fadeOutRight", transitionOutMobile: "fadeOutRight" }), t, "drag")) : (r = (d + a) / d, l > r && e.hide(g(o, { transitionOut: "fadeOutLeft", transitionOutMobile: "fadeOutLeft" }), t, "drag")), t.style.opacity = r, l > r && ((i || s) && (t.style.left = a + "px"), t.parentNode.style.opacity = l, this.stopMoving(t, null))) }, startMoving: function (t, e, n, o) { o = o || window.event; var i = a ? o.touches[0].clientX : o.clientX, s = t.style.transform.replace("px)", ""); s = s.replace("translateX(", ""); var r = i - s; n.transitionIn && t.classList.remove(n.transitionIn), n.transitionInMobile && t.classList.remove(n.transitionInMobile), t.style.transition = "", a ? document.ontouchmove = function (o) { o.preventDefault(), o = o || window.event; var i = o.touches[0].clientX, s = i - r; b.move(t, e, n, s) } : document.onmousemove = function (o) { o.preventDefault(), o = o || window.event; var i = o.clientX, s = i - r; b.move(t, e, n, s) } }, stopMoving: function (t, e) { a ? document.ontouchmove = function () { } : document.onmousemove = function () { }, t.style.opacity = "", t.style.transform = "", t.classList.contains(n + "-dragged") && (t.classList.remove(n + "-dragged"), t.style.transition = "transform 0.4s ease, opacity 0.4s ease", setTimeout(function () { t.style.transition = "" }, 400)) } } }(); return e.setSetting = function (t, n, o) { e.children[t][n] = o }, e.getSetting = function (t, n) { return e.children[t][n] }, e.destroy = function () { m(document.querySelectorAll("." + n + "-overlay"), function (t, e) { t.remove() }), m(document.querySelectorAll("." + n + "-wrapper"), function (t, e) { t.remove() }), m(document.querySelectorAll("." + n), function (t, e) { t.remove() }), this.children = {}, document.removeEventListener(n + "-opened", {}, !1), document.removeEventListener(n + "-opening", {}, !1), document.removeEventListener(n + "-closing", {}, !1), document.removeEventListener(n + "-closed", {}, !1), document.removeEventListener("keyup", {}, !1), c = {} }, e.settings = function (t) { e.destroy(), c = t, u = g(u, t || {}) }, m(l, function (t, n) { e[n] = function (e) { var n = g(c, e || {}); n = g(t, n || {}), this.show(n) } }), e.progress = function (t, e, o) { var i = this, s = e.getAttribute("data-iziToast-ref"), a = g(this.children[s], t || {}), r = e.querySelector("." + n + "-progressbar div"); return { start: function () { "undefined" == typeof a.time.REMAINING && (e.classList.remove(n + "-reseted"), null !== r && (r.style.transition = "width " + a.timeout + "ms " + a.progressBarEasing, r.style.width = "0%"), a.time.START = (new Date).getTime(), a.time.END = a.time.START + a.timeout, a.time.TIMER = setTimeout(function () { clearTimeout(a.time.TIMER), e.classList.contains(n + "-closing") || (i.hide(a, e, "timeout"), "function" == typeof o && o.apply(i)) }, a.timeout), i.setSetting(s, "time", a.time)) }, pause: function () { if ("undefined" != typeof a.time.START && !e.classList.contains(n + "-paused") && !e.classList.contains(n + "-reseted")) { if (e.classList.add(n + "-paused"), a.time.REMAINING = a.time.END - (new Date).getTime(), clearTimeout(a.time.TIMER), i.setSetting(s, "time", a.time), null !== r) { var t = window.getComputedStyle(r), l = t.getPropertyValue("width"); r.style.transition = "none", r.style.width = l } "function" == typeof o && setTimeout(function () { o.apply(i) }, 10) } }, resume: function () { "undefined" != typeof a.time.REMAINING ? (e.classList.remove(n + "-paused"), null !== r && (r.style.transition = "width " + a.time.REMAINING + "ms " + a.progressBarEasing, r.style.width = "0%"), a.time.END = (new Date).getTime() + a.time.REMAINING, a.time.TIMER = setTimeout(function () { clearTimeout(a.time.TIMER), e.classList.contains(n + "-closing") || (i.hide(a, e, "timeout"), "function" == typeof o && o.apply(i)) }, a.time.REMAINING), i.setSetting(s, "time", a.time)) : this.start() }, reset: function () { clearTimeout(a.time.TIMER), delete a.time.REMAINING, i.setSetting(s, "time", a.time), e.classList.add(n + "-reseted"), e.classList.remove(n + "-paused"), null !== r && (r.style.transition = "none", r.style.width = "100%"), "function" == typeof o && setTimeout(function () { o.apply(i) }, 10) } } }, e.hide = function (t, e, i) { "object" != typeof e && (e = document.querySelector(e)); var s = this, a = g(this.children[e.getAttribute("data-iziToast-ref")], t || {}); a.closedBy = i || null, delete a.time.REMAINING, e.classList.add(n + "-closing"), function () { var t = document.querySelector("." + n + "-overlay"); if (null !== t) { var e = t.getAttribute("data-iziToast-ref"); e = e.split(","); var o = e.indexOf(String(a.ref)); -1 !== o && e.splice(o, 1), t.setAttribute("data-iziToast-ref", e.join()), 0 === e.length && (t.classList.remove("fadeIn"), t.classList.add("fadeOut"), setTimeout(function () { t.remove() }, 700)) } }(), a.transitionIn && e.classList.remove(a.transitionIn), a.transitionInMobile && e.classList.remove(a.transitionInMobile), o || window.innerWidth <= d ? a.transitionOutMobile && e.classList.add(a.transitionOutMobile) : a.transitionOut && e.classList.add(a.transitionOut); var r = e.parentNode.offsetHeight; e.parentNode.style.height = r + "px", e.style.pointerEvents = "none", (!o || window.innerWidth > d) && (e.parentNode.style.transitionDelay = "0.2s"); try { var l = new CustomEvent(n + "-closing", { detail: a, bubbles: !0, cancelable: !0 }); document.dispatchEvent(l) } catch (c) { console.warn(c) } setTimeout(function () { e.parentNode.style.height = "0px", e.parentNode.style.overflow = "", setTimeout(function () { delete s.children[a.ref], e.parentNode.remove(); try { var t = new CustomEvent(n + "-closed", { detail: a, bubbles: !0, cancelable: !0 }); document.dispatchEvent(t) } catch (o) { console.warn(o) } "undefined" != typeof a.onClosed && a.onClosed.apply(null, [a, e, i]) }, 1e3) }, 200), "undefined" != typeof a.onClosing && a.onClosing.apply(null, [a, e, i]) }, e.show = function (t) { var i = this, s = g(c, t || {}); if (s = g(u, s), s.time = {}, null === s.id && (s.id = v(s.title + s.message + s.color)), 1 === s.displayMode || "once" == s.displayMode) try { if (document.querySelectorAll("." + n + "#" + s.id).length > 0) return !1 } catch (l) { console.warn("[" + n + "] Could not find an element with this selector: #" + s.id + ". Try to set an valid id.") } if (2 === s.displayMode || "replace" == s.displayMode) try { m(document.querySelectorAll("." + n + "#" + s.id), function (t, e) { i.hide(s, t, "replaced") }) } catch (l) { console.warn("[" + n + "] Could not find an element with this selector: #" + s.id + ". Try to set an valid id.") } s.ref = (new Date).getTime() + Math.floor(1e7 * Math.random() + 1), e.children[s.ref] = s; var p = { body: document.querySelector("body"), overlay: document.createElement("div"), toast: document.createElement("div"), toastBody: document.createElement("div"), toastTexts: document.createElement("div"), toastCapsule: document.createElement("div"), cover: document.createElement("div"), buttons: document.createElement("div"), inputs: document.createElement("div"), icon: s.iconUrl ? document.createElement("img") : document.createElement("i"), wrapper: null }; p.toast.setAttribute("data-iziToast-ref", s.ref), p.toast.appendChild(p.toastBody), p.toastCapsule.appendChild(p.toast), function () { if (p.toast.classList.add(n), p.toast.classList.add(n + "-opening"), p.toastCapsule.classList.add(n + "-capsule"), p.toastBody.classList.add(n + "-body"), p.toastTexts.classList.add(n + "-texts"), o || window.innerWidth <= d ? s.transitionInMobile && p.toast.classList.add(s.transitionInMobile) : s.transitionIn && p.toast.classList.add(s.transitionIn), s["class"]) { var t = s["class"].split(" "); m(t, function (t, e) { p.toast.classList.add(t) }) } s.id && (p.toast.id = s.id), s.rtl && (p.toast.classList.add(n + "-rtl"), p.toast.setAttribute("dir", "rtl")), s.layout > 1 && p.toast.classList.add(n + "-layout" + s.layout), s.balloon && p.toast.classList.add(n + "-balloon"), s.maxWidth && (isNaN(s.maxWidth) ? p.toast.style.maxWidth = s.maxWidth : p.toast.style.maxWidth = s.maxWidth + "px"), "" === s.theme && "light" === s.theme || p.toast.classList.add(n + "-theme-" + s.theme), s.color && (y(s.color) ? p.toast.style.background = s.color : p.toast.classList.add(n + "-color-" + s.color)), s.backgroundColor && (p.toast.style.background = s.backgroundColor, s.balloon && (p.toast.style.borderColor = s.backgroundColor)) }(), function () { s.image && (p.cover.classList.add(n + "-cover"), p.cover.style.width = s.imageWidth + "px", h(s.image.replace(/ /g, "")) ? p.cover.style.backgroundImage = "url(data:image/png;base64," + s.image.replace(/ /g, "") + ")" : p.cover.style.backgroundImage = "url(" + s.image + ")", s.rtl ? p.toastBody.style.marginRight = s.imageWidth + 10 + "px" : p.toastBody.style.marginLeft = s.imageWidth + 10 + "px", p.toast.appendChild(p.cover)) }(), function () { s.close ? (p.buttonClose = document.createElement("button"), p.buttonClose.type = "button", p.buttonClose.classList.add(n + "-close"), p.buttonClose.addEventListener("click", function (t) { t.target; i.hide(s, p.toast, "button") }), p.toast.appendChild(p.buttonClose)) : s.rtl ? p.toast.style.paddingLeft = "18px" : p.toast.style.paddingRight = "18px" }(), function () { s.progressBar && (p.progressBar = document.createElement("div"), p.progressBarDiv = document.createElement("div"), p.progressBar.classList.add(n + "-progressbar"), p.progressBarDiv.style.background = s.progressBarColor, p.progressBar.appendChild(p.progressBarDiv), p.toast.appendChild(p.progressBar)), s.timeout && (s.pauseOnHover && !s.resetOnHover && (p.toast.addEventListener("mouseenter", function (t) { i.progress(s, p.toast).pause() }), p.toast.addEventListener("mouseleave", function (t) { i.progress(s, p.toast).resume() })), s.resetOnHover && (p.toast.addEventListener("mouseenter", function (t) { i.progress(s, p.toast).reset() }), p.toast.addEventListener("mouseleave", function (t) { i.progress(s, p.toast).start() }))) }(), function () { s.iconUrl ? (p.icon.setAttribute("class", n + "-icon"), p.icon.setAttribute("src", s.iconUrl)) : s.icon && (p.icon.setAttribute("class", n + "-icon " + s.icon), s.iconText && p.icon.appendChild(document.createTextNode(s.iconText)), s.iconColor && (p.icon.style.color = s.iconColor)), (s.icon || s.iconUrl) && (s.rtl ? p.toastBody.style.paddingRight = "33px" : p.toastBody.style.paddingLeft = "33px", p.toastBody.appendChild(p.icon)) }(), function () { s.title.length > 0 && (p.strong = document.createElement("strong"), p.strong.classList.add(n + "-title"), p.strong.appendChild(f(s.title)), p.toastTexts.appendChild(p.strong), s.titleColor && (p.strong.style.color = s.titleColor), s.titleSize && (isNaN(s.titleSize) ? p.strong.style.fontSize = s.titleSize : p.strong.style.fontSize = s.titleSize + "px"), s.titleLineHeight && (isNaN(s.titleSize) ? p.strong.style.lineHeight = s.titleLineHeight : p.strong.style.lineHeight = s.titleLineHeight + "px")), s.message.length > 0 && (p.p = document.createElement("p"), p.p.classList.add(n + "-message"), p.p.appendChild(f(s.message)), p.toastTexts.appendChild(p.p), s.messageColor && (p.p.style.color = s.messageColor), s.messageSize && (isNaN(s.titleSize) ? p.p.style.fontSize = s.messageSize : p.p.style.fontSize = s.messageSize + "px"), s.messageLineHeight && (isNaN(s.titleSize) ? p.p.style.lineHeight = s.messageLineHeight : p.p.style.lineHeight = s.messageLineHeight + "px")), s.title.length > 0 && s.message.length > 0 && (s.rtl ? p.strong.style.marginLeft = "10px" : 2 === s.layout || s.rtl || (p.strong.style.marginRight = "10px")) }(), p.toastBody.appendChild(p.toastTexts); var L; !function () { s.inputs.length > 0 && (p.inputs.classList.add(n + "-inputs"), m(s.inputs, function (t, e) { p.inputs.appendChild(f(t[0])), L = p.inputs.childNodes, L[e].classList.add(n + "-inputs-child"), t[3] && setTimeout(function () { L[e].focus() }, 300), L[e].addEventListener(t[1], function (e) { var n = t[2]; return n(i, p.toast, this, e) }) }), p.toastBody.appendChild(p.inputs)) }(), function () { s.buttons.length > 0 && (p.buttons.classList.add(n + "-buttons"), m(s.buttons, function (t, e) { p.buttons.appendChild(f(t[0])); var o = p.buttons.childNodes; o[e].classList.add(n + "-buttons-child"), t[2] && setTimeout(function () { o[e].focus() }, 300), o[e].addEventListener("click", function (e) { e.preventDefault(); var n = t[1]; return n(i, p.toast, this, e, L) }) })), p.toastBody.appendChild(p.buttons) }(), s.message.length > 0 && (s.inputs.length > 0 || s.buttons.length > 0) && (p.p.style.marginBottom = "0"), (s.inputs.length > 0 || s.buttons.length > 0) && (s.rtl ? p.toastTexts.style.marginLeft = "10px" : p.toastTexts.style.marginRight = "10px", s.inputs.length > 0 && s.buttons.length > 0 && (s.rtl ? p.inputs.style.marginLeft = "8px" : p.inputs.style.marginRight = "8px")), function () { p.toastCapsule.style.visibility = "hidden", setTimeout(function () { var t = p.toast.offsetHeight, e = p.toast.currentStyle || window.getComputedStyle(p.toast), n = e.marginTop; n = n.split("px"), n = parseInt(n[0]); var o = e.marginBottom; o = o.split("px"), o = parseInt(o[0]), p.toastCapsule.style.visibility = "", p.toastCapsule.style.height = t + o + n + "px", setTimeout(function () { p.toastCapsule.style.height = "auto", s.target && (p.toastCapsule.style.overflow = "visible") }, 500), s.timeout && i.progress(s, p.toast).start() }, 100) }(), function () { var t = s.position; if (s.target) p.wrapper = document.querySelector(s.target), p.wrapper.classList.add(n + "-target"), s.targetFirst ? p.wrapper.insertBefore(p.toastCapsule, p.wrapper.firstChild) : p.wrapper.appendChild(p.toastCapsule); else { if (-1 == r.indexOf(s.position)) return void console.warn("[" + n + "] Incorrect position.\nIt can be › " + r); t = o || window.innerWidth <= d ? "bottomLeft" == s.position || "bottomRight" == s.position || "bottomCenter" == s.position ? n + "-wrapper-bottomCenter" : "topLeft" == s.position || "topRight" == s.position || "topCenter" == s.position ? n + "-wrapper-topCenter" : n + "-wrapper-center" : n + "-wrapper-" + t, p.wrapper = document.querySelector("." + n + "-wrapper." + t), p.wrapper || (p.wrapper = document.createElement("div"), p.wrapper.classList.add(n + "-wrapper"), p.wrapper.classList.add(t), document.body.appendChild(p.wrapper)), "topLeft" == s.position || "topCenter" == s.position || "topRight" == s.position ? p.wrapper.insertBefore(p.toastCapsule, p.wrapper.firstChild) : p.wrapper.appendChild(p.toastCapsule) } isNaN(s.zindex) ? console.warn("[" + n + "] Invalid zIndex.") : p.wrapper.style.zIndex = s.zindex }(), function () { s.overlay && (null !== document.querySelector("." + n + "-overlay.fadeIn") ? (p.overlay = document.querySelector("." + n + "-overlay"), p.overlay.setAttribute("data-iziToast-ref", p.overlay.getAttribute("data-iziToast-ref") + "," + s.ref), isNaN(s.zindex) || null === s.zindex || (p.overlay.style.zIndex = s.zindex - 1)) : (p.overlay.classList.add(n + "-overlay"), p.overlay.classList.add("fadeIn"), p.overlay.style.background = s.overlayColor, p.overlay.setAttribute("data-iziToast-ref", s.ref), isNaN(s.zindex) || null === s.zindex || (p.overlay.style.zIndex = s.zindex - 1), document.querySelector("body").appendChild(p.overlay)), s.overlayClose ? (p.overlay.removeEventListener("click", {}), p.overlay.addEventListener("click", function (t) { i.hide(s, p.toast, "overlay") })) : p.overlay.removeEventListener("click", {})) }(), function () { if (s.animateInside) { p.toast.classList.add(n + "-animateInside"); var t = [200, 100, 300]; "bounceInLeft" != s.transitionIn && "bounceInRight" != s.transitionIn || (t = [400, 200, 400]), s.title.length > 0 && setTimeout(function () { p.strong.classList.add("slideIn") }, t[0]), s.message.length > 0 && setTimeout(function () { p.p.classList.add("slideIn") }, t[1]), (s.icon || s.iconUrl) && setTimeout(function () { p.icon.classList.add("revealIn") }, t[2]); var e = 150; s.buttons.length > 0 && p.buttons && setTimeout(function () { m(p.buttons.childNodes, function (t, n) { setTimeout(function () { t.classList.add("revealIn") }, e), e += 150 }) }, s.inputs.length > 0 ? 150 : 0), s.inputs.length > 0 && p.inputs && (e = 150, m(p.inputs.childNodes, function (t, n) { setTimeout(function () { t.classList.add("revealIn") }, e), e += 150 })) } }(), s.onOpening.apply(null, [s, p.toast]); try { var C = new CustomEvent(n + "-opening", { detail: s, bubbles: !0, cancelable: !0 }); document.dispatchEvent(C) } catch (w) { console.warn(w) } setTimeout(function () { p.toast.classList.remove(n + "-opening"), p.toast.classList.add(n + "-opened"); try { var t = new CustomEvent(n + "-opened", { detail: s, bubbles: !0, cancelable: !0 }); document.dispatchEvent(t) } catch (e) { console.warn(e) } s.onOpened.apply(null, [s, p.toast]) }, 1e3), s.drag && (a ? (p.toast.addEventListener("touchstart", function (t) { b.startMoving(this, i, s, t) }, !1), p.toast.addEventListener("touchend", function (t) { b.stopMoving(this, t) }, !1)) : (p.toast.addEventListener("mousedown", function (t) { t.preventDefault(), b.startMoving(this, i, s, t) }, !1), p.toast.addEventListener("mouseup", function (t) { t.preventDefault(), b.stopMoving(this, t) }, !1))), s.closeOnEscape && document.addEventListener("keyup", function (t) { t = t || window.event, 27 == t.keyCode && i.hide(s, p.toast, "esc") }), s.closeOnClick && p.toast.addEventListener("click", function (t) { i.hide(s, p.toast, "toast") }), i.toast = p.toast }, e });
(function (c) { c.extend(c.fn, { validate: function (a) { if (this.length) { var b = c.data(this[0], "validator"); if (b) return b; this.attr("novalidate", "novalidate"); b = new c.validator(a, this[0]); c.data(this[0], "validator", b); if (b.settings.onsubmit) { a = this.find("input, button"); a.filter(".cancel").click(function () { b.cancelSubmit = true }); b.settings.submitHandler && a.filter(":submit").click(function () { b.submitButton = this }); this.submit(function (d) { function e() { if (b.settings.submitHandler) { if (b.submitButton) var f = c("
").attr("name", b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm); b.settings.submitHandler.call(b, b.currentForm); b.submitButton && f.remove(); return false } return true } b.settings.debug && d.preventDefault(); if (b.cancelSubmit) { b.cancelSubmit = false; return e() } if (b.form()) { if (b.pendingRequest) { b.formSubmitted = true; return false } return e() } else { b.focusInvalid(); return false } }) } return b } else a && a.debug && window.console && console.warn("nothing selected, can't validate, returning nothing") }, valid: function () { if (c(this[0]).is("form")) return this.validate().form(); else { var a = true, b = c(this[0].form).validate(); this.each(function () { a &= b.element(this) }); return a } }, removeAttrs: function (a) { var b = {}, d = this; c.each(a.split(/\s/), function (e, f) { b[f] = d.attr(f); d.removeAttr(f) }); return b }, rules: function (a, b) { var d = this[0]; if (a) { var e = c.data(d.form, "validator").settings, f = e.rules, g = c.validator.staticRules(d); switch (a) { case "add": c.extend(g, c.validator.normalizeRule(b)); f[d.name] = g; if (b.messages) e.messages[d.name] = c.extend(e.messages[d.name], b.messages); break; case "remove": if (!b) { delete f[d.name]; return g } var h = {}; c.each(b.split(/\s/), function (j, i) { h[i] = g[i]; delete g[i] }); return h } } d = c.validator.normalizeRules(c.extend({}, c.validator.metadataRules(d), c.validator.classRules(d), c.validator.attributeRules(d), c.validator.staticRules(d)), d); if (d.required) { e = d.required; delete d.required; d = c.extend({ required: e }, d) } return d } }); c.extend(c.expr[":"], { blank: function (a) { return !c.trim("" + a.value) }, filled: function (a) { return !!c.trim("" + a.value) }, unchecked: function (a) { return !a.checked } }); c.validator = function (a, b) { this.settings = c.extend(true, {}, c.validator.defaults, a); this.currentForm = b; this.init() }; c.validator.format = function (a, b) { if (arguments.length == 1) return function () { var d = c.makeArray(arguments); d.unshift(a); return c.validator.format.apply(this, d) }; if (arguments.length > 2 && b.constructor != Array) b = c.makeArray(arguments).slice(1); if (b.constructor != Array) b = [b]; c.each(b, function (d, e) { a = a.replace(RegExp("\\{" + d + "\\}", "g"), e) }); return a }; c.extend(c.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: c([]), errorLabelContainer: c([]), onsubmit: true, ignore: ":hidden", ignoreTitle: false, onfocusin: function (a) { this.lastActive = a; if (this.settings.focusCleanup && !this.blockFocusCleanup) { this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass); this.addWrapper(this.errorsFor(a)).hide() } }, onfocusout: function (a) { if (!this.checkable(a) && (a.name in this.submitted || !this.optional(a))) this.element(a) }, onkeyup: function (a) { if (a.name in this.submitted || a == this.lastElement) this.element(a) }, onclick: function (a) { if (a.name in this.submitted) this.element(a); else a.parentNode.name in this.submitted && this.element(a.parentNode) }, highlight: function (a, b, d) { a.type === "radio" ? this.findByName(a.name).addClass(b).removeClass(d) : c(a).addClass(b).removeClass(d) }, unhighlight: function (a, b, d) { a.type === "radio" ? this.findByName(a.name).removeClass(b).addClass(d) : c(a).removeClass(b).addClass(d) } }, setDefaults: function (a) { c.extend(c.validator.defaults, a) }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", maxlength: c.validator.format("Please enter no more than {0} characters."), minlength: c.validator.format("Please enter at least {0} characters."), rangelength: c.validator.format("Please enter a value between {0} and {1} characters long."), range: c.validator.format("Please enter a value between {0} and {1}."), max: c.validator.format("Please enter a value less than or equal to {0}."), min: c.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: false, prototype: { init: function () { function a(e) { var f = c.data(this[0].form, "validator"), g = "on" + e.type.replace(/^validate/, ""); f.settings[g] && f.settings[g].call(f, this[0], e) } this.labelContainer = c(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length && this.labelContainer || c(this.currentForm); this.containers = c(this.settings.errorContainer).add(this.settings.errorLabelContainer); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var b = this.groups = {}; c.each(this.settings.groups, function (e, f) { c.each(f.split(/\s/), function (g, h) { b[h] = e }) }); var d = this.settings.rules; c.each(d, function (e, f) { d[e] = c.validator.normalizeRule(f) }); c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", a).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", a); this.settings.invalidHandler && c(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler) }, form: function () { this.checkForm(); c.extend(this.submitted, this.errorMap); this.invalid = c.extend({}, this.errorMap); this.valid() || c(this.currentForm).triggerHandler("invalid-form", [this]); this.showErrors(); return this.valid() }, checkForm: function () { this.prepareForm(); for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++)this.check(b[a]); return this.valid() }, element: function (a) { this.lastElement = a = this.validationTargetFor(this.clean(a)); this.prepareElement(a); this.currentElements = c(a); var b = this.check(a); if (b) delete this.invalid[a.name]; else this.invalid[a.name] = true; if (!this.numberOfInvalids()) this.toHide = this.toHide.add(this.containers); this.showErrors(); return b }, showErrors: function (a) { if (a) { c.extend(this.errorMap, a); this.errorList = []; for (var b in a) this.errorList.push({ message: a[b], element: this.findByName(b)[0] }); this.successList = c.grep(this.successList, function (d) { return !(d.name in a) }) } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors() }, resetForm: function () { c.fn.resetForm && c(this.currentForm).resetForm(); this.submitted = {}; this.lastElement = null; this.prepareForm(); this.hideErrors(); this.elements().removeClass(this.settings.errorClass) }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (a) { var b = 0, d; for (d in a) b++; return b }, hideErrors: function () { this.addWrapper(this.toHide).hide() }, valid: function () { return this.size() == 0 }, size: function () { return this.errorList.length }, focusInvalid: function () { if (this.settings.focusInvalid) try { c(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (a) { } }, findLastActive: function () { var a = this.lastActive; return a && c.grep(this.errorList, function (b) { return b.element.name == a.name }).length == 1 && a }, elements: function () { var a = this, b = {}; return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () { !this.name && a.settings.debug && window.console && console.error("%o has no name assigned", this); if (this.name in b || !a.objectLength(c(this).rules())) return false; return b[this.name] = true }) }, clean: function (a) { return c(a)[0] }, errors: function () { return c(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext) }, reset: function () { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = c([]); this.toHide = c([]); this.currentElements = c([]) }, prepareForm: function () { this.reset(); this.toHide = this.errors().add(this.containers) }, prepareElement: function (a) { this.reset(); this.toHide = this.errorsFor(a) }, check: function (a) { a = this.validationTargetFor(this.clean(a)); var b = c(a).rules(), d = false, e; for (e in b) { var f = { method: e, parameters: b[e] }; try { var g = c.validator.methods[e].call(this, a.value.replace(/\r/g, ""), a, f.parameters); if (g == "dependency-mismatch") d = true; else { d = false; if (g == "pending") { this.toHide = this.toHide.not(this.errorsFor(a)); return } if (!g) { this.formatAndAdd(a, f); return false } } } catch (h) { this.settings.debug && window.console && console.log("exception occured when checking element " + a.id + ", check the '" + f.method + "' method", h); throw h; } } if (!d) { this.objectLength(b) && this.successList.push(a); return true } }, customMetaMessage: function (a, b) { if (c.metadata) { var d = this.settings.meta ? c(a).metadata()[this.settings.meta] : c(a).metadata(); return d && d.messages && d.messages[b] } }, customMessage: function (a, b) { var d = this.settings.messages[a]; return d && (d.constructor == String ? d : d[b]) }, findDefined: function () { for (var a = 0; a < arguments.length; a++)if (arguments[a] !== undefined) return arguments[a] }, defaultMessage: function (a, b) { return this.findDefined(this.customMessage(a.name, b), this.customMetaMessage(a, b), !this.settings.ignoreTitle && a.title || undefined, c.validator.messages[b], "
Warning: No message defined for " + a.name + "") }, formatAndAdd: function (a, b) { var d = this.defaultMessage(a, b.method), e = /\$?\{(\d+)\}/g; if (typeof d == "function") d = d.call(this, b.parameters, a); else if (e.test(d)) d = jQuery.format(d.replace(e, "{$1}"), b.parameters); this.errorList.push({ message: d, element: a }); this.errorMap[a.name] = d; this.submitted[a.name] = d }, addWrapper: function (a) { if (this.settings.wrapper) a = a.add(a.parent(this.settings.wrapper)); return a }, defaultShowErrors: function () { for (var a = 0; this.errorList[a]; a++) { var b = this.errorList[a]; this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass); this.showLabel(b.element, b.message) } if (this.errorList.length) this.toShow = this.toShow.add(this.containers); if (this.settings.success) for (a = 0; this.successList[a]; a++)this.showLabel(this.successList[a]); if (this.settings.unhighlight) { a = 0; for (b = this.validElements(); b[a]; a++)this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass) } this.toHide = this.toHide.not(this.toShow); this.hideErrors(); this.addWrapper(this.toShow).show() }, validElements: function () { return this.currentElements.not(this.invalidElements()) }, invalidElements: function () { return c(this.errorList).map(function () { return this.element }) }, showLabel: function (a, b) { var d = this.errorsFor(a); if (d.length) { d.removeClass(this.settings.validClass).addClass(this.settings.errorClass); d.attr("generated") && d.html(b) } else { d = c("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(a), generated: true }).addClass(this.settings.errorClass).html(b || ""); if (this.settings.wrapper) d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, c(a)) : d.insertAfter(a)) } if (!b && this.settings.success) { d.text(""); typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d) } this.toShow = this.toShow.add(d) }, errorsFor: function (a) { var b = this.idOrName(a); return this.errors().filter(function () { return c(this).attr("for") == b }) }, idOrName: function (a) { return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) }, validationTargetFor: function (a) { if (this.checkable(a)) a = this.findByName(a.name).not(this.settings.ignore)[0]; return a }, checkable: function (a) { return /radio|checkbox/i.test(a.type) }, findByName: function (a) { var b = this.currentForm; return c(document.getElementsByName(a)).map(function (d, e) { return e.form == b && e.name == a && e || null }) }, getLength: function (a, b) { switch (b.nodeName.toLowerCase()) { case "select": return c("option:selected", b).length; case "input": if (this.checkable(b)) return this.findByName(b.name).filter(":checked").length }return a.length }, depend: function (a, b) { return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : true }, dependTypes: { "boolean": function (a) { return a }, string: function (a, b) { return !!c(a, b.form).length }, "function": function (a, b) { return a(b) } }, optional: function (a) { return !c.validator.methods.required.call(this, c.trim(a.value), a) && "dependency-mismatch" }, startRequest: function (a) { if (!this.pending[a.name]) { this.pendingRequest++; this.pending[a.name] = true } }, stopRequest: function (a, b) { this.pendingRequest--; if (this.pendingRequest < 0) this.pendingRequest = 0; delete this.pending[a.name]; if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) { c(this.currentForm).submit(); this.formSubmitted = false } else if (!b && this.pendingRequest == 0 && this.formSubmitted) { c(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted = false } }, previousValue: function (a) { return c.data(a, "previousValue") || c.data(a, "previousValue", { old: null, valid: true, message: this.defaultMessage(a, "remote") }) } }, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, dateDE: { dateDE: true }, number: { number: true }, numberDE: { numberDE: true }, digits: { digits: true }, creditcard: { creditcard: true } }, addClassRules: function (a, b) { a.constructor == String ? this.classRuleSettings[a] = b : c.extend(this.classRuleSettings, a) }, classRules: function (a) { var b = {}; (a = c(a).attr("class")) && c.each(a.split(" "), function () { this in c.validator.classRuleSettings && c.extend(b, c.validator.classRuleSettings[this]) }); return b }, attributeRules: function (a) { var b = {}; a = c(a); for (var d in c.validator.methods) { var e; if (e = d === "required" && typeof c.fn.prop === "function" ? a.prop(d) : a.attr(d)) b[d] = e; else if (a[0].getAttribute("type") === d) b[d] = true } b.maxlength && /-1|2147483647|524288/.test(b.maxlength) && delete b.maxlength; return b }, metadataRules: function (a) { if (!c.metadata) return {}; var b = c.data(a.form, "validator").settings.meta; return b ? c(a).metadata()[b] : c(a).metadata() }, staticRules: function (a) { var b = {}, d = c.data(a.form, "validator"); if (d.settings.rules) b = c.validator.normalizeRule(d.settings.rules[a.name]) || {}; return b }, normalizeRules: function (a, b) { c.each(a, function (d, e) { if (e === false) delete a[d]; else if (e.param || e.depends) { var f = true; switch (typeof e.depends) { case "string": f = !!c(e.depends, b.form).length; break; case "function": f = e.depends.call(b, b) }if (f) a[d] = e.param !== undefined ? e.param : true; else delete a[d] } }); c.each(a, function (d, e) { a[d] = c.isFunction(e) ? e(b) : e }); c.each(["minlength", "maxlength", "min", "max"], function () { if (a[this]) a[this] = Number(a[this]) }); c.each(["rangelength", "range"], function () { if (a[this]) a[this] = [Number(a[this][0]), Number(a[this][1])] }); if (c.validator.autoCreateRanges) { if (a.min && a.max) { a.range = [a.min, a.max]; delete a.min; delete a.max } if (a.minlength && a.maxlength) { a.rangelength = [a.minlength, a.maxlength]; delete a.minlength; delete a.maxlength } } a.messages && delete a.messages; return a }, normalizeRule: function (a) { if (typeof a == "string") { var b = {}; c.each(a.split(/\s/), function () { b[this] = true }); a = b } return a }, addMethod: function (a, b, d) { c.validator.methods[a] = b; c.validator.messages[a] = d != undefined ? d : c.validator.messages[a]; b.length < 3 && c.validator.addClassRules(a, c.validator.normalizeRule(a)) }, methods: { required: function (a, b, d) { if (!this.depend(d, b)) return "dependency-mismatch"; switch (b.nodeName.toLowerCase()) { case "select": return (a = c(b).val()) && a.length > 0; case "input": if (this.checkable(b)) return this.getLength(a, b) > 0; default: return c.trim(a).length > 0 } }, remote: function (a, b, d) { if (this.optional(b)) return "dependency-mismatch"; var e = this.previousValue(b); this.settings.messages[b.name] || (this.settings.messages[b.name] = {}); e.originalMessage = this.settings.messages[b.name].remote; this.settings.messages[b.name].remote = e.message; d = typeof d == "string" && { url: d } || d; if (this.pending[b.name]) return "pending"; if (e.old === a) return e.valid; e.old = a; var f = this; this.startRequest(b); var g = {}; g[b.name] = a; c.ajax(c.extend(true, { url: d, mode: "abort", port: "validate" + b.name, dataType: "json", data: g, success: function (h) { f.settings.messages[b.name].remote = e.originalMessage; var j = h === true; if (j) { var i = f.formSubmitted; f.prepareElement(b); f.formSubmitted = i; f.successList.push(b); f.showErrors() } else { i = {}; h = h || f.defaultMessage(b, "remote"); i[b.name] = e.message = c.isFunction(h) ? h(a) : h; f.showErrors(i) } e.valid = j; f.stopRequest(b, j) } }, d)); return "pending" }, minlength: function (a, b, d) { return this.optional(b) || this.getLength(c.trim(a), b) >= d }, maxlength: function (a, b, d) { return this.optional(b) || this.getLength(c.trim(a), b) <= d }, rangelength: function (a, b, d) { a = this.getLength(c.trim(a), b); return this.optional(b) || a >= d[0] && a <= d[1] }, min: function (a, b, d) { return this.optional(b) || a >= d }, max: function (a, b, d) { return this.optional(b) || a <= d }, range: function (a, b, d) { return this.optional(b) || a >= d[0] && a <= d[1] }, email: function (a, b) { return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a) }, url: function (a, b) { return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a) }, date: function (a, b) { return this.optional(b) || !/Invalid|NaN/.test(new Date(a)) }, dateISO: function (a, b) { return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a) }, number: function (a, b) { return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a) }, digits: function (a, b) { return this.optional(b) || /^\d+$/.test(a) }, creditcard: function (a, b) { if (this.optional(b)) return "dependency-mismatch"; if (/[^0-9 -]+/.test(a)) return false; var d = 0, e = 0, f = false; a = a.replace(/\D/g, ""); for (var g = a.length - 1; g >= 0; g--) { e = a.charAt(g); e = parseInt(e, 10); if (f) if ((e *= 2) > 9) e -= 9; d += e; f = !f } return d % 10 == 0 }, accept: function (a, b, d) { d = typeof d == "string" ? d.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(b) || a.match(RegExp(".(" + d + ")$", "i")) }, equalTo: function (a, b, d) { d = c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () { c(b).valid() }); return a == d.val() } } }); c.format = c.validator.format })(jQuery); (function (c) { var a = {}; if (c.ajaxPrefilter) c.ajaxPrefilter(function (d, e, f) { e = d.port; if (d.mode == "abort") { a[e] && a[e].abort(); a[e] = f } }); else { var b = c.ajax; c.ajax = function (d) { var e = ("port" in d ? d : c.ajaxSettings).port; if (("mode" in d ? d : c.ajaxSettings).mode == "abort") { a[e] && a[e].abort(); return a[e] = b.apply(this, arguments) } return b.apply(this, arguments) } } })(jQuery); (function (c) { !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && c.each({ focus: "focusin", blur: "focusout" }, function (a, b) { function d(e) { e = c.event.fix(e); e.type = b; return c.event.handle.call(this, e) } c.event.special[b] = { setup: function () { this.addEventListener(a, d, true) }, teardown: function () { this.removeEventListener(a, d, true) }, handler: function (e) { arguments[0] = c.event.fix(e); arguments[0].type = b; return c.event.handle.apply(this, arguments) } } }); c.extend(c.fn, { validateDelegate: function (a, b, d) { return this.bind(b, function (e) { var f = c(e.target); if (f.is(a)) return d.apply(f, arguments) }) } }) })(jQuery);
$.extend($.validator.messages, { required: "Este campo es obligatorio.", remote: "Por favor, rellena este campo.", email: "Por favor, escribe una dirección de correo válida.", url: "Por favor, escribe una URL válida.", date: "Por favor, escribe una fecha válida.", dateISO: "Por favor, escribe una fecha (ISO) válida.", number: "Por favor, escribe un número válido.", digits: "Por favor, escribe sólo dígitos.", creditcard: "Por favor, escribe un número de tarjeta válido.", equalTo: "Por favor, escribe el mismo valor de nuevo.", extension: "Por favor, escribe un valor con una extensión aceptada.", maxlength: $.validator.format("Por favor, no escribas más de {0} caracteres."), minlength: $.validator.format("Por favor, no escribas menos de {0} caracteres."), rangelength: $.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), range: $.validator.format("Por favor, escribe un valor entre {0} y {1}."), max: $.validator.format("Por favor, escribe un valor menor o igual a {0}."), min: $.validator.format("Por favor, escribe un valor mayor o igual a {0}."), nifES: "Por favor, escribe un NIF válido.", nieES: "Por favor, escribe un NIE válido.", cifES: "Por favor, escribe un CIF válido." });
function mensaje(e, t, o) { iziToast.show({ title: t, message: o, class: "iziToast-color-" + e, theme: "light", position: "bottomRight" }) } function reload_carro() { $.getJSON("/carro-de-compras/get", function (e) { var a = 0; $(".dropdown-cart-products").empty(), 0 < e.productos.length ? ($.each(e.productos, function (e, t) { t.estado || (a += parseInt(t.cantidad)); var o = '
\t
' + (t.estado ? '
NO DISPONIBLE' : "") + '\t\t
\t\t\t' + t.nombre + '\t\t\t\t
\t\t\t' + t.cantidad + "\t\t\tx " + t.precio + "" + (0 < t.grabado ? '
+ ' + t.grabado_f + " (grabado adicional)" : "") + (t.medida_id ? "
Medida: " + t.medida_nombre + "" : "") + '\t\t\t
\t
\t\t\t\t\t
\t\t\t\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 += '
" }) : 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())
}