// Magnific Popup v1.1.0 by Dmitry Semenov
// http://bit.ly/magnific-popup#build=ajax
(function (a) {
typeof define == "function" && define.amd ? define(["jquery"], a) : typeof exports == "object" ? a(require("jquery")) : a(window.jQuery || window.Zepto)
})(function (a) {
var b = "Close",
c = "BeforeClose",
d = "AfterClose",
e = "BeforeAppend",
f = "MarkupParse",
g = "Open",
h = "Change",
i = "mfp",
j = "." + i,
k = "mfp-ready",
l = "mfp-removing",
m = "mfp-prevent-close",
n, o = function () {},
p = !!window.jQuery,
q, r = a(window),
s, t, u, v, w = function (a, b) {
n.ev.on(i + a + j, b)
},
x = function (b, c, d, e) {
var f = document.createElement("div");
return f.className = "mfp-" + b, d && (f.innerHTML = d), e ? c && c.appendChild(f) : (f = a(f), c && f.appendTo(c)), f
},
y = function (b, c) {
n.ev.triggerHandler(i + b, c), n.st.callbacks && (b = b.charAt(0).toLowerCase() + b.slice(1), n.st.callbacks[b] && n.st.callbacks[b].apply(n, a.isArray(c) ? c : [c]))
},
z = function (b) {
if (b !== v || !n.currTemplate.closeBtn) n.currTemplate.closeBtn = a(n.st.closeMarkup.replace("%title%", n.st.tClose)), v = b;
return n.currTemplate.closeBtn
},
A = function () {
a.magnificPopup.instance || (n = new o, n.init(), a.magnificPopup.instance = n)
},
B = function () {
var a = document.createElement("p").style,
b = ["ms", "O", "Moz", "Webkit"];
if (a.transition !== undefined) return !0;
while (b.length)
if (b.pop() + "Transition" in a) return !0;
return !1
};
o.prototype = {
constructor: o,
init: function () {
var b = navigator.appVersion;
n.isLowIE = n.isIE8 = document.all && !document.addEventListener, n.isAndroid = /android/gi.test(b), n.isIOS = /iphone|ipad|ipod/gi.test(b), n.supportsTransition = B(), n.probablyMobile = n.isAndroid || n.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), s = a(document), n.popupsCache = {}
},
open: function (b) {
var c;
if (b.isObj === !1) {
n.items = b.items.toArray(), n.index = 0;
var d = b.items,
e;
for (c = 0; c < d.length; c++) {
e = d[c], e.parsed && (e = e.el[0]);
if (e === b.el[0]) {
n.index = c;
break
}
}
} else n.items = a.isArray(b.items) ? b.items : [b.items], n.index = b.index || 0;
if (n.isOpen) {
n.updateItemHTML();
return
}
n.types = [], u = "", b.mainEl && b.mainEl.length ? n.ev = b.mainEl.eq(0) : n.ev = s, b.key ? (n.popupsCache[b.key] || (n.popupsCache[b.key] = {}), n.currTemplate = n.popupsCache[b.key]) : n.currTemplate = {}, n.st = a.extend(!0, {}, a.magnificPopup.defaults, b), n.fixedContentPos = n.st.fixedContentPos === "auto" ? !n.probablyMobile : n.st.fixedContentPos, n.st.modal && (n.st.closeOnContentClick = !1, n.st.closeOnBgClick = !1, n.st.showCloseBtn = !1, n.st.enableEscapeKey = !1), n.bgOverlay || (n.bgOverlay = x("bg").on("click" + j, function () {
n.close()
}), n.wrap = x("wrap").attr("tabindex", -1).on("click" + j, function (a) {
n._checkIfClose(a.target) && n.close()
}), n.container = x("container", n.wrap)), n.contentContainer = x("content"), n.st.preloader && (n.preloader = x("preloader", n.container, n.st.tLoading));
var h = a.magnificPopup.modules;
for (c = 0; c < h.length; c++) {
var i = h[c];
i = i.charAt(0).toUpperCase() + i.slice(1), n["init" + i].call(n)
}
y("BeforeOpen"), n.st.showCloseBtn && (n.st.closeBtnInside ? (w(f, function (a, b, c, d) {
c.close_replaceWith = z(d.type)
}), u += " mfp-close-btn-in") : n.wrap.append(z())), n.st.alignTop && (u += " mfp-align-top"), n.fixedContentPos ? n.wrap.css({
overflow: n.st.overflowY,
overflowX: "hidden",
overflowY: n.st.overflowY
}) : n.wrap.css({
top: r.scrollTop(),
position: "absolute"
}), (n.st.fixedBgPos === !1 || n.st.fixedBgPos === "auto" && !n.fixedContentPos) && n.bgOverlay.css({
height: s.height(),
position: "absolute"
}), n.st.enableEscapeKey && s.on("keyup" + j, function (a) {
a.keyCode === 27 && n.close()
}), r.on("resize" + j, function () {
n.updateSize()
}), n.st.closeOnContentClick || (u += " mfp-auto-cursor"), u && n.wrap.addClass(u);
var l = n.wH = r.height(),
m = {};
if (n.fixedContentPos && n._hasScrollBar(l)) {
var o = n._getScrollbarSize();
o && (m.marginRight = o)
}
n.fixedContentPos && (n.isIE7 ? a("body, html").css("overflow", "hidden") : m.overflow = "hidden");
var p = n.st.mainClass;
return n.isIE7 && (p += " mfp-ie7"), p && n._addClassToMFP(p), n.updateItemHTML(), y("BuildControls"), a("html").css(m), n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo || a(document.body)), n._lastFocusedEl = document.activeElement, setTimeout(function () {
n.content ? (n._addClassToMFP(k), n._setFocus()) : n.bgOverlay.addClass(k), s.on("focusin" + j, n._onFocusIn)
}, 16), n.isOpen = !0, n.updateSize(l), y(g), b
},
close: function () {
if (!n.isOpen) return;
y(c), n.isOpen = !1, n.st.removalDelay && !n.isLowIE && n.supportsTransition ? (n._addClassToMFP(l), setTimeout(function () {
n._close()
}, n.st.removalDelay)) : n._close()
},
_close: function () {
y(b);
var c = l + " " + k + " ";
n.bgOverlay.detach(), n.wrap.detach(), n.container.empty(), n.st.mainClass && (c += n.st.mainClass + " "), n._removeClassFromMFP(c);
if (n.fixedContentPos) {
var e = {
marginRight: ""
};
n.isIE7 ? a("body, html").css("overflow", "") : e.overflow = "", a("html").css(e)
}
s.off("keyup" + j + " focusin" + j), n.ev.off(j), n.wrap.attr("class", "mfp-wrap").removeAttr("style"), n.bgOverlay.attr("class", "mfp-bg"), n.container.attr("class", "mfp-container"), n.st.showCloseBtn && (!n.st.closeBtnInside || n.currTemplate[n.currItem.type] === !0) && n.currTemplate.closeBtn && n.currTemplate.closeBtn.detach(), n.st.autoFocusLast && n._lastFocusedEl && a(n._lastFocusedEl).focus(), n.currItem = null, n.content = null, n.currTemplate = null, n.prevHeight = 0, y(d)
},
updateSize: function (a) {
if (n.isIOS) {
var b = document.documentElement.clientWidth / window.innerWidth,
c = window.innerHeight * b;
n.wrap.css("height", c), n.wH = c
} else n.wH = a || r.height();
n.fixedContentPos || n.wrap.css("height", n.wH), y("Resize")
},
updateItemHTML: function () {
var b = n.items[n.index];
n.contentContainer.detach(), n.content && n.content.detach(), b.parsed || (b = n.parseEl(n.index));
var c = b.type;
y("BeforeChange", [n.currItem ? n.currItem.type : "", c]), n.currItem = b;
if (!n.currTemplate[c]) {
var d = n.st[c] ? n.st[c].markup : !1;
y("FirstMarkupParse", d), d ? n.currTemplate[c] = a(d) : n.currTemplate[c] = !0
}
t && t !== b.type && n.container.removeClass("mfp-" + t + "-holder");
var e = n["get" + c.charAt(0).toUpperCase() + c.slice(1)](b, n.currTemplate[c]);
n.appendContent(e, c), b.preloaded = !0, y(h, b), t = b.type, n.container.prepend(n.contentContainer), y("AfterChange")
},
appendContent: function (a, b) {
n.content = a, a ? n.st.showCloseBtn && n.st.closeBtnInside && n.currTemplate[b] === !0 ? n.content.find(".mfp-close").length || n.content.append(z()) : n.content = a : n.content = "", y(e), n.container.addClass("mfp-" + b + "-holder"), n.contentContainer.append(n.content)
},
parseEl: function (b) {
var c = n.items[b],
d;
c.tagName ? c = {
el: a(c)
} : (d = c.type, c = {
data: c,
src: c.src
});
if (c.el) {
var e = n.types;
for (var f = 0; f < e.length; f++)
if (c.el.hasClass("mfp-" + e[f])) {
d = e[f];
break
} c.src = c.el.attr("data-mfp-src"), c.src || (c.src = c.el.attr("href"))
}
return c.type = d || n.st.type || "inline", c.index = b, c.parsed = !0, n.items[b] = c, y("ElementParse", c), n.items[b]
},
addGroup: function (a, b) {
var c = function (c) {
c.mfpEl = this, n._openClick(c, a, b)
};
b || (b = {});
var d = "click.magnificPopup";
b.mainEl = a, b.items ? (b.isObj = !0, a.off(d).on(d, c)) : (b.isObj = !1, b.delegate ? a.off(d).on(d, b.delegate, c) : (b.items = a, a.off(d).on(d, c)))
},
_openClick: function (b, c, d) {
var e = d.midClick !== undefined ? d.midClick : a.magnificPopup.defaults.midClick;
if (!e && (b.which === 2 || b.ctrlKey || b.metaKey || b.altKey || b.shiftKey)) return;
var f = d.disableOn !== undefined ? d.disableOn : a.magnificPopup.defaults.disableOn;
if (f)
if (a.isFunction(f)) {
if (!f.call(n)) return !0
} else if (r.width() < f) return !0;
b.type && (b.preventDefault(), n.isOpen && b.stopPropagation()), d.el = a(b.mfpEl), d.delegate && (d.items = c.find(d.delegate)), n.open(d)
},
updateStatus: function (a, b) {
if (n.preloader) {
q !== a && n.container.removeClass("mfp-s-" + q), !b && a === "loading" && (b = n.st.tLoading);
var c = {
status: a,
text: b
};
y("UpdateStatus", c), a = c.status, b = c.text, n.preloader.html(b), n.preloader.find("a").on("click", function (a) {
a.stopImmediatePropagation()
}), n.container.addClass("mfp-s-" + a), q = a
}
},
_checkIfClose: function (b) {
if (a(b).hasClass(m)) return;
var c = n.st.closeOnContentClick,
d = n.st.closeOnBgClick;
if (c && d) return !0;
if (!n.content || a(b).hasClass("mfp-close") || n.preloader && b === n.preloader[0]) return !0;
if (b !== n.content[0] && !a.contains(n.content[0], b)) {
if (d && a.contains(document, b)) return !0
} else if (c) return !0;
return !1
},
_addClassToMFP: function (a) {
n.bgOverlay.addClass(a), n.wrap.addClass(a)
},
_removeClassFromMFP: function (a) {
this.bgOverlay.removeClass(a), n.wrap.removeClass(a)
},
_hasScrollBar: function (a) {
return (n.isIE7 ? s.height() : document.body.scrollHeight) > (a || r.height())
},
_setFocus: function () {
(n.st.focus ? n.content.find(n.st.focus).eq(0) : n.wrap).focus()
},
_onFocusIn: function (b) {
if (b.target !== n.wrap[0] && !a.contains(n.wrap[0], b.target)) return n._setFocus(), !1
},
_parseMarkup: function (b, c, d) {
var e;
d.data && (c = a.extend(d.data, c)), y(f, [b, c, d]), a.each(c, function (c, d) {
if (d === undefined || d === !1) return !0;
e = c.split("_");
if (e.length > 1) {
var f = b.find(j + "-" + e[0]);
if (f.length > 0) {
var g = e[1];
g === "replaceWith" ? f[0] !== d[0] && f.replaceWith(d) : g === "img" ? f.is("img") ? f.attr("src", d) : f.replaceWith(a("
").attr("src", d).attr("class", f.attr("class"))) : f.attr(e[1], d)
}
} else b.find(j + "-" + c).html(d)
})
},
_getScrollbarSize: function () {
if (n.scrollbarSize === undefined) {
var a = document.createElement("div");
a.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(a), n.scrollbarSize = a.offsetWidth - a.clientWidth, document.body.removeChild(a)
}
return n.scrollbarSize
}
}, a.magnificPopup = {
instance: null,
proto: o.prototype,
modules: [],
open: function (b, c) {
return A(), b ? b = a.extend(!0, {}, b) : b = {}, b.isObj = !0, b.index = c || 0, this.instance.open(b)
},
close: function () {
return a.magnificPopup.instance && a.magnificPopup.instance.close()
},
registerModule: function (b, c) {
c.options && (a.magnificPopup.defaults[b] = c.options), a.extend(this.proto, c.proto), this.modules.push(b)
},
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: "Zamknij (Esc)",
tLoading: "Ładowanie..."
}
}, a.fn.magnificPopup = function (b) {
A();
var c = a(this);
if (typeof b == "string")
if (b === "open") {
var d, e = p ? c.data("magnificPopup") : c[0].magnificPopup,
f = parseInt(arguments[1], 10) || 0;
e.items ? d = e.items[f] : (d = c, e.delegate && (d = d.find(e.delegate)), d = d.eq(f)), n._openClick({
mfpEl: d
}, c, e)
} else n.isOpen && n[b].apply(n, Array.prototype.slice.call(arguments, 1));
else b = a.extend(!0, {}, b), p ? c.data("magnificPopup", b) : c[0].magnificPopup = b, n.addGroup(c, b);
return c
};
var C = "ajax",
D, E = function () {
D && a(document.body).removeClass(D)
},
F = function () {
E(), n.req && n.req.abort()
};
a.magnificPopup.registerModule(C, {
options: {
settings: null,
cursor: "mfp-ajax-cur",
tError: 'Treść nie mogła zostać załadowana.'
},
proto: {
initAjax: function () {
n.types.push(C), D = n.st.ajax.cursor, w(b + "." + C, F), w("BeforeChange." + C, F)
},
getAjax: function (b) {
D && a(document.body).addClass(D), n.updateStatus("loading");
var c = a.extend({
url: b.src,
success: function (c, d, e) {
var f = {
data: c,
xhr: e
};
y("ParseAjax", f), n.appendContent(a(f.data), C), b.finished = !0, E(), n._setFocus(), setTimeout(function () {
n.wrap.addClass(k)
}, 16), n.updateStatus("ready"), y("AjaxContentAdded")
},
error: function () {
E(), b.finished = b.loadError = !0, n.updateStatus("error", n.st.ajax.tError.replace("%url%", b.src))
}
}, n.st.ajax.settings);
return n.req = a.ajax(c), ""
}
}
});
var G, H = function () {
return G === undefined && (G = document.createElement("p").style.MozTransform !== undefined), G
};
a.magnificPopup.registerModule("zoom", {
options: {
enabled: !1,
easing: "ease-in-out",
duration: 300,
opener: function (a) {
return a.is("img") ? a : a.find("img")
}
},
proto: {
initZoom: function () {
var a = n.st.zoom,
d = ".zoom",
e;
if (!a.enabled || !n.supportsTransition) return;
var f = a.duration,
g = function (b) {
var c = b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
d = "all " + a.duration / 1e3 + "s " + a.easing,
e = {
position: "fixed",
zIndex: 9999,
left: 0,
top: 0,
"-webkit-backface-visibility": "hidden"
},
f = "transition";
return e["-webkit-" + f] = e["-moz-" + f] = e["-o-" + f] = e[f] = d, c.css(e), c
},
h = function () {
n.content.css("visibility", "visible")
},
i, j;
w("BuildControls" + d, function () {
if (n._allowZoom()) {
clearTimeout(i), n.content.css("visibility", "hidden"), e = n._getItemToZoom();
if (!e) {
h();
return
}
j = g(e), j.css(n._getOffset()), n.wrap.append(j), i = setTimeout(function () {
j.css(n._getOffset(!0)), i = setTimeout(function () {
h(), setTimeout(function () {
j.remove(), e = j = null, y("ZoomAnimationEnded")
}, 16)
}, f)
}, 16)
}
}), w(c + d, function () {
if (n._allowZoom()) {
clearTimeout(i), n.st.removalDelay = f;
if (!e) {
e = n._getItemToZoom();
if (!e) return;
j = g(e)
}
j.css(n._getOffset(!0)), n.wrap.append(j), n.content.css("visibility", "hidden"), setTimeout(function () {
j.css(n._getOffset())
}, 16)
}
}), w(b + d, function () {
n._allowZoom() && (h(), j && j.remove(), e = null)
})
},
_allowZoom: function () {
return n.currItem.type === "image"
},
_getItemToZoom: function () {
return n.currItem.hasSize ? n.currItem.img : !1
},
_getOffset: function (b) {
var c;
b ? c = n.currItem.img : c = n.st.zoom.opener(n.currItem.el || n.currItem);
var d = c.offset(),
e = parseInt(c.css("padding-top"), 10),
f = parseInt(c.css("padding-bottom"), 10);
d.top -= a(window).scrollTop() - e;
var g = {
width: c.width(),
height: (p ? c.innerHeight() : c[0].offsetHeight) - f - e
};
return H() ? g["-moz-transform"] = g.transform = "translate(" + d.left + "px," + d.top + "px)" : (g.left = d.left, g.top = d.top), g
}
}
}), A()
});
/**
* Copyright (c) 2011-2014 Felix Gnass
* Licensed under the MIT license
*/
! function (t, e) {
"object" == typeof exports ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.Spinner = e()
}(this, function () {
"use strict";
function t(t, e) {
var i, o = document.createElement(t || "div");
for (i in e) o[i] = e[i];
return o
}
function e(t) {
for (var e = 1, i = arguments.length; i > e; e++) t.appendChild(arguments[e]);
return t
}
function i(t, e, i, o) {
var n = ["opacity", e, ~~(100 * t), i, o].join("-"),
r = .01 + i / o * 100,
s = Math.max(1 - (1 - t) / e * (100 - r), t),
a = c.substring(0, c.indexOf("Animation")).toLowerCase(),
l = a && "-" + a + "-" || "";
return p[n] || (u.insertRule("@" + l + "keyframes " + n + "{0%{opacity:" + s + "}" + r + "%{opacity:" + t + "}" + (r + .01) + "%{opacity:1}" + (r + e) % 100 + "%{opacity:" + t + "}100%{opacity:" + s + "}}", u.cssRules.length), p[n] = 1), n
}
function o(t, e) {
var i, o, n = t.style;
for (e = e.charAt(0).toUpperCase() + e.slice(1), o = 0; o < d.length; o++)
if (i = d[o] + e, void 0 !== n[i]) return i;
return void 0 !== n[e] ? e : void 0
}
function n(t, e) {
for (var i in e) t.style[o(t, i) || i] = e[i];
return t
}
function r(t) {
for (var e = 1; e < arguments.length; e++) {
var i = arguments[e];
for (var o in i) void 0 === t[o] && (t[o] = i[o])
}
return t
}
function s(t, e) {
return "string" == typeof t ? t : t[e % t.length]
}
function a(t) {
this.opts = r(t || {}, a.defaults, f)
}
function l() {
function i(e, i) {
return t("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', i)
}
u.addRule(".spin-vml", "behavior:url(#default#VML)"), a.prototype.lines = function (t, o) {
function r() {
return n(i("group", {
coordsize: d + " " + d,
coordorigin: -c + " " + -c
}), {
width: d,
height: d
})
}
function a(t, a, l) {
e(u, e(n(r(), {
rotation: 360 / o.lines * t + "deg",
left: ~~a
}), e(n(i("roundrect", {
arcsize: o.corners
}), {
width: c,
height: o.width,
left: o.radius,
top: -o.width >> 1,
filter: l
}), i("fill", {
color: s(o.color, t),
opacity: o.opacity
}), i("stroke", {
opacity: 0
}))))
}
var l, c = o.length + o.width,
d = 2 * c,
p = 2 * -(o.width + o.length) + "px",
u = n(r(), {
position: "absolute",
top: p,
left: p
});
if (o.shadow)
for (l = 1; l <= o.lines; l++) a(l, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");
for (l = 1; l <= o.lines; l++) a(l);
return e(t, u)
}, a.prototype.opacity = function (t, e, i, o) {
var n = t.firstChild;
o = o.shadow && o.lines || 0, n && e + o < n.childNodes.length && (n = n.childNodes[e + o], n = n && n.firstChild, n = n && n.firstChild, n && (n.opacity = i))
}
}
var c, d = ["webkit", "Moz", "ms", "O"],
p = {},
u = function () {
var i = t("style", {
type: "text/css"
});
return e(document.getElementsByTagName("head")[0], i), i.sheet || i.styleSheet
}(),
f = {
lines: 12,
length: 7,
width: 5,
radius: 10,
rotate: 0,
corners: 1,
color: "#000",
direction: 1,
speed: 1,
trail: 100,
opacity: .25,
fps: 20,
zIndex: 2e9,
className: "spinner",
top: "50%",
left: "50%",
position: "absolute"
};
a.defaults = {}, r(a.prototype, {
spin: function (e) {
this.stop();
var i = this,
o = i.opts,
r = i.el = n(t(0, {
className: o.className
}), {
position: o.position,
width: 0,
zIndex: o.zIndex
});
o.radius + o.length + o.width;
if (n(r, {
left: o.left,
top: o.top
}), e && e.insertBefore(r, e.firstChild || null), r.setAttribute("role", "progressbar"), i.lines(r, i.opts), !c) {
var s, a = 0,
l = (o.lines - 1) * (1 - o.direction) / 2,
d = o.fps,
p = d / o.speed,
u = (1 - o.opacity) / (p * o.trail / 100),
f = p / o.lines;
! function h() {
a++;
for (var t = 0; t < o.lines; t++) s = Math.max(1 - (a + (o.lines - t) * f) % p * u, o.opacity), i.opacity(r, t * o.direction + l, s, o);
i.timeout = i.el && setTimeout(h, ~~(1e3 / d))
}()
}
return i
},
stop: function () {
var t = this.el;
return t && (clearTimeout(this.timeout), t.parentNode && t.parentNode.removeChild(t), this.el = void 0), this
},
lines: function (o, r) {
function a(e, i) {
return n(t(), {
position: "absolute",
width: r.length + r.width + "px",
height: r.width + "px",
background: e,
boxShadow: i,
transformOrigin: "left",
transform: "rotate(" + ~~(360 / r.lines * d + r.rotate) + "deg) translate(" + r.radius + "px,0)",
borderRadius: (r.corners * r.width >> 1) + "px"
})
}
for (var l, d = 0, p = (r.lines - 1) * (1 - r.direction) / 2; d < r.lines; d++) l = n(t(), {
position: "absolute",
top: 1 + ~(r.width / 2) + "px",
transform: r.hwaccel ? "translate3d(0,0,0)" : "",
opacity: r.opacity,
animation: c && i(r.opacity, r.trail, p + d * r.direction, r.lines) + " " + 1 / r.speed + "s linear infinite"
}), r.shadow && e(l, n(a("#000", "0 0 4px #000"), {
top: "2px"
})), e(o, e(l, a(s(r.color, d), "0 0 1px rgba(0,0,0,.1)")));
return o
},
opacity: function (t, e, i) {
e < t.childNodes.length && (t.childNodes[e].style.opacity = i)
}
});
var h = n(t("group"), {
behavior: "url(#default#VML)"
});
return !o(h, "transform") && h.adj ? l() : c = o(h, "animation"), a
});
/*!
* Ladda
* http://lab.hakim.se/ladda
* MIT licensed
*
* Copyright (C) 2016 Hakim El Hattab, http://hakim.se
*/
! function (t, e) {
"object" == typeof exports ? module.exports = e(require("spin.js")) : "function" == typeof define && define.amd ? define(["spin"], e) : t.Ladda = e(t.Spinner)
}(this, function (t) {
"use strict";
function e(t) {
if ("undefined" == typeof t) return void console.warn("Ladda button target must be defined.");
if (/ladda-button/i.test(t.className) || (t.className += " ladda-button"), t.hasAttribute("data-style") || t.setAttribute("data-style", "expand-right"), !t.querySelector(".ladda-label")) {
var e = document.createElement("span");
e.className = "ladda-label", u(t, e)
}
var n, a = t.querySelector(".ladda-spinner");
a || (a = document.createElement("span"), a.className = "ladda-spinner"), t.appendChild(a);
var r, i = {
start: function () {
return n || (n = o(t)), t.setAttribute("disabled", ""), t.setAttribute("data-loading", ""), clearTimeout(r), n.spin(a), this.setProgress(0), this
},
startAfter: function (t) {
return clearTimeout(r), r = setTimeout(function () {
i.start()
}, t), this
},
stop: function () {
return t.removeAttribute("disabled"), t.removeAttribute("data-loading"), clearTimeout(r), n && (r = setTimeout(function () {
n.stop()
}, 1e3)), this
},
toggle: function () {
return this.isLoading() ? this.stop() : this.start(), this
},
setProgress: function (e) {
e = Math.max(Math.min(e, 1), 0);
var n = t.querySelector(".ladda-progress");
0 === e && n && n.parentNode ? n.parentNode.removeChild(n) : (n || (n = document.createElement("div"), n.className = "ladda-progress", t.appendChild(n)), n.style.width = (e || 0) * t.offsetWidth + "px")
},
enable: function () {
return this.stop(), this
},
disable: function () {
return this.stop(), t.setAttribute("disabled", ""), this
},
isLoading: function () {
return t.hasAttribute("data-loading")
},
remove: function () {
clearTimeout(r), t.removeAttribute("disabled", ""), t.removeAttribute("data-loading", ""), n && (n.stop(), n = null);
for (var e = 0, a = d.length; a > e; e++)
if (i === d[e]) {
d.splice(e, 1);
break
}
}
};
return d.push(i), i
}
function n(t, e) {
for (; t.parentNode && t.tagName !== e;) t = t.parentNode;
return e === t.tagName ? t : void 0
}
function a(t) {
for (var e = ["input", "textarea", "select"], n = [], a = 0; a < e.length; a++)
for (var r = t.getElementsByTagName(e[a]), i = 0; i < r.length; i++) r[i].hasAttribute("required") && n.push(r[i]);
return n
}
function r(t, r) {
r = r || {};
var i = [];
"string" == typeof t ? i = s(document.querySelectorAll(t)) : "object" == typeof t && "string" == typeof t.nodeName && (i = [t]);
for (var o = 0, u = i.length; u > o; o++) ! function () {
var t = i[o];
if ("function" == typeof t.addEventListener) {
var s = e(t),
u = -1;
t.addEventListener("click", function (e) {
var i = !0,
o = n(t, "FORM");
if ("undefined" != typeof o)
if ("function" == typeof o.checkValidity) i = o.checkValidity();
else
for (var d = a(o), l = 0; l < d.length; l++) "" === d[l].value.replace(/^\s+|\s+$/g, "") && (i = !1), "checkbox" !== d[l].type && "radio" !== d[l].type || d[l].checked || (i = !1), "email" === d[l].type && (i = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(d[l].value));
i && (s.startAfter(1), "number" == typeof r.timeout && (clearTimeout(u), u = setTimeout(s.stop, r.timeout)), "function" == typeof r.callback && r.callback.apply(null, [s]))
}, !1)
}
}()
}
function i() {
for (var t = 0, e = d.length; e > t; t++) d[t].stop()
}
function o(e) {
var n, a, r = e.offsetHeight;
0 === r && (r = parseFloat(window.getComputedStyle(e).height)), r > 32 && (r *= .8), e.hasAttribute("data-spinner-size") && (r = parseInt(e.getAttribute("data-spinner-size"), 10)), e.hasAttribute("data-spinner-color") && (n = e.getAttribute("data-spinner-color")), e.hasAttribute("data-spinner-lines") && (a = parseInt(e.getAttribute("data-spinner-lines"), 10));
var i = .2 * r,
o = .6 * i,
s = 7 > i ? 2 : 3;
return new t({
color: n || "#fff",
lines: a || 12,
radius: i,
length: o,
width: s,
zIndex: "auto",
top: "auto",
left: "auto",
className: ""
})
}
function s(t) {
for (var e = [], n = 0; n < t.length; n++) e.push(t[n]);
return e
}
function u(t, e) {
var n = document.createRange();
n.selectNodeContents(t), n.surroundContents(e), t.appendChild(e)
}
var d = [];
return {
bind: r,
create: e,
stopAll: i
}
});
/*!
* Ladda for jQuery
* http://lab.hakim.se/ladda
* MIT licensed
*
* Copyright (C) 2015 Hakim El Hattab, http://hakim.se
*/
! function (a, t) {
if (void 0 === t) return console.error("jQuery required for Ladda.jQuery");
var d = [];
t = t.extend(t, {
ladda: function (t) {
"stopAll" === t && a.stopAll()
}
}), t.fn = t.extend(t.fn, {
ladda: function (e) {
var i = d.slice.call(arguments, 1);
return "bind" === e ? (i.unshift(t(this).selector), a.bind.apply(a, i)) : t(this).each(function () {
var d, n = t(this);
void 0 === e ? n.data("ladda", a.create(this)) : (d = n.data("ladda"), d[e].apply(d, i))
}), this
}
})
}(this.Ladda, this.jQuery);; /*! jQuery Form Plugin | version: 3.51.0-2014.06.20 | https://github.com/malsup/form */
! function (e) {
"use strict";
"function" == typeof define && define.amd ? define(["jquery"], e) : e("undefined" != typeof jQuery ? jQuery : window.Zepto)
}(function (e) {
"use strict";
function t(t) {
var r = t.data;
t.isDefaultPrevented() || (t.preventDefault(), e(t.target).ajaxSubmit(r))
}
function r(t) {
var r = t.target,
a = e(r);
if (!a.is("[type=submit],[type=image]")) {
var n = a.closest("[type=submit]");
if (0 === n.length) return;
r = n[0]
}
var i = this;
if (i.clk = r, "image" == r.type)
if (void 0 !== t.offsetX) i.clk_x = t.offsetX, i.clk_y = t.offsetY;
else if ("function" == typeof e.fn.offset) {
var o = a.offset();
i.clk_x = t.pageX - o.left, i.clk_y = t.pageY - o.top
} else i.clk_x = t.pageX - r.offsetLeft, i.clk_y = t.pageY - r.offsetTop;
setTimeout(function () {
i.clk = i.clk_x = i.clk_y = null
}, 100)
}
function a() {
if (e.fn.ajaxSubmit.debug) {
var t = "[jquery.form] " + Array.prototype.join.call(arguments, "");
window.console && window.console.log ? window.console.log(t) : window.opera && window.opera.postError && window.opera.postError(t)
}
}
var n = {};
n.fileapi = void 0 !== e("").get(0).files, n.formdata = void 0 !== window.FormData;
var i = !!e.fn.prop;
e.fn.attr2 = function () {
if (!i) return this.attr.apply(this, arguments);
var e = this.prop.apply(this, arguments);
return e && e.jquery || "string" == typeof e ? e : this.attr.apply(this, arguments)
}, e.fn.ajaxSubmit = function (t) {
function r(r) {
var a, n, i = e.param(r, t.traditional).split("&"),
o = i.length,
s = [];
for (a = 0; o > a; a++) i[a] = i[a].replace(/\+/g, " "), n = i[a].split("="), s.push([decodeURIComponent(n[0]), decodeURIComponent(n[1])]);
return s
}
function o(a) {
for (var n = new FormData, i = 0; i < a.length; i++) n.append(a[i].name, a[i].value);
if (t.extraData) {
var o = r(t.extraData);
for (i = 0; i < o.length; i++) o[i] && n.append(o[i][0], o[i][1])
}
t.data = null;
var s = e.extend(!0, {}, e.ajaxSettings, t, {
contentType: !1,
processData: !1,
cache: !1,
type: u || "POST"
});
t.uploadProgress && (s.xhr = function () {
var r = e.ajaxSettings.xhr();
return r.upload && r.upload.addEventListener("progress", function (e) {
var r = 0,
a = e.loaded || e.position,
n = e.total;
e.lengthComputable && (r = Math.ceil(a / n * 100)), t.uploadProgress(e, a, n, r)
}, !1), r
}), s.data = null;
var c = s.beforeSend;
return s.beforeSend = function (e, r) {
r.data = t.formData ? t.formData : n, c && c.call(this, e, r)
}, e.ajax(s)
}
function s(r) {
function n(e) {
var t = null;
try {
e.contentWindow && (t = e.contentWindow.document)
} catch (r) {
a("cannot get iframe.contentWindow document: " + r)
}
if (t) return t;
try {
t = e.contentDocument ? e.contentDocument : e.document
} catch (r) {
a("cannot get iframe.contentDocument: " + r), t = e.document
}
return t
}
function o() {
function t() {
try {
var e = n(g).readyState;
a("state = " + e), e && "uninitialized" == e.toLowerCase() && setTimeout(t, 50)
} catch (r) {
a("Server abort: ", r, " (", r.name, ")"), s(k), j && clearTimeout(j), j = void 0
}
}
var r = f.attr2("target"),
i = f.attr2("action"),
o = "multipart/form-data",
c = f.attr("enctype") || f.attr("encoding") || o;
w.setAttribute("target", p), (!u || /post/i.test(u)) && w.setAttribute("method", "POST"), i != m.url && w.setAttribute("action", m.url), m.skipEncodingOverride || u && !/post/i.test(u) || f.attr({
encoding: "multipart/form-data",
enctype: "multipart/form-data"
}), m.timeout && (j = setTimeout(function () {
T = !0, s(D)
}, m.timeout));
var l = [];
try {
if (m.extraData)
for (var d in m.extraData) m.extraData.hasOwnProperty(d) && l.push(e.isPlainObject(m.extraData[d]) && m.extraData[d].hasOwnProperty("name") && m.extraData[d].hasOwnProperty("value") ? e('').val(m.extraData[d].value).appendTo(w)[0] : e('').val(m.extraData[d]).appendTo(w)[0]);
m.iframeTarget || v.appendTo("body"), g.attachEvent ? g.attachEvent("onload", s) : g.addEventListener("load", s, !1), setTimeout(t, 15);
try {
w.submit()
} catch (h) {
var x = document.createElement("form").submit;
x.apply(w)
}
} finally {
w.setAttribute("action", i), w.setAttribute("enctype", c), r ? w.setAttribute("target", r) : f.removeAttr("target"), e(l).remove()
}
}
function s(t) {
if (!x.aborted && !F) {
if (M = n(g), M || (a("cannot access response document"), t = k), t === D && x) return x.abort("timeout"), void S.reject(x, "timeout");
if (t == k && x) return x.abort("server abort"), void S.reject(x, "error", "server abort");
if (M && M.location.href != m.iframeSrc || T) {
g.detachEvent ? g.detachEvent("onload", s) : g.removeEventListener("load", s, !1);
var r, i = "success";
try {
if (T) throw "timeout";
var o = "xml" == m.dataType || M.XMLDocument || e.isXMLDoc(M);
if (a("isXml=" + o), !o && window.opera && (null === M.body || !M.body.innerHTML) && --O) return a("requeing onLoad callback, DOM not available"), void setTimeout(s, 250);
var u = M.body ? M.body : M.documentElement;
x.responseText = u ? u.innerHTML : null, x.responseXML = M.XMLDocument ? M.XMLDocument : M, o && (m.dataType = "xml"), x.getResponseHeader = function (e) {
var t = {
"content-type": m.dataType
};
return t[e.toLowerCase()]
}, u && (x.status = Number(u.getAttribute("status")) || x.status, x.statusText = u.getAttribute("statusText") || x.statusText);
var c = (m.dataType || "").toLowerCase(),
l = /(json|script|text)/.test(c);
if (l || m.textarea) {
var f = M.getElementsByTagName("textarea")[0];
if (f) x.responseText = f.value, x.status = Number(f.getAttribute("status")) || x.status, x.statusText = f.getAttribute("statusText") || x.statusText;
else if (l) {
var p = M.getElementsByTagName("pre")[0],
h = M.getElementsByTagName("body")[0];
p ? x.responseText = p.textContent ? p.textContent : p.innerText : h && (x.responseText = h.textContent ? h.textContent : h.innerText)
}
} else "xml" == c && !x.responseXML && x.responseText && (x.responseXML = X(x.responseText));
try {
E = _(x, c, m)
} catch (y) {
i = "parsererror", x.error = r = y || i
}
} catch (y) {
a("error caught: ", y), i = "error", x.error = r = y || i
}
x.aborted && (a("upload aborted"), i = null), x.status && (i = x.status >= 200 && x.status < 300 || 304 === x.status ? "success" : "error"), "success" === i ? (m.success && m.success.call(m.context, E, "success", x), S.resolve(x.responseText, "success", x), d && e.event.trigger("ajaxSuccess", [x, m])) : i && (void 0 === r && (r = x.statusText), m.error && m.error.call(m.context, x, i, r), S.reject(x, "error", r), d && e.event.trigger("ajaxError", [x, m, r])), d && e.event.trigger("ajaxComplete", [x, m]), d && !--e.active && e.event.trigger("ajaxStop"), m.complete && m.complete.call(m.context, x, i), F = !0, m.timeout && clearTimeout(j), setTimeout(function () {
m.iframeTarget ? v.attr("src", m.iframeSrc) : v.remove(), x.responseXML = null
}, 100)
}
}
}
var c, l, m, d, p, v, g, x, y, b, T, j, w = f[0],
S = e.Deferred();
if (S.abort = function (e) {
x.abort(e)
}, r)
for (l = 0; l < h.length; l++) c = e(h[l]), i ? c.prop("disabled", !1) : c.removeAttr("disabled");
if (m = e.extend(!0, {}, e.ajaxSettings, t), m.context = m.context || m, p = "jqFormIO" + (new Date).getTime(), m.iframeTarget ? (v = e(m.iframeTarget), b = v.attr2("name"), b ? p = b : v.attr2("name", p)) : (v = e(''), v.css({
position: "absolute",
top: "-1000px",
left: "-1000px"
})), g = v[0], x = {
aborted: 0,
responseText: null,
responseXML: null,
status: 0,
statusText: "n/a",
getAllResponseHeaders: function () {},
getResponseHeader: function () {},
setRequestHeader: function () {},
abort: function (t) {
var r = "timeout" === t ? "timeout" : "aborted";
a("aborting upload... " + r), this.aborted = 1;
try {
g.contentWindow.document.execCommand && g.contentWindow.document.execCommand("Stop")
} catch (n) {}
v.attr("src", m.iframeSrc), x.error = r, m.error && m.error.call(m.context, x, r, t), d && e.event.trigger("ajaxError", [x, m, r]), m.complete && m.complete.call(m.context, x, r)
}
}, d = m.global, d && 0 === e.active++ && e.event.trigger("ajaxStart"), d && e.event.trigger("ajaxSend", [x, m]), m.beforeSend && m.beforeSend.call(m.context, x, m) === !1) return m.global && e.active--, S.reject(), S;
if (x.aborted) return S.reject(), S;
y = w.clk, y && (b = y.name, b && !y.disabled && (m.extraData = m.extraData || {}, m.extraData[b] = y.value, "image" == y.type && (m.extraData[b + ".x"] = w.clk_x, m.extraData[b + ".y"] = w.clk_y)));
var D = 1,
k = 2,
A = e("meta[name=csrf-token]").attr("content"),
L = e("meta[name=csrf-param]").attr("content");
L && A && (m.extraData = m.extraData || {}, m.extraData[L] = A), m.forceSync ? o() : setTimeout(o, 10);
var E, M, F, O = 50,
X = e.parseXML || function (e, t) {
return window.ActiveXObject ? (t = new ActiveXObject("Microsoft.XMLDOM"), t.async = "false", t.loadXML(e)) : t = (new DOMParser).parseFromString(e, "text/xml"), t && t.documentElement && "parsererror" != t.documentElement.nodeName ? t : null
},
C = e.parseJSON || function (e) {
return window.eval("(" + e + ")")
},
_ = function (t, r, a) {
var n = t.getResponseHeader("content-type") || "",
i = "xml" === r || !r && n.indexOf("xml") >= 0,
o = i ? t.responseXML : t.responseText;
return i && "parsererror" === o.documentElement.nodeName && e.error && e.error("parsererror"), a && a.dataFilter && (o = a.dataFilter(o, r)), "string" == typeof o && ("json" === r || !r && n.indexOf("json") >= 0 ? o = C(o) : ("script" === r || !r && n.indexOf("javascript") >= 0) && e.globalEval(o)), o
};
return S
}
if (!this.length) return a("ajaxSubmit: skipping submit process - no element selected"), this;
var u, c, l, f = this;
"function" == typeof t ? t = {
success: t
} : void 0 === t && (t = {}), u = t.type || this.attr2("method"), c = t.url || this.attr2("action"), l = "string" == typeof c ? e.trim(c) : "", l = l || window.location.href || "", l && (l = (l.match(/^([^#]+)/) || [])[1]), t = e.extend(!0, {
url: l,
success: e.ajaxSettings.success,
type: u || e.ajaxSettings.type,
iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank"
}, t);
var m = {};
if (this.trigger("form-pre-serialize", [this, t, m]), m.veto) return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this;
if (t.beforeSerialize && t.beforeSerialize(this, t) === !1) return a("ajaxSubmit: submit aborted via beforeSerialize callback"), this;
var d = t.traditional;
void 0 === d && (d = e.ajaxSettings.traditional);
var p, h = [],
v = this.formToArray(t.semantic, h);
if (t.data && (t.extraData = t.data, p = e.param(t.data, d)), t.beforeSubmit && t.beforeSubmit(v, this, t) === !1) return a("ajaxSubmit: submit aborted via beforeSubmit callback"), this;
if (this.trigger("form-submit-validate", [v, this, t, m]), m.veto) return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this;
var g = e.param(v, d);
p && (g = g ? g + "&" + p : p), "GET" == t.type.toUpperCase() ? (t.url += (t.url.indexOf("?") >= 0 ? "&" : "?") + g, t.data = null) : t.data = g;
var x = [];
if (t.resetForm && x.push(function () {
f.resetForm()
}), t.clearForm && x.push(function () {
f.clearForm(t.includeHidden)
}), !t.dataType && t.target) {
var y = t.success || function () {};
x.push(function (r) {
var a = t.replaceTarget ? "replaceWith" : "html";
e(t.target)[a](r).each(y, arguments)
})
} else t.success && x.push(t.success);
if (t.success = function (e, r, a) {
for (var n = t.context || this, i = 0, o = x.length; o > i; i++) x[i].apply(n, [e, r, a || f, f])
}, t.error) {
var b = t.error;
t.error = function (e, r, a) {
var n = t.context || this;
b.apply(n, [e, r, a, f])
}
}
if (t.complete) {
var T = t.complete;
t.complete = function (e, r) {
var a = t.context || this;
T.apply(a, [e, r, f])
}
}
var j = e("input[type=file]:enabled", this).filter(function () {
return "" !== e(this).val()
}),
w = j.length > 0,
S = "multipart/form-data",
D = f.attr("enctype") == S || f.attr("encoding") == S,
k = n.fileapi && n.formdata;
a("fileAPI :" + k);
var A, L = (w || D) && !k;
t.iframe !== !1 && (t.iframe || L) ? t.closeKeepAlive ? e.get(t.closeKeepAlive, function () {
A = s(v)
}) : A = s(v) : A = (w || D) && k ? o(v) : e.ajax(t), f.removeData("jqxhr").data("jqxhr", A);
for (var E = 0; E < h.length; E++) h[E] = null;
return this.trigger("form-submit-notify", [this, t]), this
}, e.fn.ajaxForm = function (n) {
if (n = n || {}, n.delegation = n.delegation && e.isFunction(e.fn.on), !n.delegation && 0 === this.length) {
var i = {
s: this.selector,
c: this.context
};
return !e.isReady && i.s ? (a("DOM not ready, queuing ajaxForm"), e(function () {
e(i.s, i.c).ajaxForm(n)
}), this) : (a("terminating; zero elements found by selector" + (e.isReady ? "" : " (DOM not ready)")), this)
}
return n.delegation ? (e(document).off("submit.form-plugin", this.selector, t).off("click.form-plugin", this.selector, r).on("submit.form-plugin", this.selector, n, t).on("click.form-plugin", this.selector, n, r), this) : this.ajaxFormUnbind().bind("submit.form-plugin", n, t).bind("click.form-plugin", n, r)
}, e.fn.ajaxFormUnbind = function () {
return this.unbind("submit.form-plugin click.form-plugin")
}, e.fn.formToArray = function (t, r) {
var a = [];
if (0 === this.length) return a;
var i, o = this[0],
s = this.attr("id"),
u = t ? o.getElementsByTagName("*") : o.elements;
if (u && !/MSIE [678]/.test(navigator.userAgent) && (u = e(u).get()), s && (i = e(':input[form="' + s + '"]').get(), i.length && (u = (u || []).concat(i))), !u || !u.length) return a;
var c, l, f, m, d, p, h;
for (c = 0, p = u.length; p > c; c++)
if (d = u[c], f = d.name, f && !d.disabled)
if (t && o.clk && "image" == d.type) o.clk == d && (a.push({
name: f,
value: e(d).val(),
type: d.type
}), a.push({
name: f + ".x",
value: o.clk_x
}, {
name: f + ".y",
value: o.clk_y
}));
else if (m = e.fieldValue(d, !0), m && m.constructor == Array)
for (r && r.push(d), l = 0, h = m.length; h > l; l++) a.push({
name: f,
value: m[l]
});
else if (n.fileapi && "file" == d.type) {
r && r.push(d);
var v = d.files;
if (v.length)
for (l = 0; l < v.length; l++) a.push({
name: f,
value: v[l],
type: d.type
});
else a.push({
name: f,
value: "",
type: d.type
})
} else null !== m && "undefined" != typeof m && (r && r.push(d), a.push({
name: f,
value: m,
type: d.type,
required: d.required
}));
if (!t && o.clk) {
var g = e(o.clk),
x = g[0];
f = x.name, f && !x.disabled && "image" == x.type && (a.push({
name: f,
value: g.val()
}), a.push({
name: f + ".x",
value: o.clk_x
}, {
name: f + ".y",
value: o.clk_y
}))
}
return a
}, e.fn.formSerialize = function (t) {
return e.param(this.formToArray(t))
}, e.fn.fieldSerialize = function (t) {
var r = [];
return this.each(function () {
var a = this.name;
if (a) {
var n = e.fieldValue(this, t);
if (n && n.constructor == Array)
for (var i = 0, o = n.length; o > i; i++) r.push({
name: a,
value: n[i]
});
else null !== n && "undefined" != typeof n && r.push({
name: this.name,
value: n
})
}
}), e.param(r)
}, e.fn.fieldValue = function (t) {
for (var r = [], a = 0, n = this.length; n > a; a++) {
var i = this[a],
o = e.fieldValue(i, t);
null === o || "undefined" == typeof o || o.constructor == Array && !o.length || (o.constructor == Array ? e.merge(r, o) : r.push(o))
}
return r
}, e.fieldValue = function (t, r) {
var a = t.name,
n = t.type,
i = t.tagName.toLowerCase();
if (void 0 === r && (r = !0), r && (!a || t.disabled || "reset" == n || "button" == n || ("checkbox" == n || "radio" == n) && !t.checked || ("submit" == n || "image" == n) && t.form && t.form.clk != t || "select" == i && -1 == t.selectedIndex)) return null;
if ("select" == i) {
var o = t.selectedIndex;
if (0 > o) return null;
for (var s = [], u = t.options, c = "select-one" == n, l = c ? o + 1 : u.length, f = c ? o : 0; l > f; f++) {
var m = u[f];
if (m.selected) {
var d = m.value;
if (d || (d = m.attributes && m.attributes.value && !m.attributes.value.specified ? m.text : m.value), c) return d;
s.push(d)
}
}
return s
}
return e(t).val()
}, e.fn.clearForm = function (t) {
return this.each(function () {
e("input,select,textarea", this).clearFields(t)
})
}, e.fn.clearFields = e.fn.clearInputs = function (t) {
var r = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
return this.each(function () {
var a = this.type,
n = this.tagName.toLowerCase();
r.test(a) || "textarea" == n ? this.value = "" : "checkbox" == a || "radio" == a ? this.checked = !1 : "select" == n ? this.selectedIndex = -1 : "file" == a ? /MSIE/.test(navigator.userAgent) ? e(this).replaceWith(e(this).clone(!0)) : e(this).val("") : t && (t === !0 && /hidden/.test(a) || "string" == typeof t && e(this).is(t)) && (this.value = "")
})
}, e.fn.resetForm = function () {
return this.each(function () {
("function" == typeof this.reset || "object" == typeof this.reset && !this.reset.nodeType) && this.reset()
})
}, e.fn.enable = function (e) {
return void 0 === e && (e = !0), this.each(function () {
this.disabled = !e
})
}, e.fn.selected = function (t) {
return void 0 === t && (t = !0), this.each(function () {
var r = this.type;
if ("checkbox" == r || "radio" == r) this.checked = t;
else if ("option" == this.tagName.toLowerCase()) {
var a = e(this).parent("select");
t && a[0] && "select-one" == a[0].type && a.find("option").selected(!1), this.selected = t
}
})
}, e.fn.ajaxSubmit.debug = !1
});;
/*!
* DLE UniForm — унверсальные формы для DLE
*
* @author ПафНутиЙ
* @link http://pafnuty.name/
* @link https://twitter.com/pafnuty_name
*/
var doc = $(document);
doc
.on('submit', '[data-uf-form]', function () {
var $this = $(this),
laddaLoad,
options = {
beforeSubmit: ufStart,
success: ufDone,
};
$this.ajaxSubmit(options);
return false;
})
.on('click', '[data-uf-open]', function (e) {
var $this = $(this),
src = $this.data('ufOpen'),
data = $this.data('ufSettings');
$.magnificPopup.open({
items: {
src: src,
},
focus: '.uf-input-first',
type: 'ajax',
ajax: {
settings: {
data: data
}
}
});
return false;
})
.on('keyup input', '.uf-input-error', function (e) {
var $this = $(this);
if (e.type == 'input') {
doc.off('keyup', '.uf-input-error');
}
if ($this.val().length) {
$this.removeClass('uf-input-error');
}
});
function ufStart(formData, jqForm) {
laddaLoad = jqForm.find('.ladda-button').ladda();
laddaLoad.ladda('start');
return true;
}
function ufDone(responseText, statusText, xhr, $form) {
var $responseText = $(responseText),
responseResult = ($responseText.is('form')) ? $responseText.html() : responseText;
if (statusText == 'success') {
laddaLoad.ladda('stop');
$form.html(responseResult);
}
}
jQuery(document).ready(function ($) {
var $inlineUniform = $('[data-uf-inline]');
if ($inlineUniform.length) {
$.each($inlineUniform, function (index, val) {
var $this = $(this),
url = $this.data('ufInline'),
data = $this.data('ufSettings');
$.ajax({
url: url,
data: data,
})
.done(function (data) {
$this.html(data);
});
});
};
});