/* == jquery mousewheel plugin == version: 3.1.12, license: mit license (mit) */ ! function(a) {
"function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a : a(jquery)
}(function(a) {
function b(b) {
var g = b || window.event,
h = i.call(arguments, 1),
j = 0,
l = 0,
m = 0,
n = 0,
o = 0,
p = 0;
if (b = a.event.fix(g), b.type = "mousewheel", "detail" in g && (m = -1 * g.detail), "wheeldelta" in g && (m = g.wheeldelta), "wheeldeltay" in g && (m = g.wheeldeltay), "wheeldeltax" in g && (l = -1 * g.wheeldeltax), "axis" in g && g.axis === g.horizontal_axis && (l = -1 * m, m = 0), j = 0 === m ? l : m, "deltay" in g && (m = -1 * g.deltay, j = m), "deltax" in g && (l = g.deltax, 0 === m && (j = -1 * l)), 0 !== m || 0 !== l) {
if (1 === g.deltamode) {
var q = a.data(this, "mousewheel-line-height");
j *= q, m *= q, l *= q
} else if (2 === g.deltamode) {
var r = a.data(this, "mousewheel-page-height");
j *= r, m *= r, l *= r
}
if (n = math.max(math.abs(m), math.abs(l)), (!f || f > n) && (f = n, d(g, n) && (f /= 40)), d(g, n) && (j /= 40, l /= 40, m /= 40), j = math[j >= 1 ? "floor" : "ceil"](j / f), l = math[l >= 1 ? "floor" : "ceil"](l / f), m = math[m >= 1 ? "floor" : "ceil"](m / f), k.settings.normalizeoffset && this.getboundingclientrect) {
var s = this.getboundingclientrect();
o = b.clientx - s.left, p = b.clienty - s.top
}
return b.deltax = l, b.deltay = m, b.deltafactor = f, b.offsetx = o, b.offsety = p, b.deltamode = 0, h.unshift(b, j, l, m), e && cleartimeout(e), e = settimeout(c, 200), (a.event.dispatch || a.event.handle)
.apply(this, h)
}
}
function c() {
f = null
}
function d(a, b) {
return k.settings.adjustolddeltas && "mousewheel" === a.type && b % 120 === 0
}
var e, f, g = ["wheel", "mousewheel", "dommousescroll", "mozmousepixelscroll"],
h = "onwheel" in document || document.documentmode >= 9 ? ["wheel"] : ["mousewheel", "dommousescroll", "mozmousepixelscroll"],
i = array.prototype.slice;
if (a.event.fixhooks)
for (var j = g.length; j;) a.event.fixhooks[g[--j]] = a.event.mousehooks;
var k = a.event.special.mousewheel = {
version: "3.1.12",
setup: function() {
if (this.addeventlistener)
for (var c = h.length; c;) this.addeventlistener(h[--c], b, !1);
else this.onmousewheel = b;
a.data(this, "mousewheel-line-height", k.getlineheight(this)), a.data(this, "mousewheel-page-height", k.getpageheight(this))
},
teardown: function() {
if (this.removeeventlistener)
for (var c = h.length; c;) this.removeeventlistener(h[--c], b, !1);
else this.onmousewheel = null;
a.removedata(this, "mousewheel-line-height"), a.removedata(this, "mousewheel-page-height")
},
getlineheight: function(b) {
var c = a(b),
d = c["offsetparent" in a.fn ? "offsetparent" : "parent"]();
return d.length || (d = a("body")), parseint(d.css("fontsize"), 10) || parseint(c.css("fontsize"), 10) || 16
},
getpageheight: function(b) {
return a(b)
.height()
},
settings: {
adjustolddeltas: !0,
normalizeoffset: !0
}
};
a.fn.extend({
mousewheel: function(a) {
return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
},
unmousewheel: function(a) {
return this.unbind("mousewheel", a)
}
})
});
/* == malihu jquery custom scrollbar plugin == version: 3.0.9, license: mit license (mit) */
! function(e) {
"undefined" != typeof module && module.exports ? module.exports = e : e(jquery, window, document)
}(function(e) {
! function(t) {
var o = "function" == typeof define && define.amd,
a = "undefined" != typeof module && module.exports,
n = "https:" == document.location.protocol ? "https:" : "http:",
i = "cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";
o || (a ? require("jquery-mousewheel")(e) : e.event.special.mousewheel || e("head")
.append(decodeuri("%3cscript src=" + n + "//" + i + "%3e%3c/script%3e"))), t()
}(function() {
var t, o = "mcustomscrollbar",
a = "mcs",
n = ".mcustomscrollbar",
i = {
settop: 0,
setleft: 0,
axis: "y",
scrollbarposition: "inside",
scrollinertia: 950,
autodraggerlength: !0,
alwaysshowscrollbar: 0,
snapoffset: 0,
mousewheel: {
enable: !0,
scrollamount: "auto",
axis: "y",
deltafactor: "auto",
disableover: ["select", "option", "keygen", "datalist", "textarea"]
},
scrollbuttons: {
scrolltype: "stepless",
scrollamount: "auto"
},
keyboard: {
enable: !0,
scrolltype: "stepless",
scrollamount: "auto"
},
contenttouchscroll: 25,
advanced: {
autoscrollonfocus: "input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",
updateoncontentresize: !0,
updateonimageload: !0,
autoupdatetimeout: 60
},
theme: "light",
callbacks: {
ontotalscrolloffset: 0,
ontotalscrollbackoffset: 0,
alwaystriggeroffsets: !0
}
},
r = 0,
l = {},
s = window.attachevent && !window.addeventlistener ? 1 : 0,
c = !1,
d = ["mcsb_dragger_ondrag", "mcsb_scrolltools_ondrag", "mcs_img_loaded", "mcs_disabled", "mcs_destroyed", "mcs_no_scrollbar", "mcs-autohide", "mcs-dir-rtl", "mcs_no_scrollbar_y", "mcs_no_scrollbar_x", "mcs_y_hidden", "mcs_x_hidden", "mcsb_draggercontainer", "mcsb_buttonup", "mcsb_buttondown", "mcsb_buttonleft", "mcsb_buttonright"],
u = {
init: function(t) {
var t = e.extend(!0, {}, i, t),
o = f.call(this);
if (t.live) {
var s = t.liveselector || this.selector || n,
c = e(s);
if ("off" === t.live) return void m(s);
l[s] = settimeout(function() {
c.mcustomscrollbar(t), "once" === t.live && c.length && m(s)
}, 500)
} else m(s);
return t.setwidth = t.set_width ? t.set_width : t.setwidth, t.setheight = t.set_height ? t.set_height : t.setheight, t.axis = t.horizontalscroll ? "x" : p(t.axis), t.scrollinertia = t.scrollinertia > 0 && t.scrollinertia < 17 ? 17 : t.scrollinertia, "object" != typeof t.mousewheel && 1 == t.mousewheel && (t.mousewheel = {
enable: !0,
scrollamount: "auto",
axis: "y",
preventdefault: !1,
deltafactor: "auto",
normalizedelta: !1,
invert: !1
}), t.mousewheel.scrollamount = t.mousewheelpixels ? t.mousewheelpixels : t.mousewheel.scrollamount, t.mousewheel.normalizedelta = t.advanced.normalizemousewheeldelta ? t.advanced.normalizemousewheeldelta : t.mousewheel.normalizedelta, t.scrollbuttons.scrolltype = g(t.scrollbuttons.scrolltype), h(t), e(o)
.each(function() {
var o = e(this);
if (!o.data(a)) {
o.data(a, {
idx: ++r,
opt: t,
scrollratio: {
y: null,
x: null
},
overflowed: null,
contentreset: {
y: null,
x: null
},
bindevents: !1,
tweenrunning: !1,
sequential: {},
langdir: o.css("direction"),
cboffsets: null,
trigger: null
});
var n = o.data(a),
i = n.opt,
l = o.data("mcs-axis"),
s = o.data("mcs-scrollbar-position"),
c = o.data("mcs-theme");
l && (i.axis = l), s && (i.scrollbarposition = s), c && (i.theme = c, h(i)), v.call(this), e("#mcsb_" + n.idx + "_container img:not(." + d[2] + ")")
.addclass(d[2]), u.update.call(null, o)
}
})
},
update: function(t, o) {
var n = t || f.call(this);
return e(n)
.each(function() {
var t = e(this);
if (t.data(a)) {
var n = t.data(a),
i = n.opt,
r = e("#mcsb_" + n.idx + "_container"),
l = [e("#mcsb_" + n.idx + "_dragger_vertical"), e("#mcsb_" + n.idx + "_dragger_horizontal")];
if (!r.length) return;
n.tweenrunning && v(t), t.hasclass(d[3]) && t.removeclass(d[3]), t.hasclass(d[4]) && t.removeclass(d[4]), s.call(this), _.call(this), "y" === i.axis || i.advanced.autoexpandhorizontalscroll || r.css("width", x(r.children())), n.overflowed = b.call(this), o.call(this), i.autodraggerlength && b.call(this), c.call(this), k.call(this);
var s = [math.abs(r[0].offsettop), math.abs(r[0].offsetleft)];
"x" !== i.axis && (n.overflowed[0] ? l[0].height() > l[0].parent()
.height() ? t.call(this) : (q(t, s[0].tostring(), {
dir: "y",
dur: 0,
overwrite: "none"
}), n.contentreset.y = null) : (t.call(this), "y" === i.axis ? m.call(this) : "yx" === i.axis && n.overflowed[1] && q(t, s[1].tostring(), {
dir: "x",
dur: 0,
overwrite: "none"
}))), "y" !== i.axis && (n.overflowed[1] ? l[1].width() > l[1].parent()
.width() ? t.call(this) : (q(t, s[1].tostring(), {
dir: "x",
dur: 0,
overwrite: "none"
}), n.contentreset.x = null) : (t.call(this), "x" === i.axis ? m.call(this) : "yx" === i.axis && n.overflowed[0] && q(t, s[0].tostring(), {
dir: "y",
dur: 0,
overwrite: "none"
}))), o && n && (2 === o && i.callbacks.onimageload && "function" == typeof i.callbacks.onimageload ? i.callbacks.onimageload.call(this) : 3 === o && i.callbacks.onselectorchange && "function" == typeof i.callbacks.onselectorchange ? i.callbacks.onselectorchange.call(this) : i.callbacks.onupdate && "function" == typeof i.callbacks.onupdate && i.callbacks.onupdate.call(this)), x.call(this)
}
})
},
scrollto: function(t, o) {
if ("undefined" != typeof t && null != t) {
var n = f.call(this);
return e(n)
.each(function() {
var n = e(this);
if (n.data(a)) {
var i = n.data(a),
r = i.opt,
l = {
trigger: "external",
scrollinertia: r.scrollinertia,
scrolleasing: "mcseaseinout",
movedragger: !1,
timeout: 60,
callbacks: !0,
onstart: !0,
onupdate: !0,
oncomplete: !0
},
s = e.extend(!0, {}, l, o),
c = y.call(this, t),
d = s.scrollinertia > 0 && s.scrollinertia < 17 ? 17 : s.scrollinertia;
c[0] = j.call(this, c[0], "y"), c[1] = j.call(this, c[1], "x"), s.movedragger && (c[0] *= i.scrollratio.y, c[1] *= i.scrollratio.x), s.dur = d, settimeout(function() {
null !== c[0] && "undefined" != typeof c[0] && "x" !== r.axis && i.overflowed[0] && (s.dir = "y", s.overwrite = "all", q(n, c[0].tostring(), s)), null !== c[1] && "undefined" != typeof c[1] && "y" !== r.axis && i.overflowed[1] && (s.dir = "x", s.overwrite = "none", q(n, c[1].tostring(), s))
}, s.timeout)
}
})
}
},
stop: function() {
var t = f.call(this);
return e(t)
.each(function() {
var t = e(this);
t.data(a) && v(t)
})
},
disable: function(t) {
var o = f.call(this);
return e(o)
.each(function() {
var o = e(this);
if (o.data(a)) {
{
o.data(a)
}
x.call(this, "remove"), m.call(this), t && t.call(this), o.call(this, !0), o.addclass(d[3])
}
})
},
destroy: function() {
var t = f.call(this);
return e(t)
.each(function() {
var n = e(this);
if (n.data(a)) {
var i = n.data(a),
r = i.opt,
l = e("#mcsb_" + i.idx),
s = e("#mcsb_" + i.idx + "_container"),
c = e(".mcsb_" + i.idx + "_scrollbar");
r.live && m(r.liveselector || e(t)
.selector), x.call(this, "remove"), m.call(this), t.call(this), n.removedata(a), z(this, "mcs"), c.remove(), s.find("img." + d[2])
.removeclass(d[2]), l.replacewith(s.contents()), n.removeclass(o + " _" + a + "_" + i.idx + " " + d[6] + " " + d[7] + " " + d[5] + " " + d[3])
.addclass(d[4])
}
})
}
},
f = function() {
return "object" != typeof e(this) || e(this)
.length < 1 ? n : this
},
h = function(t) {
var o = ["rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark"],
a = ["rounded-dots", "rounded-dots-dark", "3d", "3d-dark", "3d-thick", "3d-thick-dark", "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark"],
n = ["minimal", "minimal-dark"],
i = ["minimal", "minimal-dark"],
r = ["minimal", "minimal-dark"];
t.autodraggerlength = e.inarray(t.theme, o) > -1 ? !1 : t.autodraggerlength, t.autoexpandscrollbar = e.inarray(t.theme, a) > -1 ? !1 : t.autoexpandscrollbar, t.scrollbuttons.enable = e.inarray(t.theme, n) > -1 ? !1 : t.scrollbuttons.enable, t.autohidescrollbar = e.inarray(t.theme, i) > -1 ? !0 : t.autohidescrollbar, t.scrollbarposition = e.inarray(t.theme, r) > -1 ? "outside" : t.scrollbarposition
},
m = function(e) {
l[e] && (cleartimeout(l[e]), z(l, e))
},
p = function(e) {
return "yx" === e || "xy" === e || "auto" === e ? "yx" : "x" === e || "horizontal" === e ? "x" : "y"
},
g = function(e) {
return "stepped" === e || "pixels" === e || "step" === e || "click" === e ? "stepped" : "stepless"
},
v = function() {
var t = e(this),
n = t.data(a),
i = n.opt,
r = i.autoexpandscrollbar ? " " + d[1] + "_expand" : "",
l = ["
", ""],
s = "yx" === i.axis ? "mcsb_vertical_horizontal" : "x" === i.axis ? "mcsb_horizontal" : "mcsb_vertical",
c = "yx" === i.axis ? l[0] + l[1] : "x" === i.axis ? l[1] : l[0],
u = "yx" === i.axis ? "" : "",
f = i.autohidescrollbar ? " " + d[6] : "",
h = "x" !== i.axis && "rtl" === n.langdir ? " " + d[7] : "";
i.setwidth && t.css("width", i.setwidth), i.setheight && t.css("height", i.setheight), i.setleft = "y" !== i.axis && "rtl" === n.langdir ? "989999px" : i.setleft, t.addclass(o + " _" + a + "_" + n.idx + f + h)
.wrapinner("");
var m = e("#mcsb_" + n.idx),
p = e("#mcsb_" + n.idx + "_container");
"y" === i.axis || i.advanced.autoexpandhorizontalscroll || p.css("width", x(p.children())), "outside" === i.scrollbarposition ? ("static" === t.css("position") && t.css("position", "relative"), t.css("overflow", "visible"), m.addclass("mcsb_outside")
.after(c)) : (m.addclass("mcsb_inside")
.append(c), p.wrap(u)), w.call(this);
var g = [e("#mcsb_" + n.idx + "_dragger_vertical"), e("#mcsb_" + n.idx + "_dragger_horizontal")];
g[0].css("min-height", g[0].height()), g[1].css("min-width", g[1].width())
},
x = function(t) {
return math.max.apply(math, t.map(function() {
return e(this)
.outerwidth(!0)
})
.get())
},
_ = function() {
var t = e(this),
o = t.data(a),
n = o.opt,
i = e("#mcsb_" + o.idx + "_container");
n.advanced.autoexpandhorizontalscroll && "y" !== n.axis && i.css({
position: "absolute",
width: "auto"
})
.wrap("")
.css({
width: math.ceil(i[0].getboundingclientrect()
.right + .4) - math.floor(i[0].getboundingclientrect()
.left),
position: "relative"
})
.unwrap()
},
w = function() {
var t = e(this),
o = t.data(a),
n = o.opt,
i = e(".mcsb_" + o.idx + "_scrollbar:first"),
r = te(n.scrollbuttons.tabindex) ? "tabindex='" + n.scrollbuttons.tabindex + "'" : "",
l = ["", "", "", ""],
s = ["x" === n.axis ? l[2] : l[0], "x" === n.axis ? l[3] : l[1], l[2], l[3]];
n.scrollbuttons.enable && i.prepend(s[0])
.append(s[1])
.next(".mcsb_scrolltools")
.prepend(s[2])
.append(s[3])
},
s = function() {
var t = e(this),
o = t.data(a),
n = e("#mcsb_" + o.idx),
i = t.css("max-height") || "none",
r = -1 !== i.indexof("%"),
l = t.css("box-sizing");
if ("none" !== i) {
var s = r ? t.parent()
.height() * parseint(i) / 100 : parseint(i);
"border-box" === l && (s -= t.innerheight() - t.height() + (t.outerheight() - t.innerheight())), n.css("max-height", math.round(s))
}
},
b = function() {
var t = e(this),
o = t.data(a),
n = e("#mcsb_" + o.idx),
i = e("#mcsb_" + o.idx + "_container"),
r = [e("#mcsb_" + o.idx + "_dragger_vertical"), e("#mcsb_" + o.idx + "_dragger_horizontal")],
l = [n.height() / i.outerheight(!1), n.width() / i.outerwidth(!1)],
c = [parseint(r[0].css("min-height")), math.round(l[0] * r[0].parent()
.height()), parseint(r[1].css("min-width")), math.round(l[1] * r[1].parent()
.width())],
d = s && c[1] < c[0] ? c[0] : c[1],
u = s && c[3] < c[2] ? c[2] : c[3];
r[0].css({
height: d,
"max-height": r[0].parent()
.height() - 10
})
.find(".mcsb_dragger_bar")
.css({
"line-height": c[0] + "px"
}), r[1].css({
width: u,
"max-width": r[1].parent()
.width() - 10
})
},
c = function() {
var t = e(this),
o = t.data(a),
n = e("#mcsb_" + o.idx),
i = e("#mcsb_" + o.idx + "_container"),
r = [e("#mcsb_" + o.idx + "_dragger_vertical"), e("#mcsb_" + o.idx + "_dragger_horizontal")],
l = [i.outerheight(!1) - n.height(), i.outerwidth(!1) - n.width()],
s = [l[0] / (r[0].parent()
.height() - r[0].height()), l[1] / (r[1].parent()
.width() - r[1].width())];
o.scrollratio = {
y: s[0],
x: s[1]
}
},
y = function(e, t, o) {
var a = o ? d[0] + "_expanded" : "",
n = e.closest(".mcsb_scrolltools");
"active" === t ? (e.toggleclass(d[0] + " " + a), n.toggleclass(d[1]), e[0]._draggable = e[0]._draggable ? 0 : 1) : e[0]._draggable || ("hide" === t ? (e.removeclass(d[0]), n.removeclass(d[1])) : (e.addclass(d[0]), n.addclass(d[1])))
},
b = function() {
var t = e(this),
o = t.data(a),
n = e("#mcsb_" + o.idx),
i = e("#mcsb_" + o.idx + "_container"),
r = null == o.overflowed ? i.height() : i.outerheight(!1),
l = null == o.overflowed ? i.width() : i.outerwidth(!1);
return [r > n.height(), l > n.width()]
},
t = function() {
var t = e(this),
o = t.data(a),
n = o.opt,
i = e("#mcsb_" + o.idx),
r = e("#mcsb_" + o.idx + "_container"),
l = [e("#mcsb_" + o.idx + "_dragger_vertical"), e("#mcsb_" + o.idx + "_dragger_horizontal")];
if (v(t), ("x" !== n.axis && !o.overflowed[0] || "y" === n.axis && o.overflowed[0]) && (l[0].add(r)
.css("top", 0), q(t, "_resety")), "y" !== n.axis && !o.overflowed[1] || "x" === n.axis && o.overflowed[1]) {
var s = dx = 0;
"rtl" === o.langdir && (s = i.width() - r.outerwidth(!1), dx = math.abs(s / o.scrollratio.x)), r.css("left", s), l[1].css("left", dx), q(t, "_resetx")
}
},
k = function() {
function t() {
r = settimeout(function() {
e.event.special.mousewheel ? (cleartimeout(r), w.call(o[0])) : t()
}, 100)
}
var o = e(this),
n = o.data(a),
i = n.opt;
if (!n.bindevents) {
if (r.call(this), i.contenttouchscroll && d.call(this), e.call(this), i.mousewheel.enable) {
var r;
t()
}
p.call(this), h.call(this), i.advanced.autoscrollonfocus && z.call(this), i.scrollbuttons.enable && u.call(this), i.keyboard.enable && f.call(this), n.bindevents = !0
}
},
m = function() {
var t = e(this),
o = t.data(a),
n = o.opt,
i = a + "_" + o.idx,
r = ".mcsb_" + o.idx + "_scrollbar",
l = e("#mcsb_" + o.idx + ",#mcsb_" + o.idx + "_container,#mcsb_" + o.idx + "_container_wrapper," + r + " ." + d[12] + ",#mcsb_" + o.idx + "_dragger_vertical,#mcsb_" + o.idx + "_dragger_horizontal," + r + ">a"),
s = e("#mcsb_" + o.idx + "_container");
n.advanced.releasedraggableselectors && l.add(e(n.advanced.releasedraggableselectors)), o.bindevents && (e(document)
.unbind("." + i), l.each(function() {
e(this)
.unbind("." + i)
}), cleartimeout(t[0]._focustimeout), z(t[0], "_focustimeout"), cleartimeout(o.sequential.step), z(o.sequential, "step"), cleartimeout(s[0].oncompletetimeout), z(s[0], "oncompletetimeout"), o.bindevents = !1)
},
o = function(t) {
var o = e(this),
n = o.data(a),
i = n.opt,
r = e("#mcsb_" + n.idx + "_container_wrapper"),
l = r.length ? r : e("#mcsb_" + n.idx + "_container"),
s = [e("#mcsb_" + n.idx + "_scrollbar_vertical"), e("#mcsb_" + n.idx + "_scrollbar_horizontal")],
c = [s[0].find(".mcsb_dragger"), s[1].find(".mcsb_dragger")];
"x" !== i.axis && (n.overflowed[0] && !t ? (s[0].add(c[0])
.add(s[0].children("a"))
.css("display", "block"), l.removeclass(d[8] + " " + d[10])) : (i.alwaysshowscrollbar ? (2 !== i.alwaysshowscrollbar && c[0].css("display", "none"), l.removeclass(d[10])) : (s[0].css("display", "none"), l.addclass(d[10])), l.addclass(d[8]))), "y" !== i.axis && (n.overflowed[1] && !t ? (s[1].add(c[1])
.add(s[1].children("a"))
.css("display", "block"), l.removeclass(d[9] + " " + d[11])) : (i.alwaysshowscrollbar ? (2 !== i.alwaysshowscrollbar && c[1].css("display", "none"), l.removeclass(d[11])) : (s[1].css("display", "none"), l.addclass(d[11])), l.addclass(d[9]))), n.overflowed[0] || n.overflowed[1] ? o.removeclass(d[5]) : o.addclass(d[5])
},
i = function(e) {
var t = e.type;
switch (t) {
case "pointerdown":
case "mspointerdown":
case "pointermove":
case "mspointermove":
case "pointerup":
case "mspointerup":
return e.target.ownerdocument !== document ? [e.originalevent.screeny, e.originalevent.screenx, !1] : [e.originalevent.pagey, e.originalevent.pagex, !1];
case "touchstart":
case "touchmove":
case "touchend":
var o = e.originalevent.touches[0] || e.originalevent.changedtouches[0],
a = e.originalevent.touches.length || e.originalevent.changedtouches.length;
return e.target.ownerdocument !== document ? [o.screeny, o.screenx, a > 1] : [o.pagey, o.pagex, a > 1];
default:
return [e.pagey, e.pagex, !1]
}
},
r = function() {
function t(e) {
var t = m.find("iframe");
if (t.length) {
var o = e ? "auto" : "none";
t.css("pointer-events", o)
}
}
function o(e, t, o, a) {
if (m[0].idletimer = u.scrollinertia < 233 ? 250 : 0, n.attr("id") === h[1]) var i = "x",
r = (n[0].offsetleft - t + a) * d.scrollratio.x;
else var i = "y",
r = (n[0].offsettop - e + o) * d.scrollratio.y;
q(l, r.tostring(), {
dir: i,
drag: !0
})
}
var n, i, r, l = e(this),
d = l.data(a),
u = d.opt,
f = a + "_" + d.idx,
h = ["mcsb_" + d.idx + "_dragger_vertical", "mcsb_" + d.idx + "_dragger_horizontal"],
m = e("#mcsb_" + d.idx + "_container"),
p = e("#" + h[0] + ",#" + h[1]),
g = u.advanced.releasedraggableselectors ? p.add(e(u.advanced.releasedraggableselectors)) : p;
p.bind("mousedown." + f + " touchstart." + f + " pointerdown." + f + " mspointerdown." + f, function(o) {
if (o.stopimmediatepropagation(), o.preventdefault(), $(o)) {
c = !0, s && (document.onselectstart = function() {
return !1
}), t(!1), v(l), n = e(this);
var a = n.offset(),
d = i(o)[0] - a.top,
f = i(o)[1] - a.left,
h = n.height() + a.top,
m = n.width() + a.left;
h > d && d > 0 && m > f && f > 0 && (i = d, r = f), y(n, "active", u.autoexpandscrollbar)
}
})
.bind("touchmove." + f, function(e) {
e.stopimmediatepropagation(), e.preventdefault();
var t = n.offset(),
a = i(e)[0] - t.top,
l = i(e)[1] - t.left;
o(i, r, a, l)
}), e(document)
.bind("mousemove." + f + " pointermove." + f + " mspointermove." + f, function(e) {
if (n) {
var t = n.offset(),
a = i(e)[0] - t.top,
l = i(e)[1] - t.left;
if (i === a) return;
o(i, r, a, l)
}
})
.add(g)
.bind("mouseup." + f + " touchend." + f + " pointerup." + f + " mspointerup." + f, function(e) {
n && (y(n, "active", u.autoexpandscrollbar), n = null), c = !1, s && (document.onselectstart = null), t(!0)
})
},
d = function() {
function o(e) {
if (!ee(e) || c || i(e)[2]) return void(t = 0);
t = 1, s = 0, b = 0, c.removeclass("mcs_touch_action");
var o = m.offset();
d = i(e)[0] - o.top, u = i(e)[1] - o.left, a = [i(e)[0], i(e)[1]]
}
function n(e) {
if (ee(e) && !c && !i(e)[2] && (e.stopimmediatepropagation(), !b || s)) {
p = j();
var t = k.offset(),
o = i(e)[0] - t.top,
a = i(e)[1] - t.left,
n = "mcslinearout";
if (r.push(o), d.push(a), a[2] = math.abs(i(e)[0] - a[0]), a[3] = math.abs(i(e)[1] - a[1]), y.overflowed[0]) var i = o[0].parent()
.height() - o[0].height(),
r = d - o > 0 && o - d > -(i * y.scrollratio.y) && (2 * a[3] < a[2] || "yx" === b.axis);
if (y.overflowed[1]) var l = o[1].parent()
.width() - o[1].width(),
f = u - a > 0 && a - u > -(l * y.scrollratio.x) && (2 * a[2] < a[3] || "yx" === b.axis);
r || f ? (e.preventdefault(), s = 1) : (b = 1, c.addclass("mcs_touch_action")), _ = "yx" === b.axis ? [d - o, u - a] : "x" === b.axis ? [null, u - a] : [d - o, null], m[0].idletimer = 250, y.overflowed[0] && s(_[0], e, n, "y", "all", !0), y.overflowed[1] && s(_[1], e, n, "x", w, !0)
}
}
function i(e) {
if (!ee(e) || c || i(e)[2]) return void(t = 0);
t = 1, e.stopimmediatepropagation(), v(c), m = j();
var o = k.offset();
f = i(e)[0] - o.top, h = i(e)[1] - o.left, r = [], d = []
}
function r(e) {
if (ee(e) && !c && !i(e)[2]) {
e.stopimmediatepropagation(), s = 0, b = 0, g = j();
var t = k.offset(),
o = i(e)[0] - t.top,
a = i(e)[1] - t.left;
if (!(g - p > 30)) {
x = 1e3 / (g - m);
var n = "mcseaseout",
i = 2.5 > x,
r = i ? [r[r.length - 2], d[d.length - 2]] : [0, 0];
v = i ? [o - r[0], a - r[1]] : [o - f, a - h];
var d = [math.abs(v[0]), math.abs(v[1])];
x = i ? [math.abs(v[0] / 4), math.abs(v[1] / 4)] : [x, x];
var u = [math.abs(m[0].offsettop) - v[0] * l(d[0] / x[0], x[0]), math.abs(m[0].offsetleft) - v[1] * l(d[1] / x[1], x[1])];
_ = "yx" === b.axis ? [u[0], u[1]] : "x" === b.axis ? [null, u[1]] : [u[0], null], w = [4 * d[0] + b.scrollinertia, 4 * d[1] + b.scrollinertia];
var c = parseint(b.contenttouchscroll) || 0;
_[0] = d[0] > c ? _[0] : 0, _[1] = d[1] > c ? _[1] : 0, y.overflowed[0] && s(_[0], w[0], n, "y", w, !1), y.overflowed[1] && s(_[1], w[1], n, "x", w, !1)
}
}
}
function l(e, t) {
var o = [1.5 * t, 2 * t, t / 1.5, t / 2];
return e > 90 ? t > 4 ? o[0] : o[3] : e > 60 ? t > 3 ? o[3] : o[2] : e > 30 ? t > 8 ? o[1] : t > 6 ? o[0] : t > 4 ? t : o[2] : t > 8 ? t : o[3]
}
function s(e, t, o, a, n, i) {
e && q(c, e.tostring(), {
dur: t,
scrolleasing: o,
dir: a,
overwrite: n,
drag: i
})
}
var d, u, f, h, m, p, g, v, x, _, w, s, b, c = e(this),
y = c.data(a),
b = y.opt,
t = a + "_" + y.idx,
k = e("#mcsb_" + y.idx),
m = e("#mcsb_" + y.idx + "_container"),
o = [e("#mcsb_" + y.idx + "_dragger_vertical"), e("#mcsb_" + y.idx + "_dragger_horizontal")],
r = [],
d = [],
e = 0,
w = "yx" === b.axis ? "none" : "all",
a = [],
p = m.find("iframe"),
z = ["touchstart." + t + " pointerdown." + t + " mspointerdown." + t, "touchmove." + t + " pointermove." + t + " mspointermove." + t, "touchend." + t + " pointerup." + t + " mspointerup." + t];
m.bind(z[0], function(e) {
o(e)
})
.bind(z[1], function(e) {
n(e)
}), k.bind(z[0], function(e) {
i(e)
})
.bind(z[2], function(e) {
r(e)
}), p.length && p.each(function() {
e(this).load(function() {
l(this) && e(this.contentdocument || this.contentwindow.document)
.bind(z[0], function(e) {
o(e), i(e)
})
.bind(z[1], function(e) {
n(e)
})
.bind(z[2], function(e) {
r(e)
})
})
})
},
e = function() {
function o() {
return window.getselection ? window.getselection()
.tostring() : document.selection && "control" != document.selection.type ? document.selection.createrange()
.text : 0
}
function n(e, t, o) {
d.type = o && i ? "stepped" : "stepless", d.scrollamount = 10, q(r, e, t, "mcslinearout", o ? 60 : null)
}
var i, r = e(this),
l = r.data(a),
s = l.opt,
d = l.sequential,
u = a + "_" + l.idx,
f = e("#mcsb_" + l.idx + "_container"),
h = f.parent();
f.bind("mousedown." + u, function(e) {
t || i || (i = 1, c = !0)
})
.add(document)
.bind("mousemove." + u, function(e) {
if (!t && i && o()) {
var a = f.offset(),
r = i(e)[0] - a.top + f[0].offsettop,
c = i(e)[1] - a.left + f[0].offsetleft;
r > 0 && r < h.height() && c > 0 && c < h.width() ? d.step && n("off", null, "stepped") : ("x" !== s.axis && l.overflowed[0] && (0 > r ? n("on", 38) : r > h.height() && n("on", 40)), "y" !== s.axis && l.overflowed[1] && (0 > c ? n("on", 37) : c > h.width() && n("on", 39)))
}
})
.bind("mouseup." + u, function(e) {
t || (i && (i = 0, n("off", null)), c = !1)
})
},
w = function() {
function t(t, a) {
if (v(o), !a(o, t.target)) {
var r = "auto" !== i.mousewheel.deltafactor ? parseint(i.mousewheel.deltafactor) : s && t.deltafactor < 100 ? 100 : t.deltafactor || 100;
if ("x" === i.axis || "x" === i.mousewheel.axis) var d = "x",
u = [math.round(r * n.scrollratio.x), parseint(i.mousewheel.scrollamount)],
f = "auto" !== i.mousewheel.scrollamount ? u[1] : u[0] >= l.width() ? .9 * l.width() : u[0],
h = math.abs(e("#mcsb_" + n.idx + "_container")[0].offsetleft),
m = c[1][0].offsetleft,
p = c[1].parent()
.width() - c[1].width(),
g = t.deltax || t.deltay || a;
else var d = "y",
u = [math.round(r * n.scrollratio.y), parseint(i.mousewheel.scrollamount)],
f = "auto" !== i.mousewheel.scrollamount ? u[1] : u[0] >= l.height() ? .9 * l.height() : u[0],
h = math.abs(e("#mcsb_" + n.idx + "_container")[0].offsettop),
m = c[0][0].offsettop,
p = c[0].parent()
.height() - c[0].height(),
g = t.deltay || a;
"y" === d && !n.overflowed[0] || "x" === d && !n.overflowed[1] || ((i.mousewheel.invert || t.webkitdirectioninvertedfromdevice) && (g = -g), i.mousewheel.normalizedelta && (g = 0 > g ? -1 : 1), (g > 0 && 0 !== m || 0 > g && m !== p || i.mousewheel.preventdefault) && (t.stopimmediatepropagation(), t.preventdefault()), q(o, (h - g * f)
.tostring(), {
dir: d
}))
}
}
if (e(this)
.data(a)) {
var o = e(this),
n = o.data(a),
i = n.opt,
r = a + "_" + n.idx,
l = e("#mcsb_" + n.idx),
c = [e("#mcsb_" + n.idx + "_dragger_vertical"), e("#mcsb_" + n.idx + "_dragger_horizontal")],
d = e("#mcsb_" + n.idx + "_container")
.find("iframe");
d.length && d.each(function() {
e(this).load(function() {
l(this) && e(this.contentdocument || this.contentwindow.document)
.bind("mousewheel." + r, function(e, o) {
t(e, o)
})
})
}), l.bind("mousewheel." + r, function(e, o) {
t(e, o)
})
}
},
l = function(e) {
var t = null;
try {
var o = e.contentdocument || e.contentwindow.document;
t = o.body.innerhtml
} catch (a) {}
return null !== t
},
a = function(t, o) {
var n = o.nodename.tolowercase(),
i = t.data(a)
.opt.mousewheel.disableover,
r = ["select", "textarea"];
return e.inarray(n, i) > -1 && !(e.inarray(n, r) > -1 && !e(o)
.is(":focus"))
},
p = function() {
var t = e(this),
o = t.data(a),
n = a + "_" + o.idx,
i = e("#mcsb_" + o.idx + "_container"),
r = i.parent(),
l = e(".mcsb_" + o.idx + "_scrollbar ." + d[12]);
l.bind("touchstart." + n + " pointerdown." + n + " mspointerdown." + n, function(e) {
c = !0
})
.bind("touchend." + n + " pointerup." + n + " mspointerup." + n, function(e) {
c = !1
})
.bind("click." + n, function(a) {
if (e(a.target)
.hasclass(d[12]) || e(a.target)
.hasclass("mcsb_draggerrail")) {
v(t);
var n = e(this),
l = n.find(".mcsb_dragger");
if (n.parent(".mcsb_scrolltools_horizontal")
.length > 0) {
if (!o.overflowed[1]) return;
var s = "x",
c = a.pagex > l.offset()
.left ? -1 : 1,
u = math.abs(i[0].offsetleft) - .9 * c * r.width()
} else {
if (!o.overflowed[0]) return;
var s = "y",
c = a.pagey > l.offset()
.top ? -1 : 1,
u = math.abs(i[0].offsettop) - .9 * c * r.height()
}
q(t, u.tostring(), {
dir: s,
scrolleasing: "mcseaseinout"
})
}
})
},
z = function() {
var t = e(this),
o = t.data(a),
n = o.opt,
i = a + "_" + o.idx,
r = e("#mcsb_" + o.idx + "_container"),
l = r.parent();
r.bind("focusin." + i, function(o) {
var a = e(document.activeelement),
i = r.find(".mcustomscrollbox")
.length,
s = 0;
a.is(n.advanced.autoscrollonfocus) && (v(t), cleartimeout(t[0]._focustimeout), t[0]._focustimer = i ? (s + 17) * i : 0, t[0]._focustimeout = settimeout(function() {
var e = [oe(a)[0], oe(a)[1]],
o = [r[0].offsettop, r[0].offsetleft],
i = [o[0] + e[0] >= 0 && o[0] + e[0] < l.height() - a.outerheight(!1), o[1] + e[1] >= 0 && o[0] + e[1] < l.width() - a.outerwidth(!1)],
c = "yx" !== n.axis || i[0] || i[1] ? "all" : "none";
"x" === n.axis || i[0] || q(t, e[0].tostring(), {
dir: "y",
scrolleasing: "mcseaseinout",
overwrite: c,
dur: s
}), "y" === n.axis || i[1] || q(t, e[1].tostring(), {
dir: "x",
scrolleasing: "mcseaseinout",
overwrite: c,
dur: s
})
}, t[0]._focustimer))
})
},
h = function() {
var t = e(this),
o = t.data(a),
n = a + "_" + o.idx,
i = e("#mcsb_" + o.idx + "_container")
.parent();
i.bind("scroll." + n, function(t) {
(0 !== i.scrolltop() || 0 !== i.scrollleft()) && e(".mcsb_" + o.idx + "_scrollbar")
.css("visibility", "hidden")
})
},
u = function() {
var t = e(this),
o = t.data(a),
n = o.opt,
i = o.sequential,
r = a + "_" + o.idx,
l = ".mcsb_" + o.idx + "_scrollbar",
s = e(l + ">a");
s.bind("mousedown." + r + " touchstart." + r + " pointerdown." + r + " mspointerdown." + r + " mouseup." + r + " touchend." + r + " pointerup." + r + " mspointerup." + r + " mouseout." + r + " pointerout." + r + " mspointerout." + r + " click." + r, function(a) {
function r(e, o) {
i.scrollamount = n.snapamount || n.scrollbuttons.scrollamount, q(t, e, o)
}
if (a.preventdefault(), $(a)) {
var l = e(this)
.attr("class");
switch (i.type = n.scrollbuttons.scrolltype, a.type) {
case "mousedown":
case "touchstart":
case "pointerdown":
case "mspointerdown":
if ("stepped" === i.type) return;
c = !0, o.tweenrunning = !1, r("on", l);
break;
case "mouseup":
case "touchend":
case "pointerup":
case "mspointerup":
case "mouseout":
case "pointerout":
case "mspointerout":
if ("stepped" === i.type) return;
c = !1, i.dir && r("off", l);
break;
case "click":
if ("stepped" !== i.type || o.tweenrunning) return;
r("on", l)
}
}
})
},
f = function() {
function t(t) {
function a(e, t) {
r.type = i.keyboard.scrolltype, r.scrollamount = i.snapamount || i.keyboard.scrollamount, "stepped" === r.type && n.tweenrunning || q(o, e, t)
}
switch (t.type) {
case "blur":
n.tweenrunning && r.dir && a("off", null);
break;
case "keydown":
case "keyup":
var l = t.keycode ? t.keycode : t.which,
s = "on";
if ("x" !== i.axis && (38 === l || 40 === l) || "y" !== i.axis && (37 === l || 39 === l)) {
if ((38 === l || 40 === l) && !n.overflowed[0] || (37 === l || 39 === l) && !n.overflowed[1]) return;
"keyup" === t.type && (s = "off"), e(document.activeelement)
.is(u) || (t.preventdefault(), t.stopimmediatepropagation(), a(s, l))
} else if (33 === l || 34 === l) {
if ((n.overflowed[0] || n.overflowed[1]) && (t.preventdefault(), t.stopimmediatepropagation()), "keyup" === t.type) {
v(o);
var f = 34 === l ? -1 : 1;
if ("x" === i.axis || "yx" === i.axis && n.overflowed[1] && !n.overflowed[0]) var h = "x",
m = math.abs(c[0].offsetleft) - .9 * f * d.width();
else var h = "y",
m = math.abs(c[0].offsettop) - .9 * f * d.height();
q(o, m.tostring(), {
dir: h,
scrolleasing: "mcseaseinout"
})
}
} else if ((35 === l || 36 === l) && !e(document.activeelement)
.is(u) && ((n.overflowed[0] || n.overflowed[1]) && (t.preventdefault(), t.stopimmediatepropagation()), "keyup" === t.type)) {
if ("x" === i.axis || "yx" === i.axis && n.overflowed[1] && !n.overflowed[0]) var h = "x",
m = 35 === l ? math.abs(d.width() - c.outerwidth(!1)) : 0;
else var h = "y",
m = 35 === l ? math.abs(d.height() - c.outerheight(!1)) : 0;
q(o, m.tostring(), {
dir: h,
scrolleasing: "mcseaseinout"
})
}
}
}
var o = e(this),
n = o.data(a),
i = n.opt,
r = n.sequential,
l = a + "_" + n.idx,
s = e("#mcsb_" + n.idx),
c = e("#mcsb_" + n.idx + "_container"),
d = c.parent(),
u = "input,textarea,select,datalist,keygen,[contenteditable='true']",
f = c.find("iframe"),
h = ["blur." + l + " keydown." + l + " keyup." + l];
f.length && f.each(function() {
e(this).load(function() {
l(this) && e(this.contentdocument || this.contentwindow.document)
.bind(h[0], function(e) {
t(e)
})
})
}), s.attr("tabindex", "0")
.bind(h[0], function(e) {
t(e)
})
},
q = function(t, o, n, i, r) {
function l(e) {
var o = "stepped" !== f.type,
a = r ? r : e ? o ? p / 1.5 : g : 1e3 / 60,
n = e ? o ? 7.5 : 40 : 2.5,
s = [math.abs(h[0].offsettop), math.abs(h[0].offsetleft)],
d = [c.scrollratio.y > 10 ? 10 : c.scrollratio.y, c.scrollratio.x > 10 ? 10 : c.scrollratio.x],
u = "x" === f.dir[0] ? s[1] + f.dir[1] * d[1] * n : s[0] + f.dir[1] * d[0] * n,
m = "x" === f.dir[0] ? s[1] + f.dir[1] * parseint(f.scrollamount) : s[0] + f.dir[1] * parseint(f.scrollamount),
v = "auto" !== f.scrollamount ? m : u,
x = i ? i : e ? o ? "mcslinearout" : "mcseaseinout" : "mcslinear",
_ = e ? !0 : !1;
return e && 17 > a && (v = "x" === f.dir[0] ? s[1] : s[0]), q(t, v.tostring(), {
dir: f.dir[0],
scrolleasing: x,
dur: a,
oncomplete: _
}), e ? void(f.dir = !1) : (cleartimeout(f.step), void(f.step = settimeout(function() {
l()
}, a)))
}
function s() {
cleartimeout(f.step), z(f, "step"), v(t)
}
var c = t.data(a),
u = c.opt,
f = c.sequential,
h = e("#mcsb_" + c.idx + "_container"),
m = "stepped" === f.type ? !0 : !1,
p = u.scrollinertia < 26 ? 26 : u.scrollinertia,
g = u.scrollinertia < 1 ? 17 : u.scrollinertia;
switch (o) {
case "on":
if (f.dir = [n === d[16] || n === d[15] || 39 === n || 37 === n ? "x" : "y", n === d[13] || n === d[15] || 38 === n || 37 === n ? -1 : 1], v(t), te(n) && "stepped" === f.type) return;
l(m);
break;
case "off":
s(), (m || c.tweenrunning && f.dir) && l(!0)
}
},
y = function(t) {
var o = e(this)
.data(a)
.opt,
n = [];
return "function" == typeof t && (t = t()), t instanceof array ? n = t.length > 1 ? [t[0], t[1]] : "x" === o.axis ? [null, t[0]] : [t[0], null] : (n[0] = t.y ? t.y : t.x || "x" === o.axis ? null : t, n[1] = t.x ? t.x : t.y || "y" === o.axis ? null : t), "function" == typeof n[0] && (n[0] = n[0]()), "function" == typeof n[1] && (n[1] = n[1]()), n
},
j = function(t, o) {
if (null != t && "undefined" != typeof t) {
var n = e(this),
i = n.data(a),
r = i.opt,
l = e("#mcsb_" + i.idx + "_container"),
s = l.parent(),
c = typeof t;
o || (o = "x" === r.axis ? "x" : "y");
var d = "x" === o ? l.outerwidth(!1) : l.outerheight(!1),
f = "x" === o ? l[0].offsetleft : l[0].offsettop,
h = "x" === o ? "left" : "top";
switch (c) {
case "function":
return t();
case "object":
var m = t.jquery ? t : e(t);
if (!m.length) return;
return "x" === o ? oe(m)[1] : oe(m)[0];
case "string":
case "number":
if (te(t)) return math.abs(t);
if (-1 !== t.indexof("%")) return math.abs(d * parseint(t) / 100);
if (-1 !== t.indexof("-=")) return math.abs(f - parseint(t.split("-=")[1]));
if (-1 !== t.indexof("+=")) {
var p = f + parseint(t.split("+=")[1]);
return p >= 0 ? 0 : math.abs(p)
}
if (-1 !== t.indexof("px") && te(t.split("px")[0])) return math.abs(t.split("px")[0]);
if ("top" === t || "left" === t) return 0;
if ("bottom" === t) return math.abs(s.height() - l.outerheight(!1));
if ("right" === t) return math.abs(s.width() - l.outerwidth(!1));
if ("first" === t || "last" === t) {
var m = l.find(":" + t);
return "x" === o ? oe(m)[1] : oe(m)[0]
}
return e(t)
.length ? "x" === o ? oe(e(t))[1] : oe(e(t))[0] : (l.css(h, t), void u.update.call(null, n[0]))
}
}
},
x = function(t) {
function o() {
return cleartimeout(h[0].autoupdate), 0 === s.parents("html")
.length ? void(s = null) : void(h[0].autoupdate = settimeout(function() {
return f.advanced.updateonselectorchange && (m = r(), m !== w) ? (l(3), void(w = m)) : (f.advanced.updateoncontentresize && (p = [h.outerheight(!1), h.outerwidth(!1), v.height(), v.width(), _()[0], _()[1]], (p[0] !== s[0] || p[1] !== s[1] || p[2] !== s[2] || p[3] !== s[3] || p[4] !== s[4] || p[5] !== s[5]) && (l(p[0] !== s[0] || p[1] !== s[1]), s = p)), f.advanced.updateonimageload && (g = n(), g !== b && (h.find("img")
.each(function() {
i(this)
}), b = g)), void((f.advanced.updateonselectorchange || f.advanced.updateoncontentresize || f.advanced.updateonimageload) && o()))
}, f.advanced.autoupdatetimeout))
}
function n() {
var e = 0;
return f.advanced.updateonimageload && (e = h.find("img")
.length), e
}
function i(t) {
function o(e, t) {
return function() {
return t.apply(e, arguments)
}
}
function a() {
this.onload = null, e(t)
.addclass(d[2]), l(2)
}
if (e(t)
.hasclass(d[2])) return void l();
var n = new image;
n.onload = o(n, a), n.src = t.src
}
function r() {
f.advanced.updateonselectorchange === !0 && (f.advanced.updateonselectorchange = "*");
var t = 0,
o = h.find(f.advanced.updateonselectorchange);
return f.advanced.updateonselectorchange && o.length > 0 && o.each(function() {
t += e(this)
.height() + e(this)
.width()
}), t
}
function l(e) {
cleartimeout(h[0].autoupdate), u.update.call(null, s[0], e)
}
var s = e(this),
c = s.data(a),
f = c.opt,
h = e("#mcsb_" + c.idx + "_container");
if (t) return cleartimeout(h[0].autoupdate), void z(h[0], "autoupdate");
var m, p, g, v = h.parent(),
x = [e("#mcsb_" + c.idx + "_scrollbar_vertical"), e("#mcsb_" + c.idx + "_scrollbar_horizontal")],
_ = function() {
return [x[0].is(":visible") ? x[0].outerheight(!0) : 0, x[1].is(":visible") ? x[1].outerwidth(!0) : 0]
},
w = r(),
s = [h.outerheight(!1), h.outerwidth(!1), v.height(), v.width(), _()[0], _()[1]],
b = n();
o()
},
n = function(e, t, o) {
return math.round(e / t) * t - o
},
v = function(t) {
var o = t.data(a),
n = e("#mcsb_" + o.idx + "_container,#mcsb_" + o.idx + "_container_wrapper,#mcsb_" + o.idx + "_dragger_vertical,#mcsb_" + o.idx + "_dragger_horizontal");
n.each(function() {
k.call(this)
})
},
q = function(t, o, n) {
function i(e) {
return s && c.callbacks[e] && "function" == typeof c.callbacks[e]
}
function r() {
return [c.callbacks.alwaystriggeroffsets || _ >= w[0] + b, c.callbacks.alwaystriggeroffsets || -c >= _]
}
function l() {
var e = [h[0].offsettop, h[0].offsetleft],
o = [v[0].offsettop, v[0].offsetleft],
a = [h.outerheight(!1), h.outerwidth(!1)],
i = [f.height(), f.width()];
t[0].mcs = {
content: h,
top: e[0],
left: e[1],
draggertop: o[0],
draggerleft: o[1],
toppct: math.round(100 * math.abs(e[0]) / (math.abs(a[0]) - i[0])),
leftpct: math.round(100 * math.abs(e[1]) / (math.abs(a[1]) - i[1])),
direction: n.dir
}
}
var s = t.data(a),
c = s.opt,
d = {
trigger: "internal",
dir: "y",
scrolleasing: "mcseaseout",
drag: !1,
dur: c.scrollinertia,
overwrite: "all",
callbacks: !0,
onstart: !0,
onupdate: !0,
oncomplete: !0
},
n = e.extend(d, n),
u = [n.dur, n.drag ? 0 : n.dur],
f = e("#mcsb_" + s.idx),
h = e("#mcsb_" + s.idx + "_container"),
m = h.parent(),
p = c.callbacks.ontotalscrolloffset ? y.call(t, c.callbacks.ontotalscrolloffset) : [0, 0],
g = c.callbacks.ontotalscrollbackoffset ? y.call(t, c.callbacks.ontotalscrollbackoffset) : [0, 0];
if (s.trigger = n.trigger, (0 !== m.scrolltop() || 0 !== m.scrollleft()) && (e(".mcsb_" + s.idx + "_scrollbar")
.css("visibility", "visible"), m.scrolltop(0)
.scrollleft(0)), "_resety" !== o || s.contentreset.y || (i("onoverflowynone") && c.callbacks.onoverflowynone.call(t[0]), s.contentreset.y = 1), "_resetx" !== o || s.contentreset.x || (i("onoverflowxnone") && c.callbacks.onoverflowxnone.call(t[0]), s.contentreset.x = 1), "_resety" !== o && "_resetx" !== o) {
switch (!s.contentreset.y && t[0].mcs || !s.overflowed[0] || (i("onoverflowy") && c.callbacks.onoverflowy.call(t[0]), s.contentreset.x = null), !s.contentreset.x && t[0].mcs || !s.overflowed[1] || (i("onoverflowx") && c.callbacks.onoverflowx.call(t[0]), s.contentreset.x = null), c.snapamount && (o = n(o, c.snapamount, c.snapoffset)), n.dir) {
case "x":
var v = e("#mcsb_" + s.idx + "_dragger_horizontal"),
x = "left",
_ = h[0].offsetleft,
w = [f.width() - h.outerwidth(!1), v.parent()
.width() - v.width()
],
s = [o, 0 === o ? 0 : o / s.scrollratio.x],
b = p[1],
c = g[1],
b = b > 0 ? b / s.scrollratio.x : 0,
t = c > 0 ? c / s.scrollratio.x : 0;
break;
case "y":
var v = e("#mcsb_" + s.idx + "_dragger_vertical"),
x = "top",
_ = h[0].offsettop,
w = [f.height() - h.outerheight(!1), v.parent()
.height() - v.height()
],
s = [o, 0 === o ? 0 : o / s.scrollratio.y],
b = p[0],
c = g[0],
b = b > 0 ? b / s.scrollratio.y : 0,
t = c > 0 ? c / s.scrollratio.y : 0
}
s[1] < 0 || 0 === s[0] && 0 === s[1] ? s = [0, 0] : s[1] >= w[1] ? s = [w[0], w[1]] : s[0] = -s[0], t[0].mcs || (l(), i("oninit") && c.callbacks.oninit.call(t[0])), cleartimeout(h[0].oncompletetimeout), (s.tweenrunning || !(0 === _ && s[0] >= 0 || _ === w[0] && s[0] <= w[0])) && (g(v[0], x, math.round(s[1]), u[1], n.scrolleasing), g(h[0], x, math.round(s[0]), u[0], n.scrolleasing, n.overwrite, {
onstart: function() {
n.callbacks && n.onstart && !s.tweenrunning && (i("onscrollstart") && (l(), c.callbacks.onscrollstart.call(t[0])), s.tweenrunning = !0, y(v), s.cboffsets = r())
},
onupdate: function() {
n.callbacks && n.onupdate && i("whilescrolling") && (l(), c.callbacks.whilescrolling.call(t[0]))
},
oncomplete: function() {
if (n.callbacks && n.oncomplete) {
"yx" === c.axis && cleartimeout(h[0].oncompletetimeout);
var e = h[0].idletimer || 0;
h[0].oncompletetimeout = settimeout(function() {
i("onscroll") && (l(), c.callbacks.onscroll.call(t[0])), i("ontotalscroll") && s[1] >= w[1] - b && s.cboffsets[0] && (l(), c.callbacks.ontotalscroll.call(t[0])), i("ontotalscrollback") && s[1] <= t && s.cboffsets[1] && (l(), c.callbacks.ontotalscrollback.call(t[0])), s.tweenrunning = !1, h[0].idletimer = 0, y(v, "hide")
}, e)
}
}
}))
}
},
g = function(e, t, o, a, n, i, r) {
function l() {
s.stop || (x || m.call(), x = j() - v, s(), x >= s.time && (s.time = x > s.time ? x + f - (x - s.time) : x + f - 1, s.time < x + 1 && (s.time = x + 1)), s.time < a ? s.id = h(l) : g.call())
}
function s() {
a > 0 ? (s.currval = u(s.time, _, b, a, n), w[t] = math.round(s.currval) + "px") : w[t] = o + "px", p.call()
}
function c() {
f = 1e3 / 60, s.time = x + f, h = window.requestanimationframe ? window.requestanimationframe : function(e) {
return s(), settimeout(e, .01)
}, s.id = h(l)
}
function d() {
null != s.id && (window.requestanimationframe ? window.cancelanimationframe(s.id) : cleartimeout(s.id), s.id = null)
}
function u(e, t, o, a, n) {
switch (n) {
case "linear":
case "mcslinear":
return o * e / a + t;
case "mcslinearout":
return e /= a, e--, o * math.sqrt(1 - e * e) + t;
case "easeinoutsmooth":
return e /= a / 2, 1 > e ? o / 2 * e * e + t : (e--, -o / 2 * (e * (e - 2) - 1) + t);
case "easeinoutstrong":
return e /= a / 2, 1 > e ? o / 2 * math.pow(2, 10 * (e - 1)) + t : (e--, o / 2 * (-math.pow(2, -10 * e) + 2) + t);
case "easeinout":
case "mcseaseinout":
return e /= a / 2, 1 > e ? o / 2 * e * e * e + t : (e -= 2, o / 2 * (e * e * e + 2) + t);
case "easeoutsmooth":
return e /= a, e--, -o * (e * e * e * e - 1) + t;
case "easeoutstrong":
return o * (-math.pow(2, -10 * e / a) + 1) + t;
case "easeout":
case "mcseaseout":
default:
var i = (e /= a) * e,
r = i * e;
return t + o * (.499999999999997 * r * i + -2.5 * i * i + 5.5 * r + -6.5 * i + 4 * e)
}
}
e._mtween || (e._mtween = {
top: {},
left: {}
});
var f, h, r = r || {},
m = r.onstart || function() {},
p = r.onupdate || function() {},
g = r.oncomplete || function() {},
v = j(),
x = 0,
_ = e.offsettop,
w = e.style,
s = e._mtween[t];
"left" === t && (_ = e.offsetleft);
var b = o - _;
s.stop = 0, "none" !== i && d(), c()
},
j = function() {
return window.performance && window.performance.now ? window.performance.now() : window.performance && window.performance.webkitnow ? window.performance.webkitnow() : date.now ? date.now() : (new date)
.gettime()
},
k = function() {
var e = this;
e._mtween || (e._mtween = {
top: {},
left: {}
});
for (var t = ["top", "left"], o = 0; o < t.length; o++) {
var a = t[o];
e._mtween[a].id && (window.requestanimationframe ? window.cancelanimationframe(e._mtween[a].id) : cleartimeout(e._mtween[a].id), e._mtween[a].id = null, e._mtween[a].stop = 1)
}
},
z = function(e, t) {
try {
delete e[t]
} catch (o) {
e[t] = null
}
},
$ = function(e) {
return !(e.which && 1 !== e.which)
},
ee = function(e) {
var t = e.originalevent.pointertype;
return !(t && "touch" !== t && 2 !== t)
},
te = function(e) {
return !isnan(parsefloat(e)) && isfinite(e)
},
oe = function(e) {
var t = e.parents(".mcsb_container");
return [e.offset()
.top - t.offset()
.top, e.offset()
.left - t.offset()
.left
]
};
e.fn[o] = function(t) {
return u[t] ? u[t].apply(this, array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("method " + t + " does not exist") : u.init.apply(this, arguments)
}, e[o] = function(t) {
return u[t] ? u[t].apply(this, array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("method " + t + " does not exist") : u.init.apply(this, arguments)
}, e[o].defaults = i, window[o] = !0,
e(window).on('load',function() {
e(n)[o](), e.extend(e.expr[":"], {
mcsinview: e.expr[":"].mcsinview || function(t) {
var o, a, n = e(t),
i = n.parents(".mcsb_container");
if (i.length) return o = i.parent(), a = [i[0].offsettop, i[0].offsetleft], a[0] + oe(n)[0] >= 0 && a[0] + oe(n)[0] < o.height() - n.outerheight(!1) && a[1] + oe(n)[1] >= 0 && a[1] + oe(n)[1] < o.width() - n.outerwidth(!1)
},
mcsoverflow: e.expr[":"].mcsoverflow || function(t) {
var o = e(t)
.data(a);
if (o) return o.overflowed[0] || o.overflowed[1]
}
})
})
})
});