!function(e) { "use strict"; var t = "1.0.0" , s = "jxmark" , i = e , n = i.jx , a = {}; if (!("undefined" == typeof n || n.mark && n.mark === s)) throw new error('"jx" name is defined in other javascript code !!!'); n && (a = n.packages), n = function(e) { var t = this , s = function(e, t) { return e && e.hasownproperty && e instanceof t }; return e ? s(t, n) ? t._init() : t = new n : t = n.root, t } , n.prototype = { version: t, _init: function() { this.constructor = n }, namespace: function(e) { if (!e) return i; e = string(e); var t, s, n = e.split("."), a = i; for (t = 0; t < n.length; t += 1) s = n[t], a[s] = a[s] || {}, a = a[n[t]]; return a }, "package": function() { var e, t = arguments[0], s = arguments[arguments.length - 1], a = i; if ("function" != typeof s) throw new error("function required"); "string" == typeof t ? (a = this.namespace(t), n.packages[t] || (n.packages[t] = { isloaded: !0, returnvalue: e }), a.packagename = t) : "object" == typeof t && (a = t), e = s.call(a, this), "string" == typeof t && (n.packages[t].returnvalue = e) }, checkpackage: function(e) { return n.packages[e] }, starttime: +new date, tostring: function() { return "jet version " + this.version + " !" } }, n.packages = a, n.root = new n((!0)), n.mark = s, i.jx = n }(this), jx()["package"](function(e) { "use strict"; var t, s, i, n, a, o, r, l, h, c, d, u, p, m; t = function(e) { return "undefined" == typeof e } , s = function(e) { return null === e } , i = function(e) { return (0 === e || e) && e.constructor === number } , a = function(e) { return (e === !1 || e) && e.constructor === boolean } , n = function(e) { return ("" === e || e) && e.constructor === string } , o = function(e) { return e && (e.constructor === object || "[object object]" === object.prototype.tostring.call(e)) } , r = function(e) { return e && (e.constructor === array || "[object array]" === object.prototype.tostring.call(e)) } , l = function(e) { return !!(e && e.callee && i(e.length)) } , h = function(e) { return e && e.constructor === function } , c = function(e) { return t(e) ? "undefined" : s(e) ? "null" : i(e) ? "number" : a(e) ? "boolean" : n(e) ? "string" : o(e) ? "object" : r(e) ? "array" : l(e) ? "arguments" : h(e) ? "function" : "other" } , u = function(e, t) { return math.floor(math.random() * (t - e + 1) + e) } , p = function(e, t, s) { var i, n, e, a, l = arguments; for (1 === l.length ? (e = this, i = 0) : (e = l[0] || {}, i = 1); i < arguments.length; i++) { a = arguments[i]; for (n in a) { var c = e[n] , d = a[n]; c !== d && (!d || !o(d) || r(d) || d.nodetype || h(d) ? void 0 !== d && (e[n] = d) : (c = e[n] || {}, e[n] = p(c, d || (null != d.length ? [] : {})))) } } return e } , d = function() {} , m = function() { var t = arguments.length , s = arguments[t - 1]; if (s.init = s.init || function() {} , 2 === t) { var i = arguments[0].extend , n = function() {}; n.prototype = i.prototype; var a = function() { this.init.apply(this, arguments) }; return a.superclass = i.prototype, a.callsuper = function(e, t) { var s = array.prototype.slice , i = s.call(arguments, 2) , n = a.superclass[t]; n && n.apply(e, i.concat(s.call(arguments))) } , a.prototype = new n, a.prototype.constructor = a, e.extend(a.prototype, s), a.prototype.init = function() { s.init.apply(this, arguments) } , a } if (1 === t) { var o = function() { return this.init.apply(this, arguments) }; return o.prototype = s, o } } , e.isundefined = t, e.isnull = s, e.isnumber = i, e.isstring = n, e.isboolean = a, e.isobject = o, e.isarray = r, e.isarguments = l, e.isfunction = h, e.$typeof = c, e.emptyfunc = d, e.random = u, e.extend = p, e.class = m }), function() { function e() { return os.apply(null, arguments) } function t(e) { os = e } function s(e) { return "[object array]" === object.prototype.tostring.call(e) } function i(e) { return e instanceof date || "[object date]" === object.prototype.tostring.call(e) } function n(e, t) { var s, i = []; for (s = 0; s < e.length; ++s) i.push(t(e[s], s)); return i } function a(e, t) { return object.prototype.hasownproperty.call(e, t) } function o(e, t) { for (var s in t) a(t, s) && (e[s] = t[s]); return a(t, "tostring") && (e.tostring = t.tostring), a(t, "valueof") && (e.valueof = t.valueof), e } function r(e, t, s, i) { return ne(e, t, s, i, !0).utc() } function l() { return { empty: !1, unusedtokens: [], unusedinput: [], overflow: -2, charsleftover: 0, nullinput: !1, invalidmonth: null, invalidformat: !1, userinvalidated: !1, iso: !1 } } function h(e) { return null == e._pf && (e._pf = l()), e._pf } function c(e) { if (null == e._isvalid) { var t = h(e); e._isvalid = !(isnan(e._d.gettime()) || !(t.overflow < 0) || t.empty || t.invalidmonth || t.invalidweekday || t.nullinput || t.invalidformat || t.userinvalidated), e._strict && (e._isvalid = e._isvalid && 0 === t.charsleftover && 0 === t.unusedtokens.length && void 0 === t.bighour) } return e._isvalid } function d(e) { var t = r(nan); return null != e ? o(h(t), e) : h(t).userinvalidated = !0, t } function u(e, t) { var s, i, n; if ("undefined" != typeof t._isamomentobject && (e._isamomentobject = t._isamomentobject), "undefined" != typeof t._i && (e._i = t._i), "undefined" != typeof t._f && (e._f = t._f), "undefined" != typeof t._l && (e._l = t._l), "undefined" != typeof t._strict && (e._strict = t._strict), "undefined" != typeof t._tzm && (e._tzm = t._tzm), "undefined" != typeof t._isutc && (e._isutc = t._isutc), "undefined" != typeof t._offset && (e._offset = t._offset), "undefined" != typeof t._pf && (e._pf = h(t)), "undefined" != typeof t._locale && (e._locale = t._locale), as.length > 0) for (s in as) i = as[s], n = t[i], "undefined" != typeof n && (e[i] = n); return e } function p(t) { u(this, t), this._d = new date(null != t._d ? t._d.gettime() : nan), ls === !1 && (ls = !0, e.updateoffset(this), ls = !1) } function m(e) { return e instanceof p || null != e && null != e._isamomentobject } function f(e) { return e < 0 ? math.ceil(e) : math.floor(e) } function g(e) { var t = +e , s = 0; return 0 !== t && isfinite(t) && (s = f(t)), s } function v(e, t, s) { var i, n = math.min(e.length, t.length), a = math.abs(e.length - t.length), o = 0; for (i = 0; i < n; i++) (s && e[i] !== t[i] || !s && g(e[i]) !== g(t[i])) && o++; return o + a } function b() {} function y(e) { return e ? e.tolowercase().replace("_", "-") : e } function k(e) { for (var t, s, i, n, a = 0; a < e.length; ) { for (n = y(e[a]).split("-"), t = n.length, s = y(e[a + 1]), s = s ? s.split("-") : null; t > 0; ) { if (i = w(n.slice(0, t).join("-"))) return i; if (s && s.length >= t && v(n, s, !0) >= t - 1) break; t-- } a++ } return null } function w(e) { var t = null; if (!ys[e] && "undefined" != typeof module && module && module.exports) try { t = es._abbr, require("./locale/" + e), x(t) } catch (s) {} return ys[e] } function x(e, t) { var s; return e && (s = "undefined" == typeof t ? _(e) : c(e, t), s && (es = s)), es._abbr } function c(e, t) { return null !== t ? (t.abbr = e, ys[e] = ys[e] || new b, ys[e].set(t), x(e), ys[e]) : (delete ys[e], null) } function _(e) { var t; if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return es; if (!s(e)) { if (t = w(e)) return t; e = [e] } return k(e) } function d(e, t) { var s = e.tolowercase(); hs[s] = hs[s + "s"] = hs[t] = e } function s(e) { return "string" == typeof e ? hs[e] || hs[e.tolowercase()] : void 0 } function i(e) { var t, s, i = {}; for (s in e) a(e, s) && (t = s(s), t && (i[t] = e[s])); return i } function n(t, s) { return function(i) { return null != i ? ($(this, t, i), e.updateoffset(this, s), this) : m(this, t) } } function m(e, t) { return e._d["get" + (e._isutc ? "utc" : "") + t]() } function $(e, t, s) { return e._d["set" + (e._isutc ? "utc" : "") + t](s) } function t(e, t) { var s; if ("object" == typeof e) for (s in e) this.set(s, e[s]); else if (e = s(e), "function" == typeof this[e]) return this[e](t); return this } function p(e, t, s) { var i = "" + math.abs(e) , n = t - i.length , a = e >= 0; return (a ? s ? "+" : "" : "-") + math.pow(10, math.max(0, n)).tostring().substr(1) + i } function o(e, t, s, i) { var n = i; "string" == typeof i && (n = function() { return this[i]() } ), e && (bs[e] = n), t && (bs[t[0]] = function() { return p(n.apply(this, arguments), t[1], t[2]) } ), s && (bs[s] = function() { return this.localedata().ordinal(n.apply(this, arguments), e) } ) } function e(e) { return e.match(/\[[\s\s]/) ? e.replace(/^\[|\]$/g, "") : e.replace(/\\/g, "") } function a(e) { var t, s, i = e.match(vs); for (t = 0, s = i.length; t < s; t++) bs[i[t]] ? i[t] = bs[i[t]] : i[t] = e(i[t]); return function(n) { var a = ""; for (t = 0; t < s; t++) a += i[t]instanceof function ? i[t].call(n, e) : i[t]; return a } } function l(e, t) { return e.isvalid() ? (t = y(t, e.localedata()), us[t] = us[t] || a(t), us[t](e)) : e.localedata().invaliddate() } function y(e, t) { function s(e) { return t.longdateformat(e) || e } var i = 5; for (rs.lastindex = 0; i >= 0 && rs.test(e); ) e = e.replace(rs, s), rs.lastindex = 0, i -= 1; return e } function h(e) { return "function" == typeof e && "[object function]" === object.prototype.tostring.call(e) } function v(e, t, s) { ii[e] = h(t) ? t : function(e) { return e && s ? s : t } } function r(e, t) { return a(ii, e) ? ii[e](t._strict, t._locale) : new regexp(u(e)) } function u(e) { return e.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(e, t, s, i, n) { return t || s || i || n }).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") } function b(e, t) { var s, i = t; for ("string" == typeof e && (e = [e]), "number" == typeof t && (i = function(e, s) { s[t] = g(e) } ), s = 0; s < e.length; s++) ni[e[s]] = i } function j(e, t) { b(e, function(e, s, i, n) { i._w = i._w || {}, t(e, i._w, i, n) }) } function f(e, t, s) { null != t && a(ni, e) && ni[e](t, s._a, s, e) } function w(e, t) { return new date(date.utc(e, t + 1, 0)).getutcdate() } function z(e) { return this._months[e.month()] } function g(e) { return this._monthsshort[e.month()] } function j(e, t, s) { var i, n, a; for (this._monthsparse || (this._monthsparse = [], this._longmonthsparse = [], this._shortmonthsparse = []), i = 0; i < 12; i++) { if (n = r([2e3, i]), s && !this._longmonthsparse[i] && (this._longmonthsparse[i] = new regexp("^" + this.months(n, "").replace(".", "") + "$","i"), this._shortmonthsparse[i] = new regexp("^" + this.monthsshort(n, "").replace(".", "") + "$","i")), s || this._monthsparse[i] || (a = "^" + this.months(n, "") + "|^" + this.monthsshort(n, ""), this._monthsparse[i] = new regexp(a.replace(".", ""),"i")), s && "mmmm" === t && this._longmonthsparse[i].test(e)) return i; if (s && "mmm" === t && this._shortmonthsparse[i].test(e)) return i; if (!s && this._monthsparse[i].test(e)) return i } } function q(e, t) { var s; return "string" == typeof t && (t = e.localedata().monthsparse(t), "number" != typeof t) ? e : (s = math.min(e.date(), w(e.year(), t)), e._d["set" + (e._isutc ? "utc" : "") + "month"](t, s), e) } function q(t) { return null != t ? (q(this, t), e.updateoffset(this, !0), this) : m(this, "month") } function k() { return w(this.year(), this.month()) } function x(e) { var t, s = e._a; return s && h(e).overflow === -2 && (t = s[oi] < 0 || s[oi] > 11 ? oi : s[ri] < 1 || s[ri] > w(s[ai], s[oi]) ? ri : s[li] < 0 || s[li] > 24 || 24 === s[li] && (0 !== s[hi] || 0 !== s[ci] || 0 !== s[di]) ? li : s[hi] < 0 || s[hi] > 59 ? hi : s[ci] < 0 || s[ci] > 59 ? ci : s[di] < 0 || s[di] > 999 ? di : -1, h(e)._overflowdayofyear && (t < ai || t > ri) && (t = ri), h(e).overflow = t), e } function z(t) { e.suppressdeprecationwarnings === !1 && "undefined" != typeof console && console.warn && console.warn("deprecation warning: " + t) } function ee(e, t) { var s = !0; return o(function() { return s && (z(e + "\n" + (new error).stack), s = !1), t.apply(this, arguments) }, t) } function te(e, t) { mi[e] || (z(t), mi[e] = !0) } function se(e) { var t, s, i = e._i, n = fi.exec(i); if (n) { for (h(e).iso = !0, t = 0, s = gi.length; t < s; t++) if (gi[t][1].exec(i)) { e._f = gi[t][0]; break } for (t = 0, s = vi.length; t < s; t++) if (vi[t][1].exec(i)) { e._f += (n[6] || " ") + vi[t][0]; break } i.match(ei) && (e._f += "z"), we(e) } else e._isvalid = !1 } function ie(t) { var s = bi.exec(t._i); return null !== s ? void (t._d = new date((+s[1]))) : (se(t), void (t._isvalid === !1 && (delete t._isvalid, e.createfrominputfallback(t)))) } function ne(e, t, s, i, n, a, o) { var r = new date(e,t,s,i,n,a,o); return e < 1970 && r.setfullyear(e), r } function ae(e) { var t = new date(date.utc.apply(null, arguments)); return e < 1970 && t.setutcfullyear(e), t } function oe(e) { return re(e) ? 366 : 365 } function re(e) { return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0 } function le() { return re(this.year()) } function he(e, t, s) { var i, n = s - t, a = s - e.day(); return a > n && (a -= 7), a < n - 7 && (a += 7), i = me(e).add(a, "d"), { week: math.ceil(i.dayofyear() / 7), year: i.year() } } function ce(e) { return he(e, this._week.dow, this._week.doy).week } function de() { return this._week.dow } function ue() { return this._week.doy } function pe(e) { var t = this.localedata().week(this); return null == e ? t : this.add(7 * (e - t), "d") } function me(e) { var t = he(this, 1, 4).week; return null == e ? t : this.add(7 * (e - t), "d") } function fe(e, t, s, i, n) { var a, o = 6 + n - i, r = ae(e, 0, 1 + o), l = r.getutcday(); return l < n && (l += 7), s = null != s ? 1 * s : n, a = 1 + o + 7 * (t - 1) - l + s, { year: a > 0 ? e : e - 1, dayofyear: a > 0 ? a : oe(e - 1) + a } } function ge(e) { var t = math.round((this.clone().startof("day") - this.clone().startof("year")) / 864e5) + 1; return null == e ? t : this.add(e - t, "d") } function ve(e, t, s) { return null != e ? e : null != t ? t : s } function be(e) { var t = new date; return e._useutc ? [t.getutcfullyear(), t.getutcmonth(), t.getutcdate()] : [t.getfullyear(), t.getmonth(), t.getdate()] } function ye(e) { var t, s, i, n, a = []; if (!e._d) { for (i = be(e), e._w && null == e._a[ri] && null == e._a[oi] && ke(e), e._dayofyear && (n = ve(e._a[ai], i[ai]), e._dayofyear > oe(n) && (h(e)._overflowdayofyear = !0), s = ae(n, 0, e._dayofyear), e._a[oi] = s.getutcmonth(), e._a[ri] = s.getutcdate()), t = 0; t < 3 && null == e._a[t]; ++t) e._a[t] = a[t] = i[t]; for (; t < 7; t++) e._a[t] = a[t] = null == e._a[t] ? 2 === t ? 1 : 0 : e._a[t]; 24 === e._a[li] && 0 === e._a[hi] && 0 === e._a[ci] && 0 === e._a[di] && (e._nextday = !0, e._a[li] = 0), e._d = (e._useutc ? ae : ne).apply(null, a), null != e._tzm && e._d.setutcminutes(e._d.getutcminutes() - e._tzm), e._nextday && (e._a[li] = 24) } } function ke(e) { var t, s, i, n, a, o, r; t = e._w, null != t.gg || null != t.w || null != t.e ? (a = 1, o = 4, s = ve(t.gg, e._a[ai], he(me(), 1, 4).year), i = ve(t.w, 1), n = ve(t.e, 1)) : (a = e._locale._week.dow, o = e._locale._week.doy, s = ve(t.gg, e._a[ai], he(me(), a, o).year), i = ve(t.w, 1), null != t.d ? (n = t.d, n < a && ++i) : n = null != t.e ? t.e + a : a), r = fe(s, i, n, o, a), e._a[ai] = r.year, e._dayofyear = r.dayofyear } function we(t) { if (t._f === e.iso_8601) return void se(t); t._a = [], h(t).empty = !0; var s, i, n, a, o, r = "" + t._i, l = r.length, c = 0; for (n = y(t._f, t._locale).match(vs) || [], s = 0; s < n.length; s++) a = n[s], i = (r.match(r(a, t)) || [])[0], i && (o = r.substr(0, r.indexof(i)), o.length > 0 && h(t).unusedinput.push(o), r = r.slice(r.indexof(i) + i.length), c += i.length), bs[a] ? (i ? h(t).empty = !1 : h(t).unusedtokens.push(a), f(a, i, t)) : t._strict && !i && h(t).unusedtokens.push(a); h(t).charsleftover = l - c, r.length > 0 && h(t).unusedinput.push(r), h(t).bighour === !0 && t._a[li] <= 12 && t._a[li] > 0 && (h(t).bighour = void 0), t._a[li] = xe(t._locale, t._a[li], t._meridiem), ye(t), x(t) } function xe(e, t, s) { var i; return null == s ? t : null != e.meridiemhour ? e.meridiemhour(t, s) : null != e.ispm ? (i = e.ispm(s), i && t < 12 && (t += 12), i || 12 !== t || (t = 0), t) : t } function ce(e) { var t, s, i, n, a; if (0 === e._f.length) return h(e).invalidformat = !0, void (e._d = new date(nan)); for (n = 0; n < e._f.length; n++) a = 0, t = u({}, e), null != e._useutc && (t._useutc = e._useutc), t._f = e._f[n], we(t), c(t) && (a += h(t).charsleftover, a += 10 * h(t).unusedtokens.length, h(t).score = a, (null == i || a < i) && (i = a, s = t)); o(e, s || t) } function _e(e) { if (!e._d) { var t = i(e._i); e._a = [t.year, t.month, t.day || t.date, t.hour, t.minute, t.second, t.millisecond], ye(e) } } function de(e) { var t = new p(x(se(e))); return t._nextday && (t.add(1, "d"), t._nextday = void 0), t } function se(e) { var t = e._i , n = e._f; return e._locale = e._locale || _(e._l), null === t || void 0 === n && "" === t ? d({ nullinput: !0 }) : ("string" == typeof t && (e._i = t = e._locale.preparse(t)), m(t) ? new p(x(t)) : (s(n) ? ce(e) : n ? we(e) : i(t) ? e._d = t : ie(e), e)) } function ie(t) { var a = t._i; void 0 === a ? t._d = new date : i(a) ? t._d = new date((+a)) : "string" == typeof a ? ie(t) : s(a) ? (t._a = n(a.slice(0), function(e) { return parseint(e, 10) }), ye(t)) : "object" == typeof a ? _e(t) : "number" == typeof a ? t._d = new date(a) : e.createfrominputfallback(t) } function ne(e, t, s, i, n) { var a = {}; return "boolean" == typeof s && (i = s, s = void 0), a._isamomentobject = !0, a._useutc = a._isutc = n, a._l = s, a._i = e, a._f = t, a._strict = i, de(a) } function me(e, t, s, i) { return ne(e, t, s, i, !1) } function $e(e, t) { var i, n; if (1 === t.length && s(t[0]) && (t = t[0]), !t.length) return me(); for (i = t[0], n = 1; n < t.length; ++n) t[n].isvalid() && !t[n][e](i) || (i = t[n]); return i } function te() { var e = [].slice.call(arguments, 0); return $e("isbefore", e) } function pe() { var e = [].slice.call(arguments, 0); return $e("isafter", e) } function oe(e) { var t = i(e) , s = t.year || 0 , i = t.quarter || 0 , n = t.month || 0 , a = t.week || 0 , o = t.day || 0 , r = t.hour || 0 , l = t.minute || 0 , h = t.second || 0 , c = t.millisecond || 0; this._milliseconds = +c + 1e3 * h + 6e4 * l + 36e5 * r, this._days = +o + 7 * a, this._months = +n + 3 * i + 12 * s, this._data = {}, this._locale = _(), this._bubble() } function ee(e) { return e instanceof oe } function ae(e, t) { o(e, 0, 0, function() { var e = this.utcoffset() , s = "+"; return e < 0 && (e = -e, s = "-"), s + p(~~(e / 60), 2) + t + p(~~e % 60, 2) }) } function le(e) { var t = (e || "").match(ei) || [] , s = t[t.length - 1] || [] , i = (s + "").match(ci) || ["-", 0, 0] , n = +(60 * i[1]) + g(i[2]); return "+" === i[0] ? n : -n } function ye(t, s) { var n, a; return s._isutc ? (n = s.clone(), a = (m(t) || i(t) ? +t : +me(t)) - +n, n._d.settime(+n._d + a), e.updateoffset(n, !1), n) : me(t).local() } function he(e) { return 15 * -math.round(e._d.gettimezoneoffset() / 15) } function ve(t, s) { var i, n = this._offset || 0; return null != t ? ("string" == typeof t && (t = le(t)), math.abs(t) < 16 && (t = 60 * t), !this._isutc && s && (i = he(this)), this._offset = t, this._isutc = !0, null != i && this.add(i, "m"), n !== t && (!s || this._changeinprogress ? tt(this, qe(t - n, "m"), 1, !1) : this._changeinprogress || (this._changeinprogress = !0, e.updateoffset(this, !0), this._changeinprogress = null)), this) : this._isutc ? n : he(this) } function re(e, t) { return null != e ? ("string" != typeof e && (e = -e), this.utcoffset(e, t), this) : -this.utcoffset() } function ue(e) { return this.utcoffset(0, e) } function be(e) { return this._isutc && (this.utcoffset(0, e), this._isutc = !1, e && this.subtract(he(this), "m")), this } function je() { return this._tzm ? this.utcoffset(this._tzm) : "string" == typeof this._i && this.utcoffset(le(this._i)), this } function fe(e) { return e = e ? me(e).utcoffset() : 0, (this.utcoffset() - e) % 60 === 0 } function we() { return this.utcoffset() > this.clone().month(0).utcoffset() || this.utcoffset() > this.clone().month(5).utcoffset() } function ze() { if ("undefined" != typeof this._isdstshifted) return this._isdstshifted; var e = {}; if (u(e, this), e = se(e), e._a) { var t = e._isutc ? r(e._a) : me(e._a); this._isdstshifted = this.isvalid() && v(e._a, t.toarray()) > 0 } else this._isdstshifted = !1; return this._isdstshifted } function ge() { return !this._isutc } function je() { return this._isutc } function qe() { return this._isutc && 0 === this._offset } function qe(e, t) { var s, i, n, o = e, r = null; return ee(e) ? o = { ms: e._milliseconds, d: e._days, m: e._months } : "number" == typeof e ? (o = {}, t ? o[t] = e : o.milliseconds = e) : (r = _i.exec(e)) ? (s = "-" === r[1] ? -1 : 1, o = { y: 0, d: g(r[ri]) * s, h: g(r[li]) * s, m: g(r[hi]) * s, s: g(r[ci]) * s, ms: g(r[di]) * s }) : (r = di.exec(e)) ? (s = "-" === r[1] ? -1 : 1, o = { y: ke(r[2], s), m: ke(r[3], s), d: ke(r[4], s), h: ke(r[5], s), m: ke(r[6], s), s: ke(r[7], s), w: ke(r[8], s) }) : null == o ? o = {} : "object" == typeof o && ("from"in o || "to"in o) && (n = ze(me(o.from), me(o.to)), o = {}, o.ms = n.milliseconds, o.m = n.months), i = new oe(o), ee(e) && a(e, "_locale") && (i._locale = e._locale), i } function ke(e, t) { var s = e && parsefloat(e.replace(",", ".")); return (isnan(s) ? 0 : s) * t } function xe(e, t) { var s = { milliseconds: 0, months: 0 }; return s.months = t.month() - e.month() + 12 * (t.year() - e.year()), e.clone().add(s.months, "m").isafter(t) && --s.months, s.milliseconds = +t - +e.clone().add(s.months, "m"), s } function ze(e, t) { var s; return t = ye(t, e), e.isbefore(t) ? s = xe(e, t) : (s = xe(t, e), s.milliseconds = -s.milliseconds, s.months = -s.months), s } function et(e, t) { return function(s, i) { var n, a; return null === i || isnan(+i) || (te(t, "moment()." + t + "(period, number) is deprecated. please use moment()." + t + "(number, period)."), a = s, s = i, i = a), s = "string" == typeof s ? +s : s, n = qe(s, i), tt(this, n, e), this } } function tt(t, s, i, n) { var a = s._milliseconds , o = s._days , r = s._months; n = null == n || n, a && t._d.settime(+t._d + a * i), o && $(t, "date", m(t, "date") + o * i), r && q(t, m(t, "month") + r * i), n && e.updateoffset(t, o || r) } function st(e, t) { var s = e || me() , i = ye(s, this).startof("day") , n = this.diff(i, "days", !0) , a = n < -6 ? "sameelse" : n < -1 ? "lastweek" : n < 0 ? "lastday" : n < 1 ? "sameday" : n < 2 ? "nextday" : n < 7 ? "nextweek" : "sameelse"; return this.format(t && t[a] || this.localedata().calendar(a, this, me(s))) } function it() { return new p(this) } function nt(e, t) { var s; return t = s("undefined" != typeof t ? t : "millisecond"), "millisecond" === t ? (e = m(e) ? e : me(e), +this > +e) : (s = m(e) ? +e : +me(e), s < +this.clone().startof(t)) } function at(e, t) { var s; return t = s("undefined" != typeof t ? t : "millisecond"), "millisecond" === t ? (e = m(e) ? e : me(e), +this < +e) : (s = m(e) ? +e : +me(e), +this.clone().endof(t) < s) } function ot(e, t, s) { return this.isafter(e, s) && this.isbefore(t, s) } function rt(e, t) { var s; return t = s(t || "millisecond"), "millisecond" === t ? (e = m(e) ? e : me(e), +this === +e) : (s = +me(e), +this.clone().startof(t) <= s && s <= +this.clone().endof(t)) } function lt(e, t, s) { var i, n, a = ye(e, this), o = 6e4 * (a.utcoffset() - this.utcoffset()); return t = s(t), "year" === t || "month" === t || "quarter" === t ? (n = ht(this, a), "quarter" === t ? n /= 3 : "year" === t && (n /= 12)) : (i = this - a, n = "second" === t ? i / 1e3 : "minute" === t ? i / 6e4 : "hour" === t ? i / 36e5 : "day" === t ? (i - o) / 864e5 : "week" === t ? (i - o) / 6048e5 : i), s ? n : f(n) } function ht(e, t) { var s, i, n = 12 * (t.year() - e.year()) + (t.month() - e.month()), a = e.clone().add(n, "months"); return t - a < 0 ? (s = e.clone().add(n - 1, "months"), i = (t - a) / (a - s)) : (s = e.clone().add(n + 1, "months"), i = (t - a) / (s - a)), -(n + i) } function ct() { return this.clone().locale("en").format("ddd mmm dd yyyy hh:mm:ss [gmt]zz") } function dt() { var e = this.clone().utc(); return 0 < e.year() && e.year() <= 9999 ? "function" == typeof date.prototype.toisostring ? this.todate().toisostring() : l(e, "yyyy-mm-dd[t]hh:mm:ss.sss[z]") : l(e, "yyyyyy-mm-dd[t]hh:mm:ss.sss[z]") } function ut(t) { var s = l(this, t || e.defaultformat); return this.localedata().postformat(s) } function pt(e, t) { return this.isvalid() ? qe({ to: this, from: e }).locale(this.locale()).humanize(!t) : this.localedata().invaliddate() } function mt(e) { return this.from(me(), e) } function ft(e, t) { return this.isvalid() ? qe({ from: this, to: e }).locale(this.locale()).humanize(!t) : this.localedata().invaliddate() } function gt(e) { return this.to(me(), e) } function vt(e) { var t; return void 0 === e ? this._locale._abbr : (t = _(e), null != t && (this._locale = t), this) } function bt() { return this._locale } function yt(e) { switch (e = s(e)) { case "year": this.month(0); case "quarter": case "month": this.date(1); case "week": case "isoweek": case "day": this.hours(0); case "hour": this.minutes(0); case "minute": this.seconds(0); case "second": this.milliseconds(0) } return "week" === e && this.weekday(0), "isoweek" === e && this.isoweekday(1), "quarter" === e && this.month(3 * math.floor(this.month() / 3)), this } function kt(e) { return e = s(e), void 0 === e || "millisecond" === e ? this : this.startof(e).add(1, "isoweek" === e ? "week" : e).subtract(1, "ms") } function wt() { return +this._d - 6e4 * (this._offset || 0) } function xt() { return math.floor(+this / 1e3) } function ct() { return this._offset ? new date((+this)) : this._d } function _t() { var e = this; return [e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second(), e.millisecond()] } function dt() { var e = this; return { years: e.year(), months: e.month(), date: e.date(), hours: e.hours(), minutes: e.minutes(), seconds: e.seconds(), milliseconds: e.milliseconds() } } function st() { return c(this) } function it() { return o({}, h(this)) } function nt() { return h(this).overflow } function mt(e, t) { o(0, [e, e.length], 0, t) } function $t(e, t, s) { return he(me([e, 11, 31 + t - s]), t, s).week } function tt(e) { var t = he(this, this.localedata()._week.dow, this.localedata()._week.doy).year; return null == e ? t : this.add(e - t, "y") } function pt(e) { var t = he(this, 1, 4).year; return null == e ? t : this.add(e - t, "y") } function ot() { return $t(this.year(), 1, 4) } function et() { var e = this.localedata()._week; return $t(this.year(), e.dow, e.doy) } function at(e) { return null == e ? math.ceil((this.month() + 1) / 3) : this.month(3 * (e - 1) + this.month() % 3) } function lt(e, t) { return "string" != typeof e ? e : isnan(e) ? (e = t.weekdaysparse(e), "number" == typeof e ? e : null) : parseint(e, 10) } function yt(e) { return this._weekdays[e.day()] } function ht(e) { return this._weekdaysshort[e.day()] } function vt(e) { return this._weekdaysmin[e.day()] } function rt(e) { var t, s, i; for (this._weekdaysparse = this._weekdaysparse || [], t = 0; t < 7; t++) if (this._weekdaysparse[t] || (s = me([2e3, 1]).day(t), i = "^" + this.weekdays(s, "") + "|^" + this.weekdaysshort(s, "") + "|^" + this.weekdaysmin(s, ""), this._weekdaysparse[t] = new regexp(i.replace(".", ""),"i")), this._weekdaysparse[t].test(e)) return t } function ut(e) { var t = this._isutc ? this._d.getutcday() : this._d.getday(); return null != e ? (e = lt(e, this.localedata()), this.add(e - t, "d")) : t } function bt(e) { var t = (this.day() + 7 - this.localedata()._week.dow) % 7; return null == e ? t : this.add(e - t, "d") } function jt(e) { return null == e ? this.day() || 7 : this.day(this.day() % 7 ? e : e - 7) } function ft(e, t) { o(e, 0, 0, function() { return this.localedata().meridiem(this.hours(), this.minutes(), t) }) } function wt(e, t) { return t._meridiemparse } function zt(e) { return "p" === (e + "").tolowercase().charat(0) } function gt(e, t, s) { return e > 11 ? s ? "pm" : "pm" : s ? "am" : "am" } function jt(e, t) { t[di] = g(1e3 * ("0." + e)) } function qt() { return this._isutc ? "utc" : "" } function qt() { return this._isutc ? "coordinated universal time" : "" } function kt(e) { return me(1e3 * e) } function xt() { return me.apply(null, arguments).parsezone() } function zt(e, t, s) { var i = this._calendar[e]; return "function" == typeof i ? i.call(t, s) : i } function es(e) { var t = this._longdateformat[e] , s = this._longdateformat[e.touppercase()]; return t || !s ? t : (this._longdateformat[e] = s.replace(/mmmm|mm|dd|dddd/g, function(e) { return e.slice(1) }), this._longdateformat[e]) } function ts() { return this._invaliddate } function ss(e) { return this._ordinal.replace("%d", e) } function is(e) { return e } function ns(e, t, s, i) { var n = this._relativetime[s]; return "function" == typeof n ? n(e, t, s, i) : n.replace(/%d/i, e) } function as(e, t) { var s = this._relativetime[e > 0 ? "future" : "past"]; return "function" == typeof s ? s(t) : s.replace(/%s/i, t) } function os(e) { var t, s; for (s in e) t = e[s], "function" == typeof t ? this[s] = t : this["_" + s] = t; this._ordinalparselenient = new regexp(this._ordinalparse.source + "|" + /\d{1,2}/.source) } function rs(e, t, s, i) { var n = _() , a = r().set(i, t); return n[s](a, e) } function ls(e, t, s, i, n) { if ("number" == typeof e && (t = e, e = void 0), e = e || "", null != t) return rs(e, t, s, n); var a, o = []; for (a = 0; a < i; a++) o[a] = rs(e, a, s, n); return o } function hs(e, t) { return ls(e, t, "months", 12, "month") } function cs(e, t) { return ls(e, t, "monthsshort", 12, "month") } function ds(e, t) { return ls(e, t, "weekdays", 7, "day") } function us(e, t) { return ls(e, t, "weekdaysshort", 7, "day") } function ps(e, t) { return ls(e, t, "weekdaysmin", 7, "day") } function ms() { var e = this._data; return this._milliseconds = ji(this._milliseconds), this._days = ji(this._days), this._months = ji(this._months), e.milliseconds = ji(e.milliseconds), e.seconds = ji(e.seconds), e.minutes = ji(e.minutes), e.hours = ji(e.hours), e.months = ji(e.months), e.years = ji(e.years), this } function fs(e, t, s, i) { var n = qe(t, s); return e._milliseconds += i * n._milliseconds, e._days += i * n._days, e._months += i * n._months, e._bubble() } function gs(e, t) { return fs(this, e, t, 1) } function vs(e, t) { return fs(this, e, t, -1) } function bs(e) { return e < 0 ? math.floor(e) : math.ceil(e) } function ys() { var e, t, s, i, n, a = this._milliseconds, o = this._days, r = this._months, l = this._data; return a >= 0 && o >= 0 && r >= 0 || a <= 0 && o <= 0 && r <= 0 || (a += 864e5 * bs(ws(r) + o), o = 0, r = 0), l.milliseconds = a % 1e3, e = f(a / 1e3), l.seconds = e % 60, t = f(e / 60), l.minutes = t % 60, s = f(t / 60), l.hours = s % 24, o += f(s / 24), n = f(ks(o)), r += n, o -= bs(ws(n)), i = f(r / 12), r %= 12, l.days = o, l.months = r, l.years = i, this } function ks(e) { return 4800 * e / 146097 } function ws(e) { return 146097 * e / 4800 } function xs(e) { var t, s, i = this._milliseconds; if (e = s(e), "month" === e || "year" === e) return t = this._days + i / 864e5, s = this._months + ks(t), "month" === e ? s : s / 12; switch (t = this._days + math.round(ws(this._months)), e) { case "week": return t / 7 + i / 6048e5; case "day": return t + i / 864e5; case "hour": return 24 * t + i / 36e5; case "minute": return 1440 * t + i / 6e4; case "second": return 86400 * t + i / 1e3; case "millisecond": return math.floor(864e5 * t) + i; default: throw new error("unknown unit " + e) } } function cs() { return this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * g(this._months / 12) } function _s(e) { return function() { return this.as(e) } } function ds(e) { return e = s(e), this[e + "s"]() } function ss(e) { return function() { return this._data[e] } } function is() { return f(this.days() / 7) } function ns(e, t, s, i, n) { return n.relativetime(t || 1, !!s, e, i) } function ms(e, t, s) { var i = qe(e).abs() , n = dn(i.as("s")) , a = dn(i.as("m")) , o = dn(i.as("h")) , r = dn(i.as("d")) , l = dn(i.as("m")) , h = dn(i.as("y")) , c = n < un.s && ["s", n] || 1 === a && ["m"] || a < un.m && ["mm", a] || 1 === o && ["h"] || o < un.h && ["hh", o] || 1 === r && ["d"] || r < un.d && ["dd", r] || 1 === l && ["m"] || l < un.m && ["mm", l] || 1 === h && ["y"] || ["yy", h]; return c[2] = t, c[3] = +e > 0, c[4] = s, ns.apply(null, c) } function $s(e, t) { return void 0 !== un[e] && (void 0 === t ? un[e] : (un[e] = t, !0)) } function ts(e) { var t = this.localedata() , s = ms(this, !e, t); return e && (s = t.pastfuture(+this, s)), t.postformat(s) } function ps() { var e, t, s, i = pn(this._milliseconds) / 1e3, n = pn(this._days), a = pn(this._months); e = f(i / 60), t = f(e / 60), i %= 60, e %= 60, s = f(a / 12), a %= 12; var o = s , r = a , l = n , h = t , c = e , d = i , u = this.asseconds(); return u ? (u < 0 ? "-" : "") + "p" + (o ? o + "y" : "") + (r ? r + "m" : "") + (l ? l + "d" : "") + (h || c || d ? "t" : "") + (h ? h + "h" : "") + (c ? c + "m" : "") + (d ? d + "s" : "") : "p0d" } var os, es, as = e.momentproperties = [], ls = !1, ys = {}, hs = {}, vs = /(\[[^\[]*\])|(\\)?(mo|mm?m?m?|do|dddo|dd?d?d?|ddd?d?|do?|w[o|w]?|w[o|w]?|q|yyyyyy|yyyyy|yyyy|yy|gg(ggg?)?|gg(ggg?)?|e|e|a|a|hh?|hh?|mm?|ss?|s{1,9}|x|x|zz?|zz?|.)/g, rs = /(\[[^\[]*\])|(\\)?(lts|lt|ll?l?l?|l{1,4})/g, us = {}, bs = {}, js = /\d/, fs = /\d\d/, ws = /\d{3}/, zs = /\d{4}/, gs = /[+-]?\d{6}/, js = /\d\d?/, qs = /\d{1,3}/, qs = /\d{1,4}/, ks = /[+-]?\d{1,6}/, xs = /\d+/, zs = /[+-]?\d+/, ei = /z|[+-]\d\d:?\d\d/gi, ti = /[+-]?\d+(\.\d{1,3})?/, si = /[0-9]*['a-z\u00a0-\u05ff\u0700-\ud7ff\uf900-\ufdcf\ufdf0-\uffef]+|[\u0600-\u06ff\/]+(\s*?[\u0600-\u06ff]+){1,2}/i, ii = {}, ni = {}, ai = 0, oi = 1, ri = 2, li = 3, hi = 4, ci = 5, di = 6; o("m", ["mm", 2], "mo", function() { return this.month() + 1 }), o("mmm", 0, 0, function(e) { return this.localedata().monthsshort(this, e) }), o("mmmm", 0, 0, function(e) { return this.localedata().months(this, e) }), d("month", "m"), v("m", js), v("mm", js, fs), v("mmm", si), v("mmmm", si), b(["m", "mm"], function(e, t) { t[oi] = g(e) - 1 }), b(["mmm", "mmmm"], function(e, t, s, i) { var n = s._locale.monthsparse(e, i, s._strict); null != n ? t[oi] = n : h(s).invalidmonth = e }); var ui = "january_february_march_april_may_june_july_august_september_october_november_december".split("_") , pi = "jan_feb_mar_apr_may_jun_jul_aug_sep_oct_nov_dec".split("_") , mi = {}; e.suppressdeprecationwarnings = !1; var fi = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(w\d\d$)|(w\d\d-\d)|(\d\d\d))((t| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*z)?)?$/ , gi = [["yyyyyy-mm-dd", /[+-]\d{6}-\d{2}-\d{2}/], ["yyyy-mm-dd", /\d{4}-\d{2}-\d{2}/], ["gggg-[w]ww-e", /\d{4}-w\d{2}-\d/], ["gggg-[w]ww", /\d{4}-w\d{2}/], ["yyyy-ddd", /\d{4}-\d{3}/]] , vi = [["hh:mm:ss.ssss", /(t| )\d\d:\d\d:\d\d\.\d+/], ["hh:mm:ss", /(t| )\d\d:\d\d:\d\d/], ["hh:mm", /(t| )\d\d:\d\d/], ["hh", /(t| )\d\d/]] , bi = /^\/?date\((\-?\d+)/i; e.createfrominputfallback = ee("moment construction falls back to js date. this is discouraged and will be removed in upcoming major release. please refer to https://github.com/moment/moment/issues/1407 for more info.", function(e) { e._d = new date(e._i + (e._useutc ? " utc" : "")) }), o(0, ["yy", 2], 0, function() { return this.year() % 100 }), o(0, ["yyyy", 4], 0, "year"), o(0, ["yyyyy", 5], 0, "year"), o(0, ["yyyyyy", 6, !0], 0, "year"), d("year", "y"), v("y", zs), v("yy", js, fs), v("yyyy", qs, zs), v("yyyyy", ks, gs), v("yyyyyy", ks, gs), b(["yyyyy", "yyyyyy"], ai), b("yyyy", function(t, s) { s[ai] = 2 === t.length ? e.parsetwodigityear(t) : g(t) }), b("yy", function(t, s) { s[ai] = e.parsetwodigityear(t) }), e.parsetwodigityear = function(e) { return g(e) + (g(e) > 68 ? 1900 : 2e3) } ; var yi = n("fullyear", !1); o("w", ["ww", 2], "wo", "week"), o("w", ["ww", 2], "wo", "isoweek"), d("week", "w"), d("isoweek", "w"), v("w", js), v("ww", js, fs), v("w", js), v("ww", js, fs), j(["w", "ww", "w", "ww"], function(e, t, s, i) { t[i.substr(0, 1)] = g(e) }); var ki = { dow: 0, doy: 6 }; o("ddd", ["dddd", 3], "dddo", "dayofyear"), d("dayofyear", "ddd"), v("ddd", qs), v("dddd", ws), b(["ddd", "dddd"], function(e, t, s) { s._dayofyear = g(e) }), e.iso_8601 = function() {} ; var wi = ee("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function() { var e = me.apply(null, arguments); return e < this ? this : e }) , xi = ee("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function() { var e = me.apply(null, arguments); return e > this ? this : e }); ae("z", ":"), ae("zz", ""), v("z", ei), v("zz", ei), b(["z", "zz"], function(e, t, s) { s._useutc = !0, s._tzm = le(e) }); var ci = /([\+\-]|\d\d)/gi; e.updateoffset = function() {} ; var _i = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/ , di = /^(-)?p(?:(?:([0-9,.]*)y)?(?:([0-9,.]*)m)?(?:([0-9,.]*)d)?(?:t(?:([0-9,.]*)h)?(?:([0-9,.]*)m)?(?:([0-9,.]*)s)?)?|([0-9,.]*)w)$/; qe.fn = oe.prototype; var si = et(1, "add") , ii = et(-1, "subtract"); e.defaultformat = "yyyy-mm-ddthh:mm:ssz"; var ni = ee("moment().lang() is deprecated. instead, use moment().localedata() to get the language configuration. use moment().locale() to change languages.", function(e) { return void 0 === e ? this.localedata() : this.locale(e) }); o(0, ["gg", 2], 0, function() { return this.weekyear() % 100 }), o(0, ["gg", 2], 0, function() { return this.isoweekyear() % 100 }), mt("gggg", "weekyear"), mt("ggggg", "weekyear"), mt("gggg", "isoweekyear"), mt("ggggg", "isoweekyear"), d("weekyear", "gg"), d("isoweekyear", "gg"), v("g", zs), v("g", zs), v("gg", js, fs), v("gg", js, fs), v("gggg", qs, zs), v("gggg", qs, zs), v("ggggg", ks, gs), v("ggggg", ks, gs), j(["gggg", "ggggg", "gggg", "ggggg"], function(e, t, s, i) { t[i.substr(0, 2)] = g(e) }), j(["gg", "gg"], function(t, s, i, n) { s[n] = e.parsetwodigityear(t) }), o("q", 0, 0, "quarter"), d("quarter", "q"), v("q", js), b("q", function(e, t) { t[oi] = 3 * (g(e) - 1) }), o("d", ["dd", 2], "do", "date"), d("date", "d"), v("d", js), v("dd", js, fs), v("do", function(e, t) { return e ? t._ordinalparse : t._ordinalparselenient }), b(["d", "dd"], ri), b("do", function(e, t) { t[ri] = g(e.match(js)[0], 10) }); var mi = n("date", !0); o("d", 0, "do", "day"), o("dd", 0, 0, function(e) { return this.localedata().weekdaysmin(this, e) }), o("ddd", 0, 0, function(e) { return this.localedata().weekdaysshort(this, e) }), o("dddd", 0, 0, function(e) { return this.localedata().weekdays(this, e) }), o("e", 0, 0, "weekday"), o("e", 0, 0, "isoweekday"), d("day", "d"), d("weekday", "e"), d("isoweekday", "e"), v("d", js), v("e", js), v("e", js), v("dd", si), v("ddd", si), v("dddd", si), j(["dd", "ddd", "dddd"], function(e, t, s) { var i = s._locale.weekdaysparse(e); null != i ? t.d = i : h(s).invalidweekday = e }), j(["d", "e", "e"], function(e, t, s, i) { t[i] = g(e) }); var $i = "sunday_monday_tuesday_wednesday_thursday_friday_saturday".split("_") , ti = "sun_mon_tue_wed_thu_fri_sat".split("_") , pi = "su_mo_tu_we_th_fr_sa".split("_"); o("h", ["hh", 2], 0, "hour"), o("h", ["hh", 2], 0, function() { return this.hours() % 12 || 12 }), ft("a", !0), ft("a", !1), d("hour", "h"), v("a", wt), v("a", wt), v("h", js), v("h", js), v("hh", js, fs), v("hh", js, fs), b(["h", "hh"], li), b(["a", "a"], function(e, t, s) { s._ispm = s._locale.ispm(e), s._meridiem = e }), b(["h", "hh"], function(e, t, s) { t[li] = g(e), h(s).bighour = !0 }); var oi = /[ap]\.?m?\.?/i , ei = n("hours", !0); o("m", ["mm", 2], 0, "minute"), d("minute", "m"), v("m", js), v("mm", js, fs), b(["m", "mm"], hi); var ai = n("minutes", !1); o("s", ["ss", 2], 0, "second"), d("second", "s"), v("s", js), v("ss", js, fs), b(["s", "ss"], ci); var li = n("seconds", !1); o("s", 0, 0, function() { return ~~(this.millisecond() / 100) }), o(0, ["ss", 2], 0, function() { return ~~(this.millisecond() / 10) }), o(0, ["sss", 3], 0, "millisecond"), o(0, ["ssss", 4], 0, function() { return 10 * this.millisecond() }), o(0, ["sssss", 5], 0, function() { return 100 * this.millisecond() }), o(0, ["ssssss", 6], 0, function() { return 1e3 * this.millisecond() }), o(0, ["sssssss", 7], 0, function() { return 1e4 * this.millisecond() }), o(0, ["ssssssss", 8], 0, function() { return 1e5 * this.millisecond() }), o(0, ["sssssssss", 9], 0, function() { return 1e6 * this.millisecond() }), d("millisecond", "ms"), v("s", qs, js), v("ss", qs, fs), v("sss", qs, ws); var yi; for (yi = "ssss"; yi.length <= 9; yi += "s") v(yi, xs); for (yi = "s"; yi.length <= 9; yi += "s") b(yi, jt); var hi = n("milliseconds", !1); o("z", 0, 0, "zoneabbr"), o("zz", 0, 0, "zonename"); var vi = p.prototype; vi.add = si, vi.calendar = st, vi.clone = it, vi.diff = lt, vi.endof = kt, vi.format = ut, vi.from = pt, vi.fromnow = mt, vi.to = ft, vi.tonow = gt, vi.get = t, vi.invalidat = nt, vi.isafter = nt, vi.isbefore = at, vi.isbetween = ot, vi.issame = rt, vi.isvalid = st, vi.lang = ni, vi.locale = vt, vi.localedata = bt, vi.max = xi, vi.min = wi, vi.parsingflags = it, vi.set = t, vi.startof = yt, vi.subtract = ii, vi.toarray = _t, vi.toobject = dt, vi.todate = ct, vi.toisostring = dt, vi.tojson = dt, vi.tostring = ct, vi.unix = xt, vi.valueof = wt, vi.year = yi, vi.isleapyear = le, vi.weekyear = tt, vi.isoweekyear = pt, vi.quarter = vi.quarters = at, vi.month = q, vi.daysinmonth = k, vi.week = vi.weeks = pe, vi.isoweek = vi.isoweeks = me, vi.weeksinyear = et, vi.isoweeksinyear = ot, vi.date = mi, vi.day = vi.days = ut, vi.weekday = bt, vi.isoweekday = jt, vi.dayofyear = ge, vi.hour = vi.hours = ei, vi.minute = vi.minutes = ai, vi.second = vi.seconds = li, vi.millisecond = vi.milliseconds = hi, vi.utcoffset = ve, vi.utc = ue, vi.local = be, vi.parsezone = je, vi.hasalignedhouroffset = fe, vi.isdst = we, vi.isdstshifted = ze, vi.islocal = ge, vi.isutcoffset = je, vi.isutc = qe, vi.isutc = qe, vi.zoneabbr = qt, vi.zonename = qt, vi.dates = ee("dates accessor is deprecated. use date instead.", mi), vi.months = ee("months accessor is deprecated. use month instead", q), vi.years = ee("years accessor is deprecated. use year instead", yi), vi.zone = ee("moment().zone is deprecated, use moment().utcoffset instead. https://github.com/moment/moment/issues/1779", re); var ri = vi , ui = { sameday: "[today at] lt", nextday: "[tomorrow at] lt", nextweek: "dddd [at] lt", lastday: "[yesterday at] lt", lastweek: "[last] dddd [at] lt", sameelse: "l" } , bi = { lts: "h:mm:ss a", lt: "h:mm a", l: "mm/dd/yyyy", ll: "mmmm d, yyyy", lll: "mmmm d, yyyy h:mm a", llll: "dddd, mmmm d, yyyy h:mm a" } , ji = "invalid date" , fi = "%d" , wi = /\d{1,2}/ , zi = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", m: "a month", mm: "%d months", y: "a year", yy: "%d years" } , gi = b.prototype; gi._calendar = ui, gi.calendar = zt, gi._longdateformat = bi, gi.longdateformat = es, gi._invaliddate = ji, gi.invaliddate = ts, gi._ordinal = fi, gi.ordinal = ss, gi._ordinalparse = wi, gi.preparse = is, gi.postformat = is, gi._relativetime = zi, gi.relativetime = ns, gi.pastfuture = as, gi.set = os, gi.months = z, gi._months = ui, gi.monthsshort = g, gi._monthsshort = pi, gi.monthsparse = j, gi.week = ce, gi._week = ki, gi.firstdayofyear = ue, gi.firstdayofweek = de, gi.weekdays = yt, gi._weekdays = $i, gi.weekdaysmin = vt, gi._weekdaysmin = pi, gi.weekdaysshort = ht, gi._weekdaysshort = ti, gi.weekdaysparse = rt, gi.ispm = zt, gi._meridiemparse = oi, gi.meridiem = gt, x("en", { ordinalparse: /\d{1,2}(th|st|nd|rd)/, ordinal: function(e) { var t = e % 10 , s = 1 === g(e % 100 / 10) ? "th" : 1 === t ? "st" : 2 === t ? "nd" : 3 === t ? "rd" : "th"; return e + s } }), e.lang = ee("moment.lang is deprecated. use moment.locale instead.", x), e.langdata = ee("moment.langdata is deprecated. use moment.localedata instead.", _); var ji = math.abs , qi = _s("ms") , qi = _s("s") , ki = _s("m") , xi = _s("h") , zi = _s("d") , en = _s("w") , tn = _s("m") , sn = _s("y") , nn = ss("milliseconds") , an = ss("seconds") , on = ss("minutes") , rn = ss("hours") , ln = ss("days") , hn = ss("months") , cn = ss("years") , dn = math.round , un = { s: 45, m: 45, h: 22, d: 26, m: 11 } , pn = math.abs , mn = oe.prototype; mn.abs = ms, mn.add = gs, mn.subtract = vs, mn.as = xs, mn.asmilliseconds = qi, mn.asseconds = qi, mn.asminutes = ki, mn.ashours = xi, mn.asdays = zi, mn.asweeks = en, mn.asmonths = tn, mn.asyears = sn, mn.valueof = cs, mn._bubble = ys, mn.get = ds, mn.milliseconds = nn, mn.seconds = an, mn.minutes = on, mn.hours = rn, mn.days = ln, mn.weeks = is, mn.months = hn, mn.years = cn, mn.humanize = ts, mn.toisostring = ps, mn.tostring = ps, mn.tojson = ps, mn.locale = vt, mn.localedata = bt, mn.toisostring = ee("toisostring() is deprecated. please use toisostring() instead (notice the capitals)", ps), mn.lang = ni, o("x", 0, 0, "unix"), o("x", 0, 0, "valueof"), v("x", zs), v("x", ti), b("x", function(e, t, s) { s._d = new date(1e3 * parsefloat(e, 10)) }), b("x", function(e, t, s) { s._d = new date(g(e)) }), e.version = "2.10.6", t(me), e.fn = ri, e.min = te, e.max = pe, e.utc = r, e.unix = kt, e.months = hs, e.isdate = i, e.locale = x, e.invalid = d, e.duration = qe, e.ismoment = m, e.weekdays = ds, e.parsezone = xt, e.localedata = _, e.isduration = ee, e.monthsshort = cs, e.weekdaysmin = ps, e.definelocale = c, e.weekdaysshort = us, e.normalizeunits = s, e.relativetimethreshold = $s; var fn = e; window.moment = fn }(), function(e) { e.definelocale("zh-cn", { months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsshort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysshort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysmin: "日_一_二_三_四_五_六".split("_"), longdateformat: { lt: "ah点mm分", lts: "ah点m分s秒", l: "yyyy-mm-dd", ll: "yyyy年mmmd日", lll: "yyyy年mmmd日ah点mm分", llll: "yyyy年mmmd日ddddah点mm分", l: "yyyy-mm-dd", ll: "yyyy年mmmd日", lll: "yyyy年mmmd日ah点mm分", llll: "yyyy年mmmd日ddddah点mm分" }, meridiemparse: /凌晨|早上|上午|中午|下午|晚上/, meridiemhour: function(e, t) { return 12 === e && (e = 0), "凌晨" === t || "早上" === t || "上午" === t ? e : "下午" === t || "晚上" === t ? e + 12 : e >= 11 ? e : e + 12 }, meridiem: function(e, t, s) { var i = 100 * e + t; return i < 600 ? "凌晨" : i < 900 ? "早上" : i < 1130 ? "上午" : i < 1230 ? "中午" : i < 1800 ? "下午" : "晚上" }, calendar: { sameday: function() { return 0 === this.minutes() ? "[今天]ah[点整]" : "[今天]lt" }, nextday: function() { return 0 === this.minutes() ? "[明天]ah[点整]" : "[明天]lt" }, lastday: function() { return 0 === this.minutes() ? "[昨天]ah[点整]" : "[昨天]lt" }, nextweek: function() { var t, s; return t = e().startof("week"), s = this.unix() - t.unix() >= 604800 ? "[下]" : "[本]", 0 === this.minutes() ? s + "dddah点整" : s + "dddah点mm" }, lastweek: function() { var t, s; return t = e().startof("week"), s = this.unix() < t.unix() ? "[上]" : "[本]", 0 === this.minutes() ? s + "dddah点整" : s + "dddah点mm" }, sameelse: "ll" }, ordinalparse: /\d{1,2}(日|月|周)/, ordinal: function(e, t) { switch (t) { case "d": case "d": case "ddd": return e + "日"; case "m": return e + "月"; case "w": case "w": return e + "周"; default: return e } }, relativetime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", m: "1 个月", mm: "%d 个月", y: "1 年", yy: "%d 年" }, week: { dow: 1, doy: 4 } }) }(moment), function(e) { e.locale("zh_cn") }(moment), +function(e) { "use strict"; function t() { var e = document.createelement("bootstrap") , t = { webkittransition: "webkittransitionend", moztransition: "transitionend", otransition: "otransitionend otransitionend", transition: "transitionend" }; for (var s in t) if (void 0 !== e.style[s]) return { end: t[s] }; return !1 } e.fn.emulatetransitionend = function(t) { var s = !1 , i = this; e(this).one("bstransitionend", function() { s = !0 }); var n = function() { s || e(i).trigger(e.support.transition.end) }; return settimeout(n, t), this } , e(function() { e.support.transition = t(), e.support.transition && (e.event.special.bstransitionend = { bindtype: e.support.transition.end, delegatetype: e.support.transition.end, handle: function(t) { if (e(t.target).is(this)) return t.handleobj.handler.apply(this, arguments) } }) }) }(jquery), function(e) { e.fn.drags = function(t) { t = e.extend({ handle: "", cursor: "move" }, t); var s = "" === t.handle ? e(this) : e(this).find(t.handle) , i = e(this) , n = function() { var t, s; return { start: function(n) { t = i.css("z-index"), s = function() { var e = i.outerheight() , t = i.outerwidth() , s = i.offset().top + e - n.pagey , a = i.offset().left + t - n.pagex; return function(n) { i.offset({ top: n.pagey + s - e, left: n.pagex + a - t }) } }(), e(window).on("mousemove", s).addclass("draggable") }, stop: function() { e(window).off("mousemove", s).removeclass("draggable") } } }(); return s.css("cursor", t.cursor).on("mousedown", function(t) { e(window).one("mouseup", function(e) { n.stop(), s.removeclass("active-handle") }), n.start(t), s.addclass("active-handle") }), s } }(jquery), $.fn.extend({ dragging: function(e) { function t() { o.each(function(e) { var t = parseint(math.random() * (b - k)) , s = parseint(math.random() * (v - y)); "x" == c.tolowercase() ? $(this).css({ left: s }) : "y" == c.tolowercase() ? $(this).css({ top: t }) : "both" == c.tolowercase() && $(this).css({ top: t, left: s }) }) } var s, i, n, a, o = $(this), r = o.parent(), l = { move: "both", randomposition: !0, hander: 1 }, h = $.extend({}, l, e), c = h.move, d = h.randomposition, u = h.hander; h.parent && (o = h.parent), u = 1 == u ? o : o.find(h.hander), r.css({ position: "relative" }), h.parent ? o.css({ position: "absolute", left: "50%", marginleft: -o.width() / 2 }) : o.css({ position: "absolute" }), u.css({ cursor: "move" }); var p, m, f, g, v = r.width(), b = r.height(), y = o.width() + parseint(o.css("padding-left")) + parseint(o.css("padding-right")), k = o.height() + parseint(o.css("padding-top")) + parseint(o.css("padding-bottom")), w = !1; d && t(), u.mousedown(function(e) { return w = !0, n = e.pagex, a = e.pagey, p = o.position().left, m = o.position().top, !1 }), $(document).mouseup(function(e) { w = !1 }), $(document).mousemove(function(e) { function t() { if (w === !0) return o.css({ left: f }), f < 0 && o.css({ left: "0" }), f > v - y && o.css({ left: v - y }), f } function r() { if (w === !0) return o.css({ top: g }), g < 0 && o.css({ top: "0" }), g > b - k && o.css({ top: b - k }), g } function l() { w === !0 && o.css({ left: f, top: g }) } s = e.pagex, f = p + s - n, i = e.pagey, g = m + i - a, "x" == c.tolowercase() ? t() : "y" == c.tolowercase() ? r() : "both" == c.tolowercase() && l() }) } }), function(e, t, s) { "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e(require("jquery")) : e(t || s) }(function(e) { var t = function(t, s, i) { var n = { invalid: [], getcaret: function() { try { var e, s = 0, i = t.get(0), a = document.selection, o = i.selectionstart; return a && navigator.appversion.indexof("msie 10") === -1 ? (e = a.createrange(), e.movestart("character", -n.val().length), s = e.text.length) : (o || "0" === o) && (s = o), s } catch (r) {} }, setcaret: function(e) { try { if (t.is(":focus")) { var s, i = t.get(0); i.setselectionrange ? i.setselectionrange(i.value.length, i.value.length) : (s = i.createtextrange(), s.collapse(!0), s.moveend("character", s.value.length), s.movestart("character", s.value.length), s.select()) } } catch (n) {} }, events: function() { t.on("keydown.mask", function(e) { t.data("mask-keycode", e.keycode || e.which), t.data("mask-previus-value", t.val()), t.data("mask-previus-caret-pos", n.getcaret()), n.maskdigitposmapold = n.maskdigitposmap }).on(e.jmaskglobals.useinput ? "input.mask" : "keyup.mask", n.behaviour).on("paste.mask drop.mask", function() { settimeout(function() { t.keydown().keyup() }, 100) }).on("change.mask", function() { t.data("changed", !0) }).on("blur.mask", function() { r === n.val() || t.data("changed") || t.trigger("change"), t.data("changed", !1) }).on("blur.mask", function() { r = n.val() }).on("focus.mask", function(t) { i.selectonfocus === !0 && e(t.target).select() }).on("focusout.mask", function() { i.clearifnotmatch && !a.test(n.val()) && n.val("") }) }, getregexmask: function() { for (var e, t, i, n, a, r, l = [], h = 0; h < s.length; h++) e = o.translation[s.charat(h)], e ? (t = e.pattern.tostring().replace(/.{1}$|^.{1}/g, ""), i = e.optional, n = e.recursive, n ? (l.push(s.charat(h)), a = { digit: s.charat(h), pattern: t }) : l.push(i || n ? t + "?" : t)) : l.push(s.charat(h).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")); return r = l.join(""), a && (r = r.replace(new regexp("(" + a.digit + "(.*" + a.digit + ")?)"), "($1)?").replace(new regexp(a.digit,"g"), a.pattern)), new regexp(r) }, destroyevents: function() { t.off(["input", "keydown", "keyup", "paste", "drop", "blur", "focusout", ""].join(".mask ")) }, val: function(e) { var s, i = t.is("input"), n = i ? "val" : "text"; return arguments.length > 0 ? (t[n]() !== e && t[n](e), s = t) : s = t[n](), s }, calculatecaretposition: function() { var e = t.data("mask-previus-value") || "" , s = n.getmasked() , i = n.getcaret(); if (e !== s) { var a = t.data("mask-previus-caret-pos") || 0 , o = s.length , r = e.length , l = 0 , h = 0 , c = 0 , d = 0 , u = 0; for (u = i; u < o && n.maskdigitposmap[u]; u++) h++; for (u = i - 1; u >= 0 && n.maskdigitposmap[u]; u--) l++; for (u = i - 1; u >= 0; u--) n.maskdigitposmap[u] && c++; for (u = a - 1; u >= 0; u--) n.maskdigitposmapold[u] && d++; if (i > r) i = o; else if (a >= i && a !== r) { if (!n.maskdigitposmapold[i]) { var p = i; i -= d - c, i -= l, n.maskdigitposmap[i] && (i = p) } } else i > a && (i += c - d, i += h) } return i }, behaviour: function(s) { s = s || window.event, n.invalid = []; var i = t.data("mask-keycode"); if (e.inarray(i, o.bypasskeys) === -1) { var a = n.getmasked() , r = n.getcaret(); return settimeout(function() { n.setcaret(n.calculatecaretposition()) }, 10), n.val(a), n.setcaret(r), n.callbacks(s) } }, getmasked: function(e, t) { var a, r, l = [], h = void 0 === t ? n.val() : t + "", c = 0, d = s.length, u = 0, p = h.length, m = 1, f = "push", g = -1, v = 0, b = []; i.reverse ? (f = "unshift", m = -1, a = 0, c = d - 1, u = p - 1, r = function() { return c > -1 && u > -1 } ) : (a = d - 1, r = function() { return c < d && u < p } ); for (var y; r(); ) { var k = s.charat(c) , w = h.charat(u) , x = o.translation[k]; x ? (w.match(x.pattern) ? (l[f](w), x.recursive && (g === -1 ? g = c : c === a && (c = g - m), a === g && (c -= m)), c += m) : w === y ? (v--, y = void 0) : x.optional ? (c += m, u -= m) : x.fallback ? (l[f](x.fallback), c += m, u -= m) : n.invalid.push({ p: u, v: w, e: x.pattern }), u += m) : (e || l[f](k), w === k ? (b.push(u), u += m) : (y = k, b.push(u + v), v++), c += m) } var c = s.charat(a); d !== p + 1 || o.translation[c] || l.push(c); var _ = l.join(""); return n.mapmaskdigitpositions(_, b, p), _ }, mapmaskdigitpositions: function(e, t, s) { var a = i.reverse ? e.length - s : 0; n.maskdigitposmap = {}; for (var o = 0; o < t.length; o++) n.maskdigitposmap[t[o] + a] = 1 }, callbacks: function(e) { var a = n.val() , o = a !== r , l = [a, e, t, i] , h = function(e, t, s) { "function" == typeof i[e] && t && i[e].apply(this, s) }; h("onchange", o === !0, l), h("onkeypress", o === !0, l), h("oncomplete", a.length === s.length, l), h("oninvalid", n.invalid.length > 0, [a, e, t, n.invalid, i]) } }; t = e(t); var a, o = this, r = n.val(); s = "function" == typeof s ? s(n.val(), void 0, t, i) : s, o.mask = s, o.options = i, o.remove = function() { var e = n.getcaret(); return n.destroyevents(), n.val(o.getcleanval()), n.setcaret(e), t } , o.getcleanval = function() { return n.getmasked(!0) } , o.getmaskedval = function(e) { return n.getmasked(!1, e) } , o.init = function(r) { if (r = r || !1, i = i || {}, o.clearifnotmatch = e.jmaskglobals.clearifnotmatch, o.bypasskeys = e.jmaskglobals.bypasskeys, o.translation = e.extend({}, e.jmaskglobals.translation, i.translation), o = e.extend(!0, {}, o, i), a = n.getregexmask(), r) n.events(), n.val(n.getmasked()); else { i.placeholder && t.attr("placeholder", i.placeholder), t.data("mask") && t.attr("autocomplete", "off"); for (var l = 0, h = !0; l < s.length; l++) { var c = o.translation[s.charat(l)]; if (c && c.recursive) { h = !1; break } } h && t.attr("maxlength", s.length), n.destroyevents(), n.events(); var d = n.getcaret(); n.val(n.getmasked()), n.setcaret(d) } } , o.init(!t.is("input")) }; e.maskwatchers = {}; var s = function() { var s = e(this) , n = {} , a = "data-mask-" , o = s.attr("data-mask"); if (s.attr(a + "reverse") && (n.reverse = !0), s.attr(a + "clearifnotmatch") && (n.clearifnotmatch = !0), "true" === s.attr(a + "selectonfocus") && (n.selectonfocus = !0), i(s, o, n)) return s.data("mask", new t(this,o,n)) } , i = function(t, s, i) { i = i || {}; var n = e(t).data("mask") , a = json.stringify , o = e(t).val() || e(t).text(); try { return "function" == typeof s && (s = s(o)), "object" != typeof n || a(n.options) !== a(i) || n.mask !== s } catch (r) {} } , n = function(e) { var t, s = document.createelement("div"); return e = "on" + e, t = e in s, t || (s.setattribute(e, "return;"), t = "function" == typeof s[e]), s = null, t }; e.fn.mask = function(s, n) { n = n || {}; var a = this.selector , o = e.jmaskglobals , r = o.watchinterval , l = n.watchinputs || o.watchinputs , h = function() { if (i(this, s, n)) return e(this).data("mask", new t(this,s,n)) }; return e(this).each(h), a && "" !== a && l && (clearinterval(e.maskwatchers[a]), e.maskwatchers[a] = setinterval(function() { e(document).find(a).each(h) }, r)), this } , e.fn.masked = function(e) { return this.data("mask").getmaskedval(e) } , e.fn.unmask = function() { return clearinterval(e.maskwatchers[this.selector]), delete e.maskwatchers[this.selector], this.each(function() { var t = e(this).data("mask"); t && t.remove().removedata("mask") }) } , e.fn.cleanval = function() { return this.data("mask").getcleanval() } , e.applydatamask = function(t) { t = t || e.jmaskglobals.maskelements; var i = t instanceof e ? t : e(t); i.filter(e.jmaskglobals.datamaskattr).each(s) } ; var a = { maskelements: "input,td,span,div", datamaskattr: "*[data-mask]", datamask: !0, watchinterval: 300, watchinputs: !0, useinput: !/chrome\/[2-4][0-9]|samsungbrowser/.test(window.navigator.useragent) && n("input"), watchdatamask: !1, bypasskeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91], translation: { 0: { pattern: /\d/ }, 9: { pattern: /\d/, optional: !0 }, "#": { pattern: /\d/, recursive: !0 }, a: { pattern: /[a-za-z0-9]/ }, s: { pattern: /[a-za-z]/ } } }; e.jmaskglobals = e.jmaskglobals || {}, a = e.jmaskglobals = e.extend(!0, {}, a, e.jmaskglobals), a.datamask && e.applydatamask(), setinterval(function() { e.jmaskglobals.watchdatamask && e.applydatamask() }, a.watchinterval) }, window.jquery, window.zepto), function(e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e(jquery) }(function(e) { e.ui = e.ui || {}; var t = (e.ui.version = "1.12.1", 0) , s = array.prototype.slice; e.cleandata = function(t) { return function(s) { var i, n, a; for (a = 0; null != (n = s[a]); a++) try { i = e._data(n, "events"), i && i.remove && e(n).triggerhandler("remove") } catch (o) {} t(s) } }(e.cleandata), e.widget = function(t, s, i) { var n, a, o, r = {}, l = t.split(".")[0]; t = t.split(".")[1]; var h = l + "-" + t; return i || (i = s, s = e.widget), e.isarray(i) && (i = e.extend.apply(null, [{}].concat(i))), e.expr[":"][h.tolowercase()] = function(t) { return !!e.data(t, h) } , e[l] = e[l] || {}, n = e[l][t], a = e[l][t] = function(e, t) { return this._createwidget ? void (arguments.length && this._createwidget(e, t)) : new a(e,t) } , e.extend(a, n, { version: i.version, _proto: e.extend({}, i), _childconstructors: [] }), o = new s, o.options = e.widget.extend({}, o.options), e.each(i, function(t, i) { return e.isfunction(i) ? void (r[t] = function() { function e() { return s.prototype[t].apply(this, arguments) } function n(e) { return s.prototype[t].apply(this, e) } return function() { var t, s = this._super, a = this._superapply; return this._super = e, this._superapply = n, t = i.apply(this, arguments), this._super = s, this._superapply = a, t } }()) : void (r[t] = i) }), a.prototype = e.widget.extend(o, { widgeteventprefix: n ? o.widgeteventprefix || t : t }, r, { constructor: a, namespace: l, widgetname: t, widgetfullname: h }), n ? (e.each(n._childconstructors, function(t, s) { var i = s.prototype; e.widget(i.namespace + "." + i.widgetname, a, s._proto) }), delete n._childconstructors) : s._childconstructors.push(a), e.widget.bridge(t, a), a } , e.widget.extend = function(t) { for (var i, n, a = s.call(arguments, 1), o = 0, r = a.length; o < r; o++) for (i in a[o]) n = a[o][i], a[o].hasownproperty(i) && void 0 !== n && (e.isplainobject(n) ? t[i] = e.isplainobject(t[i]) ? e.widget.extend({}, t[i], n) : e.widget.extend({}, n) : t[i] = n); return t } , e.widget.bridge = function(t, i) { var n = i.prototype.widgetfullname || t; e.fn[t] = function(a) { var o = "string" == typeof a , r = s.call(arguments, 1) , l = this; return o ? this.length || "instance" !== a ? this.each(function() { var s, i = e.data(this, n); return "instance" === a ? (l = i, !1) : i ? e.isfunction(i[a]) && "_" !== a.charat(0) ? (s = i[a].apply(i, r), s !== i && void 0 !== s ? (l = s && s.jquery ? l.pushstack(s.get()) : s, !1) : void 0) : e.error("no such method '" + a + "' for " + t + " widget instance") : e.error("cannot call methods on " + t + " prior to initialization; attempted to call method '" + a + "'") }) : l = void 0 : (r.length && (a = e.widget.extend.apply(null, [a].concat(r))), this.each(function() { var t = e.data(this, n); t ? (t.option(a || {}), t._init && t._init()) : e.data(this, n, new i(a,this)) })), l } } , e.widget = function() {} , e.widget._childconstructors = [], e.widget.prototype = { widgetname: "widget", widgeteventprefix: "", defaultelement: "
", options: { classes: {}, disabled: !1, create: null }, _createwidget: function(s, i) { i = e(i || this.defaultelement || this)[0], this.element = e(i), this.uuid = t++, this.eventnamespace = "." + this.widgetname + this.uuid, this.bindings = e(), this.hoverable = e(), this.focusable = e(), this.classeselementlookup = {}, i !== this && (e.data(i, this.widgetfullname, this), this._on(!0, this.element, { remove: function(e) { e.target === i && this.destroy() } }), this.document = e(i.style ? i.ownerdocument : i.document || i), this.window = e(this.document[0].defaultview || this.document[0].parentwindow)), this.options = e.widget.extend({}, this.options, this._getcreateoptions(), s), this._create(), this.options.disabled && this._setoptiondisabled(this.options.disabled), this._trigger("create", null, this._getcreateeventdata()), this._init() }, _getcreateoptions: function() { return {} }, _getcreateeventdata: e.noop, _create: e.noop, _init: e.noop, destroy: function() { var t = this; this._destroy(), e.each(this.classeselementlookup, function(e, s) { t._removeclass(s, e) }), this.element.off(this.eventnamespace).removedata(this.widgetfullname), this.widget().off(this.eventnamespace).removeattr("aria-disabled"), this.bindings.off(this.eventnamespace) }, _destroy: e.noop, widget: function() { return this.element }, option: function(t, s) { var i, n, a, o = t; if (0 === arguments.length) return e.widget.extend({}, this.options); if ("string" == typeof t) if (o = {}, i = t.split("."), t = i.shift(), i.length) { for (n = o[t] = e.widget.extend({}, this.options[t]), a = 0; a < i.length - 1; a++) n[i[a]] = n[i[a]] || {}, n = n[i[a]]; if (t = i.pop(), 1 === arguments.length) return void 0 === n[t] ? null : n[t]; n[t] = s } else { if (1 === arguments.length) return void 0 === this.options[t] ? null : this.options[t]; o[t] = s } return this._setoptions(o), this }, _setoptions: function(e) { var t; for (t in e) this._setoption(t, e[t]); return this }, _setoption: function(e, t) { return "classes" === e && this._setoptionclasses(t), this.options[e] = t, "disabled" === e && this._setoptiondisabled(t), this }, _setoptionclasses: function(t) { var s, i, n; for (s in t) n = this.classeselementlookup[s], t[s] !== this.options.classes[s] && n && n.length && (i = e(n.get()), this._removeclass(n, s), i.addclass(this._classes({ element: i, keys: s, classes: t, add: !0 }))) }, _setoptiondisabled: function(e) { this._toggleclass(this.widget(), this.widgetfullname + "-disabled", null, !!e), e && (this._removeclass(this.hoverable, null, "ui-state-hover"), this._removeclass(this.focusable, null, "ui-state-focus")) }, enable: function() { return this._setoptions({ disabled: !1 }) }, disable: function() { return this._setoptions({ disabled: !0 }) }, _classes: function(t) { function s(s, a) { var o, r; for (r = 0; r < s.length; r++) o = n.classeselementlookup[s[r]] || e(), o = e(t.add ? e.unique(o.get().concat(t.element.get())) : o.not(t.element).get()), n.classeselementlookup[s[r]] = o, i.push(s[r]), a && t.classes[s[r]] && i.push(t.classes[s[r]]) } var i = [] , n = this; return t = e.extend({ element: this.element, classes: this.options.classes || {} }, t), this._on(t.element, { remove: "_untrackclasseselement" }), t.keys && s(t.keys.match(/\s+/g) || [], !0), t.extra && s(t.extra.match(/\s+/g) || []), i.join(" ") }, _untrackclasseselement: function(t) { var s = this; e.each(s.classeselementlookup, function(i, n) { e.inarray(t.target, n) !== -1 && (s.classeselementlookup[i] = e(n.not(t.target).get())) }) }, _removeclass: function(e, t, s) { return this._toggleclass(e, t, s, !1) }, _addclass: function(e, t, s) { return this._toggleclass(e, t, s, !0) }, _toggleclass: function(e, t, s, i) { i = "boolean" == typeof i ? i : s; var n = "string" == typeof e || null === e , a = { extra: n ? t : s, keys: n ? e : t, element: n ? this.element : e, add: i }; return a.element.toggleclass(this._classes(a), i), this }, _on: function(t, s, i) { var n, a = this; "boolean" != typeof t && (i = s, s = t, t = !1), i ? (s = n = e(s), this.bindings = this.bindings.add(s)) : (i = s, s = this.element, n = this.widget()), e.each(i, function(i, o) { function r() { if (t || a.options.disabled !== !0 && !e(this).hasclass("ui-state-disabled")) return ("string" == typeof o ? a[o] : o).apply(a, arguments) } "string" != typeof o && (r.guid = o.guid = o.guid || r.guid || e.guid++); var l = i.match(/^([\w:-]*)\s*(.*)$/) , h = l[1] + a.eventnamespace , c = l[2]; c ? n.on(h, c, r) : s.on(h, r) }) }, _off: function(t, s) { s = (s || "").split(" ").join(this.eventnamespace + " ") + this.eventnamespace, t.off(s).off(s), this.bindings = e(this.bindings.not(t).get()), this.focusable = e(this.focusable.not(t).get()), this.hoverable = e(this.hoverable.not(t).get()) }, _delay: function(e, t) { function s() { return ("string" == typeof e ? i[e] : e).apply(i, arguments) } var i = this; return settimeout(s, t || 0) }, _hoverable: function(t) { this.hoverable = this.hoverable.add(t), this._on(t, { mouseenter: function(t) { this._addclass(e(t.currenttarget), null, "ui-state-hover") }, mouseleave: function(t) { this._removeclass(e(t.currenttarget), null, "ui-state-hover") } }) }, _focusable: function(t) { this.focusable = this.focusable.add(t), this._on(t, { focusin: function(t) { this._addclass(e(t.currenttarget), null, "ui-state-focus") }, focusout: function(t) { this._removeclass(e(t.currenttarget), null, "ui-state-focus") } }) }, _trigger: function(t, s, i) { var n, a, o = this.options[t]; if (i = i || {}, s = e.event(s), s.type = (t === this.widgeteventprefix ? t : this.widgeteventprefix + t).tolowercase(), s.target = this.element[0], a = s.originalevent) for (n in a) n in s || (s[n] = a[n]); return this.element.trigger(s, i), !(e.isfunction(o) && o.apply(this.element[0], [s].concat(i)) === !1 || s.isdefaultprevented()) } }, e.each({ show: "fadein", hide: "fadeout" }, function(t, s) { e.widget.prototype["_" + t] = function(i, n, a) { "string" == typeof n && (n = { effect: n }); var o, r = n ? n === !0 || "number" == typeof n ? s : n.effect || s : t; n = n || {}, "number" == typeof n && (n = { duration: n }), o = !e.isemptyobject(n), n.complete = a, n.delay && i.delay(n.delay), o && e.effects && e.effects.effect[r] ? i[t](n) : r !== t && i[r] ? i[r](n.duration, n.easing, a) : i.queue(function(s) { e(this)[t](), a && a.call(i[0]), s() }) } }); var i = (e.widget, e.extend(e.expr[":"], { data: e.expr.createpseudo ? e.expr.createpseudo(function(t) { return function(s) { return !!e.data(s, t) } }) : function(t, s, i) { return !!e.data(t, i[3]) } }), e.fn.scrollparent = function(t) { var s = this.css("position") , i = "absolute" === s , n = t ? /(auto|scroll|hidden)/ : /(auto|scroll)/ , a = this.parents().filter(function() { var t = e(this); return (!i || "static" !== t.css("position")) && n.test(t.css("overflow") + t.css("overflow-y") + t.css("overflow-x")) }).eq(0); return "fixed" !== s && a.length ? a : e(this[0].ownerdocument || document) } , e.ui.ie = !!/msie [\w.]+/.exec(navigator.useragent.tolowercase()), !1); e(document).on("mouseup", function() { i = !1 }); e.widget("ui.mouse", { version: "1.12.1", options: { cancel: "input, textarea, button, select, option", distance: 1, delay: 0 }, _mouseinit: function() { var t = this; this.element.on("mousedown." + this.widgetname, function(e) { return t._mousedown(e) }).on("click." + this.widgetname, function(s) { if (!0 === e.data(s.target, t.widgetname + ".preventclickevent")) return e.removedata(s.target, t.widgetname + ".preventclickevent"), s.stopimmediatepropagation(), !1 }), this.started = !1 }, _mousedestroy: function() { this.element.off("." + this.widgetname), this._mousemovedelegate && this.document.off("mousemove." + this.widgetname, this._mousemovedelegate).off("mouseup." + this.widgetname, this._mouseupdelegate) }, _mousedown: function(t) { if (!i) { this._mousemoved = !1, this._mousestarted && this._mouseup(t), this._mousedownevent = t; var s = this , n = 1 === t.which , a = !("string" != typeof this.options.cancel || !t.target.nodename) && e(t.target).closest(this.options.cancel).length; return !(n && !a && this._mousecapture(t)) || (this.mousedelaymet = !this.options.delay, this.mousedelaymet || (this._mousedelaytimer = settimeout(function() { s.mousedelaymet = !0 }, this.options.delay)), this._mousedistancemet(t) && this._mousedelaymet(t) && (this._mousestarted = this._mousestart(t) !== !1, !this._mousestarted) ? (t.preventdefault(), !0) : (!0 === e.data(t.target, this.widgetname + ".preventclickevent") && e.removedata(t.target, this.widgetname + ".preventclickevent"), this._mousemovedelegate = function(e) { return s._mousemove(e) } , this._mouseupdelegate = function(e) { return s._mouseup(e) } , this.document.on("mousemove." + this.widgetname, this._mousemovedelegate).on("mouseup." + this.widgetname, this._mouseupdelegate), t.preventdefault(), i = !0, !0)) } }, _mousemove: function(t) { if (this._mousemoved) { if (e.ui.ie && (!document.documentmode || document.documentmode < 9) && !t.button) return this._mouseup(t); if (!t.which) if (t.originalevent.altkey || t.originalevent.ctrlkey || t.originalevent.metakey || t.originalevent.shiftkey) this.ignoremissingwhich = !0; else if (!this.ignoremissingwhich) return this._mouseup(t) } return (t.which || t.button) && (this._mousemoved = !0), this._mousestarted ? (this._mousedrag(t), t.preventdefault()) : (this._mousedistancemet(t) && this._mousedelaymet(t) && (this._mousestarted = this._mousestart(this._mousedownevent, t) !== !1, this._mousestarted ? this._mousedrag(t) : this._mouseup(t)), !this._mousestarted) }, _mouseup: function(t) { this.document.off("mousemove." + this.widgetname, this._mousemovedelegate).off("mouseup." + this.widgetname, this._mouseupdelegate), this._mousestarted && (this._mousestarted = !1, t.target === this._mousedownevent.target && e.data(t.target, this.widgetname + ".preventclickevent", !0), this._mousestop(t)), this._mousedelaytimer && (cleartimeout(this._mousedelaytimer), delete this._mousedelaytimer), this.ignoremissingwhich = !1, i = !1, t.preventdefault() }, _mousedistancemet: function(e) { return math.max(math.abs(this._mousedownevent.pagex - e.pagex), math.abs(this._mousedownevent.pagey - e.pagey)) >= this.options.distance }, _mousedelaymet: function() { return this.mousedelaymet }, _mousestart: function() {}, _mousedrag: function() {}, _mousestop: function() {}, _mousecapture: function() { return !0 } }), e.ui.plugin = { add: function(t, s, i) { var n, a = e.ui[t].prototype; for (n in i) a.plugins[n] = a.plugins[n] || [], a.plugins[n].push([s, i[n]]) }, call: function(e, t, s, i) { var n, a = e.plugins[t]; if (a && (i || e.element[0].parentnode && 11 !== e.element[0].parentnode.nodetype)) for (n = 0; n < a.length; n++) e.options[a[n][0]] && a[n][1].apply(e.element, s) } }, e.ui.safeactiveelement = function(e) { var t; try { t = e.activeelement } catch (s) { t = e.body } return t || (t = e.body), t.nodename || (t = e.body), t } , e.ui.safeblur = function(t) { t && "body" !== t.nodename.tolowercase() && e(t).trigger("blur") } ; e.widget("ui.draggable", e.ui.mouse, { version: "1.12.1", widgeteventprefix: "drag", options: { addclasses: !0, appendto: "parent", axis: !1, connecttosortable: !1, containment: !1, cursor: "auto", cursorat: !1, grid: !1, handle: !1, helper: "original", iframefix: !1, opacity: !1, refreshpositions: !1, revert: !1, revertduration: 500, scope: "default", scroll: !0, scrollsensitivity: 20, scrollspeed: 20, snap: !1, snapmode: "both", snaptolerance: 20, stack: !1, zindex: !1, drag: null, start: null, stop: null }, _create: function() { "original" === this.options.helper && this._setpositionrelative(), this.options.addclasses && this._addclass("ui-draggable"), this._sethandleclassname(), this._mouseinit() }, _setoption: function(e, t) { this._super(e, t), "handle" === e && (this._removehandleclassname(), this._sethandleclassname()) }, _destroy: function() { return (this.helper || this.element).is(".ui-draggable-dragging") ? void (this.destroyonclear = !0) : (this._removehandleclassname(), void this._mousedestroy()) }, _mousecapture: function(t) { var s = this.options; return !(this.helper || s.disabled || e(t.target).closest(".ui-resizable-handle").length > 0) && (this.handle = this._gethandle(t), !!this.handle && (this._bluractiveelement(t), this._blockframes(s.iframefix === !0 ? "iframe" : s.iframefix), !0)) }, _blockframes: function(t) { this.iframeblocks = this.document.find(t).map(function() { var t = e(this); return e("
").css("position", "absolute").appendto(t.parent()).outerwidth(t.outerwidth()).outerheight(t.outerheight()).offset(t.offset())[0] }) }, _unblockframes: function() { this.iframeblocks && (this.iframeblocks.remove(), delete this.iframeblocks) }, _bluractiveelement: function(t) { var s = e.ui.safeactiveelement(this.document[0]) , i = e(t.target); i.closest(s).length || e.ui.safeblur(s) }, _mousestart: function(t) { var s = this.options; return this.helper = this._createhelper(t), this._addclass(this.helper, "ui-draggable-dragging"), this._cachehelperproportions(), e.ui.ddmanager && (e.ui.ddmanager.current = this), this._cachemargins(), this.cssposition = this.helper.css("position"), this.scrollparent = this.helper.scrollparent(!0), this.offsetparent = this.helper.offsetparent(), this.hasfixedancestor = this.helper.parents().filter(function() { return "fixed" === e(this).css("position") }).length > 0, this.positionabs = this.element.offset(), this._refreshoffsets(t), this.originalposition = this.position = this._generateposition(t, !1), this.originalpagex = t.pagex, this.originalpagey = t.pagey, s.cursorat && this._adjustoffsetfromhelper(s.cursorat), this._setcontainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cachehelperproportions(), e.ui.ddmanager && !s.dropbehaviour && e.ui.ddmanager.prepareoffsets(this, t), this._mousedrag(t, !0), e.ui.ddmanager && e.ui.ddmanager.dragstart(this, t), !0) }, _refreshoffsets: function(e) { this.offset = { top: this.positionabs.top - this.margins.top, left: this.positionabs.left - this.margins.left, scroll: !1, parent: this._getparentoffset(), relative: this._getrelativeoffset() }, this.offset.click = { left: e.pagex - this.offset.left, top: e.pagey - this.offset.top } }, _mousedrag: function(t, s) { if (this.hasfixedancestor && (this.offset.parent = this._getparentoffset()), this.position = this._generateposition(t, !0), this.positionabs = this._convertpositionto("absolute"), !s) { var i = this._uihash(); if (this._trigger("drag", t, i) === !1) return this._mouseup(new e.event("mouseup",t)), !1; this.position = i.position } return this.helper[0].style.left = this.position.left + "px", this.helper[0].style.top = this.position.top + "px", e.ui.ddmanager && e.ui.ddmanager.drag(this, t), !1 }, _mousestop: function(t) { var s = this , i = !1; return e.ui.ddmanager && !this.options.dropbehaviour && (i = e.ui.ddmanager.drop(this, t)), this.dropped && (i = this.dropped, this.dropped = !1), "invalid" === this.options.revert && !i || "valid" === this.options.revert && i || this.options.revert === !0 || e.isfunction(this.options.revert) && this.options.revert.call(this.element, i) ? e(this.helper).animate(this.originalposition, parseint(this.options.revertduration, 10), function() { s._trigger("stop", t) !== !1 && s._clear() }) : this._trigger("stop", t) !== !1 && this._clear(), !1 }, _mouseup: function(t) { return this._unblockframes(), e.ui.ddmanager && e.ui.ddmanager.dragstop(this, t), this.handleelement.is(t.target) && this.element.trigger("focus"), e.ui.mouse.prototype._mouseup.call(this, t) }, cancel: function() { return this.helper.is(".ui-draggable-dragging") ? this._mouseup(new e.event("mouseup",{ target: this.element[0] })) : this._clear(), this }, _gethandle: function(t) { return !this.options.handle || !!e(t.target).closest(this.element.find(this.options.handle)).length }, _sethandleclassname: function() { this.handleelement = this.options.handle ? this.element.find(this.options.handle) : this.element, this._addclass(this.handleelement, "ui-draggable-handle") }, _removehandleclassname: function() { this._removeclass(this.handleelement, "ui-draggable-handle") }, _createhelper: function(t) { var s = this.options , i = e.isfunction(s.helper) , n = i ? e(s.helper.apply(this.element[0], [t])) : "clone" === s.helper ? this.element.clone().removeattr("id") : this.element; return n.parents("body").length || n.appendto("parent" === s.appendto ? this.element[0].parentnode : s.appendto), i && n[0] === this.element[0] && this._setpositionrelative(), n[0] === this.element[0] || /(fixed|absolute)/.test(n.css("position")) || n.css("position", "absolute"), n }, _setpositionrelative: function() { /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative") }, _adjustoffsetfromhelper: function(t) { "string" == typeof t && (t = t.split(" ")), e.isarray(t) && (t = { left: +t[0], top: +t[1] || 0 }), "left"in t && (this.offset.click.left = t.left + this.margins.left), "right"in t && (this.offset.click.left = this.helperproportions.width - t.right + this.margins.left), "top"in t && (this.offset.click.top = t.top + this.margins.top), "bottom"in t && (this.offset.click.top = this.helperproportions.height - t.bottom + this.margins.top) }, _isrootnode: function(e) { return /(html|body)/i.test(e.tagname) || e === this.document[0] }, _getparentoffset: function() { var t = this.offsetparent.offset() , s = this.document[0]; return "absolute" === this.cssposition && this.scrollparent[0] !== s && e.contains(this.scrollparent[0], this.offsetparent[0]) && (t.left += this.scrollparent.scrollleft(), t.top += this.scrollparent.scrolltop()), this._isrootnode(this.offsetparent[0]) && (t = { top: 0, left: 0 }), { top: t.top + (parseint(this.offsetparent.css("bordertopwidth"), 10) || 0), left: t.left + (parseint(this.offsetparent.css("borderleftwidth"), 10) || 0) } }, _getrelativeoffset: function() { if ("relative" !== this.cssposition) return { top: 0, left: 0 }; var e = this.element.position() , t = this._isrootnode(this.scrollparent[0]); return { top: e.top - (parseint(this.helper.css("top"), 10) || 0) + (t ? 0 : this.scrollparent.scrolltop()), left: e.left - (parseint(this.helper.css("left"), 10) || 0) + (t ? 0 : this.scrollparent.scrollleft()) } }, _cachemargins: function() { this.margins = { left: parseint(this.element.css("marginleft"), 10) || 0, top: parseint(this.element.css("margintop"), 10) || 0, right: parseint(this.element.css("marginright"), 10) || 0, bottom: parseint(this.element.css("marginbottom"), 10) || 0 } }, _cachehelperproportions: function() { this.helperproportions = { width: this.helper.outerwidth(), height: this.helper.outerheight() } }, _setcontainment: function() { var t, s, i, n = this.options, a = this.document[0]; return this.relativecontainer = null, n.containment ? "window" === n.containment ? void (this.containment = [e(window).scrollleft() - this.offset.relative.left - this.offset.parent.left, e(window).scrolltop() - this.offset.relative.top - this.offset.parent.top, e(window).scrollleft() + e(window).width() - this.helperproportions.width - this.margins.left, e(window).scrolltop() + (e(window).height() || a.body.parentnode.scrollheight) - this.helperproportions.height - this.margins.top]) : "document" === n.containment ? void (this.containment = [0, 0, e(a).width() - this.helperproportions.width - this.margins.left, (e(a).height() || a.body.parentnode.scrollheight) - this.helperproportions.height - this.margins.top]) : n.containment.constructor === array ? void (this.containment = n.containment) : ("parent" === n.containment && (n.containment = this.helper[0].parentnode), s = e(n.containment), i = s[0], void (i && (t = /(scroll|auto)/.test(s.css("overflow")), this.containment = [(parseint(s.css("borderleftwidth"), 10) || 0) + (parseint(s.css("paddingleft"), 10) || 0), (parseint(s.css("bordertopwidth"), 10) || 0) + (parseint(s.css("paddingtop"), 10) || 0), (t ? math.max(i.scrollwidth, i.offsetwidth) : i.offsetwidth) - (parseint(s.css("borderrightwidth"), 10) || 0) - (parseint(s.css("paddingright"), 10) || 0) - this.helperproportions.width - this.margins.left - this.margins.right, (t ? math.max(i.scrollheight, i.offsetheight) : i.offsetheight) - (parseint(s.css("borderbottomwidth"), 10) || 0) - (parseint(s.css("paddingbottom"), 10) || 0) - this.helperproportions.height - this.margins.top - this.margins.bottom], this.relativecontainer = s))) : void (this.containment = null) }, _convertpositionto: function(e, t) { t || (t = this.position); var s = "absolute" === e ? 1 : -1 , i = this._isrootnode(this.scrollparent[0]); return { top: t.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssposition ? -this.offset.scroll.top : i ? 0 : this.offset.scroll.top) * s, left: t.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssposition ? -this.offset.scroll.left : i ? 0 : this.offset.scroll.left) * s } }, _generateposition: function(e, t) { var s, i, n, a, o = this.options, r = this._isrootnode(this.scrollparent[0]), l = e.pagex, h = e.pagey; return r && this.offset.scroll || (this.offset.scroll = { top: this.scrollparent.scrolltop(), left: this.scrollparent.scrollleft() }), t && (this.containment && (this.relativecontainer ? (i = this.relativecontainer.offset(), s = [this.containment[0] + i.left, this.containment[1] + i.top, this.containment[2] + i.left, this.containment[3] + i.top]) : s = this.containment, e.pagex - this.offset.click.left < s[0] && (l = s[0] + this.offset.click.left), e.pagey - this.offset.click.top < s[1] && (h = s[1] + this.offset.click.top), e.pagex - this.offset.click.left > s[2] && (l = s[2] + this.offset.click.left), e.pagey - this.offset.click.top > s[3] && (h = s[3] + this.offset.click.top)), o.grid && (n = o.grid[1] ? this.originalpagey + math.round((h - this.originalpagey) / o.grid[1]) * o.grid[1] : this.originalpagey, h = s ? n - this.offset.click.top >= s[1] || n - this.offset.click.top > s[3] ? n : n - this.offset.click.top >= s[1] ? n - o.grid[1] : n + o.grid[1] : n, a = o.grid[0] ? this.originalpagex + math.round((l - this.originalpagex) / o.grid[0]) * o.grid[0] : this.originalpagex, l = s ? a - this.offset.click.left >= s[0] || a - this.offset.click.left > s[2] ? a : a - this.offset.click.left >= s[0] ? a - o.grid[0] : a + o.grid[0] : a), "y" === o.axis && (l = this.originalpagex), "x" === o.axis && (h = this.originalpagey)), { top: h - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssposition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top), left: l - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssposition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left) } }, _clear: function() { this._removeclass(this.helper, "ui-draggable-dragging"), this.helper[0] === this.element[0] || this.cancelhelperremoval || this.helper.remove(), this.helper = null, this.cancelhelperremoval = !1, this.destroyonclear && this.destroy() }, _trigger: function(t, s, i) { return i = i || this._uihash(), e.ui.plugin.call(this, t, [s, i, this], !0), /^(drag|start|stop)/.test(t) && (this.positionabs = this._convertpositionto("absolute"), i.offset = this.positionabs), e.widget.prototype._trigger.call(this, t, s, i) }, plugins: {}, _uihash: function() { return { helper: this.helper, position: this.position, originalposition: this.originalposition, offset: this.positionabs } } }), e.ui.plugin.add("draggable", "connecttosortable", { start: function(t, s, i) { var n = e.extend({}, s, { item: i.element }); i.sortables = [], e(i.options.connecttosortable).each(function() { var s = e(this).sortable("instance"); s && !s.options.disabled && (i.sortables.push(s), s.refreshpositions(), s._trigger("activate", t, n)) }) }, stop: function(t, s, i) { var n = e.extend({}, s, { item: i.element }); i.cancelhelperremoval = !1, e.each(i.sortables, function() { var e = this; e.isover ? (e.isover = 0, i.cancelhelperremoval = !0, e.cancelhelperremoval = !1, e._storedcss = { position: e.placeholder.css("position"), top: e.placeholder.css("top"), left: e.placeholder.css("left") }, e._mousestop(t), e.options.helper = e.options._helper) : (e.cancelhelperremoval = !0, e._trigger("deactivate", t, n)) }) }, drag: function(t, s, i) { e.each(i.sortables, function() { var n = !1 , a = this; a.positionabs = i.positionabs, a.helperproportions = i.helperproportions, a.offset.click = i.offset.click, a._intersectswith(a.containercache) && (n = !0, e.each(i.sortables, function() { return this.positionabs = i.positionabs, this.helperproportions = i.helperproportions, this.offset.click = i.offset.click, this !== a && this._intersectswith(this.containercache) && e.contains(a.element[0], this.element[0]) && (n = !1), n })), n ? (a.isover || (a.isover = 1, i._parent = s.helper.parent(), a.currentitem = s.helper.appendto(a.element).data("ui-sortable-item", !0), a.options._helper = a.options.helper, a.options.helper = function() { return s.helper[0] } , t.target = a.currentitem[0], a._mousecapture(t, !0), a._mousestart(t, !0, !0), a.offset.click.top = i.offset.click.top, a.offset.click.left = i.offset.click.left, a.offset.parent.left -= i.offset.parent.left - a.offset.parent.left, a.offset.parent.top -= i.offset.parent.top - a.offset.parent.top, i._trigger("tosortable", t), i.dropped = a.element, e.each(i.sortables, function() { this.refreshpositions() }), i.currentitem = i.element, a.fromoutside = i), a.currentitem && (a._mousedrag(t), s.position = a.position)) : a.isover && (a.isover = 0, a.cancelhelperremoval = !0, a.options._revert = a.options.revert, a.options.revert = !1, a._trigger("out", t, a._uihash(a)), a._mousestop(t, !0), a.options.revert = a.options._revert, a.options.helper = a.options._helper, a.placeholder && a.placeholder.remove(), s.helper.appendto(i._parent), i._refreshoffsets(t), s.position = i._generateposition(t, !0), i._trigger("fromsortable", t), i.dropped = !1, e.each(i.sortables, function() { this.refreshpositions() })) }) } }), e.ui.plugin.add("draggable", "cursor", { start: function(t, s, i) { var n = e("body") , a = i.options; n.css("cursor") && (a._cursor = n.css("cursor")), n.css("cursor", a.cursor) }, stop: function(t, s, i) { var n = i.options; n._cursor && e("body").css("cursor", n._cursor) } }), e.ui.plugin.add("draggable", "opacity", { start: function(t, s, i) { var n = e(s.helper) , a = i.options; n.css("opacity") && (a._opacity = n.css("opacity")), n.css("opacity", a.opacity) }, stop: function(t, s, i) { var n = i.options; n._opacity && e(s.helper).css("opacity", n._opacity) } }), e.ui.plugin.add("draggable", "scroll", { start: function(e, t, s) { s.scrollparentnothidden || (s.scrollparentnothidden = s.helper.scrollparent(!1)), s.scrollparentnothidden[0] !== s.document[0] && "html" !== s.scrollparentnothidden[0].tagname && (s.overflowoffset = s.scrollparentnothidden.offset()) }, drag: function(t, s, i) { var n = i.options , a = !1 , o = i.scrollparentnothidden[0] , r = i.document[0]; o !== r && "html" !== o.tagname ? (n.axis && "x" === n.axis || (i.overflowoffset.top + o.offsetheight - t.pagey < n.scrollsensitivity ? o.scrolltop = a = o.scrolltop + n.scrollspeed : t.pagey - i.overflowoffset.top < n.scrollsensitivity && (o.scrolltop = a = o.scrolltop - n.scrollspeed)), n.axis && "y" === n.axis || (i.overflowoffset.left + o.offsetwidth - t.pagex < n.scrollsensitivity ? o.scrollleft = a = o.scrollleft + n.scrollspeed : t.pagex - i.overflowoffset.left < n.scrollsensitivity && (o.scrollleft = a = o.scrollleft - n.scrollspeed))) : (n.axis && "x" === n.axis || (t.pagey - e(r).scrolltop() < n.scrollsensitivity ? a = e(r).scrolltop(e(r).scrolltop() - n.scrollspeed) : e(window).height() - (t.pagey - e(r).scrolltop()) < n.scrollsensitivity && (a = e(r).scrolltop(e(r).scrolltop() + n.scrollspeed))), n.axis && "y" === n.axis || (t.pagex - e(r).scrollleft() < n.scrollsensitivity ? a = e(r).scrollleft(e(r).scrollleft() - n.scrollspeed) : e(window).width() - (t.pagex - e(r).scrollleft()) < n.scrollsensitivity && (a = e(r).scrollleft(e(r).scrollleft() + n.scrollspeed)))), a !== !1 && e.ui.ddmanager && !n.dropbehaviour && e.ui.ddmanager.prepareoffsets(i, t) } }), e.ui.plugin.add("draggable", "snap", { start: function(t, s, i) { var n = i.options; i.snapelements = [], e(n.snap.constructor !== string ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function() { var t = e(this) , s = t.offset(); this !== i.element[0] && i.snapelements.push({ item: this, width: t.outerwidth(), height: t.outerheight(), top: s.top, left: s.left }) }) }, drag: function(t, s, i) { var n, a, o, r, l, h, c, d, u, p, m = i.options, f = m.snaptolerance, g = s.offset.left, v = g + i.helperproportions.width, b = s.offset.top, y = b + i.helperproportions.height; for (u = i.snapelements.length - 1; u >= 0; u--) l = i.snapelements[u].left - i.margins.left, h = l + i.snapelements[u].width, c = i.snapelements[u].top - i.margins.top, d = c + i.snapelements[u].height, v < l - f || g > h + f || y < c - f || b > d + f || !e.contains(i.snapelements[u].item.ownerdocument, i.snapelements[u].item) ? (i.snapelements[u].snapping && i.options.snap.release && i.options.snap.release.call(i.element, t, e.extend(i._uihash(), { snapitem: i.snapelements[u].item })), i.snapelements[u].snapping = !1) : ("inner" !== m.snapmode && (n = math.abs(c - y) <= f, a = math.abs(d - b) <= f, o = math.abs(l - v) <= f, r = math.abs(h - g) <= f, n && (s.position.top = i._convertpositionto("relative", { top: c - i.helperproportions.height, left: 0 }).top), a && (s.position.top = i._convertpositionto("relative", { top: d, left: 0 }).top), o && (s.position.left = i._convertpositionto("relative", { top: 0, left: l - i.helperproportions.width }).left), r && (s.position.left = i._convertpositionto("relative", { top: 0, left: h }).left)), p = n || a || o || r, "outer" !== m.snapmode && (n = math.abs(c - b) <= f, a = math.abs(d - y) <= f, o = math.abs(l - g) <= f, r = math.abs(h - v) <= f, n && (s.position.top = i._convertpositionto("relative", { top: c, left: 0 }).top), a && (s.position.top = i._convertpositionto("relative", { top: d - i.helperproportions.height, left: 0 }).top), o && (s.position.left = i._convertpositionto("relative", { top: 0, left: l }).left), r && (s.position.left = i._convertpositionto("relative", { top: 0, left: h - i.helperproportions.width }).left)), !i.snapelements[u].snapping && (n || a || o || r || p) && i.options.snap.snap && i.options.snap.snap.call(i.element, t, e.extend(i._uihash(), { snapitem: i.snapelements[u].item })), i.snapelements[u].snapping = n || a || o || r || p) } }), e.ui.plugin.add("draggable", "stack", { start: function(t, s, i) { var n, a = i.options, o = e.makearray(e(a.stack)).sort(function(t, s) { return (parseint(e(t).css("zindex"), 10) || 0) - (parseint(e(s).css("zindex"), 10) || 0) }); o.length && (n = parseint(e(o[0]).css("zindex"), 10) || 0, e(o).each(function(t) { e(this).css("zindex", n + t) }), this.css("zindex", n + o.length)) } }), e.ui.plugin.add("draggable", "zindex", { start: function(t, s, i) { var n = e(s.helper) , a = i.options; n.css("zindex") && (a._zindex = n.css("zindex")), n.css("zindex", a.zindex) }, stop: function(t, s, i) { var n = i.options; n._zindex && e(s.helper).css("zindex", n._zindex) } }); e.ui.draggable; e.widget("ui.droppable", { version: "1.12.1", widgeteventprefix: "drop", options: { accept: "*", addclasses: !0, greedy: !1, scope: "default", tolerance: "intersect", activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function() { var t, s = this.options, i = s.accept; this.isover = !1, this.isout = !0, this.accept = e.isfunction(i) ? i : function(e) { return e.is(i) } , this.proportions = function() { return arguments.length ? void (t = arguments[0]) : t ? t : t = { width: this.element[0].offsetwidth, height: this.element[0].offsetheight } } , this._addtomanager(s.scope), s.addclasses && this._addclass("ui-droppable") }, _addtomanager: function(t) { e.ui.ddmanager.droppables[t] = e.ui.ddmanager.droppables[t] || [], e.ui.ddmanager.droppables[t].push(this) }, _splice: function(e) { for (var t = 0; t < e.length; t++) e[t] === this && e.splice(t, 1) }, _destroy: function() { var t = e.ui.ddmanager.droppables[this.options.scope]; this._splice(t) }, _setoption: function(t, s) { if ("accept" === t) this.accept = e.isfunction(s) ? s : function(e) { return e.is(s) } ; else if ("scope" === t) { var i = e.ui.ddmanager.droppables[this.options.scope]; this._splice(i), this._addtomanager(s) } this._super(t, s) }, _activate: function(t) { var s = e.ui.ddmanager.current; this._addactiveclass(), s && this._trigger("activate", t, this.ui(s)) }, _deactivate: function(t) { var s = e.ui.ddmanager.current; this._removeactiveclass(), s && this._trigger("deactivate", t, this.ui(s)) }, _over: function(t) { var s = e.ui.ddmanager.current; s && (s.currentitem || s.element)[0] !== this.element[0] && this.accept.call(this.element[0], s.currentitem || s.element) && (this._addhoverclass(), this._trigger("over", t, this.ui(s))) }, _out: function(t) { var s = e.ui.ddmanager.current; s && (s.currentitem || s.element)[0] !== this.element[0] && this.accept.call(this.element[0], s.currentitem || s.element) && (this._removehoverclass(), this._trigger("out", t, this.ui(s))) }, _drop: function(t, s) { var i = s || e.ui.ddmanager.current , a = !1; return !(!i || (i.currentitem || i.element)[0] === this.element[0]) && (this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() { var s = e(this).droppable("instance"); if (s.options.greedy && !s.options.disabled && s.options.scope === i.options.scope && s.accept.call(s.element[0], i.currentitem || i.element) && n(i, e.extend(s, { offset: s.element.offset() }), s.options.tolerance, t)) return a = !0, !1 }), !a && (!!this.accept.call(this.element[0], i.currentitem || i.element) && (this._removeactiveclass(), this._removehoverclass(), this._trigger("drop", t, this.ui(i)), this.element))) }, ui: function(e) { return { draggable: e.currentitem || e.element, helper: e.helper, position: e.position, offset: e.positionabs } }, _addhoverclass: function() { this._addclass("ui-droppable-hover") }, _removehoverclass: function() { this._removeclass("ui-droppable-hover") }, _addactiveclass: function() { this._addclass("ui-droppable-active") }, _removeactiveclass: function() { this._removeclass("ui-droppable-active") } }); var n = e.ui.intersect = function() { function e(e, t, s) { return e >= t && e < t + s } return function(t, s, i, n) { if (!s.offset) return !1; var a = (t.positionabs || t.position.absolute).left + t.margins.left , o = (t.positionabs || t.position.absolute).top + t.margins.top , r = a + t.helperproportions.width , l = o + t.helperproportions.height , h = s.offset.left , c = s.offset.top , d = h + s.proportions().width , u = c + s.proportions().height; switch (i) { case "fit": return h <= a && r <= d && c <= o && l <= u; case "intersect": return h < a + t.helperproportions.width / 2 && r - t.helperproportions.width / 2 < d && c < o + t.helperproportions.height / 2 && l - t.helperproportions.height / 2 < u; case "pointer": return e(n.pagey, c, s.proportions().height) && e(n.pagex, h, s.proportions().width); case "touch": return (o >= c && o <= u || l >= c && l <= u || o < c && l > u) && (a >= h && a <= d || r >= h && r <= d || a < h && r > d); default: return !1 } } }(); e.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareoffsets: function(t, s) { var i, n, a = e.ui.ddmanager.droppables[t.options.scope] || [], o = s ? s.type : null, r = (t.currentitem || t.element).find(":data(ui-droppable)").addback(); e: for (i = 0; i < a.length; i++) if (!(a[i].options.disabled || t && !a[i].accept.call(a[i].element[0], t.currentitem || t.element))) { for (n = 0; n < r.length; n++) if (r[n] === a[i].element[0]) { a[i].proportions().height = 0; continue e } a[i].visible = "none" !== a[i].element.css("display"), a[i].visible && ("mousedown" === o && a[i]._activate.call(a[i], s), a[i].offset = a[i].element.offset(), a[i].proportions({ width: a[i].element[0].offsetwidth, height: a[i].element[0].offsetheight })) } }, drop: function(t, s) { var i = !1; return e.each((e.ui.ddmanager.droppables[t.options.scope] || []).slice(), function() { this.options && (!this.options.disabled && this.visible && n(t, this, this.options.tolerance, s) && (i = this._drop.call(this, s) || i), !this.options.disabled && this.visible && this.accept.call(this.element[0], t.currentitem || t.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, s))) }), i }, dragstart: function(t, s) { t.element.parentsuntil("body").on("scroll.droppable", function() { t.options.refreshpositions || e.ui.ddmanager.prepareoffsets(t, s) }) }, drag: function(t, s) { t.options.refreshpositions && e.ui.ddmanager.prepareoffsets(t, s), e.each(e.ui.ddmanager.droppables[t.options.scope] || [], function() { if (!this.options.disabled && !this.greedychild && this.visible) { var i, a, o, r = n(t, this, this.options.tolerance, s), l = !r && this.isover ? "isout" : r && !this.isover ? "isover" : null; l && (this.options.greedy && (a = this.options.scope, o = this.element.parents(":data(ui-droppable)").filter(function() { return e(this).droppable("instance").options.scope === a }), o.length && (i = e(o[0]).droppable("instance"), i.greedychild = "isover" === l)), i && "isover" === l && (i.isover = !1, i.isout = !0, i._out.call(i, s)), this[l] = !0, this["isout" === l ? "isover" : "isout"] = !1, this["isover" === l ? "_over" : "_out"].call(this, s), i && "isout" === l && (i.isout = !1, i.isover = !0, i._over.call(i, s))) } }) }, dragstop: function(t, s) { t.element.parentsuntil("body").off("scroll.droppable"), t.options.refreshpositions || e.ui.ddmanager.prepareoffsets(t, s) } }, e.uibackcompat !== !1 && e.widget("ui.droppable", e.ui.droppable, { options: { hoverclass: !1, activeclass: !1 }, _addactiveclass: function() { this._super(), this.options.activeclass && this.element.addclass(this.options.activeclass) }, _removeactiveclass: function() { this._super(), this.options.activeclass && this.element.removeclass(this.options.activeclass) }, _addhoverclass: function() { this._super(), this.options.hoverclass && this.element.addclass(this.options.hoverclass) }, _removehoverclass: function() { this._super(), this.options.hoverclass && this.element.removeclass(this.options.hoverclass) } }); e.ui.droppable, e.widget("ui.sortable", e.ui.mouse, { version: "1.12.1", widgeteventprefix: "sort", ready: !1, options: { appendto: "parent", axis: !1, connectwith: !1, containment: !1, cursor: "auto", cursorat: !1, droponempty: !0, forceplaceholdersize: !1, forcehelpersize: !1, grid: !1, handle: !1, helper: "original", items: "> *", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollsensitivity: 20, scrollspeed: 20, scope: "default", tolerance: "intersect", zindex: 1e3, activate: null, beforestop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _isoveraxis: function(e, t, s) { return e >= t && e < t + s }, _isfloating: function(e) { return /left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display")) }, _create: function() { this.containercache = {}, this._addclass("ui-sortable"), this.refresh(), this.offset = this.element.offset(), this._mouseinit(), this._sethandleclassname(), this.ready = !0 }, _setoption: function(e, t) { this._super(e, t), "handle" === e && this._sethandleclassname() }, _sethandleclassname: function() { var t = this; this._removeclass(this.element.find(".ui-sortable-handle"), "ui-sortable-handle"), e.each(this.items, function() { t._addclass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, "ui-sortable-handle") }) }, _destroy: function() { this._mousedestroy(); for (var e = this.items.length - 1; e >= 0; e--) this.items[e].item.removedata(this.widgetname + "-item"); return this }, _mousecapture: function(t, s) { var i = null , n = !1 , a = this; return !this.reverting && (!this.options.disabled && "static" !== this.options.type && (this._refreshitems(t), e(t.target).parents().each(function() { if (e.data(this, a.widgetname + "-item") === a) return i = e(this), !1 }), e.data(t.target, a.widgetname + "-item") === a && (i = e(t.target)), !!i && (!(this.options.handle && !s && (e(this.options.handle, i).find("*").addback().each(function() { this === t.target && (n = !0) }), !n)) && (this.currentitem = i, this._removecurrentsfromitems(), !0)))) }, _mousestart: function(t, s, i) { var n, a, o = this.options; if (this.currentcontainer = this, this.refreshpositions(), this.helper = this._createhelper(t), this._cachehelperproportions(), this._cachemargins(), this.scrollparent = this.helper.scrollparent(), this.offset = this.currentitem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, e.extend(this.offset, { click: { left: t.pagex - this.offset.left, top: t.pagey - this.offset.top }, parent: this._getparentoffset(), relative: this._getrelativeoffset() }), this.helper.css("position", "absolute"), this.cssposition = this.helper.css("position"), this.originalposition = this._generateposition(t), this.originalpagex = t.pagex, this.originalpagey = t.pagey, o.cursorat && this._adjustoffsetfromhelper(o.cursorat), this.domposition = { prev: this.currentitem.prev()[0], parent: this.currentitem.parent()[0] }, this.helper[0] !== this.currentitem[0] && this.currentitem.hide(), this._createplaceholder(), o.containment && this._setcontainment(), o.cursor && "auto" !== o.cursor && (a = this.document.find("body"), this.storedcursor = a.css("cursor"), a.css("cursor", o.cursor), this.storedstylesheet = e("").appendto(a)), o.opacity && (this.helper.css("opacity") && (this._storedopacity = this.helper.css("opacity")), this.helper.css("opacity", o.opacity)), o.zindex && (this.helper.css("zindex") && (this._storedzindex = this.helper.css("zindex")), this.helper.css("zindex", o.zindex)), this.scrollparent[0] !== this.document[0] && "html" !== this.scrollparent[0].tagname && (this.overflowoffset = this.scrollparent.offset()), this._trigger("start", t, this._uihash()), this._preservehelperproportions || this._cachehelperproportions(), !i) for (n = this.containers.length - 1; n >= 0; n--) this.containers[n]._trigger("activate", t, this._uihash(this)); return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !o.dropbehaviour && e.ui.ddmanager.prepareoffsets(this, t), this.dragging = !0, this._addclass(this.helper, "ui-sortable-helper"), this._mousedrag(t), !0 }, _mousedrag: function(t) { var s, i, n, a, o = this.options, r = !1; for (this.position = this._generateposition(t), this.positionabs = this._convertpositionto("absolute"), this.lastpositionabs || (this.lastpositionabs = this.positionabs), this.options.scroll && (this.scrollparent[0] !== this.document[0] && "html" !== this.scrollparent[0].tagname ? (this.overflowoffset.top + this.scrollparent[0].offsetheight - t.pagey < o.scrollsensitivity ? this.scrollparent[0].scrolltop = r = this.scrollparent[0].scrolltop + o.scrollspeed : t.pagey - this.overflowoffset.top < o.scrollsensitivity && (this.scrollparent[0].scrolltop = r = this.scrollparent[0].scrolltop - o.scrollspeed), this.overflowoffset.left + this.scrollparent[0].offsetwidth - t.pagex < o.scrollsensitivity ? this.scrollparent[0].scrollleft = r = this.scrollparent[0].scrollleft + o.scrollspeed : t.pagex - this.overflowoffset.left < o.scrollsensitivity && (this.scrollparent[0].scrollleft = r = this.scrollparent[0].scrollleft - o.scrollspeed)) : (t.pagey - this.document.scrolltop() < o.scrollsensitivity ? r = this.document.scrolltop(this.document.scrolltop() - o.scrollspeed) : this.window.height() - (t.pagey - this.document.scrolltop()) < o.scrollsensitivity && (r = this.document.scrolltop(this.document.scrolltop() + o.scrollspeed)), t.pagex - this.document.scrollleft() < o.scrollsensitivity ? r = this.document.scrollleft(this.document.scrollleft() - o.scrollspeed) : this.window.width() - (t.pagex - this.document.scrollleft()) < o.scrollsensitivity && (r = this.document.scrollleft(this.document.scrollleft() + o.scrollspeed))), r !== !1 && e.ui.ddmanager && !o.dropbehaviour && e.ui.ddmanager.prepareoffsets(this, t)), this.positionabs = this._convertpositionto("absolute"), this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), s = this.items.length - 1; s >= 0; s--) if (i = this.items[s], n = i.item[0], a = this._intersectswithpointer(i), a && i.instance === this.currentcontainer && !(n === this.currentitem[0] || this.placeholder[1 === a ? "next" : "prev"]()[0] === n || e.contains(this.placeholder[0], n) || "semi-dynamic" === this.options.type && e.contains(this.element[0], n))) { if (this.direction = 1 === a ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectswithsides(i)) break; this._rearrange(t, i), this._trigger("change", t, this._uihash()); break } return this._contactcontainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uihash()), this.lastpositionabs = this.positionabs, !1 }, _mousestop: function(t, s) { if (t) { if (e.ui.ddmanager && !this.options.dropbehaviour && e.ui.ddmanager.drop(this, t), this.options.revert) { var i = this , n = this.placeholder.offset() , a = this.options.axis , o = {}; a && "x" !== a || (o.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetparent[0] === this.document[0].body ? 0 : this.offsetparent[0].scrollleft)), a && "y" !== a || (o.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetparent[0] === this.document[0].body ? 0 : this.offsetparent[0].scrolltop)), this.reverting = !0, e(this.helper).animate(o, parseint(this.options.revert, 10) || 500, function() { i._clear(t) }) } else this._clear(t, s); return !1 } }, cancel: function() { if (this.dragging) { this._mouseup(new e.event("mouseup",{ target: null })), "original" === this.options.helper ? (this.currentitem.css(this._storedcss), this._removeclass(this.currentitem, "ui-sortable-helper")) : this.currentitem.show(); for (var t = this.containers.length - 1; t >= 0; t--) this.containers[t]._trigger("deactivate", null, this._uihash(this)), this.containers[t].containercache.over && (this.containers[t]._trigger("out", null, this._uihash(this)), this.containers[t].containercache.over = 0) } return this.placeholder && (this.placeholder[0].parentnode && this.placeholder[0].parentnode.removechild(this.placeholder[0]), "original" !== this.options.helper && this.helper && this.helper[0].parentnode && this.helper.remove(), e.extend(this, { helper: null, dragging: !1, reverting: !1, _nofinalsort: null }), this.domposition.prev ? e(this.domposition.prev).after(this.currentitem) : e(this.domposition.parent).prepend(this.currentitem)), this }, serialize: function(t) { var s = this._getitemsasjquery(t && t.connected) , i = []; return t = t || {}, e(s).each(function() { var s = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/); s && i.push((t.key || s[1] + "[]") + "=" + (t.key && t.expression ? s[1] : s[2])) }), !i.length && t.key && i.push(t.key + "="), i.join("&") }, toarray: function(t) { var s = this._getitemsasjquery(t && t.connected) , i = []; return t = t || {}, s.each(function() { i.push(e(t.item || this).attr(t.attribute || "id") || "") }), i }, _intersectswith: function(e) { var t = this.positionabs.left , s = t + this.helperproportions.width , i = this.positionabs.top , n = i + this.helperproportions.height , a = e.left , o = a + e.width , r = e.top , l = r + e.height , h = this.offset.click.top , c = this.offset.click.left , d = "x" === this.options.axis || i + h > r && i + h < l , u = "y" === this.options.axis || t + c > a && t + c < o , p = d && u; return "pointer" === this.options.tolerance || this.options.forcepointerforcontainers || "pointer" !== this.options.tolerance && this.helperproportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"] ? p : a < t + this.helperproportions.width / 2 && s - this.helperproportions.width / 2 < o && r < i + this.helperproportions.height / 2 && n - this.helperproportions.height / 2 < l }, _intersectswithpointer: function(e) { var t, s, i = "x" === this.options.axis || this._isoveraxis(this.positionabs.top + this.offset.click.top, e.top, e.height), n = "y" === this.options.axis || this._isoveraxis(this.positionabs.left + this.offset.click.left, e.left, e.width), a = i && n; return !!a && (t = this._getdragverticaldirection(), s = this._getdraghorizontaldirection(), this.floating ? "right" === s || "down" === t ? 2 : 1 : t && ("down" === t ? 2 : 1)) }, _intersectswithsides: function(e) { var t = this._isoveraxis(this.positionabs.top + this.offset.click.top, e.top + e.height / 2, e.height) , s = this._isoveraxis(this.positionabs.left + this.offset.click.left, e.left + e.width / 2, e.width) , i = this._getdragverticaldirection() , n = this._getdraghorizontaldirection(); return this.floating && n ? "right" === n && s || "left" === n && !s : i && ("down" === i && t || "up" === i && !t); }, _getdragverticaldirection: function() { var e = this.positionabs.top - this.lastpositionabs.top; return 0 !== e && (e > 0 ? "down" : "up") }, _getdraghorizontaldirection: function() { var e = this.positionabs.left - this.lastpositionabs.left; return 0 !== e && (e > 0 ? "right" : "left") }, refresh: function(e) { return this._refreshitems(e), this._sethandleclassname(), this.refreshpositions(), this }, _connectwith: function() { var e = this.options; return e.connectwith.constructor === string ? [e.connectwith] : e.connectwith }, _getitemsasjquery: function(t) { function s() { r.push(this) } var i, n, a, o, r = [], l = [], h = this._connectwith(); if (h && t) for (i = h.length - 1; i >= 0; i--) for (a = e(h[i], this.document[0]), n = a.length - 1; n >= 0; n--) o = e.data(a[n], this.widgetfullname), o && o !== this && !o.options.disabled && l.push([e.isfunction(o.options.items) ? o.options.items.call(o.element) : e(o.options.items, o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), o]); for (l.push([e.isfunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentitem }) : e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), i = l.length - 1; i >= 0; i--) l[i][0].each(s); return e(r) }, _removecurrentsfromitems: function() { var t = this.currentitem.find(":data(" + this.widgetname + "-item)"); this.items = e.grep(this.items, function(e) { for (var s = 0; s < t.length; s++) if (t[s] === e.item[0]) return !1; return !0 }) }, _refreshitems: function(t) { this.items = [], this.containers = [this]; var s, i, n, a, o, r, l, h, c = this.items, d = [[e.isfunction(this.options.items) ? this.options.items.call(this.element[0], t, { item: this.currentitem }) : e(this.options.items, this.element), this]], u = this._connectwith(); if (u && this.ready) for (s = u.length - 1; s >= 0; s--) for (n = e(u[s], this.document[0]), i = n.length - 1; i >= 0; i--) a = e.data(n[i], this.widgetfullname), a && a !== this && !a.options.disabled && (d.push([e.isfunction(a.options.items) ? a.options.items.call(a.element[0], t, { item: this.currentitem }) : e(a.options.items, a.element), a]), this.containers.push(a)); for (s = d.length - 1; s >= 0; s--) for (o = d[s][1], r = d[s][0], i = 0, h = r.length; i < h; i++) l = e(r[i]), l.data(this.widgetname + "-item", o), c.push({ item: l, instance: o, width: 0, height: 0, left: 0, top: 0 }) }, refreshpositions: function(t) { this.floating = !!this.items.length && ("x" === this.options.axis || this._isfloating(this.items[0].item)), this.offsetparent && this.helper && (this.offset.parent = this._getparentoffset()); var s, i, n, a; for (s = this.items.length - 1; s >= 0; s--) i = this.items[s], i.instance !== this.currentcontainer && this.currentcontainer && i.item[0] !== this.currentitem[0] || (n = this.options.toleranceelement ? e(this.options.toleranceelement, i.item) : i.item, t || (i.width = n.outerwidth(), i.height = n.outerheight()), a = n.offset(), i.left = a.left, i.top = a.top); if (this.options.custom && this.options.custom.refreshcontainers) this.options.custom.refreshcontainers.call(this); else for (s = this.containers.length - 1; s >= 0; s--) a = this.containers[s].element.offset(), this.containers[s].containercache.left = a.left, this.containers[s].containercache.top = a.top, this.containers[s].containercache.width = this.containers[s].element.outerwidth(), this.containers[s].containercache.height = this.containers[s].element.outerheight(); return this }, _createplaceholder: function(t) { t = t || this; var s, i = t.options; i.placeholder && i.placeholder.constructor !== string || (s = i.placeholder, i.placeholder = { element: function() { var i = t.currentitem[0].nodename.tolowercase() , n = e("<" + i + ">", t.document[0]); return t._addclass(n, "ui-sortable-placeholder", s || t.currentitem[0].classname)._removeclass(n, "ui-sortable-helper"), "tbody" === i ? t._createtrplaceholder(t.currentitem.find("tr").eq(0), e("", t.document[0]).appendto(n)) : "tr" === i ? t._createtrplaceholder(t.currentitem, n) : "img" === i && n.attr("src", t.currentitem.attr("src")), s || n.css("visibility", "hidden"), n }, update: function(e, n) { s && !i.forceplaceholdersize || (n.height() || n.height(t.currentitem.innerheight() - parseint(t.currentitem.css("paddingtop") || 0, 10) - parseint(t.currentitem.css("paddingbottom") || 0, 10)), n.width() || n.width(t.currentitem.innerwidth() - parseint(t.currentitem.css("paddingleft") || 0, 10) - parseint(t.currentitem.css("paddingright") || 0, 10))) } }), t.placeholder = e(i.placeholder.element.call(t.element, t.currentitem)), t.currentitem.after(t.placeholder), i.placeholder.update(t, t.placeholder) }, _createtrplaceholder: function(t, s) { var i = this; t.children().each(function() { e(" ", i.document[0]).attr("colspan", e(this).attr("colspan") || 1).appendto(s) }) }, _contactcontainers: function(t) { var s, i, n, a, o, r, l, h, c, d, u = null, p = null; for (s = this.containers.length - 1; s >= 0; s--) if (!e.contains(this.currentitem[0], this.containers[s].element[0])) if (this._intersectswith(this.containers[s].containercache)) { if (u && e.contains(this.containers[s].element[0], u.element[0])) continue; u = this.containers[s], p = s } else this.containers[s].containercache.over && (this.containers[s]._trigger("out", t, this._uihash(this)), this.containers[s].containercache.over = 0); if (u) if (1 === this.containers.length) this.containers[p].containercache.over || (this.containers[p]._trigger("over", t, this._uihash(this)), this.containers[p].containercache.over = 1); else { for (n = 1e4, a = null, c = u.floating || this._isfloating(this.currentitem), o = c ? "left" : "top", r = c ? "width" : "height", d = c ? "pagex" : "pagey", i = this.items.length - 1; i >= 0; i--) e.contains(this.containers[p].element[0], this.items[i].item[0]) && this.items[i].item[0] !== this.currentitem[0] && (l = this.items[i].item.offset()[o], h = !1, t[d] - l > this.items[i][r] / 2 && (h = !0), math.abs(t[d] - l) < n && (n = math.abs(t[d] - l), a = this.items[i], this.direction = h ? "up" : "down")); if (!a && !this.options.droponempty) return; if (this.currentcontainer === this.containers[p]) return void (this.currentcontainer.containercache.over || (this.containers[p]._trigger("over", t, this._uihash()), this.currentcontainer.containercache.over = 1)); a ? this._rearrange(t, a, null, !0) : this._rearrange(t, null, this.containers[p].element, !0), this._trigger("change", t, this._uihash()), this.containers[p]._trigger("change", t, this._uihash(this)), this.currentcontainer = this.containers[p], this.options.placeholder.update(this.currentcontainer, this.placeholder), this.containers[p]._trigger("over", t, this._uihash(this)), this.containers[p].containercache.over = 1 } }, _createhelper: function(t) { var s = this.options , i = e.isfunction(s.helper) ? e(s.helper.apply(this.element[0], [t, this.currentitem])) : "clone" === s.helper ? this.currentitem.clone() : this.currentitem; return i.parents("body").length || e("parent" !== s.appendto ? s.appendto : this.currentitem[0].parentnode)[0].appendchild(i[0]), i[0] === this.currentitem[0] && (this._storedcss = { width: this.currentitem[0].style.width, height: this.currentitem[0].style.height, position: this.currentitem.css("position"), top: this.currentitem.css("top"), left: this.currentitem.css("left") }), i[0].style.width && !s.forcehelpersize || i.width(this.currentitem.width()), i[0].style.height && !s.forcehelpersize || i.height(this.currentitem.height()), i }, _adjustoffsetfromhelper: function(t) { "string" == typeof t && (t = t.split(" ")), e.isarray(t) && (t = { left: +t[0], top: +t[1] || 0 }), "left"in t && (this.offset.click.left = t.left + this.margins.left), "right"in t && (this.offset.click.left = this.helperproportions.width - t.right + this.margins.left), "top"in t && (this.offset.click.top = t.top + this.margins.top), "bottom"in t && (this.offset.click.top = this.helperproportions.height - t.bottom + this.margins.top) }, _getparentoffset: function() { this.offsetparent = this.helper.offsetparent(); var t = this.offsetparent.offset(); return "absolute" === this.cssposition && this.scrollparent[0] !== this.document[0] && e.contains(this.scrollparent[0], this.offsetparent[0]) && (t.left += this.scrollparent.scrollleft(), t.top += this.scrollparent.scrolltop()), (this.offsetparent[0] === this.document[0].body || this.offsetparent[0].tagname && "html" === this.offsetparent[0].tagname.tolowercase() && e.ui.ie) && (t = { top: 0, left: 0 }), { top: t.top + (parseint(this.offsetparent.css("bordertopwidth"), 10) || 0), left: t.left + (parseint(this.offsetparent.css("borderleftwidth"), 10) || 0) } }, _getrelativeoffset: function() { if ("relative" === this.cssposition) { var e = this.currentitem.position(); return { top: e.top - (parseint(this.helper.css("top"), 10) || 0) + this.scrollparent.scrolltop(), left: e.left - (parseint(this.helper.css("left"), 10) || 0) + this.scrollparent.scrollleft() } } return { top: 0, left: 0 } }, _cachemargins: function() { this.margins = { left: parseint(this.currentitem.css("marginleft"), 10) || 0, top: parseint(this.currentitem.css("margintop"), 10) || 0 } }, _cachehelperproportions: function() { this.helperproportions = { width: this.helper.outerwidth(), height: this.helper.outerheight() } }, _setcontainment: function() { var t, s, i, n = this.options; "parent" === n.containment && (n.containment = this.helper[0].parentnode), "document" !== n.containment && "window" !== n.containment || (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, "document" === n.containment ? this.document.width() : this.window.width() - this.helperproportions.width - this.margins.left, ("document" === n.containment ? this.document.height() || document.body.parentnode.scrollheight : this.window.height() || this.document[0].body.parentnode.scrollheight) - this.helperproportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (t = e(n.containment)[0], s = e(n.containment).offset(), i = "hidden" !== e(t).css("overflow"), this.containment = [s.left + (parseint(e(t).css("borderleftwidth"), 10) || 0) + (parseint(e(t).css("paddingleft"), 10) || 0) - this.margins.left, s.top + (parseint(e(t).css("bordertopwidth"), 10) || 0) + (parseint(e(t).css("paddingtop"), 10) || 0) - this.margins.top, s.left + (i ? math.max(t.scrollwidth, t.offsetwidth) : t.offsetwidth) - (parseint(e(t).css("borderleftwidth"), 10) || 0) - (parseint(e(t).css("paddingright"), 10) || 0) - this.helperproportions.width - this.margins.left, s.top + (i ? math.max(t.scrollheight, t.offsetheight) : t.offsetheight) - (parseint(e(t).css("bordertopwidth"), 10) || 0) - (parseint(e(t).css("paddingbottom"), 10) || 0) - this.helperproportions.height - this.margins.top]) }, _convertpositionto: function(t, s) { s || (s = this.position); var i = "absolute" === t ? 1 : -1 , n = "absolute" !== this.cssposition || this.scrollparent[0] !== this.document[0] && e.contains(this.scrollparent[0], this.offsetparent[0]) ? this.scrollparent : this.offsetparent , a = /(html|body)/i.test(n[0].tagname); return { top: s.top + this.offset.relative.top * i + this.offset.parent.top * i - ("fixed" === this.cssposition ? -this.scrollparent.scrolltop() : a ? 0 : n.scrolltop()) * i, left: s.left + this.offset.relative.left * i + this.offset.parent.left * i - ("fixed" === this.cssposition ? -this.scrollparent.scrollleft() : a ? 0 : n.scrollleft()) * i } }, _generateposition: function(t) { var s, i, n = this.options, a = t.pagex, o = t.pagey, r = "absolute" !== this.cssposition || this.scrollparent[0] !== this.document[0] && e.contains(this.scrollparent[0], this.offsetparent[0]) ? this.scrollparent : this.offsetparent, l = /(html|body)/i.test(r[0].tagname); return "relative" !== this.cssposition || this.scrollparent[0] !== this.document[0] && this.scrollparent[0] !== this.offsetparent[0] || (this.offset.relative = this._getrelativeoffset()), this.originalposition && (this.containment && (t.pagex - this.offset.click.left < this.containment[0] && (a = this.containment[0] + this.offset.click.left), t.pagey - this.offset.click.top < this.containment[1] && (o = this.containment[1] + this.offset.click.top), t.pagex - this.offset.click.left > this.containment[2] && (a = this.containment[2] + this.offset.click.left), t.pagey - this.offset.click.top > this.containment[3] && (o = this.containment[3] + this.offset.click.top)), n.grid && (s = this.originalpagey + math.round((o - this.originalpagey) / n.grid[1]) * n.grid[1], o = this.containment ? s - this.offset.click.top >= this.containment[1] && s - this.offset.click.top <= this.containment[3] ? s : s - this.offset.click.top >= this.containment[1] ? s - n.grid[1] : s + n.grid[1] : s, i = this.originalpagex + math.round((a - this.originalpagex) / n.grid[0]) * n.grid[0], a = this.containment ? i - this.offset.click.left >= this.containment[0] && i - this.offset.click.left <= this.containment[2] ? i : i - this.offset.click.left >= this.containment[0] ? i - n.grid[0] : i + n.grid[0] : i)), { top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssposition ? -this.scrollparent.scrolltop() : l ? 0 : r.scrolltop()), left: a - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssposition ? -this.scrollparent.scrollleft() : l ? 0 : r.scrollleft()) } }, _rearrange: function(e, t, s, i) { s ? s[0].appendchild(this.placeholder[0]) : t.item[0].parentnode.insertbefore(this.placeholder[0], "down" === this.direction ? t.item[0] : t.item[0].nextsibling), this.counter = this.counter ? ++this.counter : 1; var n = this.counter; this._delay(function() { n === this.counter && this.refreshpositions(!i) }) }, _clear: function(e, t) { function s(e, t, s) { return function(i) { s._trigger(e, i, t._uihash(t)) } } this.reverting = !1; var i, n = []; if (!this._nofinalsort && this.currentitem.parent().length && this.placeholder.before(this.currentitem), this._nofinalsort = null, this.helper[0] === this.currentitem[0]) { for (i in this._storedcss) "auto" !== this._storedcss[i] && "static" !== this._storedcss[i] || (this._storedcss[i] = ""); this.currentitem.css(this._storedcss), this._removeclass(this.currentitem, "ui-sortable-helper") } else this.currentitem.show(); for (this.fromoutside && !t && n.push(function(e) { this._trigger("receive", e, this._uihash(this.fromoutside)) }), !this.fromoutside && this.domposition.prev === this.currentitem.prev().not(".ui-sortable-helper")[0] && this.domposition.parent === this.currentitem.parent()[0] || t || n.push(function(e) { this._trigger("update", e, this._uihash()) }), this !== this.currentcontainer && (t || (n.push(function(e) { this._trigger("remove", e, this._uihash()) }), n.push(function(e) { return function(t) { e._trigger("receive", t, this._uihash(this)) } } .call(this, this.currentcontainer)), n.push(function(e) { return function(t) { e._trigger("update", t, this._uihash(this)) } } .call(this, this.currentcontainer)))), i = this.containers.length - 1; i >= 0; i--) t || n.push(s("deactivate", this, this.containers[i])), this.containers[i].containercache.over && (n.push(s("out", this, this.containers[i])), this.containers[i].containercache.over = 0); if (this.storedcursor && (this.document.find("body").css("cursor", this.storedcursor), this.storedstylesheet.remove()), this._storedopacity && this.helper.css("opacity", this._storedopacity), this._storedzindex && this.helper.css("zindex", "auto" === this._storedzindex ? "" : this._storedzindex), this.dragging = !1, t || this._trigger("beforestop", e, this._uihash()), this.placeholder[0].parentnode.removechild(this.placeholder[0]), this.cancelhelperremoval || (this.helper[0] !== this.currentitem[0] && this.helper.remove(), this.helper = null), !t) { for (i = 0; i < n.length; i++) n[i].call(this, e); this._trigger("stop", e, this._uihash()) } return this.fromoutside = !1, !this.cancelhelperremoval }, _trigger: function() { e.widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uihash: function(t) { var s = t || this; return { helper: s.helper, placeholder: s.placeholder || e([]), position: s.position, originalposition: s.originalposition, offset: s.positionabs, item: s.currentitem, sender: t ? t.element : null } } }) }), jx()["package"]("s.utilities", function(e) { "use strict"; string.format = function() { if (0 === arguments.length) return null; for (var e = arguments[0], t = 1; t < arguments.length; t++) { var s = new regexp("\\{" + (t - 1) + "\\}","gm"); e = e.replace(s, arguments[t]) } return e } , this.indexofarray = function(e, t, s) { var i = !0; if (array.isarray(e) || (e = [e]), array.isarray(s) || (s = [s]), "object" != typeof t) return e.indexof(t); for (var n = 0; n < e.length; n++) { i = !0; for (var a = 0; a < s.length; a++) t[s[a]] != e[n][s[a]] && (i = !1); if (i) return n } return -1 } , this.removeoneofarray = function(e, t, s) { var i = this.indexofarray(e, t, s); return i >= 0 && e.splice(i, 1), e } , this.addsomeofarray = function(e, t, s, i, n) { if (t = array.isarray(t) ? t : [t], n) { var a = this.indexofarray(e, s, i) , o = t.concat([]); o.unshift(a, 0), array.prototype.splice.apply(e, o) } else e = e.concat(t); return e } , this.modal = function(e) { function t(e) { var t = $.extend(!0, {}, n, e) , i = t.targetelement; if (delete t.targetelement, void 0 === $(i).attr("disabled")) { var a = new s.ui.controls.modal(i,t); return a } } var i = {} , n = { oninitialized: function() { this.show() } }; return i = { open: t, message: function(s) { var i, n, a = s.type, o = s.modalclass, r = function(e) { this.hide() }; switch (a) { case "error": n = { modaltitle: s.modaltitle || "错误信息", buttons: ' " }; break; case "warn": n = { modaltitle: s.modaltitle || "警告信息", buttons: ' ", btnevent: { confirm: { selector: ".confirm", eventname: "click", handler: s.ok || r }, cancel: { selector: ".cancel", eventname: "click", handler: s.cancel || r } } }; break; case "success": n = { modaltitle: s.modaltitle || "成功信息", buttons: ' ", btnevent: { cancel: { selector: ".cancel", eventname: "click", handler: s.cancel || r } } }; break; case "confirm": n = { modaltitle: s.modaltitle || "确认信息", buttons: ' ", btnevent: { confirm: { selector: ".confirm", eventname: "click", handler: s.ok || r }, cancel: { selector: ".cancel", eventname: "click", handler: s.cancel || r } } }; break; default: n = { modaltitle: s.modaltitle || "提示信息", buttons: s.buttons || ' ' } } i = { targetelement: s.targetelement, modalid: "#c-modal-messagebox-" + a, modalcontainer: "#c-modal-messagebox", modalclass: o, content: '", buttons: n.btnevent || {} }, i.buttons.cclose = { selector: ".c-close", eventname: "click", handler: function(e) { this.hide() } }; var n = $.extend(!0, {}, e, i); return t(n) } } } , this.buildapi = function(e, t) { function s(t) { return function() { return e[t].apply(e, arguments) } } var i = {}; for (var n in t) i[n] = s(t[n]); return i } , this.safeapply = function(e, t) { e.$$phase || e.$root.$$phase ? t() : e.$apply(t) } , this.replaceparsedata = function(e) { return this._replaceparsedata(e), e } , this.restoreparsedata = function(e) { return this._restoreparsedata(e), e } , this._replaceparsedata = function(e) { array.isarray(e) || (e = [e]); for (var t = 0; t < e.length; t++) if ("object" != typeof e[t]) e[t] = this.replacestr(e[t]); else for (var s in e[t]) "string" == typeof e[t][s] ? e[t][s] = this.replacestr(e[t][s]) : this._replaceparsedata(e[t][s]) } , this._restoreparsedata = function(e) { array.isarray(e) || (e = [e]); for (var t = 0; t < e.length; t++) if ("object" != typeof e[t]) e[t] = this.restorestr(e[t]); else for (var s in e[t]) "string" == typeof e[t][s] ? e[t][s] = this.restorestr(e[t][s]) : this._restoreparsedata(e[t][s]) } , this.replacestr = function(e) { if ("string" != typeof e) return e; for (var t, s = [{ key: "&", value: "&" }, { key: "'", value: """ }, { key: '"', value: "'" }, { key: "<", value: "<" }, { key: ">", value: ">" }], i = e, n = 0; n < s.length; n++) t = new regexp(s[n].key,"g"), i = i.replace(t, s[n].value); return i } , this.restorestr = function(e) { if ("string" != typeof e) return e; for (var t, s = [{ key: "&", value: "&" }, { key: "'", value: """ }, { key: '"', value: "'" }, { key: "<", value: "<" }, { key: ">", value: ">" }], i = e, n = 0; n < s.length; n++) t = new regexp(s[n].value,"g"), i = i.replace(t, s[n].key); return i } }), jx()["package"]("s.ui", function(e) { "use strict"; this.basecontrol = new e.class({ initsettings: function(e) { var t = this.parseattributes(); this.settings = $.extend(!0, {}, this.defaults, t, e) }, replaceparsedata: function(e) { return s.utilities.replaceparsedata(e) }, restoreparsedata: function(e) { return s.utilities.restoreparsedata(e) }, parseattributes: function() { var e = this , t = {}; return $.each(this.attributemap, function(s, i) { var n = "s-" + i; e.element.is("[data-" + n + "]") && (t[s] = e.element.data(n)) }), t }, destroy: function() {} }) }); var mi18ndata = { "szsewebui.cascadenames": "一级名称,二级名称,三级名称", "szsewebui.cxpand": "展开", "szsewebui.collapse": "收起", "szsewebui.lastmonth": "上一月", "szsewebui.nextmonth": "下一月", "szsewebui.today": "今日", "szsewebui.confirm": "确定", "szsewebui.start": "开始", "szsewebui.end": "结束", "szsewebui.year": "年", "szsewebui.month": "月", "szsewebui.startdate": "开始日期", "szsewebui.enddate": "结束日期", "szsewebui.starttime": "开始时间:", "szsewebui.endtime": "结束时间:", "szsewebui.lastday": "最近1日", "szsewebui.lastyear": "最近1年", "szsewebui.enter": "请输入", "szsewebui.nextyear": "下一年", "szsewebui.all": "全部", "szsewebui.selectsecond": "请选择秒钟", "szsewebui.selecthour": "请选择小时", "szsewebui.selectminute": "请选择分钟", "szsewebui.nofind": "无法匹配到适合的选项!", "szsewebui.querystaff": "调出选人控件查询", "szsewebui.pleaseselect": "请选择", "szsewebui.department": "部门", "szsewebui.selectstaff": "选择人员", "szsewebui.selectall": "全选", "szsewebui.inputkeyword": "请输入关键字", "szsewebui.tobeselected": "待选", "szsewebui.add": "添加", "szsewebui.remove": "移除", "szsewebui.clear": "清除", "szsewebui.selected": "已选", "szsewebui.cancel": "取消", "szsewebui.nextpage": "下一页", "szsewebui.prevpage": "上一页", "szsewebui.jumpto": "跳转到:", "szsewebui.to": "至" }; window.mi18n = window.mi18n || function() { return { locale: function(e) { return mi18ndata[e] } } }(), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { data: [], items: 8, menu: '', item: '
  • ', minlength: 0, scrollheight: 0, autoselect: !0, afterselect: $.noop, additem: !1, delay: 0, map: '{"text":"text","returnvalue":"json"}', onselected: void 0, matcher: void 0, sorter: void 0, template: void 0, nofound: "", nofoundwidth: 150, highlightercustom: void 0, showitemlist: !0, maxitems: 0 } , n = { items: "items", minlength: "min-length", delay: "delay", map: "map", highlightercustom: "highlighter-custom", showitemlist: "show-item-list", maxitems: "max-items" }; this.typeahead = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.map = this.settings.map, this.timeid, "string" == typeof this.settings.map && "" !== this.settings.map && (this.map = json.parse(this.settings.map)), this.matcher = this.settings.matcher || this.matcher, this.sorter = this.settings.sorter || this.sorter, this.template = this.settings.template || this.template, this.mouseover = this.settings.mouseover || this.mouseover, this.mouseout = this.settings.mouseout || this.mouseout, this.select = this.settings.select || this.select, this.autoselect = "boolean" != typeof this.settings.autoselect || this.settings.autoselect, this.highlighter = this.settings.highlighter || this.highlighter, this.render = this.settings.render || this.render, this.updater = this.settings.updater || this.updater, this.displaytext = this.settings.displaytext || this.displaytext, this.nofound = this.settings.nofound && '

    ' + this.settings.nofound + "

    ", this.source = this.settings.source || this.settings.data, this.sourcemap = {}, this.delay = this.settings.delay, this.buildhtml(), this.initelements(), this.bindevents() }, buildhtml: function() { var e = this.element.data("plugin-id") , t = '
    '; this.container = $(t), this.element.before(this.container), this.container.prepend(this.element), this.element.is("input") && this.element.attr("autocomplete", "off") }, initelements: function() { this.elements = { view: this.element, menu: $(".dropdown-menu", this.container) }; var e = this.elements.view.data("plugin-id"); this.elements.view.attr("data-s-dropdown-id", "#c-typeahead-menu-" + e), this.dropdown = new s.ui.controls.dropdown(this.elements.view,{ _pluginid: e }) }, bindevents: function() { this.elements.view.on("click", $.proxy(this.focusclick, this)), this.elements.view.on("focus", $.proxy(this.focusclick, this)), this.elements.view.on("input", $.proxy(this.focusclick, this)), this.elements.menu.on("mouseover", "li", $.proxy(this.proxymouseover, this)), this.elements.menu.on("mouseout", "li", $.proxy(this.proxymouseout, this)), this.elements.menu.on("click", "li", $.proxy(this.click, this)).on("mouseenter", "li", $.proxy(this.mouseenter, this)), this.elements.view.on("keyup", $.proxy(this.keyup, this)), this.elements.view.on("keydown", $.proxy(this.keydown, this)), "function" == typeof this.settings.onselected && this.elements.view.on("onselected", $.proxy(this.settings.onselected, this)), "function" == typeof this.settings.onchanged && this.elements.view.on("onchanged", this.settings.onchanged), this.element.unbind("click.bs.dropdown") }, proxymouseover: function(e) { var t = $(e.currenttarget); t.is("li") && !t.hasclass("disabled") && "function" == typeof this.settings.mouseover && this.settings.mouseover.apply(this, [e, t.data("value")]) }, proxymouseout: function(e) { var t = $(e.currenttarget); t.is("li") && !t.hasclass("disabled") && "function" == typeof this.settings.mouseout && this.settings.mouseout.apply(this, [e, t.data("value")]) }, focusclick: function(e) { var t = this; this.elements.view.prop("disabled") || ("" === $(e.target).val() && this.settings.showitemlist === !1 ? this.elements.menu.html("") : (t.timeid && window.cleartimeout(t.timeid), t.timeid = window.settimeout(function() { t.lookup(), t.setscrolltop() }, 100))) }, setscrolltop: function(e) { var t = this.elements.menu.find("strong").eq(0).parents("li"); if (t.length > 0) { var s = t.position().top - this.elements.menu.find("li:first").position().top; this.elements.menu.scrolltop(s) } }, setsource: function(e) { if (this.source = e, this.sourcemap = {}, e) for (var t = 0; t < e.length; t++) { var s = e[t]; this.sourcemap[this.displaytext(s)] = s } this.elements.view.is(":focus") && this.lookup() }, setvalue: function(e) { "object" == typeof e && (e = this.displaytext(e)), this.elements.view.val(e) }, matcher: function(e) { var t = this.displaytext(e); return t.tolowercase().indexof(this.query.tolowercase()) }, sorter: function(e) { for (var t, s = [], i = [], n = []; t = e.shift(); ) { var a = this.displaytext(t); a.tolowercase().indexof(this.query.tolowercase()) ? a.indexof(this.query) ? i.push(t) : n.push(t) : s.push(t) } return s.concat(i, n) }, template: function(e) { return e }, highlighter: function(e, t) { var s = $("
    ") , i = this.query; if (null === i || "undefined" == typeof i) return s.text(e).html(); var n, a, o, r, l, h = e.tolowercase().indexof(i.tolowercase()); if (n = i.length, 0 === n) return this.template(s.text(e).html(), t); for (; h > -1; ) a = e.substr(0, h), o = e.substr(h, n), r = e.substr(h + n), l = this.settings.highlightercustom ? $(this.settings.highlightercustom).text(o) : $("").text(o), s.append(document.createtextnode(a)).append(l), e = r, h = e.tolowercase().indexof(i.tolowercase()); return this.template(s.append(document.createtextnode(e)).html(), t) }, displaytext: function(e) { if (this.map.hasownproperty("text")) { var t = this.map.text; return e[t] || e } return e }, move: function(e) { if (this.ismenuopen()) { switch (e.keycode) { case 9: case 13: this.select(), this.dropdown.toggle(e); break; case 27: e.preventdefault(); break; case 38: if (e.shiftkey) return; e.preventdefault(), this.prev(); break; case 40: if (e.shiftkey) return; e.preventdefault(), this.next() } e.stoppropagation() } }, next: function(e) { var t = this.elements.menu.find(".active").removeclass("active") , s = t.next(); s.length || (s = $(this.elements.menu.find("li")[0])), s.addclass("active"), this.setscrolltop() }, prev: function(e) { var t = this.elements.menu.find(".active").removeclass("active") , s = t.prev(); s.length || (s = this.elements.menu.find("li").last()), s.addclass("active"), this.setscrolltop() }, keydown: function(e) { switch (e.keycode) { case 38: if (e.shiftkey) return; e.preventdefault(); break; case 40: if (e.shiftkey) return; e.preventdefault(); break; case 13: e.preventdefault() } }, keyup: function(e) { var t = this , s = $.inarray(e.keycode, [40, 38, 9, 13, 27]); s === -1 && t.elements.view.val().length >= t.settings.minlength ? t.lookup() : t.move(e) }, select: function() { if (!this.elements.menu.find(".active").hasclass("disabled")) { var e = this.elements.menu.find(".active").data("value"); this.elements.view.data("active", e), this.elements.view.val(this.displaytext(e)), this.elements.view.trigger("onselected", [this.displaytext(e), e]) } }, lookup: function(e) { "undefined" != typeof e && null !== e ? this.query = e : this.query = this.elements.view.val() || ""; var t = $.proxy(function() { $.isfunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source && this.process(this.source) }, this); this.elements.view.trigger("onchanged", this.query), cleartimeout(this.lookupworker), this.lookupworker = settimeout(t, this.delay) }, process: function(e) { var t = this; return e = $.grep(e, function(e) { return t.matcher(e, t.query) > -1 }), e = this.sorter(e), e && 0 !== e.length ? (this.ismenuopen() || this.container.addclass("open"), e.length > 0 ? this.elements.view.data("active", e[0]) : this.elements.view.data("active", null), "all" === this.settings.items ? this.render(e) : this.render(e.slice(0, this.settings.items))) : void (this.nofound ? this.elements.menu.html(this.nofound) : this.ismenuopen() && this.container.removeclass("open")) }, render: function(e) { var t = this , s = this , i = !1 , n = "
  • "; if (this.elements.menu.html(""), e = $(e).map(function(e, a) { var o = s.displaytext(a); return e = $(n).data("value", a), a.unselectable && e.addclass("disabled"), e.find("a").html(t.highlighter(o, a)), o === s.elements.view.val() && (e.addclass("active"), s.elements.view.data("active", a), i = !0), s.elements.menu.append(e), e[0] }), this.autoselect && !i && (e.first().addclass("active"), this.elements.view.data("active", e.first().data("value"))), this.settings.maxitems && !this.heightsate && e.length > 0) { var a = this.elements.menu.find("li").eq(0).height(); a = a ? a : 30, this.elements.menu.css("maxheight", this.settings.maxitems * a + 10), this.heightsate = !0 } return this.setscrolltop(), this }, returnvalue: function(e) { if (this.map.hasownproperty("returnvalue")) { var t = this.map.returnvalue; return "json" === t ? e : e[t] || e } return e }, getvalue: function(e) { var t = this.sourcemap[e]; return "undefined" == typeof t ? e : this.returnvalue(t) }, destroy: function() { this.elements.view.data("typeahead", null), this.elements.view.data("active", null), this.elements.menu.remove(), this.elements.view.off("focus").off("keyup"), "function" == typeof this.settings.onselected && this.elements.view.off("onselected"), "function" == typeof this.settings.onchanged && this.elements.view.off("onchanged") }, click: function(e) { this.select(), this.dropdown.toggle(e) }, mouseenter: function(e) { this.elements.menu.find(".active").removeclass("active"), $(e.currenttarget).addclass("active") }, ismenuopen: function() { return !!this.container.hasclass("open") }, enable: function() {}, disable: function() {}, getapi: function() { var e = this , t = { setsource: "setsource", getvalue: "getvalue" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "typeahead" , i = s.ui.controls.typeahead; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { mindate: "1900-01-01", maxdate: "2099-12-31", showweeknumbers: !1, weeklabel: "w", format: "yyyy/mm/dd", daysofweek: moment.weekdaysmin(), monthnames: moment.monthsshort(), firstday: 0, showlunar: !1, disableddates: [], onselected: void 0, render: void 0 } , n = { mindate: "min-date", maxdate: "max-date", showweeknumbers: "show-week-numbers", weeklabel: "week-label", firstday: "first-day", daysofweek: "days-of-week", format: "format", showlunar: "show-lunar" }; this.calendar = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.render = this.settings.render || this.render, this.currentcalendar = {}, this.buildhtml(), this.initelements(), this.bindevents(), this.setdate()) }, buildhtml: function() { var e = (this.element.data("plugin-id"), '
    '); if (this.container = $(e), this.element.before(this.container), this.element.hide(), "string" == typeof this.settings.daysofweek && (this.settings.daysofweek = json.parse(this.settings.daysofweek)), "object" == typeof this.settings.daysofweek && (this.settings.daysofweek = this.settings.daysofweek.slice()), "object" == typeof this.settings.monthnames && (this.settings.monthnames = this.settings.monthnames.slice()), "string" == typeof this.settings.mindate && (this.settings.mindate = moment(this.settings.mindate, this.settings.format)), "string" == typeof this.settings.maxdate && (this.settings.maxdate = moment(this.settings.maxdate, this.settings.format)), "object" == typeof this.settings.mindate && (this.settings.mindate = moment(this.settings.mindate)), "object" == typeof this.settings.maxdate && (this.settings.maxdate = moment(this.settings.maxdate)), 0 !== this.settings.firstday) for (var t = this.settings.firstday; t > 0; ) this.settings.daysofweek.push(this.settings.daysofweek.shift()), t-- }, initelements: function() { this.elements = { calendar: this.container, table: $(".calendar-table", this.container), td: $("td.available", this.container) } }, transferattributes: function() { this.element.prop("disabled") && this.disable() }, bindevents: function() { this.container.find(".calendar-table").on("click", "td", $.proxy(this.clickdate, this)), "function" == typeof this.settings.onselected && this.container.on("onselected", this.settings.onselected) }, setmindate: function(e) { "string" == typeof e && (this.settings.mindate = moment(e, this.settings.format)), "object" == typeof e && (this.settings.mindate = moment(e)) }, setmaxdate: function(e) { "string" == typeof e && (this.settings.maxdate = moment(e, this.settings.format)), "object" == typeof e && (this.settings.maxdate = moment(e)) }, rendercalendar: function() { var e = this.settings.disableddates ? array.isarray(this.settings.disableddates) ? this.settings.disableddates : [this.settings.disableddates] : [] , t = this.currentcalendar , s = t.month.month() , i = t.month.year() , n = 0 , a = 0 , o = 0 , r = moment([i, s]).daysinmonth() , l = moment([i, s, 1]) , h = moment([i, s, r]) , c = moment(l).subtract(1, "month").month() , d = moment(l).subtract(1, "month").year() , u = moment([d, c]).daysinmonth() , p = l.day() , t = []; t.firstday = l, t.lastday = h; for (var m = 0; m < 6; m++) t[m] = []; var f = u - p + this.settings.firstday + 1; f > u && (f -= 7), p == this.settings.firstday && (f = u - 6); for (var g, v, b = moment([d, c, f, 12, a, o]), m = 0, g = 0, v = 0; m < 42; m++, g++, b = moment(b).add(24, "hour")) m > 0 && g % 7 === 0 && (g = 0, v++), t[v][g] = b.clone().hour(n).minute(a).second(o), b.hour(12), this.settings.mindate && t[v][g].format("yyyy-mm-dd") == this.settings.mindate.format("yyyy-mm-dd") && t[v][g].isbefore(this.settings.mindate) && (t[v][g] = this.settings.mindate.clone()), this.settings.maxdate && t[v][g].format("yyyy-mm-dd") == this.settings.maxdate.format("yyyy-mm-dd") && t[v][g].isafter(this.settings.maxdate) && (t[v][g] = this.settings.maxdate.clone()); this.currentcalendar.calendar = t; var y = !1; this.settings.mindate && (y = this.settings.mindate.clone()); var k = !1; this.settings.maxdate && (k = this.settings.maxdate.clone()); var w = this.currentcalendar.month.clone() , x = (w.month(), w.year(), this.currentcalendar.selecteddate && this.currentcalendar.selecteddate.clone()) , c = ''; c += "", c += "", this.settings.showweeknumbers && (c += '"); var _ = this; $.each(this.settings.daysofweek, function(e, t) { c += e === (7 - _.settings.firstday) % 7 || e === (6 - _.settings.firstday) % 7 ? '" : "" }), c += "", c += "", c += ""; for (var v = 0; v < 6; v++) { c += "", this.settings.showweeknumbers && (c += '"); for (var g = 0; g < 7; g++) { var d = []; t[v][g].issame(x, "day") && d.push("selected"), t[v][g].issame(new date, "day") && d.push("today"); for (var s = 0; s < e.length; s++) t[v][g].issame(moment(e[s], "yyyy-mm-dd"), "day") && d.push("disable"); t[v][g].isoweekday() > 5 && d.push("weekend"), t[v][g].month() != t[1][1].month() && d.push("off"), this.settings.mindate && t[v][g].isbefore(this.settings.mindate, "day") && d.push("off", "disabled"), k && t[v][g].isafter(k, "day") && d.push("off", "disabled"); var i = this.render(new date(t[v][g])) , n = "" , m = !1 , t = new regexp("disable").test(i); t && d.push("disable"); for (var m = 0; m < d.length; m++) n += d[m] + " ", "disabled" == d[m] && (m = !0); m || (n += "available"), c += '" } c += "" } c += "", c += "
    ' + this.settings.weeklabel + "' + t + "" + t + "
    ' + t[v][0].week() + "
    ' + i + "
    ", this.elements.table.html(c) }, prev: function() { this.currentcalendar.month.subtract(1, "month"), this.rendercalendar() }, next: function() { this.currentcalendar.month.add(1, "month"), this.rendercalendar() }, clickdate: function(e) { var t = $(e.target); if (t.is("td") || (t = t.parents("td")), !t.hasclass("disable") && t.hasclass("available")) { var s = t.attr("data-title") , i = s.substr(1, 1) , n = s.substr(3, 1) , a = this.currentcalendar.calendar[i][n]; this.currentcalendar.month = a.clone(), this.currentcalendar.selecteddate = a.clone(), this.rendercalendar(), this.container.trigger("onselected", a.format(this.settings.format)), this.settings.clickcallback && this.settings.clickcallback() } }, setdate: function(e) { var t; e ? "string" == typeof e ? t = moment(e, this.settings.format) : "object" == typeof e && (t = moment(e)) : t = moment(), this.settings.mindate && t.isbefore(this.settings.mindate) && (t = this.settings.mindate.clone()), this.settings.maxdate && t.isafter(this.settings.maxdate) && (t = this.settings.maxdate.clone()), this.currentcalendar.month = t.clone(), this.currentcalendar.selecteddate = moment(e, this.settings.format), this.rendercalendar() }, setyear: function(e) { this.currentcalendar.month.year(e), this.rendercalendar() }, setmonth: function(e) { this.currentcalendar.month.month(e), this.rendercalendar() }, getdate: function(e) { var e = this.currentcalendar.month.clone(); return e = e.format(this.settings.format) }, getyear: function() { return this.currentcalendar.month.year() }, getmonth: function() { return this.currentcalendar.month.month() + 1 }, render: function(e) { return this.settings.showlunar ? this.lunarrender(e) : e.getdate() }, lunarrender: function(e) { var t = $(this).calendar("fullcalendar", e) , s = "" !== t.solarfestival ? t.solarfestival : "" !== t.lunarfestival ? t.lunarfestival : "" !== t.solarterm ? t.solarterm : t.ldaylabel; return "" + e.getdate() + "" + s + "" }, getshowdate: function() { if (this.currentcalendar.calendar) { var e = this.currentcalendar.calendar[0][0] , t = this.currentcalendar.calendar[5][6]; return e = e.format(this.settings.format), t = t.format(this.settings.format), [e, t] } return null }, refresh: function() {}, destroy: function() {}, getapi: function() { var e = this , t = { prev: "prev", next: "next", setdate: "setdate", setyear: "setyear", setmonth: "setmonth", getdate: "getdate", getyear: "getyear", getmonth: "getmonth", enable: "enable", disable: "disable", getshowdate: "getshowdate" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "calendar" , i = s.ui.controls.calendar; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), function(e) { var t = new array(19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42448,83315,21200,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46496,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19415,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448) , s = new array(31,28,31,30,31,30,31,31,30,31,30,31) , i = (new array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"), new array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至")) , n = new array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758) , a = new array("日","一","二","三","四","五","六","七","八","九","十") , o = new array("初","十","廿","卅") , r = new array("0101 元旦","0214 情人节","0308 妇女节","0312 植树节","0315 三一五","0401 愚人节","0501 劳动节","0504 青年节","0512 护士节","0601 儿童节","0701 建党节","0801 建军节","0910 教师节","1001 国庆节","1006 老人节","1224 平安夜","1225 圣诞节") , l = new array("0101 春节","0115 元宵节","0505 端午节","0707 七夕","0715 中元节","0815 中秋节","0909 重阳节","1208 腊八节","1224 小年") , h = { lyeardays: function(s) { var i, n = 348; for (i = 32768; i > 8; i >>= 1) n += t[s - 1900] & i ? 1 : 0; return n + e(this).calendar("leapdays", s) }, leapdays: function(s) { return e(this).calendar("leapmonth", s) ? 65536 & t[s - 1900] ? 30 : 29 : 0 }, leapmonth: function(e) { return 15 & t[e - 1900] }, monthdays: function(e, s) { return t[e - 1900] & 65536 >> s ? 30 : 29 }, cday: function(e) { var t; switch (e) { case 10: t = "初十"; break; case 20: t = "二十"; break; case 30: t = "三十"; break; default: t = o[math.floor(e / 10)], t += a[e % 10] } return t }, solardays: function(e, t) { return 1 === t ? e % 4 === 0 && e % 100 !== 0 || e % 400 === 0 ? 29 : 28 : s[t] }, sterm: function(e, t) { var s = new date(31556925974.7 * (e - 1900) + 6e4 * n[t] + date.utc(1900, 0, 6, 2, 5)); return s.getutcdate() }, dianaday: function(t) { t = new date(t.getfullyear(),t.getmonth(),t.getdate()); var s, i = {}, n = 0, a = 0, o = new date(1900,0,31), r = (t - o) / 864e5; for (i.daycyl = r + 40, i.moncyl = 14, s = 1900; s < 2050 && r > 0; s++) a = e(this).calendar("lyeardays", s), r -= a, i.moncyl += 12; for (r < 0 && (r += a, s--, i.moncyl -= 12), i.year = s, i.yearcyl = s - 1864, n = e(this).calendar("leapmonth", s), i.isleap = !1, s = 1; s < 13 && r > 0; s++) n > 0 && s === n + 1 && i.isleap === !1 ? (--s, i.isleap = !0, a = e(this).calendar("leapdays", i.year)) : a = e(this).calendar("monthdays", i.year, s), i.isleap === !0 && s === n + 1 && (i.isleap = !1), r -= a, i.isleap === !1 && i.moncyl++; return 0 === r && n > 0 && s === n + 1 && (i.isleap ? i.isleap = !1 : (i.isleap = !0, --s, --i.moncyl)), r < 0 && (r += a, --s, --i.moncyl), i.month = s, i.day = r + 1, o = null, r = null, i }, fullcalendar: function(t) { var s = {} , n = e(this).calendar("dianaday", t); if (s.origin = new date(t.valueof()), s.syear = t.getfullyear(), s.smonth = t.getmonth() + 1, s.sday = t.getdate(), s.week = a[t.getday()], s.lyear = n.year, s.lmonth = n.month, s.lday = n.day, s.isleap = n.isleap, 1 == s.lday) { var o = (s.lmonth > 10 ? "十" : "") + a[(s.lmonth - 1) % 10 + 1]; s.ldaylabel = (s.isleap ? "闰" : "") + o + "月", o = null } else s.ldaylabel = e(this).calendar("cday", s.lday); s.lunarfestival = "", s.solarfestival = ""; for (var h = 0; h < l.length; h++) parseint(l[h].substr(0, 2), 10) == s.lmonth && parseint(l[h].substr(2, 4), 10) == s.lday && (s.lunarfestival = l[h].substr(5)); if (12 == s.lmonth && s.lday >= 29) { var c = e(this).calendar("dianaday", new date(t.getfullyear(),t.getmonth(),t.getdate() + 1)); 1 == c.month && 1 == c.day && (s.lunarfestival = "除夕"), c = null } for (var h = 0; h < r.length; h++) parseint(r[h].substr(0, 2), 10) == s.smonth && parseint(r[h].substr(2, 4), 10) == s.sday && (s.solarfestival = r[h].substr(5)); 5 == s.smonth && "日" == s.week && s.sday >= 8 && s.sday <= 14 && (s.solarfestival = "母亲节"), 6 == s.smonth && "日" == s.week && s.sday >= 15 && s.sday <= 21 && (s.solarfestival = "父亲节"), s.solarterm = ""; var d = new date(s.syear,s.smonth,1).getday(); return tmp1 = e(this).calendar("sterm", s.syear, 2 * s.smonth - 2), tmp2 = e(this).calendar("sterm", s.syear, 2 * s.smonth - 1), s.sday == tmp1 && (s.solarterm = i[2 * s.smonth - 2]), s.sday == tmp2 && (s.solarterm = i[2 * s.smonth - 1]), d = null, n = null, s } }; e.fn.calendar = function(t) { return h[t] ? h[t].apply(this, array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("method with name " + t + " does not exists for jquery.calendar") : h.init.apply(this, arguments) } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { cascadenames: "一级名称,二级名称,三级名称", dataurl: "", map: { text: "name", returnvalue: "id" }, onchanged: void 0 } , n = { cascadenames: "cascade-names", dataurl: "data-url", map: "map" } , a = new e.class({ init: function(e, t, s) { this.inputelements = e, this.settings = t, this.cascades = this.settings.cascadenames.split(","), this.data = s, this.buildhtml(), this.initelements(), this.bindevents(), this.bindeventsinterface(), this.refresh() }, buildhtml: function() { for (var e = "", t = "", s = 0; s < this.cascades.length; s++) { var i = this.cascades[s]; e += '
  • ' + i + '
  • ', t += '
    ' } var n = ''; this.container = $(n), this.container.insertafter(this.inputelements.clear) }, initelements: function() { var e = this; this.elements = { tabs: $(".c-cascade-tabs li", this.container), contents: $(".c-cascade-content", this.container), close: $(".c-cascade-close", this.container), gettab: function(t) { var s = ".c-cascade-tab-" + t; return $(s, e.container) }, getcontent: function(t) { var s = ".c-cascade-" + t; return $(s, e.container) }, getnodes: function(t) { var s = ".c-cascade-" + t + " li"; return $(s, e.container) } } }, grep: function(e, t) { for (var s = 0; s < e.length; s++) if (t === e[s].id) { var i = e[s]; return i } }, _buildnodes: function(e, t) { for (var s = '", this.elements.getcontent(t).empty().append(s) }, bindevents: function() { var e = this , t = this.elements; this.inputelements.view.on("click", $.proxy(this.show, this)), this.inputelements.view.on("blur", $.proxy(this.blur, this)), this.container.on("mouseenter", $.proxy(this.mouseenter, this)).on("mouseleave", $.proxy(this.mouseleave, this)), t.tabs.on("click", function(t) { var s = $(this).data("s-cascade"); e.activecascadeindex = parseint(s), e._activetab(), t.preventdefault() }); for (var s = this.getpath(), i = 0; i <= s.length; i++) this._bindeventsnodes(i); t.close.on("click", function(t) { e.hide() }) }, _bindeventsnodes: function(e) { var t = this , s = this.elements.getnodes(e); s.on("click", function(e) { var s = $(this).data("s-id") , i = $(this).data("s-child"); t.change(s, t.activecascadeindex), t.refresh($(this)); var n = t.getpath(); if (n.length < t.cascades.length) { for (var a = n.length; a < t.cascades.length; a++) t._settab(a, t.cascades[a]); for (var o = n.length + 1; o < t.cascades.length; o++) t.elements.getcontent(o).empty(); "false" !== i && i || t.hide() } else t.hide() }) }, bindeventsinterface: function() {}, refresh: function(e) { var t = this.getpath(); this._refreshinputview(t), this._refreshtabs(t), this._refreshtabcontents(t), e && !$(e).data("s-child") || (this.activecascadeindex = this.getlastesttabindex(t)), this._activetab() }, _refreshtabs: function(e) { for (var t, s = this.data, i = 0; i < e.length; i++) { var n = e[i]; if (t = this.grep(s, n), !t) break; s = t.childs, this._settab(i, t.name) } }, _settab: function(e, t) { var s = this.elements.gettab(e); s.html('' + t + '') }, _activetab: function() { this.elements.tabs.removeclass("active"), this.elements.gettab(this.activecascadeindex).addclass("active"), this.elements.contents.hide(), this.elements.getcontent(this.activecascadeindex).show() }, _refreshtabcontents: function(e) { for (var t, s = this.data, i = this.getlastesttabindex(e), n = 0; n < i + 1; n++) { this._buildnodes(s, n), this._bindeventsnodes(n); var a = e[n]; if (!a) break; if (t = this.grep(s, a), !t) break; s = t.childs } }, _refreshinputview: function(e) { for (var t, s = [], i = this.data, n = this.settings.map.text, a = 0; a < e.length; a++) { var o = e[a]; if (t = this.grep(i, o), !t) break; i = t.childs, s.push(t[n]) } var r = s.join(" / "); this.inputelements.view.val(r), r ? this.inputelements.clear.show() : this.inputelements.clear.hide() }, getpath: function() { var e = this.inputelements.orginal.val() , t = "" === e ? [] : e.split(","); return t }, getlastesttabindex: function(e) { var t = e.length === this.cascades.length ? e.length - 1 : e.length; return t }, change: function(e, t) { for (var s = this.getpath(); s.length > t; ) s.pop(); s.push(e), this.inputelements.orginal.val(s.join(",")), this.inputelements.orginal.trigger("onchanged", s.join(",")) }, blur: function(e) { var t = this; this.mousedover || settimeout(function() { t.hide() }, 200) }, mouseenter: function(e) { this.mousedover = !0 }, mouseleave: function(e) { this.mousedover = !1 }, show: function() { var e = $.extend({}, this.inputelements.view.position(), { height: this.inputelements.view[0].offsetheight }); this.container.css({ top: e.top + e.height, left: e.left }).show() }, hide: function() { this.container.hide() }, destroy: function() { this.inputelements.view.off("click"), this.inputelements.view.off("blur"), this.container.off("mouseenter"), this.container.off("mouseleave"), this.container.remove() }, clear: function() { var e = this.elements.tabs; this.inputelements.view.val(""), this.inputelements.clear.hide(), this.inputelements.orginal.val(""), this.inputelements.orginal.trigger("onchanged", ""); for (var t = 0; t < this.cascades.length; t++) { var s = this.cascades[t]; $(e[t]).children("a").html(s) } $(e[0]).trigger("click") } }); this.cascade = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { if (t += 1, this.element = $(e), this.container, this.elements, this.value = this.element.val(), !this.element.data("initialized")) { this.element.data("initialized", !0), this.element.data("plugin-id", t), this.initsettings(s), this.map = this.settings.map, "string" == typeof this.settings.map && "" !== this.settings.map && (this.map = json.parse(this.settings.map)), this.buildhtml(), this.initelements(), this.transferattributes(); var i = this; this.d = $.deferred(), $.when(this.getdata(this.d)).done(function() { i.getdatamap(i.data), i.render() }), this.bindevents(), this.bindeventsinterface() } }, buildhtml: function() { var e = '
    ×
    '; this.container = $(e), this.element.before(this.container) }, getdata: function(e) { if (this.settings.data) return this.data = $.extend(!0, [], this.settings.data), delete this.settings.data, e.resolve(), e.promise(); var t = this; return $.ajax({ datatype: "json", url: this.settings.dataurl, data: {}, success: function(s) { t.data = s, e.resolve() }, error: function(t, s, i) { e.reject() } }), e.promise() }, updatedate: function(e) { e && (this.menu && this.menu.destroy(), this.data = e, this.getdatamap(this.data), this.menu = new a(this.elements,this.settings,this.data)) }, render: function() { this.menu = new a(this.elements,this.settings,this.data) }, refresh: function() { var e = this; $.when(this.d.promise()).done(function() { e.menu && e.menu.refresh() }).fail(function() { e.menu && e.menu.refresh() }) }, initelements: function() { this.elements = { orginal: this.element, view: $("input[type=text]", this.container), clear: $(".c-cascade-clear", this.container) }, this.elements.orginal.hide(), this.elements.view.prop("readonly", "readonly") }, bindevents: function() { var e = this , t = e.elements; t.clear.on("click", function(t) { e.element.prop("disabled") || e.menu.clear() }), "function" == typeof this.settings.onchanged && t.orginal.on("onchanged", this.settings.onchanged) }, bindeventsinterface: function() {}, transferattributes: function() { this.elements.view.attr("required", this.element.attr("required")), this.elements.view.attr("rel", this.element.attr("rel")), this.elements.view.attr("title", this.element.attr("title")), this.elements.view.attr("class", this.element.attr("class")), this.elements.view.attr("tabindex", this.element.attr("tabindex")), this.elements.orginal.removeattr("tabindex"), this.element.prop("disabled") && this.disable() }, disable: function() { this.element.prop("disabled", !0), this.elements.view.prop("disabled", !0) }, enable: function() { this.element.prop("disabled", !1), this.elements.view.prop("disabled", !1) }, getnode: function(e) { var t = $.extend(!0, {}, e); delete t.childs, this.sourcemap[e.id] = t }, getnodes: function(e) { if (e && 0 !== e.length) for (var t = 0; t < e.length; t++) this.getnode(e[t]), this.getnodes(e[t].childs) }, getdatamap: function(e) { this.sourcemap = {}; var t = [{ childs: e }]; this.getnodes(t) }, getvalue: function() { var e = this.elements.orginal.val(); if ("" === e) return e; var t = this.map.returnvalue; if ("id" === t) return e; if ("json" === t) { for (var s = this.sourcemap, i = e.split(","), n = [], a = 0; a < i.length; a++) n.push(s[i[a]]); return n } }, setvalue: function(e) { if ("undefined" == typeof e || null === e || "" === e) return this.elements.orginal.val(""), this.refresh(), ""; var t = []; if ("object" == typeof e) for (var s = 0; s < e.length; s++) t.push(e[s].id); else for (var i = e.split(","), s = 0; s < i.length; s++) t.push(i[s]); return t = t.join(","), this.elements.orginal.val(t), this.refresh(), t } }) }), function(e) { "use strict"; var t = "cascade" , i = s.ui.controls.cascade; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; function t(e) { var t, s = e.attr("data-s-target") || (t = e.attr("href")) && t.replace(/.*(?=#[^\s]+$)/, ""); return $(s) } var i = 0 , n = { toggle: !0 } , a = {} , o = 350; this.collapse = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, settings: {}, value: "", data: {}, templates: {}, init: function(e, t) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), i += 1, this.element.data("plugin-id", i), this.initsettings(t), this.istrigger = this.element.hasclass("c-collapse-trigger"), this.initelements(), this.bindevents()) }, initelements: function() { if (this.istrigger) { t(this.element) } else this.container = this.element, this.elements = { triggers: $(".c-collapse-trigger", this.container), targets: $(".collapse", this.container) } }, bindevents: function() { this.istrigger ? this.element.on("click", $.proxy(this.ontoggle, this)) : this.elements.triggers.on("click", $.proxy(this.ontoggle, this)) }, bindeventsinterface: function() { this.element }, render: function() {}, dimension: function(e) { var t = e.hasclass("width"); return t ? "width" : "height" }, show: function(e) { if (!this.transitioning && !e.hasclass("in")) { var t = $.event("show.bs.collapse"); if (e.trigger(t), !t.isdefaultprevented()) { if (!this.istrigger) { var s = this; this.elements.targets.each(function() { s.hide($(this)) }) } var i = this.dimension(e); e.removeclass("collapse").addclass("collapsing")[i](0), this.element.removeclass("collapsed"), this.transitioning = 1; var n = function() { e.removeclass("collapsing").addclass("collapse in")[i](""), e.parents(".panel").addclass("open"), this.transitioning = 0, e.trigger("shown.bs.collapse") }; if (!$.support.transition) return n.call(this); var a = $.camelcase(["scroll", i].join("-")); e.one("bstransitionend", $.proxy(n, this)).emulatetransitionend(o)[i](e[0][a]) } } }, hide: function(e) { if (!this.transitioning && e.hasclass("in")) { var t = $.event("hide.bs.collapse"); if (e.trigger(t), !t.isdefaultprevented()) { var s = this.dimension(e); e[s](e[s]())[0].offsetheight, e.addclass("collapsing").removeclass("collapse in"), e.parents(".panel").removeclass("open"), this.element.addclass("collapsed"), this.transitioning = 1; var i = function() { this.transitioning = 0, e.removeclass("collapsing").addclass("collapse").trigger("hidden.bs.collapse") }; return $.support.transition ? void e[s](0).one("bstransitionend", $.proxy(i, this)).emulatetransitionend(o) : i.call(this) } } }, ontoggle: function(e) { e.preventdefault(); var s = $(e.target).hasclass("c-collapse-trigger") ? $(e.target) : $(e.target).parents(".c-collapse-trigger") , i = t(s); this.istrigger ? this.toggle(i) : this.show(i) }, toggle: function(e) { var t = e.hasclass("in") ? "hide" : "show"; this[t](e) }, getparent: function() { return $(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each($.proxy(function(e, s) { var i = $(s); this.addariaandcollapsedclass(t(i), i) }, this)).end() }, addariaandcollapsedclass: function(e, t) { var s = e.hasclass("in"); t.toggleclass("collapsed", !s) }, refresh: function() {}, enable: function() {}, disable: function() {}, destroy: function() {} }) }), function(e) { "use strict"; var t = "collapse" , i = s.ui.controls.collapse; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = {} , n = { nofound: "nofound" }; this.combobox = new e.class({ extend: s.ui.controls.typeahead },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.map = this.settings.map, this.matchall = !1, "string" == typeof this.settings.map && "" !== this.settings.map && (this.map = json.parse(this.settings.map)), this.matcher = this.settings.matcher || this.matcher, this.sorter = this.settings.sorter || this.sorter, this.template = this.settings.template || this.template, this.mouseover = this.settings.mouseover || this.mouseover, this.mouseout = this.settings.mouseout || this.mouseout, this.select = this.settings.select || this.select, this.autoselect = "boolean" != typeof this.settings.autoselect || this.settings.autoselect, this.highlighter = this.settings.highlighter || this.highlighter, this.render = this.settings.render || this.render, this.updater = this.settings.updater || this.updater, this.displaytext = this.settings.displaytext || this.displaytext, this.nofound = this.settings.nofound && '

    ' + this.settings.nofound + "

    ", this.source = this.settings.source || this.settings.data, this.clear = this.settings.clear || function() {} , this.sourcemap = {}, this.delay = this.settings.delay, this.buildhtml(), this.initelements(), this.bindevents() }, initelements: function() { this.elements = { view: this.element, menu: $(".dropdown-menu", this.container), menudwon: $(".glyphicon-menu-down", this.container), menuremove: $(".glyphicon-remove", this.container) }; var e = this.elements.view.data("plugin-id"); this.elements.view.attr("data-s-dropdown-id", "#c-combobox-menu-" + e), this.dropdown = new s.ui.controls.dropdown(this.elements.view,{ _pluginid: e }) }, buildhtml: function() { var e = this.element.data("plugin-id") , t = '
    '; this.container = $(t), this.element.before(this.container), this.container.prepend(this.element), this.element.is("input") && this.element.attr("autocomplete", "off") }, bindevents: function() { this.elements.view.on("click", $.proxy(this.focusclick, this)), this.elements.view.on("focus", $.proxy(this.focusclick, this)), this.elements.view.on("blur", $.proxy(this.blur, this)), this.elements.menudwon.on("click", $.proxy(this.focusclick, this)), this.elements.menuremove.on("click", $.proxy(this.textromove, this)), this.elements.menu.on("mouseover", "li", $.proxy(this.proxymouseover, this)), this.elements.menu.on("mouseout", "li", $.proxy(this.proxymouseout, this)), this.elements.menu.on("click", "li", $.proxy(this.click, this)).on("mouseenter", "li", $.proxy(this.mouseenter, this)), this.elements.view.on("keyup", $.proxy(this.keyup, this)), this.elements.view.on("keydown", $.proxy(this.keydown, this)), "function" == typeof this.settings.onselected && this.elements.view.on("onselected", $.proxy(this.settings.onselected, this)), "function" == typeof this.settings.onchanged && this.elements.view.on("onchanged", this.settings.onchanged), this.element.unbind("click.bs.dropdown") }, matcher: function(e) { var t = this.displaytext(e); return t === this.query && (this.matchall = !0), t.tolowercase().indexof(this.query.tolowercase()) }, lookup: function(e) { "undefined" != typeof e && null !== e ? this.query = e : this.query = this.elements.view.val() || ""; var t = $.proxy(function() { $.isfunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source && this.process(this.source) }, this); this.elements.view.trigger("onchanged", this.query), cleartimeout(this.lookupworker), this.lookupworker = settimeout(t, this.delay), this.query.length > 0 ? this.elements.menuremove.removeclass("hidden") : this.elements.menuremove.addclass("hidden") }, process: function(e) { var t = this , s = e; return e = $.grep(e, function(e) { return t.matcher(e, t.query) > -1 }), this.matchall && (e = [].concat(s)), this.matchall = !1, e = this.sorter(e), e && 0 !== e.length ? (this.ismenuopen() || this.container.addclass("open"), t.nofoundtype = !1, e.length > 0 ? this.elements.view.data("active", e[0]) : this.elements.view.data("active", null), "all" === this.settings.items ? this.render(e) : this.render(e.slice(0, this.settings.items))) : void (this.nofound ? (this.elements.menu.html(this.nofound), this.ismenuopen() || this.container.addclass("open"), t.nofoundtype = !0) : this.ismenuopen() && this.container.removeclass("open")) }, blur: function() { var e = this; this.nofoundtype === !0 && (e.clear(), e.elements.menuremove.addclass("hidden")) }, textromove: function(e) { this.clear(), this.elements.menuremove.addclass("hidden"), this.elements.view.focus() }, select: function() { if (!this.elements.menu.find(".active").hasclass("disabled")) { var e = this.elements.menu.find(".active").data("value"); this.elements.view.data("active", e), this.elements.view.val(this.displaytext(e)), this.matchall = !0, this.nofoundtype = !1, this.elements.menuremove.removeclass("hidden"), this.elements.view.trigger("onselected", [this.displaytext(e), e]) } }, getapi: function() { var e = this , t = { setsource: "setsource", getvalue: "getvalue" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "combobox" , i = s.ui.controls.combobox; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { minheight: 100, collapsed: !0 } , n = { minheight: "min-height", collapsed: "collapsed" }; this.cutpannel = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { if (this.element = $(e), this.container = this.element, !this.element.data("initialized")) { this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.initelements(), this.bindevents(); this.settings.minheight; this.reflash() } }, initelements: function() { this.elements = { original: this.element, content: $(".c-cutpannel-content", this.container), button: $(".c-cutpannel-button", this.container) } }, bindevents: function() { this.elements.button.on("click", $.proxy(this.toggle, this)), this.elements.content.bind("domnodeinserted", $.proxy(this.reflash, this)) }, reflash: function() { parseint(this.elements.content.css("height")) >= this.settings.minheight ? (this.elements.button.show(), this.settings.collapsed === !0 ? (this.elements.button.find(".text").text("展开"), this.elements.content.css("height", this.settings.minheight + "px"), this.elements.button.find(".glyphicon").removeclass("glyphicon-menu-up")) : (this.elements.button.find(".text").text("收起"), this.elements.content.css("height", "auto"), this.elements.button.find(".glyphicon").addclass("glyphicon-menu-up"))) : this.elements.button.hide() }, toggle: function() { this.settings.collapsed = !this.settings.collapsed, this.reflash() } }) }), function(e) { "use strict"; var t = "cutpannel" , i = s.ui.controls.cutpannel; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = "上一月" , i = "下一月" , n = "月" , a = "年" , o = "确定" , r = "今天" , l = function() {} , h = 0 , c = { enlangflag: !1, mindate: "1900-01-01", maxdate: "2099-12-31", timepicker: !1, defaulttime: null, timepickerincrement: 5, showweeknumbers: !1, weeklabel: "w", format: "yyyy-mm-dd", daysofweek: moment.weekdaysmin(), monthnames: moment.monthsshort(), firstday: 0, position: "auto", down: "dropdown", up: "dropup", scroller: !1, datefrom: void 0, change: l, render: void 0, intervalyear: 20, calendarmode: !1, ngmindate: void 0, ngmaxdate: void 0, timeshowpanel: !0 } , d = { enlangflag: "enlangflag", scroller: "scroller", mindate: "min-date", maxdate: "max-date", firstday: "first-day", timepicker: "time-picker", defaulttime: "default-time", timepickerincrement: "time-picker-increment", showweeknumbers: "show-week-numbers", weeklabel: "week-label", daysofweek: "days-of-week", format: "format", position: "position", timeshowpanel: "time-show-panel" }; this.datepicker = new e.class({ extend: s.ui.basecontrol },{ defaults: c, attributemap: d, init: function(e, s) { this.element = $(e), this.initsettings(s), this.settings.enlangflag && (t = "prev month", i = "next month", n = "", a = "", o = "go", r = "today"), this.settings.maxdate = this.settings.ngmaxdate || this.settings.maxdate, this.settings.mindate = this.settings.ngmindate || this.settings.mindate, h += 1, this.currentcalendar = {}, "string" == typeof this.settings.daysofweek && (this.settings.daysofweek = json.parse(this.settings.daysofweek)), "object" == typeof this.settings.daysofweek && (this.settings.daysofweek = this.settings.daysofweek.slice()), "object" == typeof this.settings.monthnames && (this.settings.monthnames = this.settings.monthnames.slice()), "string" == typeof this.settings.mindate && (this.settings.mindate = moment(this.settings.mindate, this.settings.format)), this.settings.mindate && (this.settings.minyear = moment(this.settings.mindate).year()), this.settings.maxdate && (this.settings.maxyear = moment(this.settings.maxdate).year()), "string" == typeof this.settings.maxdate && (this.settings.maxdate = moment(this.settings.maxdate, this.settings.format)), "object" == typeof this.settings.mindate && (this.settings.mindate = moment(this.settings.mindate)), "object" == typeof this.settings.maxdate && (this.settings.maxdate = moment(this.settings.maxdate)), this.element.data("plugin-id", h), this.buildhtml(), this.initelements(), this.transferattributes(), this.bindevents(), this.setdate(new date) }, buildhtml: function() { var e = this.element.data("plugin-id") , s = '
    "; this.container = $(s), this.element.before(this.container), this.container.prepend(this.element), this.element.attr("data-s-dropdown-id", "#c-datepicker-menu-" + e), this.element.is("input") && this.element.attr("autocomplete", "off") }, initelements: function() { this.elements = { view: this.element, datepicker: this.container, menu: $(".dropdown-menu", this.container), icon: $(".glyphicon-calendar", this.container), prev: $(".calendar-control .icon-prev", this.container), next: $(".calendar-control .icon-next", this.container), calendaryear: $(".calendar-year", this.container), showyear: $(".calendar-year .btn-container span", this.container), showyearbtn: $(".calendar-year .btn-container", this.container), calendaryears: $(".calendar-year .calendar-years", this.container), calendarmonth: $(".calendar-month", this.container), showmonth: $(".calendar-month .btn-container span", this.container), showmonthbtn: $(".calendar-month .btn-container", this.container), calendarmonths: $(".calendar-month .calendar-months", this.container), table: $(".calendar-table", this.container), td: $("td.available", this.container), timepickerinput1: $("input.timepicker.t1", this.container), calendarbottom: $(".calendar-bottom", this.container), today: $(".calendar-bottom .today", this.container), confirm: $(".calendar-bottom .confirm", this.container) }, "auto" === this.settings.position ? this.position = this.getposition() : this.position = this.settings.position, this.autoupposition(), this.autorightposition(); var e, t = this.elements.view.data("plugin-id"); if (this.settings.datefrom && !this.settings.render) { var i = new date(this.settings.datefrom).gettime(); e = function(e) { var t, s = e.gettime(); return t = s <= i ? "
    " + e.getdate() + "
    " : e.getdate() } } var n = $.extend(!0, { render: e }, this.settings); if (this.calendar = new s.ui.controls.calendar(this.container.find("input.datepicker"),n), this.settings.timepicker) { this.elements.calendarbottom.addclass("c-time"); var a = this.settings.format.split(" ") , o = { timepickerincrement: this.settings.timepickerincrement, defaulttime: this.settings.defaulttime, timeshowpanel: this.settings.timeshowpanel }; a.length >= 1 && (o.format = a[1], "hh:mm:ss.sss" != o.format && "hh:mm:ss" != o.format || this.elements.calendarbottom.addclass("reflow")), this.timepicker = new s.ui.controls.timepicker(this.elements.timepickerinput1,o) } this.settings.calendarmode ? (this.elements.view.hide(), this.elements.icon.hide().removeattr("data-s-dropdown-id"), this.elements.datepicker.addclass("open"), this.rendercalendar(), this.settings.change.bind(this)) : (this.dropdown = new s.ui.controls.dropdown(this.elements.view,{ _pluginid: t }), this.dropdown1 = new s.ui.controls.dropdown(this.elements.icon,{ _pluginid: t })), this.elements.datepicker.show() }, getposition: function() { var e = this.elements.view.offset() , t = this.elements.view.height() , s = this.elements.menu.width() , i = this.elements.menu.height() , n = $(document).width() , a = $(document).height() , o = "down" , r = "left"; return e.top + t + i > a && (o = "up"), e.left + s > n && (r = "right"), o + "," + r }, autoupposition: function() { var e = this.position.split(",") , t = e[0] , s = e[1] , i = "up" === t ? this.settings.up : ""; this.container.addclass(i), this.settings.isrightposition = !1, "right" === s && (this.settings.isrightposition = !0) }, autorightposition: function() { if (this.settings.isrightposition) { var e = this.elements.view.width(); e += this.elements.icon.width(); var t = this.elements.menu.width() , s = e - t; this.elements.menu.css("margin-left", s) } }, transferattributes: function() { this.element.prop("disabled") && this.disable() }, bindevents: function() { if (this.elements.prev.on("click", $.proxy(this.clickprev, this)), this.elements.next.on("click", $.proxy(this.clicknext, this)), this.elements.datepicker.on("click", function(e) { e.preventdefault(), e.stoppropagation() }), this.elements.showyearbtn.on("click", $.proxy(this.showpanel, this, "year")), this.elements.showmonthbtn.on("click", $.proxy(this.showpanel, this, "month")), this.elements.view.on("focus", $.proxy(this.focusview, this)), this.elements.icon.on("click", $.proxy(function() { this.elements.view.focus() }, this)), this.elements.view.on("keyup", $.proxy(this.updatecalendar, this)), this.elements.view.on("blur", $.proxy(this.confirmcalendar, this)), this.container.find(".calendar-year").on("click", "li", $.proxy(this.yearchanged, this)), this.container.find(".calendar-month").on("click", "li", $.proxy(this.monthchanged, this)), this.elements.view.on("changedate", $.proxy(this.settings.change, this)), this.elements.today.on("click", $.proxy(this.settoday, this)), this.elements.confirm.on("click", $.proxy(this.clickapply, this)), this.settings.scroller) { var e, t = this; this.container.find(".calendar-years").scroll(function(s) { var i = $(s.target) , n = i[0].scrolltop , a = i[0].scrollheight , o = i[0].clientheight; if (n / a === 0) { if (e = i.find("ul"), 1 * e.find("li:first-child").text() <= t.settings.minyear) return; t.loadyear(e, e.find("li:first-child").text(), "up"), i.scrolltop(260) } else if (n + o === a) { if (e = i.find("ul"), 1 * e.find("li:last-child").text() >= t.settings.maxyear) return; t.loadyear(e, e.find("li:last-child").text(), "down") } }) } var s = this; this.calendar.container.on("onselected", function(e, t) { s.currentdate = moment(t, s.settings.format), s.currentcalendar.month = s.currentdate; var i = s.currentcalendar.month.clone(); if (s.settings.timepicker) { var n = $.extend(!0, {}, ["0", "0", "0", "0"], s.timepicker.getvalue().split(":")) , a = n[2].split("."); n[2] = a[0], n[3] = a[1] ? a[1] : "0", i.hour(n[0]).minute(n[1]).second(n[2]).millisecond(n[3]) } else s.settings.calendarmode || (s.dropdown.toggle(e), s.dropdown1.toggle(e)); s.setdate(i), s.setcurrentdate(i), s.showdate(), s.getdate(), s.container.trigger("dateselected", i) }), this.settings.timepicker && this.settings.calendarmode && this.timepicker.elements.view.on("timechange", function(e, t) { var i = s.currentcalendar.month.clone() , n = $.extend(!0, {}, ["0", "0", "0", "0"], s.timepicker.getvalue().split(":")) , a = n[2].split("."); n[2] = a[0], n[3] = a[1] ? a[1] : "0", i.hour(n[0]).minute(n[1]).second(n[2]).millisecond(n[3]), s.setdate(i), s.setcurrentdate(i), s.showdate(), s.getdate(), s.container.trigger("dateselected", i) }) }, setmindate: function(e) { e && (this.settings.minyear = moment(e).year()), "string" == typeof e && (this.settings.mindate = moment(e, this.settings.format)), "object" == typeof e && (this.settings.mindate = moment(e)), this.calendar.setmindate(e) }, setmaxdate: function(e) { e && (this.settings.maxyear = moment(e).year()), "string" == typeof e && (this.settings.maxdate = moment(e, this.settings.format)), "object" == typeof e && (this.settings.maxdate = moment(e)), this.calendar.setmaxdate(e) }, loadyear: function(e, t, s) { for (var i = this.getyeardata(t, s), n = "", a = 0; a < i.length; a++) n += '
  • ' + i[a] + "
  • "; "down" === s ? e.append(n) : e.find("li:first-child").before(n) }, getyeardata: function(e, t) { var s, i, n, a = []; if (s = isnan(e) ? (new date).getfullyear() : e, i = 1 * s - this.settings.intervalyear, n = 1 * s + this.settings.intervalyear, i < this.settings.minyear && (i = this.settings.minyear), n > this.settings.maxyear && (n = this.settings.maxyear), "down" === t) for (var o = 1 * s + 1; o <= n; o++) a.push(o); else for (var o = i; o < s; o++) a.push(o); return a }, setdate: function(e) { if ("string" == typeof e && (this.currentdate = moment(e, this.settings.format)), "object" == typeof e && (this.currentdate = moment(e)), "number" == typeof e && (this.currentdate = moment(e)), this.settings.timepicker || (this.currentdate = this.currentdate.startof("day")), this.settings.mindate && this.currentdate.isbefore(this.settings.mindate) && (this.currentdate = this.settings.mindate.clone()), this.settings.maxdate && this.currentdate.isafter(this.settings.maxdate) && (this.currentdate = this.settings.maxdate.clone()), this.currentcalendar.month = this.currentdate.clone(), this.settings.timepicker) { var t, s, i, n; t = this.currentdate.hour(), s = this.currentdate.minute(), i = this.currentdate.second(), n = this.currentdate.millisecond(), this.currentcalendar.month.hour(t).minute(s).second(i).millisecond(n) } this.calendar.currentcalendar.month = this.currentcalendar.month, this.calendar.currentcalendar.selecteddate = this.currentcalendar.month }, setcurrentdate: function(e) { if (!e) return void (this.currentdate = null); var t; "string" == typeof e && (t = moment(e, this.settings.format)), "object" == typeof e && (t = moment(e)), "number" == typeof e && (t = moment(e)), this.settings.timepicker || (t = t.startof("day")), this.settings.mindate && t.isbefore(this.settings.mindate) && (t = this.settings.mindate.clone()), this.settings.maxdate && t.isafter(this.settings.maxdate) && (t = this.settings.maxdate.clone()), this.currentdate = t.clone(), this.calendar.currentdate = t.clone() }, setcurrentcalendar: function(e) { var t = !1; e || (e = new date, t = !0); var s; if ("string" == typeof e && (s = moment(e, this.settings.format)), "object" == typeof e && (s = moment(e)), "number" == typeof e && (s = moment(e)), this.settings.timepicker || (s = s.startof("day")), this.settings.mindate && s.isbefore(this.settings.mindate) && (s = this.settings.mindate.clone()), this.settings.maxdate && s.isafter(this.settings.maxdate) && (s = this.settings.maxdate.clone()), this.currentcalendar.month = s.clone(), this.settings.timepicker && !t) { var i = s.hour() || "00" , n = s.minute() || "00" , a = s.second() || "00" , o = s.millisecond() || "00"; this.currentcalendar.month.hour(i).minute(n).second(a).millisecond(o); var r = i + ":" + n + ":" + a + "." + o; this.timepicker.setvalue(r) } this.calendar.currentcalendar.month = this.currentcalendar.month, this.calendar.currentcalendar.selecteddate = this.currentcalendar.month }, showdate: function() { var e = null; this.currentdate && (e = this.currentdate.clone(), e = e.format(this.settings.format)), this.elements.view.val(e), rebuildrepairedplaceholder(this.elements.view) }, setvalue: function(e) { var t = moment(e).format("yyyy/mm/dd"); "invalid date" !== t && "invalid date" !== t || (e = ""), this.setcurrentdate(e), this.setcurrentcalendar(e), this.showdate() }, settoday: function(e) { var t = new date; t = moment(t); var s = this.currentcalendar , i = s.month.hour() , n = s.month.minute() , a = s.month.second() , o = s.month.millisecond(); t.hour(i).minute(n).second(a).millisecond(o), this.setcurrentcalendar(t), this.settings.timepicker ? this.updateview() : this.clickapply(e) }, confirmcalendar: function(e) { var t = this.elements.view.val(); if (t.length > 0) { var s = this.getinputvalue(); this.setvalue(s) } else this.setcurrentdate(null), this.setcurrentcalendar(null); this.getdate() }, getnumresult: function() { return this.typenumresult }, setnumresult: function(e) { this.typenumresult = e }, updatecalendarforvalue: function(e) { var t = this; this.timer && cleartimeout(this.timer), this.timer = settimeout(function() { var s = t.parseinputdate(e) , i = s || t.getmoment(); t.setcurrentcalendar(i), t.updateview() }, 300) }, updatecalendar: function(e) { var t = this; this.timer && cleartimeout(this.timer), this.timer = settimeout(function() { var e = t.getinputvalue(); t.setcurrentcalendar(e), t.updateview() }, 300) }, getmomentdate: function(e) { var t = this.parseinputdate(e) , s = t || this.getmoment(); return s && (s = s.format(this.settings.format)), s }, getinputvalue: function() { var e = this.elements.view.val() , t = this.parseinputdate(e) , s = t || this.getmoment(); return s }, parseinputdate: function(e) { return e = moment.ismoment(e) || e instanceof date ? moment(e) : this.getmoment(e) }, getmoment: function(e) { var t; return "undefined" == typeof e || null === e ? t = null : (t = moment(e, this.settings.format, !1), moment(t, this.settings.format, !0).isvalid() || (t = null)), t }, focusview: function() { "auto" === this.settings.position && (this.position = this.getposition(), this.autoupposition(), this.autorightposition()); var e = this.getinputvalue(); this.setcurrentcalendar(e), this.updateview() }, updateview: function(e) { this.elements.calendaryear.hasclass("active") && this.elements.calendaryear.removeclass("active"), this.elements.calendarmonth.hasclass("active") && this.elements.calendarmonth.removeclass("active"), this.elements.calendaryears.hide(), this.elements.calendarmonths.hide(), this.settings.timepicker && this.timepicker.rendertimepicker(), this.rendercalendar() }, rendercalendar: function() { this.calendar.rendercalendar(); var e = this.calendar.currentcalendar , t = e.month.month() , s = e.month.year() , i = !1; this.settings.mindate && (i = this.settings.mindate.clone()); var o = !1; this.settings.maxdate && (o = this.settings.maxdate.clone()); var r = e.month.clone() , l = r.month() , h = r.year() , c = o && o.year() || this.settings.maxyear , d = i && i.year() || this.settings.minyear , u = h == d , p = h == c , m = moment([s, t]).daysinmonth() , f = moment([s, t, 1]) , g = moment([s, t, m]) , e = []; e.firstday = f, e.lastday = g; var v = '", this.elements.calendarmonths.html(v), this.settings.scroller && (d = 1 * h - this.settings.intervalyear, c = 1 * h + this.settings.intervalyear, d < this.settings.minyear && (d = this.settings.minyear), c > this.settings.maxyear && (c = this.settings.maxyear), this.scrollerminyear = d); for (var y = '", this.elements.calendaryears.html(y); var w = t + 1; this.elements.showyear.html(s + a), this.elements.showmonth.html(w + n) }, yearchanged: function(e) { var t = parseint(e.target.innerhtml); this.currentcalendar.month.year(t), this.elements.calendaryear.removeclass("active"), this.elements.calendaryears.hide(), this.monthoryearchanged() }, monthchanged: function(e) { var t = parseint(e.target.innerhtml); t -= 1, this.currentcalendar.month.month(t), this.elements.calendarmonth.removeclass("active"), this.elements.calendarmonths.hide(), this.monthoryearchanged() }, showpanel: function(e, t) { t.preventdefault(), t.stoppropagation(), this.elements.calendaryears.hide(), this.elements.calendarmonths.hide(); var s = ""; if (this.elements.calendaryear.hasclass("active") && (this.elements.calendaryear.removeclass("active"), s = "year"), this.elements.calendarmonth.hasclass("active") && (this.elements.calendarmonth.removeclass("active"), s = "month"), s != e) { var i = this.currentcalendar , n = i.month.month() , a = i.month.year() , o = this.scrollerminyear || this.settings.mindate && this.settings.mindate.year() || this.settings.minyear , r = a - o - 4; r < 0 && (r = 0), r = 26 * r; var l = n - 3; switch (l < 0 && (l = 0), l = 26 * l, e) { case "year": this.elements.calendaryears.show(), this.elements.calendaryear.addclass("active"), this.elements.calendaryears.scrolltop(r); break; case "month": this.elements.calendarmonths.show(), this.elements.calendarmonth.addclass("active"), this.elements.calendarmonths.scrolltop(l) } } }, clickprev: function(e) { this.calendar.currentcalendar.month.subtract(1, "month"), this.rendercalendar() }, clicknext: function(e) { this.calendar.currentcalendar.month.add(1, "month"), this.rendercalendar() }, clickapply: function(e) { var t = this.currentcalendar.month.clone(); if (this.settings.timepicker) { var s = $.extend(!0, {}, ["0", "0", "0", "0"], this.timepicker.getvalue().split(":")) , i = s[2].split("."); s[2] = i[0], s[3] = i[1] ? i[1] : "0", t = t.clone().hour(s[0]).minute(s[1]).second(s[2]).millisecond(s[3]) } this.setcurrentdate(t), this.showdate(), this.getdate(), this.settings.calendarmode || (this.dropdown.toggle(e), this.dropdown1.toggle(e)) }, getdate: function() { var e; this.currentdate && (e = this.currentdate.clone(), e = e.format(this.settings.format)), this.elements.view.trigger("changedate", e) }, monthoryearchanged: function() { var e = this.currentcalendar , t = e.month.month() , s = e.month.year(); this.settings.mindate && (s < this.settings.mindate.year() || s == this.settings.mindate.year() && t < this.settings.mindate.month()) && (t = this.settings.mindate.month(), s = this.settings.mindate.year()), this.settings.maxdate && (s > this.settings.maxdate.year() || s == this.settings.maxdate.year() && t > this.settings.maxdate.month()) && (t = this.settings.maxdate.month(), s = this.settings.maxdate.year()), this.calendar.currentcalendar.month.month(t).year(s), this.rendercalendar() }, render: function(e) { return e.getdate() }, refresh: function() {}, enable: function() { this.elements.view.prop("disabled", !1), this.container.removeclass("disabled"), this.elements.icon.removeclass("disabled") }, disable: function() { this.elements.view.prop("disabled", !0), this.elements.icon.addclass("disabled"), this.container.addclass("disabled") }, destroy: function() {}, getapi: function() { var e = this , t = { getvalue: "getinputvalue", setvalue: "setvalue", clickapply: "clickapply", setmindate: "setmindate", setmaxdate: "setmaxdate" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "datepicker" , i = s.ui.controls.datepicker; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = function() {} , i = 0 , n = { confirmhide: !1, mindate: "1900-01-01", maxdate: "2099-12-31", ngmindate: void 0, ngmaxdate: void 0, showweeknumbers: !1, weeklabel: "w", format: "yyyy-mm-dd", daysofweek: moment.weekdaysmin(), monthnames: moment.monthsshort(), firstday: 0, split: "至", replace: "...", options: [{ text: "不限", value: "" }, { text: "今日", value: "n+0" }, { text: "明天", value: "s+1" }, { text: "最近1日", value: "n-1" }, { text: "最近1月", value: "m-1" }, { text: "最近1年", value: "y-1" }], position: "bottom,left", bottom: "dropdown", up: "dropup", change: t, timepicker: !1, timeshowpanel: !0, mask: !1, defaulttime: null, datechangedleft: null, datechangedright: null, renderleft: null, renderright: null } , a = { confirmhide: "confirmhide", mindate: "min-date", maxdate: "max-date", showweeknumbers: "show-week-numbers", weeklabel: "week-label", format: "format", options: "options", position: "position", timepicker: "time-picker", timeshowpanel: "time-show-panel", mask: "mask", defaulttime: "default-time" }; this.daterangepicker = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, t) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), i += 1, this.element.data("plugin-id", i), this.norestrict = !1, this.initsettings(t), this.settings.maxdate = this.settings.ngmaxdate || this.settings.maxdate, this.settings.mindate = this.settings.ngmindate || this.settings.mindate, t.options && (this.settings.options = t.options), this.buildhtml(), this.initelements(), this.bindevents()) }, buildhtml: function() { var e = this.element.data("plugin-id"); if (this.settings.confirmhide) var t = ""; else var t = ' '; var s = '
    ' + this.settings.split + '
    "; this.container = $(s), this.element.before(this.container), this.element.hide() }, initelements: function() { this.elements = { original: this.element, daterangepicker: this.container, view: $(".input-group-wrap", this.container), inputleftview: $(".input-left", this.container), inputrightview: $(".input-right", this.container), menu: $(".dropdown-menu", this.container), icon: $(".glyphicon-calendar", this.container), dpkleftinput: $(".dtpicker-left", this.container), dpkrightinput: $(".dtpicker-right", this.container), options: $(".calendar-option", this.container), confirm: $(".calendar-bottom .confirm", this.container) }; var e = this.elements.view.data("plugin-id") , i = this; this.dropdown = new s.ui.controls.dropdown(this.elements.view,{ _pluginid: e }), this.currentdate = {}; var n = this.settings.defaulttime ? this.settings.defaulttime.split(",") : [null, null] , a = this.elements.inputleftview.val() , o = this.elements.inputrightview.val() , r = $.extend(!0, {}, this.settings, { calendarmode: !0, defaulttime: n[0], render: $.proxy(this.renderdateleft, this), change: t, datechanged: i.settings.datechangedleft, changedrender: function(e) { i.datepickerright.setmindate(e), i.datepickerright.rendercalendar() }, clickcallback: function() { i.datepickerleft.getinputvalue() && (a = i.datepickerleft.getinputvalue().format("yyyy-mm-dd")), i.datepickerright.getinputvalue() && (o = i.datepickerright.getinputvalue().format("yyyy-mm-dd")), i.settings.confirmhide && o && i.clickapply() } }) , l = $.extend(!0, {}, this.settings, { calendarmode: !0, defaulttime: n[1], render: $.proxy(this.renderdateright, this), change: t, datechanged: i.settings.datechangedright, changedrender: function(e) { i.datepickerleft.setmaxdate(e), i.datepickerleft.rendercalendar() }, clickcallback: function() { i.datepickerleft.getinputvalue() && (a = i.datepickerleft.getinputvalue().format("yyyy-mm-dd")), i.datepickerright.getinputvalue() && (o = i.datepickerright.getinputvalue().format("yyyy-mm-dd")), i.settings.confirmhide && a && i.clickapply() } }); if (this.datepickerleft = new s.ui.controls.datepicker(this.elements.dpkleftinput,r), this.datepickerright = new s.ui.controls.datepicker(this.elements.dpkrightinput,l), this.settings.timepicker) { var h = '
    开始时间:
    ' , c = '
    结束时间:
    '; this.datepickerleft.timepicker.elements.timepicker.prepend(h), this.datepickerright.timepicker.elements.timepicker.prepend(c) } else this.datepickerleft.elements.calendarbottom.hide(), this.datepickerright.elements.calendarbottom.hide(); if (this.settings.options) for (var d = 0; d < this.settings.options.length; d++) { var u = this.settings.options[d] , p = '"; p = $(p), this.elements.options.prepend(p), p.on("click", $.proxy(this.setrecentdays, this, u.value)) } this.autoupposition(), this.autorightposition() }, renderdateleft: function(e) { var t = moment(e); if (this.currentdate.left && this.currentdate.right) { if (t.isbefore(moment(this.currentdate.right)) && t.isafter(moment(this.currentdate.left))) return this.settings.renderleft ? '
    ' + this.settings.renderleft(e) + "
    " : '
    ' + e.getdate() + "
    "; if (t.format("yyyy-mm-dd") == moment(this.currentdate.right).format("yyyy-mm-dd") || t.format("yyyy-mm-dd") == moment(this.currentdate.left).format("yyyy-mm-dd")) return this.settings.renderleft ? '
    ' + this.settings.renderleft(e) + "
    " : '
    ' + e.getdate() + "
    " } return this.settings.renderleft ? this.settings.renderleft(e) : e.getdate() }, renderdateright: function(e) { var t = moment(e); if (this.currentdate.left && this.currentdate.right) { if (t.isbefore(moment(this.currentdate.right)) && t.isafter(moment(this.currentdate.left))) return this.settings.renderright ? '
    ' + this.settings.renderright(e) + "
    " : '
    ' + e.getdate() + "
    "; if (t.format("yyyy-mm-dd") == moment(this.currentdate.right).format("yyyy-mm-dd") || t.format("yyyy-mm-dd") == moment(this.currentdate.left).format("yyyy-mm-dd")) return this.settings.renderright ? '
    ' + this.settings.renderright(e) + "
    " : '
    ' + e.getdate() + "
    " } return this.settings.renderright ? this.settings.renderright(e) : e.getdate() }, autoupposition: function() { var e = this.settings.position.split(",") , t = e[0] , s = e[1] , i = "up" === t ? this.settings.up : ""; this.elements.view.addclass(i), this.settings.isrightposition = !1, "right" === s && (this.settings.isrightposition = !0) }, autorightposition: function() { if (this.settings.isrightposition) { var e = this.elements.view.width(); e += this.elements.icon.width(); var t = this.elements.menu.width() , s = e - t; this.elements.menu.css("margin-left", s) } }, transferattributes: function() {}, bindevents: function() { this.elements.inputrightview.on("keyup", $.proxy(this.setinputvalue, this)), this.elements.inputleftview.on("keyup", $.proxy(this.setinputvalue, this)), this.elements.view.on("keyup", $.proxy(this.updateview, this)), this.elements.view.on("changedate2", $.proxy(this.settings.change, this)), this.elements.inputleftview.on("blur", $.proxy(this.inputblurleft, this)), this.elements.inputrightview.on("blur", $.proxy(this.inputblurright, this)), this.elements.confirm.on("click", $.proxy(this.clickapply, this)); var e = this; this.elements.daterangepicker.on("click", function(e) { e.preventdefault(), e.stoppropagation() }), this.datepickerleft.container.on("dateselected", function(t, s, i) { e.currentdate.left = s, "" === s || moment(e.settings.mindate).isafter(moment(s)) || moment(e.settings.maxdate).isbefore(moment(s)) || e.datepickerright.setmindate(s); var n = e.datepickerleft.getinputvalue(); e.datepickerleft.setvalue(n), e.rendercalendar() }), this.datepickerright.container.on("dateselected", function(t, s, i) { e.currentdate.right = s, "" === s || moment(e.settings.mindate).isafter(moment(s)) || moment(e.settings.maxdate).isbefore(moment(s)) || e.datepickerleft.setmaxdate(s); var n = e.datepickerright.getinputvalue(); e.datepickerright.setvalue(n), e.rendercalendar() }) }, setmindate: function(e) { this.settings.mindate = e, this.datepickerleft.setmindate(e), this.datepickerleft.rendercalendar() }, setmaxdate: function(e) { this.settings.maxdate = e, this.datepickerright.setmaxdate(e), this.datepickerright.rendercalendar() }, restoredate: function() { this.container.find("td"), this.container.find("td.selected").removeclass("selected"), this.datepickerleft.setmaxdate(this.settings.maxdate), this.datepickerleft.setmindate(this.settings.mindate), this.datepickerright.setmindate(this.settings.mindate), this.datepickerright.setmaxdate(this.settings.maxdate) }, rendercalendar: function() { this.datepickerright.rendercalendar(), this.datepickerleft.rendercalendar() }, setviewvalue: function() { this.elements.inputleftview.val(this.elements.dpkleftinput.val()), this.elements.inputrightview.val(this.elements.dpkrightinput.val()), rebuildrepairedplaceholder(this.elements.inputleftview), rebuildrepairedplaceholder(this.elements.inputrightview), 10 !== document.documentmode && 11 !== document.documentmode || (repairedplaceholder(".input-left"), repairedplaceholder(".input-right"), $(".input-left").removeattr("placeholder"), $(".input-right").removeattr("placeholder")) }, format: function(e) { var t = e.length - 1; switch (t) { case 4: case 7: e = e.replace(new regexp("([\\d\\/-\\s\\:]{" + t + "})"), "$1-"), e = e.replace(/[\-\/]{2,}/g, "-"); break; case 10: this.settings.timepicker && (e = e.replace(new regexp("([\\d\\/-\\s\\:]{" + t + "})"), "$1 "), e = e.replace(/\s{2,}/g, " ")); break; case 13: case 16: this.settings.timepicker && (e = e.replace(new regexp("([\\d\\/-\\s\\:]{" + t + "})"), "$1:"), e = e.replace(/\:{2,}/g, ":")); break; case 19: this.settings.timepicker && (e = e.replace(new regexp("([\\d\\/-\\s\\:]{" + t + "})"), "$1."), e = e.replace(/\.{2,}/g, ".")) } return e }, setinputvalue: function(e) { if (this.settings.mask && e && [8, 37, 38, 39, 40].indexof(e.keycode) === -1) { var t = $(e.target); t.val(this.format(t.val())) } var s = this.elements.inputleftview.val() , i = this.elements.inputrightview.val() , n = this.parseinputdate(s) || this.getmoment(s) , a = this.parseinputdate(i) || this.getmoment(i); if (n) if (a) { if (n.isafter(a)) return } else this.elements.dpkrightinput.val(""); else this.elements.dpkleftinput.val(""); this.elements.dpkleftinput.val(s), this.elements.dpkrightinput.val(i), this.datepickerleft.container.trigger("dateselected", [n, !0]), this.datepickerright.container.trigger("dateselected", [a, !0]) }, setrecentdays: function(e, t) { var s = e.charat(0) , i = e.charat(1) , n = e.charat(2); if (this.restoredate(), "t" !== s) { if (!s) return this.norestrict = !0, void this.setvalue(["", ""]); var a = this.getnrecentdays(o, s, i, n) , o = a[0] , r = a[1]; this.elements.dpkrightinput.val(r.format(this.settings.format)), this.elements.dpkleftinput.val(o.format(this.settings.format)), this.datepickerleft.container.trigger("dateselected", [o, !0]), this.datepickerright.container.trigger("dateselected", [r, !0]) } this.settings.confirmhide && this.clickapply() }, getnrecentdays: function(e, t, s, i) { var n; switch (i = parseint(i), t) { case "n": n = "+" == s ? moment(e).add(i, "day") : moment(e).subtract(i, "day"); break; case "m": n = "+" == s ? moment(e).add(i, "month") : moment(e).subtract(i, "month"); break; case "y": n = "+" == s ? moment(e).add(i, "year") : moment(e).subtract(i, "year"); break; case "s": n = "+" == s ? moment(e).add(i, "day") : moment(e).subtract(i, "day") } var a = moment(); if ("s" === t) a = n; else if (n.isbefore(a)) { var o = a.clone(); a = n.clone(), n = o.clone() } return [a, n] }, parseinputdate: function(e) { return e = moment.ismoment(e) || e instanceof date ? moment(e) : this.getmoment(e) }, getmoment: function(e) { var t; return "undefined" == typeof e || null === e ? t = null : (t = moment(e, this.settings.format, !1), moment(t, this.settings.format, !0).isvalid() || (t = null)), t }, updateview: function(e) { var t = this.getdatepickervalue(); this.elements.view.trigger("changedate2", [t]), this.norestrict = !1 }, clickapply: function(e) { var t = this.getdatepickervalue(); this.elements.view.trigger("changedate2", [t]), this.setviewvalue(), this.dropdown.toggle(e) }, clickapply1: function(e, t, s) { this.elements.view.trigger("changedate2", [i]); var i = this.getdatepickervalue(); if ("left" == s) { var n = i[0]; if (t !== n) return } if ("right" == s) { var n = i[1]; if (t !== n) return } this.setviewvalue(), this.dropdown.toggle(e) }, setcalendarvalue: function(e) { if (this.value = e, e) { if (2 != e.length) return; var t = e[0] , s = e[1] , i = this.getmoment(t); i || (t = this.settings.replace); var n = this.getmoment(s); n || (s = this.settings.replace), i || n || (this.value = [null, null], t = s = ""), this.elements.dpkleftinput.val(t), this.elements.dpkrightinput.val(s), this.datepickerleft.container.trigger("dateselected", [t, !0]), this.datepickerright.container.trigger("dateselected", [s, !0]) } else this.elements.dpkleftinput.val(""), this.elements.dpkrightinput.val(""), this.datepickerleft.container.trigger("dateselected", ["", !0]), this.datepickerright.container.trigger("dateselected", ["", !0]); this.setviewvalue() }, setvalue: function(e) { this.restoredate(), this.setcalendarvalue(e) }, getcaleandarvalue: function() { var e = this.datepickerleft.getinputvalue(); e = e ? this.datepickerleft.getinputvalue().clone().format(this.settings.format) : null; var t = this.datepickerright.getinputvalue(); t = t ? this.datepickerright.getinputvalue().clone().format(this.settings.format) : null; var s = [e, t]; return s }, getdatepickervalue: function() { return this.value = this.getcaleandarvalue(), this.value }, getvalue: function() { return [this.elements.inputleftview.val(), this.elements.inputrightview.val()] }, rendercalendarleft: function() { this.datepickerleft.rendercalendar() }, rendercalendarright: function() { this.datepickerright.rendercalendar() }, inputblurleft: function() { var e = this.elements.inputleftview.val() , t = this.elements.inputrightview.val() , s = moment(e) , i = moment(t); s.isafter(i) && (this.elements.inputleftview.val(""), this.setviewvalue()) }, inputblurright: function() { var e = this.elements.inputleftview.val() , t = this.elements.inputrightview.val() , s = moment(e) , i = moment(t); i.isbefore(s) && (this.elements.inputrightview.val(""), this.setviewvalue()) }, enable: function() { this.elements.inputleftview.prop("disabled", !1), this.elements.inputrightview.prop("disabled", !1), this.elements.view.removeclass("disabled"), this.container.removeclass("disabled") }, disable: function() { this.elements.inputleftview.prop("disabled", !0), this.elements.inputrightview.prop("disabled", !0), this.elements.view.addclass("disabled"), this.container.addclass("disabled") }, destroy: function() {}, getapi: function() { var e = this , t = { setvalue: "setvalue", getvalue: "getvalue", rendercalendarleft: "rendercalendarleft", rendercalendarright: "rendercalendarright" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "daterangepicker" , i = s.ui.controls.daterangepicker; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; function t(e) { if (!e || 3 !== e.which) for (var t = 0; t < o.length; t++) { var s = o[t] , i = $(s) , n = i.parent(); n.hasclass("open") && (e && "click" == e.type && /input|textarea/i.test(e.target.tagname) && $.contains(n[0], e.target) || (r[s] && (e && $.contains(n[0], e.target) || n[0] == e.target) ? n.toggleclass("open") : r[s] || n.removeclass("open"))) } } var i = 0 , n = { multidropdown: !1 } , a = { dropdownid: "dropdown-id", multidropdown: "multi-dropdown" } , o = [] , r = {}; this.dropdown = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, settings: {}, value: "", data: {}, templates: {}, init: function(e, t) { this.element = $(e), this.element.addclass("dropdown-btn"); var s = t && t._pluginid; !s && this.element.data("initialized") || (s || (this.element.data("initialized", !0), i += 1, this.element.data("plugin-id", i)), this.initsettings(t), this.element.is("a") && this.element.attr("href") && (this.settings.dropdownid = this.element.attr("href")), o.push(this.settings.dropdownid), this.settings.multidropdown && (r[this.settings.dropdownid] = 1), this.buildhtml(), this.initelements(), this.bindevents()) }, buildhtml: function() {}, initelements: function() { this.elements = { original: this.element } }, bindevents: function() { this.element.on("click.bs.dropdown", this.toggle) }, bindeventsinterface: function() { this.element }, render: function() {}, toggle: function(e) { var s = $(this); if (!s.is(".disabled, :disabled")) { var i = s.parent() , n = i.hasclass("open"); return t(e), n || (s.trigger("focus"), i.toggleclass("open")), !1 } }, refresh: function() {}, enable: function() {}, disable: function() {}, destroy: function() {} }), $(document).on("click.bs.dropdown.data-api", t) }), function(e) { "use strict"; var t = "dropdown" , i = s.ui.controls.dropdown; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = function() {} , i = { mask: "n", rule: "", maskextend: t, translation: {}, event: {}, email: !1 } , n = { mask: "mask", email: "email" }; this.inputmask = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), this.initsettings(s), this.event = {}, this.globals = { maskelements: "input,td,span,div", datamaskattr: "*[data-mask]", datamask: !0, watchinterval: 300, watchinputs: !0, watchdatamask: !1, bypasskeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91], translation: { n: { pattern: /\s/, recursive: !0 }, 0: { pattern: /\d/ }, 1: { pattern: /[1-9]/ }, 9: { pattern: /\d/, optional: !0 }, "#": { pattern: /\d/, recursive: !0 }, a: { pattern: /[a-za-z0-9]/ }, s: { pattern: /[a-za-z]/ }, x: { pattern: /\s/ }, p: { pattern: /[0-9()+-]/ } } }, this.rule = this.settings.rule, $.extend(!0, this.globals.translation, this.settings.translation), this.mask = { decimal: "", prefix: "", integer: this.settings.mask }, this["extends"] = !1, this.settings.email ? this.bindevent() : this.settings.maskextend !== t ? (this.setmask(), this.render(!0)) : (this.bindevent(), this.setmask(), this.render()) }, bindevent: function() { this.rule && !this.settings.email && (this.event = { onkeypress: this.onkeypress.bind(this) }), this.element.on("blur", this.onblur.bind(this)) }, onblur: function() { this.settings.email ? this.setemail() : this.rule.decimal && this.setdecimal() }, onkeypress: function(e, t, s, i) { s.mask(this.getmask.apply(this, arguments), i).val(this.changeval(s.val(), e)) }, setemail: function() { var e = this.element.val().replace(/ /g, "") , t = e.lastindexof("@") , s = e.lastindexof("."); t === -1 ? e += "@_._" : s < t ? e += "" === e.substring(t + 1, e.length) ? "_._" : "._" : "" === e.substring(t + 1, s) ? e = e.substring(0, t + 1) + "_" + e.substring(s, e.length) : "" === e.substring(s + 1, e.length) && (e += "_"), 0 === e.lastindexof("@") && (e = "_" + e), this.element.val(e) }, integermask: function(e) { var t = e.replace(/\d/g, "").length , s = "9" , i = { "false": !1, wan: 4, thousand: 3, hundred: 2 }; if (0 === t) return s; for (var n = 0; n < t; n++) if (s = n % i[this.rule.numeralstyle] === 0 && 0 !== n ? "0," + s : "0" + s, n + 1 === this.rule.maxlength && this.rule.maxlength) return s.substring(0, s.length - 1); return s }, decimalmask: function() { for (var e = ".", t = 0; t < this.rule.decimal; t++) e += "0"; return e }, prefixmask: function() { for (var e = "", t = 0; t < this.rule.prefix.length; t++) e += "x"; return e }, setmask: function() { this.rule.decimal && (this.mask.decimal = this.decimalmask()), this.rule.prefix && (this.mask.prefix = this.prefixmask()) }, getmask: function(e) { if (this.rule.decimal && (e = e.split(".")[0]), this.rule.prefix) { var t = this.rule.prefix; e = e.substring(0, t.length) !== t ? this.unprefix(e) : e.replace(t, "") } return this.rule && (this.mask.integer = this.integermask(e)), this.mask.prefix + this.mask.integer + this.mask.decimal }, setdecimal: function() { var e = this.element.val() , t = e.split(".")[1] || "" , s = this.rule.prefix || ""; if (s && (e = e.replace(s, "")), e) { for (var i = 0; i < this.rule.decimal; i++) t.charat(i) || (t += "0"); e = e.split(".")[0] || "0", t = s + e + "." + t } else t = s; this.element.val(t) }, changeval: function(e, t) { var s = ""; if (this.rule.decimal && e.indexof(".") !== -1 && (s = e.split(".")[1] ? "." + e.split(".")[1] : "."), e = e.split(".")[0], this.rule.prefix) { var i = this.rule.prefix; if (!e) return i; e.substring(0, i.length) !== i && (e = i + this.unprefix(e)) } return e + s }, unprefix: function(e) { for (var t, s = this.rule.prefix, i = e.substring(0, s.length), n = 0; n < s.length; n++) if (i.charat(n) !== s.charat(n)) { t = n; break } return e.substring(t, e.length) }, setvalue: function(e) { var s; this.settings.email ? s = "n" : this.settings.maskextend !== t ? s = this.settings.maskextend.bind(this).apply(this, arguments) : (e = this.changeval(e), s = this.getmask.bind(this).apply(this, arguments)), this.element.val(e).mask(s, $.extend({}, this.event, this.globals)).val(this.element.masked(e)), this.settings.email ? this.setemail() : this.rule.decimal && this.settings.maskextend == t && this.setdecimal() }, getvalue: function() { return this.element.val() }, render: function(e) { var t = this.element.val() , s = e ? this.settings.maskextend.bind(this) : this.getmask.bind(this); this.rule.prefix && !e && (t = this.rule.prefix + t), $.extend(!0, this.event, this.settings.event), this.element.val(t).mask(s, $.extend({}, this.event, this.globals)) } }) }), function(e) { "use strict"; var t = "inputmask" , i = s.ui.controls.inputmask; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { checkedicon: "glyphicon glyphicon-check", uncheckedicon: "glyphicon glyphicon-unchecked" } , n = {} , a = { check: 1, uncheck: -1 }; this.inputmultiselect = new e.class({ extend: s.ui.controls.typeahead },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.map = this.settings.map, "string" == typeof this.settings.map && "" !== this.settings.map && (this.map = json.parse(this.settings.map)), this.matcher = this.settings.matcher || this.matcher, this.sorter = this.settings.sorter || this.sorter, this.template = this.settings.template || this.template, this.mouseover = this.settings.mouseover || this.mouseover, this.mouseout = this.settings.mouseout || this.mouseout, this.select = this.settings.select || this.select, this.autoselect = "boolean" != typeof this.settings.autoselect || this.settings.autoselect, this.highlighter = this.settings.highlighter || this.highlighter, this.render = this.settings.render || this.render, this.updater = this.settings.updater || this.updater, this.displaytext = this.settings.displaytext || this.displaytext, this.nofound = this.settings.nofound && '

    ' + this.settings.nofound + "

    ", this.source = this.settings.data, this.sourcemap = {}, this.delay = this.settings.delay, this.chooseitems = [], this.selecteditems = [], this.buildhtml(), this.initelements(), this.transferattributes(), this.bindevents(), this.bindeventsex()) }, buildhtml: function() { this.element.hide(); var e = this.element.data("plugin-id") , t = '
    请输入..
    '; this.container = $(t), this.element.before(this.container), this.element.is("input") && this.element.attr("autocomplete", "off") }, initelements: function() { this.elements = { view: $(".c-ims-input", this.container), panel: $(".c-input-multi-select-panel", this.container), placeholder: $(".c-ims-placeholder", this.container), menu: $(".dropdown-menu", this.container), dl: $(".c-ims-list", this.container), textlist: $(".c-ims-textlist", this.container) }; var e = this.elements.view.data("plugin-id"); this.dropdown = new s.ui.controls.dropdown(this.elements.view,{ _pluginid: e }) }, transferattributes: function() { this.elements.placeholder.html(this.element.attr("placeholder")), void 0 !== this.element.attr("disabled") && this.disable() }, bindeventsex: function() { this.elements.panel.on("click", $.proxy(this.clickview, this)), this.elements.view.on("blur", $.proxy(this.inputblur, this)) }, focusclick: function(e) { this.elements.placeholder.hide(), "" === $(e.target).val() && this.settings.showitemlist === !1 ? this.elements.menu.html("") : (this.lookup(), this.setscrolltop()) }, inputblur: function() { this.elements.view.val(""), 0 == this.chooseitems.length && this.elements.placeholder.show() }, clickview: function() { this.elements.view.is(":focus") || this.elements.view.trigger("focus") }, setsourceex: function(e) { this.setsource(e), this._sourcemap = $.extend(!0, {}, this.sourcemap) }, render: function(e) { var t = this , s = this , i = !1 , n = "
  • "; return e = $(e).map(function(e, a) { var o = s.displaytext(a); e = $(n).data("value", a); var r = e.find("span"); return a.unselectable && e.addclass("disabled"), s._sourcemap[o].checked ? (r.addclass(s.settings.checkedicon), e.find("a").attr("class", "checked")) : (r.addclass(s.settings.uncheckedicon), e.find("a").attr("class", "")), e.find("a").html(t.highlighter(o, a)), e.attr("data-value", a.value), o === s.elements.view.val() && (e.addclass("active"), i = !0), e[0] }), this.autoselect && !i && e.first().addclass("active"), this.elements.menu.html(e), this.setscrolltop(), this }, keyup: function(e) { var t = $.inarray(e.keycode, [8, 13, 27, 38, 40, 46]); t != -1 ? this.move(e) : this.lookup() }, move: function(e) { if (8 === e.keycode) return void this.batchdelete(); if (this.ismenuopen()) { switch (e.keycode) { case 13: var t = this.elements.menu.find("li.active") , s = t.attr("data-value"); this._sourcemap[s].checked ? this.select(a.uncheck, t) : this.select(a.check, t); break; case 27: e.preventdefault(); break; case 38: if (e.shiftkey) return; e.preventdefault(), this.prev(); break; case 40: if (e.shiftkey) return; e.preventdefault(), this.next(); break; case 46: this.batchdelete() } e.stoppropagation() } }, click: function(e) { this.toggleclick(e) }, toggleclick: function(e) { var t = $(e.currenttarget) , s = t.closest("li") , i = s.attr("data-value"); this._sourcemap[i].checked ? this.select(a.uncheck, s) : this.select(a.check, s), e.preventdefault(), e.stoppropagation() }, select: function(e, t, s) { if (!t.hasclass("disabled")) { var i = t.data("value") || this.sourcemap[s] , n = t.attr("data-value") || s; if (e === a.check && (t.find("span").attr("class", this.settings.checkedicon), t.find("a").attr("class", "checked"), this._sourcemap[n].checked = !0, this.chooseitems.push(i), this.elements.placeholder.hide()), e === a.uncheck) { t.find("span").attr("class", this.settings.uncheckedicon), t.find("a").attr("class", ""), this._sourcemap[n].checked = !1, this._sourcemap[n].selected = !1; var o = this._getindexinarray(i, this.chooseitems); this.chooseitems.splice(o, 1), 0 === this.chooseitems.length && this.elements.placeholder.hide() } this.setchooseitems(), this.elements.view.val(""), this.elements.view.trigger("onselected", [this.chooseitems, i]) } }, setchooseitems: function() { var e = this.chooseitems , t = ""; this.elements.dl.find("dd").remove(); for (var s = 0; s < e.length; s++) { t += this.displaytext(e[s]) + " ; "; var i = { dd: $("
    ").attr("class", "c-ims-item"), spanname: $("").attr("class", "c-ims-name").text(e[s].value), spandel: $("").attr("class", "c-ims-delete").text("×") }; this._sourcemap[e[s].value].selected === !0 && i.dd.addclass("active"), i.dd.data(e[s]), i.spanname.on("click", $.proxy(this.clickspanname, this)), i.spandel.on("click", $.proxy(this.clickspandel, this)), i.dd.append(i.spanname), i.dd.append(i.spandel), this.elements.view.before(i.dd) } t = t.substring(0, t.length - 3), "" != t ? this.elements.placeholder.hide() : this.elements.placeholder.show(), this.elements.textlist.html(t) }, batchdelete: function() { if (0 !== this.selecteditems.length) { for (var e = this.selecteditems, t = 0; t < e.length; t++) { var s = $("li[data-value='" + e[t].value + "']", this.container); this.select(a.uncheck, s, e[t].value) } this.selecteditems = [] } }, clickspanname: function(e) { e.stoppropagation(); var t = $(e.currenttarget); if ($(t.is("span"))) { var s = t.closest("dd") , i = s.data(); if (s.hasclass("active")) { s.removeclass("active"); var n = this._getindexinarray(i, this.selecteditems); this.selecteditems.splice(n, 1), this._sourcemap[i.value].selected = !1 } else s.addclass("active"), this.selecteditems.push(i), this._sourcemap[i.value].selected = !0 } }, clickspandel: function(e) { e.stoppropagation(); var t = $(e.currenttarget); if ($(t.is("span"))) { var s = t.closest("dd").data().value , i = $("li[data-value='" + s + "']", this.container); if (0 === i.length) { var n = t.closest("dd").data(); this._sourcemap[s].checked = !1, this._sourcemap[s].selected = !1; var o = this._getindexinarray(n, this.chooseitems); this.chooseitems.splice(o, 1), this.setchooseitems(), this.elements.view.val(""), this.elements.view.trigger("onselected", [this.chooseitems, n]) } else this.select(a.uncheck, i) } }, setvalue: function(e) { var t = e; if (t && 0 != t.length || (this.chooseitems = [], this._sourcemap = $.extend(!0, {}, this.sourcemap), this.elements.textlist.html(""), this.elements.dl.find("dd").remove(), this.elements.placeholder.show()), t && t.length > 0) { for (var s = this, i = this.chooseitems, n = 0; n < i.length; n++) this._sourcemap[i[n].value].checked = !1, this._sourcemap[i[n].value].selected = !1; if (this.chooseitems = [], 0 === this.elements.menu.children().length) { this.chooseitems = t; for (var n = 0; n < t.length; n++) this._sourcemap[t[n].value].checked = !0; this.setchooseitems() } else for (var n = 0; n < t.length; n++) { var o = $("li[data-value='" + t[n].value + "']", s.container); s.select(a.check, o) } } }, _getindexinarray: function(e, t) { for (var s = 0; s < t.length; s++) if (json.stringify(e) == json.stringify(t[s])) return s; return -1 }, getapi: function() { var e = this , t = { setsource: "setsourceex", setvalue: "setvalue", getvalue: "getvalue" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "inputmultiselect" , i = s.ui.controls.inputmultiselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { liked: !1, dataurl: "", value: "" } , n = { liked: "liked", dataurl: "data-url", value: "value" }; this.likeit = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.value = parseint(this.settings.value ? this.settings.value : this.element.text()), this.initelements(), this.bindevents(), this.reflash()) }, initelements: function() { this.elements = { original: this.element } }, bindevents: function() { this.element.on("click", $.proxy(this.toggle, this)) }, toggle: function() { this.value = this.settings.liked ? this.value - 1 : this.value + 1, this.settings.liked = !this.settings.liked, this.postback() }, postback: function() { var e = this; e.reflash(), this.settings.dataurl && 0 !== this.settings.dataurl.length && $.ajax({ datatype: "json", url: this.settings.dataurl, data: {}, success: function(e) {}, error: function() { alert("控件id: " + e.element.attr("id") + " , ajax发送数据失败!") } }) }, reflash: function() { this.element.text(this.value), this.settings.liked ? this.element.addclass("liked") : this.element.removeclass("liked") } }) }), function(e) { "use strict"; var t = "likeit" , i = s.ui.controls.likeit; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { loadingtext: "loading", maskedtarget: "" } , n = { loadingtext: "loading-text", maskedtarget: "masked-target" }; this.loading = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.buildhtml(), this.initelements()) }, buildhtml: function() { var e = '

    ' + this.settings.loadingtext + "

    "; this.overlay = $(e) }, initelements: function() { this.elements = { target: $(this.settings.maskedtarget) } }, start: function() { if (this.elements && this.elements.target) { this.elements.target.addclass("c-loading"), this.elements.target.data("loading-overlay") || this.elements.target.prepend(this.overlay).data("loading-overlay", !0) } }, stop: function() { if (this.elements && this.elements.target) { this.elements.target.data("loading-overlay", !1), this.elements.target.find(".c-loading-overlay").detach(), this.elements.target.hasclass("c-loading") ? this.elements.target.removeclass("c-loading") : this.elements.target.find(".c-loading").removeclass("c-loading") } } }) }), function(e) { "use strict"; var t = "loading" , i = s.ui.controls.loading; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = 300 , n = 150 , a = { modalid: "", modalclass: "", valign: "top", height: "", show: !1, bindtarget: !0, remote: "", content: "", parsedata: void 0, backdrop: "static", keyboard: !0, modalcontainer: "#c-modal-base", isdrag: "true", buttons: { close: { selector: ".close", eventname: "click", handler: function(e) { this.hide() } }, cancel: { selector: ".cancel", eventname: "click", handler: function(e) { this.hide() } } }, oninitialized: function() {} } , o = { modalid: "modal-id", show: "show", remote: "remote", backdrop: "backdrop", keyboard: "keyboard", modalclass: "modal-class", valign: "valign", height: "height" }; this.modal = new e.class({ extend: s.ui.basecontrol },{ defaults: a, attributemap: o, init: function(e, s) { if (this.element = $(e), t += 1, this.element && this.element.length > 0 && (this._currentpluginid = this.element.data("plugin-id"), this._currentpluginid || (this._currentpluginid = t, this.element.data("plugin-id", t))), this.isshown = !1, this.originalbodypad = null, this.scrollbarwidth = 0, this.ignorebackdropclick = !1, this.initsettings(s), !this.settings.remote) { var i = this.element.attr("href"); this.settings.remote = !/#/.test(i) && i } this.modalcontainer = $(this.settings.modalcontainer), this.settings.modalid = this.settings.modalid || this.settings.modalcontainer + "-m" + this._currentpluginid, "function" == typeof this.settings.parsedata && (this.parsedata = this.settings.parsedata, delete this.settings.parsedata), this.getdata() }, getdata: function() { var e = this; this.settings.remote ? $.ajax({ url: this.settings.remote, type: "get", datatype: "html" }).done(function(t) { var s = e.parsedata(t); e.render(s) }) : this.render(this.settings.content) }, parsedata: function(e) { return e }, buildhtml: function() {}, render: function(e) { var t = this.modalcontainer.find(this.settings.modalid); parseint(this.settings.height) + 2; if (0 === t.length) { var s = this.settings.modalclass ? " " + this.settings.modalclass : "" , i = "middle" == this.settings.valign ? " valign-middle" : "" , n = ''; this.modalcontainer.append(n), t = this.modalcontainer.find(this.settings.modalid) } var a = t.find(".modal-dialog:first"); e && (a.empty(), a.append(e)), "true" === this.settings.isdrag && $(a).draggable({ handle: ".modal-header", containment: ".modal-open .modal.in" }), this.initelements(), this.bindevents(), this.elements.modal.trigger("modal.on.initialized"), this.settings.show && this.show(this.element) }, refresh: function() {}, initelements: function() { var e = this.modalcontainer.find(this.settings.modalid); this.elements = { original: this.element, body: $(document.body), modal: e, dialog: e.find(".modal-dialog:first"), backdrop: null } }, bindevents: function() { if (this.unbindevents(), this.settings.bindtarget) { var e = this; this.elements.original.on("click", function(t) { $(this).is("a") && t.preventdefault(), $(this).prop("disabled") || e.show(e.elements.original) }) } this.elements.modal.on("modal.on.initialized", $.proxy(this.settings.oninitialized, this)); for (var t in this.settings.buttons) { var s = this.settings.buttons[t]; this.elements.modal.off(s.eventname, s.selector), this.elements.modal.on(s.eventname, s.selector, $.proxy(s.handler, this)) } }, unbindevents: function() { this.elements.modal.off("modal.on.initialized"), this.settings.bindtarget && this.elements.modal.off("click") }, show: function(e) { var t = this , s = $.event("modal.on.show", { relatedtarget: e }); this.elements.modal.trigger(s); var i = 1060 + 10 * $(".modal:visible").length; if (this.elements.modal.css("z-index", i), !this.isshown && !s.isdefaultprevented()) { this.isshown = !0; var n = window.innerwidth; if (!n) { var a = document.documentelement.getboundingclientrect(); n = a.right - math.abs(a.left) } this.bodyisoverflowing = document.body.clientwidth < n; var o = document.createelement("div"); o.classname = "modal-scrollbar-measure", this.elements.body.append(o), this.scrollbarwidth = o.offsetwidth - o.clientwidth, this.elements.body[0].removechild(o); parseint(this.elements.body.css("padding-right") || 0, 10); this.originalbodypad = document.body.style.paddingright || "", this.elements.body.addclass("modal-open"), $(window).on("resize.modal", $.proxy(this.adjustdialog, this)), this.elements.dialog.on("mousedown.modal.on.dismiss", function() { t.elements.modal.one("mouseup.modal.on.dismiss", function(e) { $(e.target).is(t.elements.modal) && (t.ignorebackdropclick = !0) }) }); var s = $.event("modal.on.shown", { relatedtarget: e }); this.backdrop($.proxy(this.backdropcallback, this, s)) } }, hide: function(e) { e && e.preventdefault(), e = $.event("modal.on.hide"), this.elements.modal.trigger(e), this.isshown && !e.isdefaultprevented() && (this.isshown = !1, $(window).off("resize.modal"), $(document).off("modal.on.focusin"), this.elements.modal.removeclass("in").off("click.modal.on.dismiss").off("mouseup.modal.on.dismiss"), this.elements.dialog.off("mousedown.modal.on.dismiss"), $.support.transition && this.elements.modal.hasclass("fade") ? this.elements.modal.one("bstransitionend", $.proxy(this.hidemodal, this)).emulatetransitionend(i) : this.hidemodal()) }, hidemodal: function() { var e = this; this.elements.modal.hide(), this.backdrop(function() { e.elements.body.removeclass("modal-open"), e.elements.body.css("padding-right", e.originalbodypad), e.elements.modal.trigger("modal.on.hidden") }) }, backdrop: function(e) { var t = this , s = this.elements.modal.hasclass("fade") ? "fade" : ""; if (this.isshown && this.settings.backdrop) { var i = $.support.transition && s; if (this.elements.backdrop = $(document.createelement("div")).addclass("modal-backdrop " + s).appendto(this.elements.body), this.elements.modal.on("click.modal.on.dismiss", $.proxy(function(e) { return this.ignorebackdropclick ? void (this.ignorebackdropclick = !1) : void (e.target === e.currenttarget && ("static" == this.settings.backdrop ? this.elements.modal[0].focus() : this.hide())) }, this)), i && this.elements.backdrop[0].offsetwidth, this.elements.backdrop.addclass("in"), !e) return; i ? this.elements.backdrop.one("bstransitionend", e).emulatetransitionend(n) : e() } else if (!this.isshown && this.elements.backdrop) { this.elements.backdrop.removeclass("in"); var a = function() { t.elements.backdrop && t.elements.backdrop.remove(), t.elements.backdrop = null, e && e() }; $.support.transition && this.elements.modal.hasclass("fade") ? this.elements.backdrop.one("bstransitionend", a).emulatetransitionend(n) : a() } else e && e() }, backdropcallback: function(e) { this.elements.modal.parent().length || this.elements.modal.appendto(this.elements.body), this.elements.modal.show(), this.elements.modal.scrolltop(0); var t = this.elements.modal.find(".modal-dialog:first") , s = document.documentelement.clientheight , n = document.documentelement.clientwidth , a = t.height() , o = t.width(); s > a && t.css({ position: "absolute", left: n / 2 - o / 2, top: s / 2 - a / 2, margin: 0 }); var r = $.support.transition && this.elements.modal.hasclass("fade"); if (r && this.elements.modal[0].offsetwidth, this.elements.modal.addclass("in"), $(document).off("modal.onfocusin"), $(document).on("modal.onfocusin", $.proxy(function(e) { this.elements.modal[0] === e.target || this.elements.modal.has(e.target).length || this.elements.modal.trigger("focus") }, this)), r) { var l = this; this.elements.dialog.one("bstransitionend", function() { l.elements.modal.trigger("focus").trigger(e) }), this.elements.dialog.emulatetransitionend(i) } else this.elements.modal.trigger("focus").trigger(e) }, adjustdialog: function() { var e = this.elements.modal[0].scrollheight > document.documentelement.clientheight; this.elements.modal.css({ paddingleft: !this.bodyisoverflowing && e ? this.scrollbarwidth : "", paddingright: this.bodyisoverflowing && !e ? this.scrollbarwidth : "" }) } }) }), function(e) { "use strict"; var t = "modal" , i = s.ui.controls.modal; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = "上一年" , n = "下一年" , a = "年" , o = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"] , r = function() {} , l = { enlangflag: !1, minyear: "1900", maxyear: "2099", position: "auto", monthsarr: o, split: "-", change: r } , h = { enlangflag: "enlangflag", minyear: "min-year", maxyear: "max-year", position: "position", split: "split" }; this.monthpicker = new e.class({ extend: s.ui.basecontrol },{ defaults: l, attributemap: h, settings: {}, value: "", data: {}, templates: {}, init: function(e, s) { if (this.element = $(e), !this.element.data("initialized")) { this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.settings.enlangflag && (i = "prev year", n = "next year", a = "", o = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], this.settings.monthsarr = o), this.year = (new date).getfullyear(), this.buildhtml(), this.initelements(), this.render(), this.transferattributes(); this.bindevents() } }, buildhtml: function() { var e = this.element.data("plugin-id") , t = ''; this.container = $(t), this.element.before(this.container), this.container.prepend(this.element), this.element.attr("data-s-dropdown-id", "#c-monthpicker-menu-" + e), this.element.is("input") && this.element.attr("autocomplete", "off") }, initelements: function() { this.elements = { view: this.element, monthpicker: this.container, menu: $(".monthpicker", this.container), icon: $(".glyphicon-calendar", this.container), prev: $(".monthpicker-control .icon-prev", this.container), next: $(".monthpicker-control .icon-next", this.container), calendaryear: $(".calendar-year", this.container), showyear: $(".calendar-year .btn-container span", this.container), showyearbtn: $(".calendar-year .btn-container", this.container), calendaryears: $(".calendar-year .calendar-years", this.container), calendarmonths: $(".calendar-months", this.container) }, this.initmonthpicker(); var e = this.elements.view.data("plugin-id"); this.dropdown = new s.ui.controls.dropdown(this.elements.view,{ _pluginid: e }), this.dropdown1 = new s.ui.controls.dropdown(this.elements.icon,{ _pluginid: e }); var t = this; this.elements.menu.on("click", function(e) { e.preventdefault(), e.stoppropagation(), t.elements.calendaryears.hide() }) }, bindevents: function() { var e = this; this.elements.view.on("focus", $.proxy(function(t) { e.elements.calendaryears.hide(), e.render() }, this)), this.elements.icon.on("click", $.proxy(function() { this.elements.view.focus() }, this)), this.elements.showyearbtn.on("click", $.proxy(this.showyearpanel, this)), this.elements.calendaryear.on("click", "li", $.proxy(this.yearchanged, this)), this.elements.calendarmonths.on("click", "li", $.proxy(this.monthchanged, this)), this.elements.view.on("blur", $.proxy(this.confirm, this)), this.elements.view.on("keydown", $.proxy(this.keyevent, this)), this.elements.view.on("onchange", $.proxy(this.settings.change, this)), this.elements.prev.on("click", $.proxy(this.clickprev, this)), this.elements.next.on("click", $.proxy(this.clicknext, this)) }, initmonthpicker: function() { for (var e = this.settings.maxyear, t = this.settings.minyear, s = '
      ', i = 0; i < 12; i++) s += "
    • " + o[i] + "
    • "; s += "
    ", this.elements.calendarmonths.html(s); for (var n = '
      ', a = t; a <= e; a++) n += "
    • " + a + "
    • "; n += "
    ", this.elements.calendaryears.html(n) }, transferattributes: function() { this.element.prop("disabled") && this.disable() }, keyevent: function(e) { switch (e.keycode) { case 13: this.confirm() } }, render: function() { this.year || (this.year = (new date).getfullyear()), this.elements.showyear.text(this.year); var e = this.elements.calendaryears.find("li[data-value=" + this.year + "]"); e.addclass("active").siblings().removeclass("active"); var t = this.elements.calendarmonths.find("li[data-value=" + this.month + "]"); t.addclass("active").siblings().removeclass("active") }, showyearpanel: function(e) { e.preventdefault(), e.stoppropagation(), this.elements.calendaryears.show(); var t = this.settings.minyear , s = this.year , i = s - t - 3; i < 0 && (i = 0), i = 26 * i, this.elements.calendaryears.scrolltop(i) }, yearchanged: function(e) { var t = $(e.target) , s = t.attr("data-value"); this.year = s, this.elements.showyear.text(s), t.addclass("active").siblings().removeclass("active"), this.elements.calendaryears.hide(), this.elements.view.trigger("onchange", this.getvalue()) }, monthchanged: function(e) { var t = $(e.target) , s = t.attr("data-value"); this.month = s, t.addclass("active").siblings().removeclass("active"), this.elements.view.trigger("onchange", this.getvalue()), "function" == typeof this.settings.onmonthselected && this.settings.onmonthselected() }, confirm: function(e) { var t = this.elements.view.val(); "" !== t && 0 !== t.length || (t = null), this.setbindvalue(t), this.render(), this.elements.view.trigger("onchange", this.getvalue()) }, setbindvalue: function(e) { if (e) { var t = moment(e, "yyyy-mm-dd"); this.year = t.toobject().years, this.month = t.toobject().months + 1, 1 * this.settings.minyear > 1 * this.year ? this.year = this.settings.minyear : 1 * this.settings.maxyear < 1 * this.year && (this.year = this.settings.maxyear) } else this.year = null, this.month = null }, setvalue: function(e) { this.setbindvalue(e), this.elements.view.val(e) }, getvalue: function() { if (this.year && this.month) { var e = parseint(this.month); return e < 10 && (e = "0" + e), this.year + this.settings.split + e } return null }, clickprev: function(e) { this.year > this.settings.minyear && (this.year = parseint(this.year) - 1), this.elements.view.trigger("onchange", this.getvalue()), this.render() }, clicknext: function(e) { this.year < this.settings.maxyear && (this.year = parseint(this.year) + 1), this.elements.view.trigger("onchange", this.getvalue()), this.render() }, refresh: function() {}, enable: function() { this.elements.view.prop("disabled", !1), this.container.removeclass("disabled"), this.elements.icon.removeclass("disabled") }, disable: function() { this.elements.view.prop("disabled", !0), this.elements.icon.addclass("disabled"), this.container.addclass("disabled") }, destroy: function() {}, getapi: function() { var e = this , t = { setvalue: "setvalue", getvalue: "getvalue" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "monthpicker" , i = s.ui.controls.monthpicker; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { group: !0, checkedicon: "glyphicon glyphicon-check", uncheckedicon: "glyphicon glyphicon-unchecked", change: void 0, placeholdervalue: "", splitformat: ",", showcheckall: !1, groupcheck: !1, sorter: void 0 } , n = { group: "group", placeholdervalue: "placeholder-value", splitformat: "split-format", showcheckall: "show-checkall", groupcheck: "group-check", name: "name" }; this.multiselect = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, settings: {}, value: "", data: {}, selects: {}, init: function(e, s) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.choosevalue = [], this.buildhtml(), this.initelements(), this.transferattributes(), this.bindevents()) }, buildhtml: function() { var e = this.element.data("plugin-id") , t = ''; this.container = $(t), this.element.before(this.container), this.element.hide() }, initelements: function() { this.elements = { original: this.element, viewcontainer: $(".c-multiselect-btn", this.container), view: $(".c-selectex-btn-text", this.container), menu: $(".dropdown-menu", this.container) }, this.dropdown = new s.ui.controls.dropdown(this.elements.viewcontainer,{}), this.elements.menu.on("click", function(e) { e.preventdefault(), e.stoppropagation() }) }, transferattributes: function() { this.elements.view.attr("style", this.element.attr("style")), this.elements.view.show(), this.elements.view.attr("title", this.element.attr("title")), this.elements.view.attr("class", this.elements.view.attr("class") + " " + this.element.attr("class")), this.element.prop("disabled") && this.disable() }, bindevents: function() { this.elements.menu.on("click", "a", $.proxy(this.clickitem, this)), "function" == typeof this.settings.change && this.elements.original.on("change", $.proxy(this.settings.change, this)) }, bindeventsinterface: function() { this.element }, updatedata: function(e) { var t = [] , s = {} , i = {} , n = {}; if (e) { var a = e; this.settings.group || (a = [{ options: e }]); for (var o = 0; o < a.length; o++) { var r = a[o]; t.push(r); for (var l = 0; l < r.options.length; l++) { var h = r.options[l]; h.value + "" && (i[h.value] = h.value), this.settings.group && (n[h.value] || (n[h.value] = []), n[h.value].push(o)), s[h.value] = h } } this.groupsource = t, this.map = s, this.showmap = i, this.lists = e, this.groupmap = n } }, render: function() { if (this.sourcemap = {}, this.groupsource) { var e = this.groupsource , t = ""; this.settings.showcheckall && (t += '
  • '); for (var s = 0, i = 0; i < e.length; i++) { var n = e[i]; t += "
  • ", this.settings.group && (t += this.settings.groupcheck ? '
    " : "
    "), t += "
    "; for (var a = 0; a < n.options.length; a++) t += "", s++, this.sourcemap[n.options[a].value] = n.options[a]; t += "
  • " } this.elements.menu.html(t) } }, setvalue: function(e) { if (e || 0 === e) { this.elements.menu.find("span").attr("class", this.settings.uncheckedicon); var t = e; "number" == typeof e && (t = e + ""); for (var s = t.split(this.settings.splitformat), i = [], n = 0; n < s.length; n++) { var a = this.showmap[s[n]]; this.map[a] && (i.push(this.map[a]), this.checkoption(a)) } this.choosevalue = i, this.relatecheck(); var o = this.elements.menu.find("a>span").length , r = this.elements.menu.find("a>span.glyphicon.glyphicon-check").length; o - 1 === r && this.elements.menu.find("span[data-s-checkall]").attr("class", this.settings.checkedicon), this.elements.view.text(this.getshowvalue()), this.container.attr("title", this.getshowvalue()), this.refreshplaceholder() } else this.choosevalue = [], this.elements.view.text(e), this.elements.view.text(e), this.container.attr("title", e), this.refreshplaceholder() }, sorterchoosevalue: function(e) { return this.choosevalue = this.settings.sorter ? this.settings.sorter(e) : e }, relatecheck: function() { var e = this.choosevalue , t = this.groupsource , s = this.groupmap; if (this.settings.group) for (var i = [], n = this, a = 0; a < e.length; a++) i = s[e[a].value], i.foreach(function(e) { var s = t[e].options , i = !0; s.foreach(function(e) { $('a[data-id="' + e.value + '"]', n.container).find("span").hasclass(n.settings.uncheckedicon) && (i = !1) }), i && $('a[data-group-id="' + e + '"]', n.container).find("span").attr("class", n.settings.checkedicon) }) }, getvalue: function() { return this.choosevalue }, getonlyvalue: function() { for (var e = [], t = 0; t < this.choosevalue.length; t++) e.push(this.choosevalue[t].value); return e.join(this.settings.splitformat) }, getshowvalue: function() { for (var e = [], t = 0; t < this.choosevalue.length; t++) e.push(this.choosevalue[t].text); return e.join(this.settings.splitformat) }, checkoption: function(e) { var t = $('a[data-id="' + e + '"]', this.container) , s = t.find("span"); s.attr("class", this.settings.checkedicon) }, clickitem: function(e) { if (!$(e.target).closest("a").hasclass("disabled")) { var t = $(e.target).closest("a") , s = t.attr("data-id") , i = t.find("span") , n = i.hasclass("glyphicon glyphicon-unchecked") , a = this.map[s] , o = !1; if (t.attr("data-group-id")) { var r = t.attr("data-group-id") , l = this.lists[r] , h = $(e.target).closest("dl").find("dd"); if (i.hasclass(this.settings.uncheckedicon)) { for (var c = 0; c < l.options.length; c++) { var d = $('a[data-id="' + l.options[c].value + '"]', this.container).find("span"); d.hasclass(this.settings.uncheckedicon) && (d.attr("class", this.settings.checkedicon), this.choosevalue.push(l.options[c])) } i.attr("class", this.settings.checkedicon) } else { for (var c = 0; c < l.options.length; c++) { var d = $(h[c]).find("a > span"); d.attr("class", this.settings.uncheckedicon), this.choosevalue.splice(this.contains(this.choosevalue, l.options[c], { value: "value" }), 1) } i.attr("class", this.settings.uncheckedicon) } return this.settings.click && this.settings.click(e, { text: t.find("label").text(), value: -1 }, n), this.elements.view.text(this.getshowvalue()), this.refreshplaceholder(), void this.elements.original.trigger("change", json.stringify(this.sorterchoosevalue(this.choosevalue))) } if ("-1" === s) return i.hasclass(this.settings.uncheckedicon) ? this.checkall() : this.uncheckall(), void (this.settings.click && this.settings.click(e, { text: t.find("label").text(), value: -1 }, n)); if (i.hasclass(this.settings.uncheckedicon)) i.attr("class", this.settings.checkedicon), this.choosevalue.push(a), o = !0; else { i.attr("class", this.settings.uncheckedicon); for (var c = 0; c < this.choosevalue.length; c++) if (this.choosevalue[c].value === a.value) { this.choosevalue.splice(c, 1); break } o = !1 } this.elements.view.text(this.getshowvalue()), this.refreshplaceholder(), this.elements.original.trigger("change", json.stringify(this.sorterchoosevalue(this.choosevalue))), this.sourcemap && this.settings.click && this.settings.click(e, this.sourcemap[t.attr("data-value")], n) } }, duplicate: function(e, t, s) { for (var i = 0; i < e.length; i++) if (e[i][s] === t[s]) return !0; return !1 }, contains: function(e, t, s) { var i = !0; if (array.isarray(e) || (e = [e]), "object" != typeof t) return e.indexof(t); for (var n = 0; n < e.length; n++) { i = !0; for (var a in s) t[s[a]] != e[n][s[a]] && (i = !1); if (i) return n } return -1 }, checkall: function() { var e = []; if (this.settings.groupcheck) { this.choosevalue.splice(0, this.choosevalue.length); for (var t = 0; t < this.lists.length; t++) for (var s = this.lists[t].options, i = 0; i < s.length; i++) this.duplicate(e, s[i], "value") || (e.push(s[i]), this.choosevalue.push(s[i])); this.elements.menu.find("dd>a>span").attr("class", this.settings.checkedicon), this.elements.view.text(this.getshowvalue()), this.refreshplaceholder(), this.elements.original.trigger("change", json.stringify(this.sorterchoosevalue(this.choosevalue))) } else { this.choosevalue.splice(0, this.choosevalue.length); for (var t = 0; t < this.lists.length; t++) this.choosevalue.push(this.lists[t]); this.elements.menu.find("dd>a>span").attr("class", this.settings.checkedicon), this.elements.view.text(this.getshowvalue()), this.refreshplaceholder(), this.elements.original.trigger("change", json.stringify(this.sorterchoosevalue(this.choosevalue))) } }, uncheckall: function() { this.choosevalue.splice(0, this.choosevalue.length), this.elements.menu.find("dd>a>span").attr("class", this.settings.uncheckedicon), this.elements.view.text(this.getshowvalue()), this.refreshplaceholder(), this.elements.original.trigger("change", json.stringify(this.choosevalue)) }, refreshplaceholder: function() { this.elements.view.text() === this.settings.placeholdervalue || "" === this.elements.view.text() ? (this.elements.view.addclass("placeholder"), this.elements.view.text(this.settings.placeholdervalue)) : this.elements.view.removeclass("placeholder") }, refresh: function() {}, enable: function() { this.elements.viewcontainer.removeclass("disabled") }, disable: function() { this.elements.viewcontainer.addclass("disabled") }, destroy: function() {} }) }), function(e) { "use strict"; var t = "multiselect" , i = s.ui.controls.multiselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = {} , n = {}; this.radio = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, settings: {}, value: "", data: {}, templates: {}, init: function(e, s) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.buildhtml(), this.buildevent()) }, buildhtml: function() { this.element.find("input").attr("type"); this.element.find("li").each(function() { $(this).find("input").attr({ "class": "labelauty", style: "display: none" }); var e = $(this).find("input").attr("data-labelauty") , t = ""; $(this).append(t) }) }, buildevent: function() { this.element; this.element.find("label").click(function() { "disabled" != $(this.previouselementsibling).attr("disabled") && ("checkbox" == $(this.previouselementsibling).attr("type") && (this.previouselementsibling.checked === !0 ? this.previouselementsibling.checked = !1 : this.previouselementsibling.checked = !0), "radio" == $(this.previouselementsibling).attr("type") && (this.previouselementsibling.checked = !0)) }) } }) }), function(e) { "use strict"; var t = "radio" , i = s.ui.controls.radio; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { left: "", leftall: "", leftselected: "", right: "", rightall: "", rightselected: "", undo: "", redo: "", submitallleft: !1, submitallright: !1, startup: function(e, t) { t.find("option").each(function(t, s) { e.find('option[value="' + s.value + '"]').remove() }) }, beforemovetoright: function(e, t, s) { return !0 }, aftermovetoright: function(e, t, s) {}, beforemovetoleft: function(e, t, s) { return !0 }, aftermovetoleft: function(e, t, s) {}, sort: function(e, t) { return "na" == e.innerhtml ? 1 : "na" == t.innerhtml ? -1 : e.innerhtml > t.innerhtml ? 1 : -1 } } , n = { left: "left", leftall: "left-all", leftselected: "left-selected", right: "right", rightselected: "right-selected", rightall: "right-all" }; this.rightselect = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, undostack: [], redostack: [], init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s); var i = this.element.prop("id") || "rightselect"; this.settings.left = this.settings.left.length ? this.settings.left : "#" + i + "_leftselect", this.settings.leftselected = this.settings.leftselected.length ? this.settings.leftselected : "#" + i + "_leftselected", this.settings.leftall = this.settings.leftall.length ? this.settings.leftall : "#" + i + "_leftall", this.settings.right = this.settings.right.length ? this.settings.right : "#" + i + "_rightselect", this.settings.rightselected = this.settings.rightselected.length ? this.settings.rightselected : "#" + i + "_rightselected", this.settings.rightall = this.settings.rightall.length ? this.settings.rightall : "#" + i + "_rightall", this.settings.undo = this.settings.undo.length ? this.settings.undo : "#" + i + "_undo", this.settings.redo = this.settings.redo.length ? this.settings.redo : "#" + i + "_redo", this.buildhtml(), this.initelements(), this.bindevents(), this.settings.keeprenderingsort && (this.settings.sort = function(e, t) { return $(e).data("position") > $(t).data("position") ? 1 : -1 } , this.elements.left.find("option").each(function(e, t) { $(t).data("position", e) }), this.elements.right.find("option").each(function(e, t) { $(t).data("position", e) })) }, buildhtml: function() { var e = ''; this.settings.search_left && $(this.settings.left).before($(e)), this.settings.search_right && $(this.settings.right).before($(e)) }, initelements: function() { this.elements = { original: this.element, left: $(this.settings.left), leftselected: $(this.settings.leftselected), rightselected: $(this.settings.rightselected), right: $(this.settings.right), leftall: $(this.settings.leftall), rightall: $(this.settings.rightall), undo: $(this.settings.undo), redo: $(this.settings.redo) }, this.settings.search_left && (this.elements.search_left = this.elements.left.prev()), this.settings.search_right && (this.elements.search_right = this.elements.right.prev()), "function" == typeof this.settings.startup && this.settings.startup(this.elements.left, this.elements.right), this.settings.keeprenderingsort && "function" == typeof this.settings.sort && (this.elements.left.find("option").sort(this.settings.sort).appendto(this.elements.left), this.elements.right.each(function(e, t) { 0 !== $(t).find("option").length && $(t).find("option").sort(this.settings.sort).appendto(t) })) }, bindevents: function() { var e = this; this.elements.left.on("dblclick", "option", function(t) { t.preventdefault(), e.movetoright(this, t) }), this.elements.right.on("dblclick", "option", function(t) { t.preventdefault(), e.movetoleft(this, t) }), this.elements.search_left && this.elements.search_left.on("keyup", $.proxy(this._filteoptions, this, this.elements.left)), this.elements.search_right && this.elements.search_right.on("keyup", $.proxy(this._filteoptions, this, this.elements.right)), this.elements.right.closest("form").on("submit", function(t) { e.elements.left.children().prop("selected", e.settings.submitallleft), e.elements.right.children().prop("selected", e.settings.submitallright) }), (navigator.useragent.match(/msie/i) || navigator.useragent.indexof("trident/") > 0 || navigator.useragent.indexof("edge/") > 0) && (this.elements.left.dblclick(function(t) { e.elements.rightselected.trigger("click") }), this.elements.right.dblclick(function(t) { e.elements.leftselected.trigger("click") })), this.elements.rightselected.on("click", function(t) { t.preventdefault(); var s = e.elements.left.find("option:selected"); s && e.movetoright(s, t), $(this).blur() }), this.elements.leftselected.on("click", function(t) { t.preventdefault(); var s = e.elements.right.find("option:selected"); s && e.movetoleft(s, t), $(this).blur() }), this.elements.rightall.on("click", function(t) { t.preventdefault(); var s = e.elements.left.find("option"); s && e.movetoright(s, t), $(this).blur() }), this.elements.leftall.on("click", function(t) { t.preventdefault(); var s = e.elements.right.find("option"); s && e.movetoleft(s, t), $(this).blur() }), this.elements.undo.on("click", function(t) { t.preventdefault(), e.undo(t) }), this.elements.redo.on("click", function(t) { t.preventdefault(), e.redo(t) }) }, _filteoptions: function(e, t) { var s = new regexp($(t.target).val(),"ig"); return navigator.useragent.match(/msie/i) || navigator.useragent.indexof("trident/") > 0 || navigator.useragent.indexof("edge/") > 0 ? void e.find("option, span").each(function(e, t) { var i = $(t); if (i.text().search(s) >= 0) { if (i.is("option")) return; i.data("ref") && i.replacewith(i.data("ref")) } else { if (i.is("span")) return; var n = i.text() , a = i.val() , o = $("").text(n).val(a).hide() , r = i.clone(); i.replacewith(o), o.data("ref", r) } }) : void e.find("option").each(function(e, t) { t.text.search(s) >= 0 ? $(t).show() : $(t).hide() }) }, movetoright: function(e, t, s, i) { if ("function" == typeof this.settings.movetoright) this.settings.movetoright(this, e, t, s, i); else { if ("function" == typeof this.settings.beforemovetoright && !s && !this.settings.beforemovetoright(this.elements.left, this.elements.right, e)) return !1; this.elements.right.append(e), i || (this.undostack.push(["right", e]), this.redostack = []), "function" != typeof this.settings.sort || s || this.elements.right.find("option").sort(this.settings.sort).appendto(this.elements.right), "function" != typeof this.settings.aftermovetoright || s || this.settings.aftermovetoright(this.elements.left, this.elements.right, e) } }, movetoleft: function(e, t, s, i) { if ("function" == typeof this.settings.movetoleft) this.settings.movetoleft(this, e, t, s, i); else { if ("function" == typeof this.settings.beforemovetoleft && !s && !this.settings.beforemovetoleft(this.elements.left, this.elements.right, e)) return !1; this.elements.left.append(e), i || (this.undostack.push(["left", e]), this.redostack = []), "function" != typeof this.settings.sort || s || this.elements.left.find("option").sort(this.settings.sort).appendto(this.elements.left), "function" != typeof this.settings.aftermovetoleft || s || this.settings.aftermovetoleft(this.elements.left, this.elements.right, e) } }, undo: function(e) { var t = this.undostack.pop(); if (t) switch (this.redostack.push(t), t[0]) { case "left": this.movetoright(t[1], e, !1, !0); break; case "right": this.movetoleft(t[1], e, !1, !0) } }, redo: function(e) { var t = this.redostack.pop(); if (t) switch (this.undostack.push(t), t[0]) { case "left": this.movetoleft(t[1], e, !1, !0); break; case "right": this.movetoright(t[1], e, !1, !0) } } }) }), function(e) { "use strict"; var t = "rightselect" , i = s.ui.controls.rightselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { onselected: void 0, placeholdervalue: "", position: "down,left", down: "dropdown", up: "dropup", selectfirst: !1 } , n = { placeholdervalue: "placeholder-value", position: "position", selectfirst: "select-first" }; this.selectex = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, settings: {}, value: "", data: {}, selects: {}, init: function(e, s) { if (this.element = $(e), !this.element.data("initialized")) { this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.buildhtml(), this.initelements(), this.transferattributes(), this.bindevents(), this.parse(); var i = this; $.when(this.getdata()).done(function() { i.render() }) } }, getdata: function() { var e = $.deferred(); if (this.settings.data) { var t = $.extend(!0, [], this.settings.data); return this.updatedata(t), delete this.settings.data, e.resolve(), e.promise() } return e.resolve(), e.promise() }, buildhtml: function() { var e = this.element.data("plugin-id") , t = ''; this.container = $(t), this.element.before(this.container), this.element.hide(), this.autoupposition() }, initelements: function() { this.elements = { original: this.element, viewcontainer: $(".c-selectex-btn", this.container), view: $(".c-selectex-btn-text", this.container), menu: $(".dropdown-menu", this.container) }, this.dropdown = new s.ui.controls.dropdown(this.elements.viewcontainer,{}) }, autoupposition: function() { var e = this.settings.position.split(",") , t = e[0] , s = e[1] , i = "up" === t ? this.settings.up : this.settings.down; $("div", this.container).addclass(i), this.settings.isrightposition = !1, "right" === s && (this.settings.isrightposition = !0) }, autorightposition: function() { if (this.settings.isrightposition) { var e = this.elements.viewcontainer.width() , t = this.elements.menu.width() , s = e - t; this.elements.menu.css("margin-left", s) } }, transferattributes: function() { this.elements.view.attr("style", this.element.attr("style")), this.elements.view.css("display", "block"), this.elements.view.attr("title", this.element.attr("title")), this.elements.view.attr("class", this.elements.view.attr("class") + " " + this.element.attr("class")), this.element.prop("disabled") && this.disable() }, bindevents: function() { this.elements.viewcontainer.on("click", $.proxy(this.setscrolltop, this)), this.elements.menu.on("click", "li", $.proxy(this.clickitem, this)), "function" == typeof this.settings.onselected && this.elements.view.on("onselected", $.proxy(this.settings.onselected, this)), this.container.on("keydown", $.proxy(this.keyevent, this)) }, keyevent: function(e) { switch (e.keycode) { case 9: case 13: this.select(); break; case 27: e.preventdefault(); break; case 38: if (e.shiftkey) return; e.preventdefault(), this.prev(); break; case 40: if (e.shiftkey) return; e.preventdefault(), this.next() } e.stoppropagation() }, next: function(e) { var t = this.elements.menu.find(".active").removeclass("active") , s = t.next(); s.length || (s = $(this.elements.menu.find("li")[0])), s.addclass("active"), this.setscrolltop() }, prev: function(e) { var t = this.elements.menu.find(".active").removeclass("active") , s = t.prev(); s.length || (s = this.elements.menu.find("li").last()), s.addclass("active"), this.setscrolltop() }, select: function() { if (!this.elements.menu.find(".active").hasclass("disabled")) { var e = this.elements.menu.find(".active a").data("value"); this.selectid = e; var t = this.map[e]; this.elements.view.text(t.text), this.elements.view.attr("title", this.elements.view.text()), this.elements.view.trigger("onselected", t), this.dropdown.toggle() } }, bindeventsinterface: function() { this.element }, parse: function() { var e, t = [], s = 0, i = {}, n = {}; this.element.find("option").each(function() { var a = $(this) , o = { text: a.text(), value: a.val(), disabled: a.prop("disabled") }; t.push(o), e = a.val() || a.text(), i[e] = o, a.val() && (n[e] = a.val()), s++ }), this.source = t, this.map = i, this.showmap = n }, updatedata: function(e) { var t, s = [], i = {}, n = {}; if (e) { for (var a = 0; a < e.length; a++) { var o = e[a]; s.push(o), t = o.value + "" || o.text, i[t] = o, o.value + "" && (n[t] = o.value) } this.source = s, this.map = i, this.showmap = n } }, setmodelvalue: function(e) { this.selectid = e }, setvalue: function(e) { this.setmodelvalue(e), this.render() }, getvalue: function(e) { var t; return t = "undefined" == typeof e || e === !1 ? this.selectid : this.map[this.selectid] }, getindex: function(e) { if (!this.source) return 0; for (var t = 0; t < this.source.length; t++) if (this.source[t].value === e) return t; return 0 }, setscrolltop: function(e) { var t = this.elements.menu.find("li.active").eq(0); if (t.length > 0) { var s = t.position().top - this.elements.menu.find("li:first").position().top; s = s < 150 ? 0 : s - 150, this.elements.menu.scrolltop(s) } }, render: function() { if (this.source) { this.elements.view.text(""); var e = this.source , t = $.extend(!0, [], e); e = this.replaceparsedata(t), this.elements.menu.html(""); for (var s = 0; s < e.length; s++) { var i = e[s] , n = $("
  • ") , a = $(""); (i.unselectable || i.disabled) && n.attr("class", "disabled"), a.attr("title", i.text).attr("data-id", "" + s).attr("data-value", i.value).html(i.text), n.html(a), this.elements.menu.append(n) } var o = this.elements.menu.find('li a[data-value="' + this.selectid + '"]').parent(); if (o.length) o.addclass("active"), this.elements.view.text(o.text()), this.elements.view.attr("title", this.elements.view.text()); else if (this.elements.menu.find("li").length && this.settings.selectfirst) { var r = this.elements.menu.find("li").eq(0) , l = r.find("a").attr("data-value") , i = this.map[l] || this.map[r.find("a").text()]; this.elements.view.trigger("onselected", i) } this.autorightposition() } }, clickitem: function(e) { var t = $(e.target); if (t.is("li") && (t = t.find("a")), !t.parent("li").hasclass("disabled")) { var s = t.attr("data-value") || t.text(); this.selectid = s, t.parent("li").addclass("active").siblings().removeclass("active"); var i = this.map[s]; this.elements.view.text(i.text), this.elements.view.attr("title", this.elements.view.text()), this.elements.view.trigger("onselected", i), this.dropdown.toggle(e) } }, refresh: function() {}, enable: function() { this.elements.viewcontainer.removeclass("disabled"), this.elements.viewcontainer.prop("disabled", !1) }, disable: function() { this.elements.viewcontainer.addclass("disabled"), this.elements.viewcontainer.prop("disabled", !0) }, destroy: function() {}, getapi: function() { var e = this , t = { setvalue: "setvalue", getvalue: "getvalue", updatedata: "updatedata" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "selectex" , i = s.ui.controls.selectex; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { map: { text: "text", value: "value" }, multiple: !0, itemstype: void 0, selecteditems: [], returnvalue: [], click: function() {}, dblclick: function() {}, mouseover: function() {}, mouseout: function() {} } , n = {}; this.selectlist = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, settings: {}, init: function(e, s) { this.$element = this.element = $(e); this.events = { click: function(e) { var t = $(e.target).is("li") ? $(e.target) : $(e.target).parent("li"); t.is("li") && !t.hasclass("c-selectlist-disabled") && (this.settings.multiple ? $(t).toggleclass("c-selectlist-active") : ($(t).siblings("li.c-selectlist-active").removeclass("c-selectlist-active"), $(t).addclass("c-selectlist-active")), this.selecteditem(), this.settings.click.apply($(e.target), [e, t.data("s-value")])) }, dblclick: function(e) { var t = $(e.target); t.is("li") && !t.hasclass("c-selectlist-disabled") && this.settings.dblclick.apply($(e.target), [e, t.data("s-value")]) }, mouseover: function(e) { var t = $(e.target); t.is("li") && !t.hasclass("c-selectlist-disabled") && this.settings.mouseover.apply($(e.target), [e, t.data("s-value")]) }, mouseout: function(e) { var t = $(e.target); t.is("li") && !t.hasclass("c-selectlist-disabled") && this.settings.mouseout.apply($(e.target), [e, t.data("s-value")]) } }, this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.choosevalue = [], this.settings.datasource = this.settings.datasource || [], this.buildhtml(), this.initelements(), this.bindevents()) }, buildhtml: function() { for (var e, t = $('
      '), s = this.settings.datasource, i = this.settings.map.text, n = 0; n < s.length; n++) e = "object" == typeof s[n] ? $('
    • ' + s[n][i] + "
    • ") : $('
    • ' + s[n] + "
    • "), e.data("s-value", s[n]), t.find("ul").append(e); this.settings.itemstype = typeof s[0], this.$element.html(t) }, initelements: function() { this.elements = {} }, transferattributes: function() {}, bindevents: function() { for (var e in this.events) this.$element.on(e, $.proxy(this.events[e], this)) }, bindeventsinterface: function() { this.element }, setdata: function(e) { this.destroy(), this.settings.selecteditems = [], this.settings.datasource = e, this.buildhtml(), this.bindevents() }, additem: function(e) { var t, s, i = this.settings.map.text; array.isarray(e) || (e = [e]); for (var n = 0; n < e.length; n++) t = e[n], s = "object" == typeof t ? $('
    • ' + t[i] + "
    • ") : $('
    • ' + t + "
    • "), s.data("s-value", t), this.$element.find("ul").append(s) }, coveritem: function(e) { var t, s, i = this.settings.map.text; array.isarray(e) || (e = [e]); for (var n = 0; n < e.length; n++) t = e[n], s = "object" == typeof t ? $('
    • ' + t[i] + "
    • ") : $('
    • ' + t + "
    • "), s.data("s-value", t), this.$element.find("ul").html(s) }, getitems: function() { var e = []; return this.$element.find("li").each(function(t, s) { e.push($(s).data("s-value")) }), e }, getcheckeditems: function() { var e = []; return this.$element.find("li.c-selectlist-checked").each(function(t, s) { e.push($(s).data("s-value")) }), e }, selecteditem: function() { var e = []; this.settings.selecteditems = [], this.$element.find("li.c-selectlist-active").each(function(t, s) { e.push($(s).data("s-value")) }), this.settings.selecteditems = e }, getselecteditems: function() { var e = [] , t = this.settings.returnvalue , s = this.settings.itemstype , i = this.settings.selecteditems; if ("object" == s && t.length > 0) { for (var n = 0; n < i.length; n++) { for (var a = new object({}), o = 0; o < t.length; o++) a[t[o]] = i[n][t[o]]; e.push(a) } return e } return this.settings.selecteditems }, clearcheckeditems: function() { this.$element.find("li").removeclass("c-selectlist-checked") }, clearselecteditems: function() { this.$element.find("li").removeclass("c-selectlist-active") }, deleteitem: function(e) { this.actiontype(e, "deleteitem", !0) }, setselecteditem: function(e) { this.actiontype(e, "setselecteditem", !0) }, setcheckeditems: function(e) { this.actiontype(e, "setcheckeditems") }, uncheckeditems: function(e) { this.actiontype(e, "uncheckeditems") }, setitemdisabled: function(e) { this.actiontype(e, "setitemdisabled", !0) }, actiontype: function(e, t, s) { array.isarray(e) || (e = [e]); for (var i = 0; i < e.length; i++) "object" == this.settings.itemstype ? this.isobject(e[i], t) : this.isstring(e[i], t); s && this.selecteditem() }, isobject: function(e, t) { var s = this.settings.map.value; this.$element.find("li").each(function(i, n) { if ($(n).data("s-value")[s] === e[s]) if ("setitemdisabled" === t) $(n).addclass("c-selectlist-disabled").removeclass("c-selectlist-active"); else if ("setselecteditem" === t) { if ($(n).hasclass("c-selectlist-disabled")) return; $(n).addclass("c-selectlist-active") } else "deleteitem" === t ? $(n).remove() : "setcheckeditems" === t ? $(n).addclass("c-selectlist-checked") : "uncheckeditems" === t && $(n).removeclass("c-selectlist-checked") }) }, isstring: function(e, t) { this.$element.find("li").each(function(s, i) { if ($(i).data("s-value") === e) if ("setitemdisabled" === t) $(i).addclass("c-selectlist-disabled").removeclass("c-selectlist-active"); else if ("setselecteditem" === t) { if ($(i).hasclass("c-selectlist-disabled")) return; $(i).addclass("c-selectlist-active") } else "deleteitem" === t ? $(i).remove() : "setcheckeditems" === t ? $(i).addclass("c-selectlist-checked") : "uncheckeditems" === t && $(i).removeclass("c-selectlist-checked"); }) }, getapi: function() { var e = this , t = { setdata: "setdata", setselecteditem: "setselecteditem", getselecteditems: "getselecteditems", setitemdisabled: "setitemdisabled", additem: "additem", coveritem: "coveritem", getitems: "getitems", deleteitem: "deleteitem", setcheckeditems: "setcheckeditems", uncheckeditems: "uncheckeditems", getcheckeditems: "getcheckeditems" } , i = s.utilities.buildapi(e, t); return i }, destroy: function() { for (var e in this.events) this.$element.off(e) }, refresh: function() {}, enable: function() {}, disable: function() {} }) }), function(e) { "use strict"; var t = "selectlist" , i = s.ui.controls.selectlist; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), function(e, t, s, i) { "use strict"; function n(t, s) { this.element = e(t), this.settings = e.extend({}, o, s), this._defaults = o, this._name = a, this.init() } var a = "sidebar" , o = { toggle: !0, doubletaptogo: !1 }; n.prototype = { init: function() { var t = this.element , i = this.settings.toggle , n = this; this.isie() <= 9 ? (t.find("li.active").has("ul").children("ul").collapse("show"), t.find("li").not(".active").has("ul").children("ul").collapse("hide")) : (t.find("li.active").has("ul").children("ul").addclass("collapse in"), t.find("li").not(".active").has("ul").children("ul").addclass("collapse")), n.settings.doubletaptogo && t.find("li.active").has("ul").children("a").addclass("doubletaptogo"); var o = this; t.find("li").has("ul").children("a").on("click." + a, function(t) { if (t.preventdefault(), n.settings.doubletaptogo && n.doubletaptogo(e(this)) && "#" !== e(this).attr("href") && "" !== e(this).attr("href")) return t.stoppropagation(), void (s.location = e(this).attr("href")); var a = e(this).parent("li").toggleclass("active").children("ul"); a.hasclass("in") ? (o.isie() <= 9 && a.hide(), a.removeclass("in")) : (o.isie() <= 9 && a.show(), a.addclass("in")), i && e(this).parent("li").siblings().removeclass("active").children("ul.in").collapse("hide") }) }, isie: function() { for (var e, t = 3, i = s.createelement("div"), n = i.getelementsbytagname("i"); i.innerhtml = "", n[0]; ) return t > 4 ? t : e }, doubletaptogo: function(e) { var t = this.element; return e.hasclass("doubletaptogo") ? (e.removeclass("doubletaptogo"), !0) : e.parent().children("ul").length ? (t.find(".doubletaptogo").removeclass("doubletaptogo"), e.addclass("doubletaptogo"), !1) : void 0 }, destroy: function() { this.element.off("." + a), this.element.removedata(a) } }, e.fn[a] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new n(this,t)) }), this } }(jquery, window, document), jx()["package"]("s.ui.controls", function(e) { "use strict"; function t(e, t) { return e + ".touchspin_" + t } function i(e, s) { return $.map(e, function(e) { return t(e, s) }) } var n = 0 , a = { min: 0, max: 100, defaultvalue: "", step: 1, decimals: 0, stepinterval: 100, forcestepdivisibility: "round", stepintervaldelay: 500, verticalbuttons: !1, verticalupclass: "glyphicon glyphicon-chevron-up", verticaldownclass: "glyphicon glyphicon-chevron-down", prefix: "", postfix: "", prefix_extraclass: "", postfix_extraclass: "", booster: !0, boostat: 10, maxboostedstep: !1, mousewheel: !0, buttondown_class: "btn btn-default", buttonup_class: "btn btn-default" } , o = { min: "min", max: "max", defaultvalue: "default-value", step: "step", decimals: "decimals", stepinterval: "step-interval", verticalbuttons: "vertical-buttons", verticalupclass: "vertical-up-class", verticaldownclass: "vertical-down-class", forcestepdivisibility: "force-step-divisibility", stepintervaldelay: "step-interval-delay", prefix: "prefix", postfix: "postfix", prefix_extraclass: "prefix-extra-class", postfix_extraclass: "postfix-extra-class", booster: "booster", boostat: "boostat", maxboostedstep: "max-boosted-step", mousewheel: "mouse-wheel", buttondown_class: "button-down-class", buttonup_class: "button-up-class" }; this.spinner = new e.class({ extend: s.ui.basecontrol },{ defaults: a, attributemap: o, init: function(e, t) { return "destroy" === t ? void this.each(function() { var e = $(e) , t = e.data(); $(document).off(i(["mouseup", "touchend", "touchcancel", "mousemove", "touchmove", "scroll", "scrollstart"], t.spinnerid).join(" ")) }) : (n += 1, this.element = $(e), this.element_data = this.element.data(), this.elements, this.settings, this.container, this.value, this.downspintimer, this.upspintimer, this.downdelaytimeout, this.updelaytimeout, this.spincount = 0, this.spinning = !1, this.element.is("input") ? void (this.element.data("alreadyinitialized") || (this.element.data("alreadyinitialized", !0), this.element.data("spinnerid", n), this.initsettings(), this._setinitval(), this._checkvalue(), this._buildhtml(), this._initelements(), this._hideemptyprefixpostfix(), this._bindevents(), this._bindeventsinterface(), this.elements.input.css("display", "block"))) : void console.log("must be an input.")) }, _setinitval: function() { "" !== this.settings.defaultvalue && "" === this.element.val() && this.element.val(this.settings.defaultvalue) }, changesettings: function(e) { this._updatesettings(e), this._checkvalue(); var t = this.elements.input.val(); "" !== t && (t = number(this.elements.input.val()), this.elements.input.val(t.tofixed(this.settings.decimals))) }, _updatesettings: function(e) { this.settings = $.extend({}, this.settings, e) }, _buildhtml: function() { var e = this.element.val() , t = this.element.parent(); "" !== e && (e = number(e).tofixed(this.settings.decimals)), this.element.data("initvalue", e).val(e), this.element.addclass("form-control"), t.hasclass("input-group") ? this._advanceinputgroup(t) : this._buildinputgroup() }, _advanceinputgroup: function(e) { e.addclass("bootstrap-spinner"); var t, s, i = this.element.prev(), n = this.element.next(), a = '' + this.settings.prefix + "", o = '' + this.settings.postfix + ""; i.hasclass("input-group-btn") ? (t = '', i.append(t)) : (t = '', $(t).insertbefore(this.element)), n.hasclass("input-group-btn") ? (s = '', n.prepend(s)) : (s = '', $(s).insertafter(this.element)), $(a).insertbefore(this.element), $(o).insertafter(this.element), this.container = e }, _buildinputgroup: function() { var e; e = this.settings.verticalbuttons ? '
      ' + this.settings.prefix + '' + this.settings.postfix + '
      ' : '
      ' + this.settings.prefix + '' + this.settings.postfix + '
      ', this.container = $(e).insertbefore(this.element), $(".bootstrap-spinner-prefix", this.container).after(this.element), this.element.hasclass("input-sm") ? this.container.addclass("input-group-sm") : this.element.hasclass("input-lg") && this.container.addclass("input-group-lg") }, _initelements: function() { this.elements = { down: $(".bootstrap-spinner-down", this.container), up: $(".bootstrap-spinner-up", this.container), input: $("input", this.container), prefix: $(".bootstrap-spinner-prefix", this.container).addclass(this.settings.prefix_extraclass), postfix: $(".bootstrap-spinner-postfix", this.container).addclass(this.settings.postfix_extraclass) } }, _hideemptyprefixpostfix: function() { "" === this.settings.prefix && this.elements.prefix.hide(), "" === this.settings.postfix && this.elements.postfix.hide() }, _bindevents: function() { var e = this; this.element.on("keydown", function(t) { var s = t.keycode || t.which; 38 === s ? ("up" !== e.spinning && (e.uponce(), e.startupspin()), t.preventdefault()) : 40 === s && ("down" !== e.spinning && (e.downonce(), e.startdownspin()), t.preventdefault()) }), this.element.on("keyup", function(t) { var s = t.keycode || t.which; 38 === s ? e.stopspin() : 40 === s && e.stopspin() }), this.element.on("blur", function() { e._checkvalue() }), this.elements.down.on("keydown", function(t) { var s = t.keycode || t.which; 32 !== s && 13 !== s || ("down" !== e.spinning && (e.downonce(), e.startdownspin()), t.preventdefault()) }), this.elements.down.on("keyup", function(t) { var s = t.keycode || t.which; 32 !== s && 13 !== s || e.stopspin() }), this.elements.up.on("keydown", function(t) { var s = t.keycode || t.which; 32 !== s && 13 !== s || ("up" !== e.spinning && (e.uponce(), e.startupspin()), t.preventdefault()) }), this.elements.up.on("keyup", function(t) { var s = t.keycode || t.which; 32 !== s && 13 !== s || e.stopspin() }), this.elements.down.on("mousedown.spinner", function(t) { e.elements.down.off("touchstart.spinner"), e.element.is(":disabled") || (e.downonce(), e.startdownspin(), t.preventdefault(), t.stoppropagation()) }), this.elements.down.on("touchstart.spinner", function(t) { e.elements.down.off("mousedown.spinner"), this.element.is(":disabled") || (e._budownonce(), e.startdownspin(), t.preventdefault(), t.stoppropagation()) }), this.elements.up.on("mousedown.spinner", function(t) { e.elements.up.off("touchstart.spinner"), e.element.is(":disabled") || (e.uponce(), e.startupspin(), t.preventdefault(), t.stoppropagation()) }), this.elements.up.on("touchstart.spinner", function(t) { e.elements.up.off("mousedown.spinner"), e.element.is(":disabled") || (e.uponce(), e.startupspin(), t.preventdefault(), t.stoppropagation()) }), this.elements.up.on("mouseout touchleave touchend touchcancel", function(t) { e.spinning && (t.stoppropagation(), e.stopspin()) }), this.elements.down.on("mouseout touchleave touchend touchcancel", function(t) { e.spinning && (t.stoppropagation(), e.stopspin()) }), this.elements.down.on("mousemove touchmove", function(t) { e.spinning && (t.stoppropagation(), t.preventdefault()) }), this.elements.up.on("mousemove touchmove", function(t) { e.spinning && (t.stoppropagation(), t.preventdefault()) }), $(document).on(i(["mouseup", "touchend", "touchcancel"], n).join(" "), function(t) { e.spinning && (t.preventdefault(), e.stopspin()) }), $(document).on(i(["mousemove", "touchmove", "scroll", "scrollstart"], n).join(" "), function(t) { e.spinning && (t.preventdefault(), e.stopspin()) }), this.element.on("mousewheel dommousescroll", function(t) { if (e.settings.mousewheel && e.element.is(":focus")) { var s = t.originalevent.wheeldelta || -t.originalevent.deltay || -t.originalevent.detail; t.stoppropagation(), t.preventdefault(), s < 0 ? e.downonce() : e.uponce() } }) }, _bindeventsinterface: function() { var e = this; this.element.on("spinner.uponce", function() { e.stopspin(), e.uponce() }), this.element.on("spinner.downonce", function() { e.stopspin(), e.downonce() }), this.element.on("spinner.startupspin", function() { e.startupspin() }), this.element.on("spinner.startdownspin", function() { e.startdownspin() }), this.element.on("spinner.stopspin", function() { e.stopspin() }), this.element.on("spinner.updatesettings", function(t, s) { e.changesettings(s) }) }, _forcestepdivisibility: function(e) { switch (this.settings.forcestepdivisibility) { case "round": return (math.round(e / this.settings.step) * this.settings.step).tofixed(this.settings.decimals); case "floor": return (math.floor(e / this.settings.step) * this.settings.step).tofixed(this.settings.decimals); case "ceil": return (math.ceil(e / this.settings.step) * this.settings.step).tofixed(this.settings.decimals); default: return e } }, _checkvalue: function() { var e, t, s; e = this.element.val(), "" !== e && (this.settings.decimals > 0 && "." === e || (t = parsefloat(e), isnan(t) && (t = 0), s = t, t.tostring() !== e && (s = t), t < this.settings.min && (s = this.settings.min), t > this.settings.max && (s = this.settings.max), s = this._forcestepdivisibility(s), number(e).tostring() !== s.tostring() && (this.element.val(s), this.element.trigger("change")))) }, _getboostedstep: function() { if (this.settings.booster) { var e = math.pow(2, math.floor(this.spincount / this.settings.boostat)) * this.settings.step; return this.settings.maxboostedstep && e > this.settings.maxboostedstep && (e = this.settings.maxboostedstep, this.value = math.round(this.value / e) * e), math.max(this.settings.step, e) } return this.settings.step }, uponce: function() { this._checkvalue(), this.value = parsefloat(this.elements.input.val()), isnan(this.value) && (this.value = 0); var e = this.value , t = this._getboostedstep(); this.value = this.value + t, this.value > this.settings.max && (this.value = this.settings.max, this.element.trigger("spinner.on.max"), this.stopspin()), this.elements.input.val(number(this.value).tofixed(this.settings.decimals)), e !== this.value && this.element.trigger("change") }, downonce: function() { this._checkvalue(), this.value = parsefloat(this.elements.input.val()), isnan(this.value) && (this.value = 0); var e = this.value , t = this._getboostedstep(); this.value = this.value - t, this.value < this.settings.min && (this.value = this.settings.min, this.element.trigger("spinner.on.min"), this.stopspin()), this.elements.input.val(this.value.tofixed(this.settings.decimals)), e !== this.value && this.element.trigger("change") }, startdownspin: function() { var e = this; this.stopspin(), this.spincount = 0, this.spinning = "down", this.element.trigger("spinner.on.startspin"), this.element.trigger("spinner.on.startdownspin"), this.downdelaytimeout = settimeout(function() { e.downspintimer = setinterval(function() { e.spincount++, e.downonce() }, e.settings.stepinterval) }, this.settings.stepintervaldelay) }, startupspin: function() { var e = this; this.stopspin(), this.spincount = 0, this.spinning = "up", this.element.trigger("spinner.on.startspin"), this.element.trigger("spinner.on.startupspin"), this.updelaytimeout = settimeout(function() { e.upspintimer = setinterval(function() { e.spincount++, e.uponce() }, e.settings.stepinterval) }, this.settings.stepintervaldelay) }, stopspin: function() { switch (cleartimeout(this.downdelaytimeout), cleartimeout(this.updelaytimeout), clearinterval(this.downspintimer), clearinterval(this.upspintimer), this.spinning) { case "up": this.element.trigger("spinner.on.stopupspin"), this.element.trigger("spinner.on.stopspin"); break; case "down": this.element.trigger("spinner.on.stopdownspin"), this.element.trigger("spinner.on.stopspin") } this.spincount = 0, this.spinning = !1 } }) }), function(e) { "use strict"; var t = "spinner" , i = s.ui.controls.spinner; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { text: "切换至简版,切换至祥版" } , n = { text: "text" }; this.switchex = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { if (this.element = $(e), !this.element.data("initialized")) { this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s); var i = this.settings.text.split(","); this.lefttext = i[0], this.righttext = i[1], this.buildhtml(), this.initelements(), this.bindevents() } }, buildhtml: function() { var e = '
      ' + this.lefttext + '
      '; this.container = $(e), this.element.before(this.container), this.element.hide() }, initelements: function() { this.elements = { view: this.container, left: $(".c-switchex-left", this.container), right: $(".c-switchex-right", this.container) } }, bindevents: function() { this.elements.view.on("click", $.proxy(this.click, this)) }, click: function(e) { var t = $(e.target); t.hasclass("c-switchex-circle") && (t.hasclass("c-switchex-left") ? (this.elements.right.addclass("c-switchex-circle").removeclass("c-switchex-content").html(""), this.elements.left.removeclass("c-switchex-circle").addclass("c-switchex-content").html(this.lefttext)) : (this.elements.left.addclass("c-switchex-circle").removeclass("c-switchex-content").html(""), this.elements.right.removeclass("c-switchex-circle").addclass("c-switchex-content").html(this.righttext))) }, render: function() {}, refresh: function() {}, enable: function() {}, disable: function() {}, destroy: function() {} }) }), function(e) { "use strict"; var t = "switchex" , i = s.ui.controls.switchex; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = 150 , n = function() {} , a = { onselected: n } , o = {}; this.tabs = new e.class({ extend: s.ui.basecontrol },{ defaults: a, attributemap: o, init: function(e, s) { this.element = $(e), this.container = this.element, this.element.data("initialized") || (this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.initelements(), this.bindevents()) }, initelements: function() { this.elements = { original: this.element, tabscontainer: $("ul.nav-tabs", this.container), tabs: $("ul.nav-tabs .tab", this.container) } }, bindevents: function() { this.elements.tabs.on("click", $.proxy(this.show, this)), this.elements.tabscontainer.on("onselected", $.proxy(this.settings.onselected, this)) }, bindeventsinterface: function() { this.element }, setactive: function(e) { var t = this.elements.tabscontainer.find("li").eq(e).find("a.tab") , s = { preventdefault: n, target: t }; this.show(s) }, getactiveindex: function() { var e = this.elements.tabscontainer.find("li.active") , t = e.index(); return t }, show: function(e) { e.preventdefault(); var t = $(e.target) , s = t.data("s-target"); if (s || (s = t.attr("href"), s = s && s.replace(/.*(?=#[^\s]*$)/, "")), !t.parent("li").hasclass("active")) { var i = this.elements.tabscontainer.find(".active:last .tab") , n = $.event("hide.bs.tab", { relatedtarget: t[0] }) , a = $.event("show.bs.tab", { relatedtarget: i[0] }); if (i.trigger(n), t.trigger(a), !a.isdefaultprevented() && !n.isdefaultprevented()) { var o = $(s); this.activate(t.closest("li"), this.elements.tabscontainer), this.activate(o, o.parent(), function() { i.trigger({ type: "hidden.bs.tab", relatedtarget: t[0] }), t.trigger({ type: "shown.bs.tab", relatedtarget: i[0] }) }), this.elements.tabscontainer.trigger("onselected", t.closest("li").index()) } } }, activate: function(e, t, s) { function n() { a.removeclass("active").find("> .dropdown-menu > .active").removeclass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1), e.addclass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), o ? (e[0].offsetwidth, e.addclass("in")) : e.removeclass("fade"), e.parent(".dropdown-menu").length && e.closest("li.dropdown").addclass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), s && s() } var a = t.find("> .active") , o = s && $.support.transition && (a.length && a.hasclass("fade") || !!t.find("> .fade").length); a.length && o ? a.one("bstransitionend", n).emulatetransitionend(i) : n(), a.removeclass("in") }, reflash: function() {}, enable: function() {}, disable: function() {}, destroy: function() {}, getapi: function() { var e = this , t = { setactive: "setactive", getactiveindex: "getactiveindex" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "tabs" , i = s.ui.controls.tabs; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = function() {} , n = { maxlength: 100, update: i, tip: "还可以输入" } , a = { maxlength: "max-length" }; this.textlimit = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, s) { t += 1, this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), this.element.data("plugin-id", t), this.initsettings(s), this.placeholder = this.element.attr("placeholder"), this.wordslength = this.settings.maxlength, this.buildhtml(), this.initelements(), this.bindevents()) }, buildhtml: function() { var e = '
      ' + this.settings.tip + '
      '; this.container = $(e), this.element.before(this.container), this.container.prepend(this.element) }, initelements: function() { this.elements = { original: this.element, viewtextarea: $("textarea", this.container), remain: $("span.remain", this.container), word: $(".word", this.container) }, this.elements.viewtextarea.attr("title", "最多为" + this.settings.maxlength + "个字"), this.elements.remain.text(this.settings.maxlength) }, bindevents: function() { this.elements.viewtextarea.on("paste", $.proxy(this.paste, this)).on("keyup", $.proxy(this.keyup, this)) }, getvalue: function() { return this.trimstr(this.elements.viewtextarea.val()) }, setvalue: function(e) { this.elements.viewtextarea.val(e) }, trimstr: function(e) { return e.replace(/(^\s*) | (\s*$)/g, "") }, refresh: function() { var e = this.elements.viewtextarea.val(); e = this.trimstr(e); var t = this.settings.maxlength - e.length; t < 0 ? (this.elements.word.text("已经超出"), this.elements.remain.text(math.abs(t)), this.elements.remain.addclass("warning")) : (this.elements.word.text("还可以输入"), this.elements.remain.text(t), this.elements.remain.removeclass("warning")) }, paste: function() { var e = this; settimeout(function() { e.refresh() }, 50) }, keyup: function() { this.refresh() } }) }), function(e) { "use strict"; var t = "textlimit" , i = s.ui.controls.textlimit; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = function() {} , i = 0 , n = { timepickerincrement: 5, format: "hh:mm", change: t, defaulttime: null, mindate: void 0, maxdate: void 0, timeshowpanel: !0 } , a = { timepickerincrement: "time-picker-increment", format: "format", defaulttime: "default-time", timeshowpanel: "time-show-panel" }; this.timepicker = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, t) { this.element = $(e), this.element.data("initialized") || (this.element.data("initialized", !0), i += 1, this.element.data("plugin-id", i), this.initsettings(t), this.currenttime = {}, this.buildhtml(), this.initelements(), this.transferattributes(), this.bindevents(), this.setvalue(this.settings.defaulttime), null != this.settings.defaulttime && this.elements.view.trigger("changedate", this.settings.defaulttime), "string" == typeof this.settings.mindate && (this.settings.mindate = moment(this.settings.mindate, this.settings.format)), "object" == typeof this.settings.mindate && (this.settings.mindate = moment(this.settings.mindate)), "string" == typeof this.settings.maxdate && (this.settings.maxdate = moment(this.settings.maxdate, this.settings.format)), "object" == typeof this.settings.maxdate && (this.settings.maxdate = moment(this.settings.maxdate))) }, buildhtml: function() { var e = this.element.data("plugin-id") , t = ' :
      ' , s = ' .
      '; s = "hh:mm:ss.sss" == this.settings.format && t + s || "", t = "hh:mm:ss" == this.settings.format && t || ""; var i = '
      :
      ' + t + s + '
      '; this.container = $(i), this.element.before(this.container), this.element.hide() }, initelements: function() { this.elements = { view: this.element, timepicker: this.container, timecontrolcontainer: $(".calendar-time-control", this.container), showhourcontainer: $(".hour-control", this.container), showminutecontainer: $(".minute-control", this.container), showsecondcontainer: $(".second-control", this.container), showhour: $(".timepicker-hour", this.container), showminute: $(".timepicker-minute", this.container), showsecond: $(".timepicker-second", this.container), showmillisecond: $(".timepicker-millisecond", this.container), calendarhours: $(".timepicker-hours", this.container), calendarminutes: $(".timepicker-minutes", this.container), calendarseconds: $(".timepicker-seconds", this.container), calendarmilliseconds: $(".timepicker-milliseconds", this.container), showhours: $(".calendar-hours", this.container), showminutes: $(".calendar-minutes", this.container), showseconds: $(".calendar-seconds", this.container), showtimeicon: $(".glyphicon-time", this.container) }, this.bypasskeys = [96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 37, 39, 8, 48, 49, 50, 51, 52, 53, 54], this.settings.timeshowpanel && (this.dropdown = new s.ui.controls.dropdown(this.elements.showhour,{}), this.dropdown1 = new s.ui.controls.dropdown(this.elements.showminute,{}), this.dropdown2 = new s.ui.controls.dropdown(this.elements.showsecond,{})) }, transferattributes: function() { this.element.prop("disabled") && this.disable() }, bindevents: function() { this.elements.showtimeicon.on("click", $.proxy(this.showhourpanel, this)), this.elements.showhour.on("click", $.proxy(this.showpanel, this)), this.elements.showhour.on("blur", $.proxy(this.confirmhour, this)), this.elements.showhour.on("keydown", $.proxy(this.inputkeydown, this)), this.elements.showhour.on("keyup", $.proxy(this.inputkeyup, this)), this.elements.showminute.on("click", $.proxy(this.showpanel, this)), this.elements.showminute.on("blur", $.proxy(this.confirmminute, this)), this.elements.showminute.on("keydown", $.proxy(this.inputkeydown, this)), this.elements.showminute.on("keyup", $.proxy(this.inputkeyup, this)), this.elements.showsecond.on("click", $.proxy(this.showpanel, this)), this.elements.showsecond.on("blur", $.proxy(this.confirmsecond, this)), this.elements.showsecond.on("keydown", $.proxy(this.inputkeydown, this)), this.elements.showsecond.on("keyup", $.proxy(this.inputkeyup, this)), this.elements.showmillisecond.on("click", $.proxy(this.showpanel, this)), this.elements.showmillisecond.on("blur", $.proxy(this.confirmmillisecond, this)), this.elements.showmillisecond.on("keydown", $.proxy(this.inputkeydown, this)), this.elements.showmillisecond.on("keyup", $.proxy(this.inputkeyup, this)), this.elements.view.on("changedate", $.proxy(this.settings.change, this)), this.elements.showhours.on("click", "span", $.proxy(this.hourchanged, this)), this.elements.showminutes.on("click", "span", $.proxy(this.minutechanged, this)), this.elements.showseconds.on("click", "span", $.proxy(this.secondchanged, this)) }, setmindate: function(e) { "string" == typeof e && (this.settings.mindate = moment(e, this.settings.format)), "object" == typeof e && (this.settings.mindate = moment(e)) }, setmaxdate: function(e) { "string" == typeof e && (this.settings.maxdate = moment(e, this.settings.format)), "object" == typeof e && (this.settings.maxdate = moment(e)) }, inputkeydown: function(e) { this.keyupflag = !0; var t = e.keycode || e.which , s = $(e.target).val(); $.inarray(t, this.bypasskeys) === -1 && $(e.target).val(s.replace(/[^\d]/g, "")) }, inputkeyup: function(e) { if (this.keyupflag) { var t = $(e.target) , s = $(e.target).parent().prev().prev().find("input") , i = $(e.target).parent().next().next().find("input") , n = e.keycode || e.which , a = t.val(); if ($.inarray(n, this.bypasskeys) === -1) return void t.val(a.replace(/[^\d]/g, "")); if (0 !== s.length && (8 === n && 0 === a.length || 37 === n)) return void s.trigger("click"); 0 !== i.length && (39 === n || 37 !== n && 2 == a.length) && i.trigger("click"), this.keyupflag = !1 } }, showhourpanel: function(e) { this.elements.showhour.click() }, confirmhour: function(e) { var t = this.elements.showhour.val(); if (t.length > 0) { var s; try { s = t, s >= 0 && s <= 23 ? this.currenttime.hour(s) : (this.elements.showhour.val("00"), this.currenttime.hour(0)) } catch (i) { this.elements.showhour.val("00"), this.currenttime.hour(0) } var n = this.getvalue(); this.setvalue(n), this.elements.view.trigger("changedate", n), this.elements.view.trigger("timechange", n) } else this.elements.view.trigger("changedate", null), this.elements.view.trigger("timechange", null) }, confirmminute: function(e) { var t = this.elements.showminute.val(); if (t.length > 0) { var s; try { s = t, s >= 0 && s <= 59 ? this.currenttime.minute(s) : (this.elements.showminute.val("00"), this.currenttime.minute(0)) } catch (i) { this.elements.showminute.val("00"), this.currenttime.minute(0) } var n = this.getvalue(); this.setvalue(n), this.elements.view.trigger("changedate", n), this.elements.view.trigger("timechange", n) } else this.elements.view.trigger("changedate", null), this.elements.view.trigger("timechange", null) }, confirmsecond: function(e) { var t = this.elements.showsecond.val(); if (t.length > 0) { var s; try { s = t, s >= 0 && s <= 59 ? this.currenttime.second(s) : (this.elements.showsecond.val("00"), this.currenttime.second(0)) } catch (i) { this.elements.showsecond.val("00"), this.currenttime.second(0) } var n = this.getvalue(); this.setvalue(n), this.elements.view.trigger("changedate", n), this.elements.view.trigger("timechange", n) } else this.elements.view.trigger("changedate", null), this.elements.view.trigger("timechange", null) }, confirmmillisecond: function(e) { var t = this.elements.showmillisecond.val(); if (t.length > 0) { var s; try { s = t, s >= 0 && s <= 999 ? this.currenttime.millisecond(s) : (this.elements.showmillisecond.val("000"), this.currenttime.millisecond(0)) } catch (i) { this.elements.showmillisecond.val("000"), this.currenttime.millisecond(0) } var n = this.getvalue(); this.setvalue(n), this.elements.view.trigger("changedate", n), this.elements.view.trigger("timechange", n) } else this.elements.view.trigger("changedate", null), this.elements.view.trigger("timechange", null) }, focusview: function() { this.updateview() }, comparetime: function() { this.settings.mindate && this.currenttime.isbefore(this.settings.mindate) && (this.currenttime = this.settings.mindate.clone()), this.settings.maxdate && this.currenttime.isafter(this.settings.maxdate) && (this.currenttime = this.settings.maxdate.clone()) }, getvalue: function() { this.comparetime(); var e = this.currenttime.clone(); return e.format(this.settings.format) }, setvalue: function(e) { if (this.currenttime = moment(), !e) return void (this.elements && (this.elements.showhour.val(""), this.elements.showminute.val(""), this.elements.showsecond.val(""), this.elements.showmillisecond.val(""))); var t; if ("string" == typeof e && (t = moment(e, this.settings.format)), "object" == typeof e && (t = moment(e)), this.currenttime = t.clone(), this.elements) { var s = this.currenttime.hour() , i = this.currenttime.minute() , n = this.currenttime.second() , a = this.currenttime.millisecond(); s = s < 10 ? "0" + s : s, i = i < 10 ? "0" + i : i, n = n < 10 ? "0" + n : n, a = a < 10 && "00" + a || a < 100 && "0" + a || a, this.elements.showhour.val(s), this.elements.showminute.val(i), this.elements.showsecond.val(n), this.elements.showmillisecond.val(a) } }, updateview: function(e) { this.rendertimepicker() }, rendertimepicker: function() { var e, t = this.currenttime, s = t.hour(), i = t.minute(), n = t.second(), a = !1; this.settings.mindate && (a = this.settings.mindate.clone()); var o = !1; this.settings.maxdate && (o = this.settings.maxdate.clone()), e = ""; for (var r = 0, l = 23, h = r; h <= l; h++) { var c = h < 10 ? "0" + h : h , d = ""; a && h < a.hour() && (d = "disable"), o && h > o.hour() && (d = "disable"), e += '' + c + "" } this.elements.showhours.html(e), e = ""; for (var h = 0; h < 60; h += this.settings.timepickerincrement) { var c = h < 10 ? "0" + h : h , d = ""; a && s == a.hour() && h < a.minute() && (d = "disable"), o && s == o.hour() && h > o.minute() && (d = "disable"), e += '' + c + "" } this.elements.showminutes.html(e), e = ""; for (var h = 0; h < 60; h += this.settings.timepickerincrement) { var c = h < 10 ? "0" + h : h , d = ""; a && s == a.hour() && i == a.minute() && h < a.second() && (d = "disable"), o && s == o.hour() && i == o.minute() && h > o.second() && (d = "disable"), e += '' + c + "" } this.elements.showseconds.html(e) }, showpanel: function(e) { $(e.target).select(), this.updateview(), $(e.target).hasclass("timepicker-millisecond") && this.elements.showsecondcontainer.removeclass("open") }, hourchanged: function(e) { if ($(e.target).hasclass("disable")) return void e.stoppropagation(); var t = parseint(e.target.innerhtml); this.currenttime.hour(t), this.elements.showhour.val(t); var s = this.getvalue(); this.setvalue(s), this.elements.view.trigger("changedate", s), this.elements.view.trigger("timechange", s), this.elements.showhourcontainer.removeclass("open") }, minutechanged: function(e) { if ($(e.target).hasclass("disable")) return void e.stoppropagation(); var t = parseint(e.target.innerhtml); this.currenttime.minute(t), this.elements.showminute.val(t); var s = this.getvalue(); this.setvalue(s), this.elements.view.trigger("changedate", s), this.elements.view.trigger("timechange", s), this.elements.showminutecontainer.removeclass("open") }, secondchanged: function(e) { if ($(e.target).hasclass("disable")) return void e.stoppropagation(); var t = parseint(e.target.innerhtml); this.currenttime.second(t), this.elements.showsecond.val(t); var s = this.getvalue(); this.setvalue(s), this.elements.view.trigger("changedate", s), this.elements.view.trigger("timechange", s), this.elements.showsecondcontainer.removeclass("open") }, timechanged: function(e) { this.rendertimepicker() }, render: function() {}, refresh: function() {}, enable: function() { this.elements.timecontrolcontainer.removeclass("disabled"), this.container.removeclass("disabled"), this.elements.showhour.removeclass("disabled"), this.elements.showhour.prop("disabled", !1), this.elements.showminute.removeclass("disabled"), this.elements.showminute.prop("disabled", !1), this.elements.showsecond.removeclass("disabled"), this.elements.showsecond.prop("disabled", !1), this.elements.showmillisecond.removeclass("disabled"), this.elements.showmillisecond.prop("disabled", !1) }, disable: function() { this.elements.timecontrolcontainer.addclass("disabled"), this.container.addclass("disabled"), this.elements.showhour.addclass("disabled"), this.elements.showhour.prop("disabled", !0), this.elements.showminute.addclass("disabled"), this.elements.showminute.prop("disabled", !0), this.elements.showsecond.addclass("disabled"), this.elements.showsecond.prop("disabled", !0), this.elements.showmillisecond.addclass("disabled"), this.elements.showmillisecond.prop("disabled", !0) }, destroy: function() {}, getapi: function() { var e = this , t = { setvalue: "setvalue", getvalue: "getvalue", updateview: "updateview", render: "rendertimepicker", setmindate: "setmindate", setmaxdate: "setmaxdate" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "timepicker" , i = s.ui.controls.timepicker; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = { show: !0, inputwidth: 0, width: 248, matekey: { id: "id" }, map: '{"text":"text","returnvalue":"json"}', onblured: void 0, typeaheadtemplate: void 0, nofound: '无法匹配到适合的选项! 
      调出选人控件查询', showitemlist: !1, ishide: !1, showicon: !0, items: 8, typeaheadmethod: {}, multiselect: !0 } , n = { map: "map", showicon: "show-icon", showitemlist: "show-item-list", items: "items", multiselect: "multi-select" }; this.userselect = new e.class({ extend: s.ui.basecontrol },{ defaults: i, attributemap: n, init: function(e, s) { if (this.element = $(e), this.textlists = [], !this.element.data("initialized")) { this.element.data("initialized", !0), t += 1, this.element.data("plugin-id", t), this.initsettings(s), "string" == typeof this.settings.map && "" !== this.settings.map && (this.settings.map = json.parse(this.settings.map)), this.settings.showicon || (this.settings.nofound = '无法匹配到适合的选项!'), this.settings.width = this.element.width() && this.element.width() >= 248 ? this.element.width() : this.settings.width, this.settings.map = "string" == typeof this.settings.map && this.settings.map ? json.parse(this.settings.map) : this.settings.map, this.buildhtml(), this.initelements(), this.transferattributes(), this.settings.inputwidth = this.elements.input.width(); var i = this; i.render(), this.bindevents() } }, buildhtml: function() { var e = ""; e = this.settings.showicon ? '
      ' : '
      ', this.container = $(e), this.element.before(this.container), this.element.hide(), this.settings.ishide ? this.container.hide() : this.container.show() }, initelements: function() { var e = this; this.elements = { container: e.container, view: $(".c-userselect-view", e.container), tips: $(".c-userselect-tips", e.container), dl: $(".c-userselect-list", e.container), input: $(".c-typeahead.form-control", e.container), textlist: $(".c-userselect-textlist", e.container), list: $(".c-userselect-list", e.container), button: $(".c-userselect-fr", e.container) }; var t = { data: e.settings.data, map: e.settings.map, showitemlist: e.settings.showitemlist, items: e.settings.items, template: this.settings.typeaheadmethod.template, onselected: this.settings.typeaheadmethod.onselected || function(t, s) { e.selected.apply(e, arguments) } , matcher: this.settings.typeaheadmethod.matcher || function(e) { var t = this.matcherreg || new regexp(this.query,"i") , s = t.test(e.name) || t.test(e.loginname) || t.test(e.spell) || t.test(e.spellfirst); return s === !0 ? 1 : -1 } , nofound: e.settings.nofound, nofoundwidth: this.settings.width - 10 }; e.typeahead = new s.ui.controls.typeahead(e.elements.input,t) }, updatedata: function(e) { this.typeahead.setsource(e) }, transferattributes: function() { this.elements.input.attr("placeholder", this.element.attr("placeholder")) }, bindevents: function() { this.elements.input.bind("keydown", $.proxy(this.keydown, this)), this.elements.input.bind("blur", $.proxy(this.blur, this)), this.elements.input.bind("focus", $.proxy(this.click, this)), this.elements.dl.bind("click", $.proxy(this.click, this)), this.elements.tips.bind("click", $.proxy(this.click, this)), this.elements.container.bind("mouseleave", $.proxy(this.mouseleave, this)), this.elements.container.bind("mouseenter", $.proxy(this.mouseenter, this)), this.elements.list.bind("click", $.proxy(this.clickspan, this)), this.elements.button.bind("click", $.proxy(this.clickbutton, this)), this.elements.container.delegate(".c-userselect-modal", "click", $.proxy(this.modal, this)) }, bindeventsinterface: function() { this.container }, render: function() {}, selected: function(e, t) { var s = this.typeahead.getvalue(t); this.elements.tips.show(), s && (this.elements.input.val(""), void 0 === this.contains(this.textlists, s, this.settings.matekey) && (this.settings.multiselect ? this.textlists.push(s) : (this.textlists = [s], this.elements.list.html("")), this.addel(this.elements.list, s), this.automove(this.textlists, this.elements.textlist))), this.elements.input.focus() }, disable: function() { this.elements.button.prop("disabled", !0), this.elements.input.prop("disabled", !0), this.elements.view.addclass("disabled") }, enable: function() { this.elements.button.prop("disabled", !1), this.elements.input.prop("disabled", !1), this.elements.view.removeclass("disabled") }, changed: function(e, t) {}, addel: function(e, t) { var s = this.displaytext(t) , i = $('
      '); i.data("value", t), i.append('' + s + 'x'), e.append(i) }, removeel: function(e, t) { var s = !0 , i = this.settings.matekey; e.find("dd").each(function(e, n) { for (var a in i) $(n).data("value")[a] != t[a] && (s = !1); return s ? $(n).remove() : void (s = !0) }) }, modal: function(e) { e.preventdefault(), e.stoppropagation(), this.elements.button.click() }, click: function(e) { this.textlists.length > 0 && this.elements.input.removeattr("placeholder"), this.elements.tips.show(), $(e.target).is("input") || this.elements.input.focus() }, clickbutton: function(e) { this.elements.tips.hide(), this.settings.show = !1, "function" == typeof this.settings.clickbutton && this.settings.clickbutton.apply(this, [e]) }, clickspan: function(e) { var t = $(e.target); if (t.hasclass("c-userselect-delete")) { var s = t.parent("dd").data("value"); this.remove(this.textlists, s, this.settings.matekey), this.automove(this.textlists, this.elements.textlist), t.parent("dd").remove(), this.elements.input.focus() } }, keydown: function(e) { $(e.target); if (8 == e.which) { if (this.elements.input.val().length <= 0) { var t = this.textlists.splice(this.textlists.length - 1, 1); this.automove(this.textlists, this.elements.textlist), this.removeel(this.elements.list, t[0]) } this.textlists.length <= 0 && this.elements.input.attr("placeholder", this.element.attr("placeholder")) } }, mouseleave: function() { this.settings.show = !1 }, mouseenter: function() { this.settings.show = !0 }, blur: function() { this.settings.show || (this.elements.tips.hide(), "function" == typeof this.settings.onblured && this.settings.onblured.apply(this, [this.textlists])) }, focus: function(e) {}, getvalue: function() { return this.textlists }, setdata: function(e) { if (e) { this.textlists = e, this.elements.list.html(""); for (var t = 0; t < e.length; t++) this.addel(this.elements.list, e[t]); this.automove(this.textlists, this.elements.textlist) } }, getbutton: function() { return this.elements.button }, automove: function(e, t) { for (var s = e.length, i = "", n = 0; n < s; n++) { var a = this.displaytext(e[n]); i += a + " ; " } i = i.substring(0, i.length - 3), t.text(i), t.attr("title", i); var o = this.elements.textlist.width(); this.elements.input.width(this.settings.inputwidth - o) }, displaytext: function(e) { return "string" == typeof e ? e : e[this.settings.map.text] }, contains: function(e, t, s) { var i = !0; if (array.isarray(e) || (e = [e]), "object" != typeof t) return e.indexof(t); for (var n = 0; n < e.length; n++) { i = !0; for (var a in s) t[s[a]] != e[n][s[a]] && (i = !1); if (i) return n } }, remove: function(e, t, s) { var i = this.contains(e, t, s); return i >= 0 && e.splice(i, 1), e }, getapi: function() { var e = this , t = { setdata: "setdata", getvalue: "getvalue", getbutton: "getbutton", updatedata: "updatedata" } , i = s.utilities.buildapi(e, t); return i }, refresh: function() {}, destroy: function() {} }) }), function(e) { "use strict"; var t = "userselect" , i = s.ui.controls.userselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = 600 , n = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0, map: '{"url":"url","src":"src","alt":"alt","title":"title","content":"content"}' } , a = { interval: "interval", pause: "pause", wrap: "wrap", keyboard: "keyboard", map: "map" }; this.carousel = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.map = this.settings.map, "string" == typeof this.settings.map && "" !== this.settings.map && (this.map = json.parse(this.settings.map)), this.paused = null, this.sliding = null, this.interval = null, this.active = null, this.items = null, this.settings.interval && this.pause().cycle(), this.buildhtml(), this.initelements(), this.bindevents() }, buildhtml: function() { var e = this.element.data("plugin-id"); this.id = this.element.attr("id") || "carousel" + e; var t = ' previous next'; this.container = $(t), this.element.append(this.container) }, updatedata: function(e) { if (!e || 0 === e.length) return void this.elements.slide.hide(); this.elements.slide.show(), this.elements.indicators.html(""), this.elements.inner.html(""); for (var t = 0; t < e.length; t++) { var s = e[t] , i = '
    • '; i = $(i), 0 === t && i.addclass("active"), this.elements.indicators.append(i); var n = ' ", n = $(n), 0 === t && n.addclass("active"), this.elements.inner.append(n) } this.settings.slide = this.element.find("li[data-s-slide-to]"); var o = this; this.settings.slide.on("click", function(e) { var t = $(this).attr("data-s-slide-to"); t && (o.settings.interval = !1, o.to(t)) }) }, initelements: function() { this.elements = { indicators: this.element.find(".carousel-indicators"), inner: this.element.find(".carousel-inner"), slide: this.element.find("a[data-s-slide]") } }, bindevents: function() { var e = this; this.settings.keyboard && this.element.on("keydown.bs.carousel", $.proxy(this.keydown, this)), this.elements.slide.on("click", function(t) { var s = $(this).attr("data-s-slide"); e[s](), t.preventdefault() }) }, keydown: function(e) { if (!/input|textarea/i.test(e.target.tagname)) { switch (e.which) { case 37: this.prev(); break; case 39: this.next(); break; default: return } e.preventdefault() } }, cycle: function(e) { return e || (this.paused = !1), this.interval && clearinterval(this.interval), this.settings.interval && !this.paused && (this.interval = setinterval($.proxy(this.next, this), this.settings.interval)), this }, getitemindex: function(e) { return this.items = e.parent().children(".item"), this.items.index(e || this.active) }, getitemfordirection: function(e, t) { var s = this.getitemindex(t) , i = "prev" == e && 0 === s || "next" == e && s == this.items.length - 1; if (i && !this.settings.wrap) return t; var n = "prev" == e ? -1 : 1 , a = (s + n) % this.items.length; return this.items.eq(a) }, to: function(e) { var t = this , s = this.getitemindex(this.active = this.element.find(".item.active")); if (!(e > this.items.length - 1 || e < 0)) return this.sliding ? this.element.one("slid.bs.carousel", function() { t.to(e) }) : s == e ? this.pause().cycle() : this.slide(e > s ? "next" : "prev", this.items.eq(e)) }, pause: function(e) { return e || (this.paused = !0), this.element.find(".next, .prev").length && $.support.transition && (this.element.trigger($.support.transition.end), this.cycle(!0)), this.interval = clearinterval(this.interval), this }, next: function() { if (!this.sliding) return this.slide("next") }, prev: function() { if (!this.sliding) return this.slide("prev") }, slide: function(e, t) { var s = this.element.find(".item.active") , n = t || this.getitemfordirection(e, s) , a = this.interval , o = "next" == e ? "left" : "right" , r = this; if (n.hasclass("active")) return this.sliding = !1; var l = n[0] , h = $.event("slide.bs.carousel", { relatedtarget: l, direction: o }); if (this.element.trigger(h), !h.isdefaultprevented()) { if (this.sliding = !0, a && this.pause(), this.elements.indicators.length) { this.elements.indicators.find(".active").removeclass("active"); var c = $(this.elements.indicators.children()[this.getitemindex(n)]); c && c.addclass("active") } var d = $.event("slid.bs.carousel", { relatedtarget: l, direction: o }); return $.support.transition && this.element.hasclass("slide") ? (n.addclass(e), n[0].offsetwidth, s.hasclass("direction") && s.removeclass(o), n.hasclass("direction") && n.removeclass(o), s.addclass(o), n.addclass(o), r.sliding = !1, s.one("bstransitionend", function() { n.removeclass([e, o].join(" ")).addclass("active"), s.removeclass(["active", o].join(" ")), settimeout(function() { r.element.trigger(d) }, 0) }).emulatetransitionend(i)) : (s.removeclass("active"), n.addclass("active"), this.sliding = !1, this.element.trigger(d)), a && this.cycle(), this } } }) }), function(e) { "use strict"; var t = "carousel"; e.fn[t] = function(t) { return this.each(function() { var i = e(this); i.data("plugin-ref") && (i.data("plugin-ref").destroy(), i.removedata("plugin-ref")), i.data("plugin-ref", new s.ui.controls.carousel(this,t)) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; function t(e, t) { for (var s = t.split(" "), i = !0, n = 0; n < s.length; n++) if (!e.hasclass(s[n])) { i = !1; break } return i } var i = { all: "all", none: "none", leaf: "leaf" } , n = { checked: "checked", unchecked: "unchecked", partof: "partof" } , a = { all: "all", leaf: "leaf" } , o = function() {} , r = 0 , l = { levels: 1, dataurl: "", expandicon: "glyphicon glyphicon-plus", collapseicon: "glyphicon glyphicon-minus", emptyicon: "glyphicon", nodeicon: "", selectedicon: "", checkedicon: "glyphicon glyphicon-check", checkedpartoficon: "glyphicon glyphicon-check partofchecked", uncheckedicon: "glyphicon glyphicon-unchecked", enablelinks: !1, enabletitle: !1, showicon: !0, showtags: !1, multiselect: !1, silent: !1, ignorechildren: !1, expandone: !0, showcheckbox: i.none, checkrecursive: !1, selectmode: a.all, appendhtml: "", parseappendhtml: void 0, selectednodeids: "", checkednodeids: "", onnodedbclick: o, onnodechecked: o, onnodecollapsed: o, onnodedisabled: o, onnodeenabled: o, onnodeexpanded: o, onnodeselected: o, onnodeunchecked: o, onnodeunselected: o, onsearchcomplete: o, onsearchcleared: o } , h = { expandone: "expand-one", ignorechildren: "ignore-children", expandicon: "expand-icon", collapseicon: "collapse-icon", showtags: "show-tags", levels: "levels", dataurl: "data-url", showcheckbox: "show-checkbox", checkrecursive: "check-recursive", selectmode: "select-mode", appendhtml: "append-html", multiselect: "multi-select", selectednodeids: "selected-node-ids", checkednodeids: "checked-node-ids" }; this.slowtree = new e.class({ extend: s.ui.basecontrol },{ defaults: l, attributemap: h, init: function(e, t) { this.element = $(e), r += 1, this.element.data("plugin-id", r), this.initsettings(t), "function" == typeof this.settings.parsedata && (this.parsedata = this.settings.parsedata, delete this.settings.parsedata), this.data = [], this.idindexmap = {}, this.container = $(''); var s = this; $.when(this.getdata()).done(function() { s.buildhtml(), s.initelements(), s.refresh(), s.bindevents() }) }, getdata: function() { var e = $.deferred(); if (this.settings.data) { var t = $.extend(!0, [], this.settings.data); return this.data = this.parsedata(t), delete this.settings.data, e.resolve(), e.promise() } return e.promise() }, parsedata: function(e) { function t(e, a) { if (e.nodes) { a++; for (var o = 0; o < e.nodes.length; o++) { var r = e.nodes[o]; r.id = r.id || i, r._innerparentid = e.id, r._innerpath = (e._innerpath || "r") + "|" + r.id, r._innerlevel = a, s.push(r), n.idindexmap["id_" + r.id] = i, i++, r.nodes && t(r, a) } } } var s = [] , i = 0 , n = this; return t({ nodes: e }, 0), s }, updatedata: function(e) { var t = $.extend(!0, [], e); this.data = this.parsedata(t) }, buildhtml: function() { this.element.addclass("c-slowtree"), this.element.empty().append(this.container) }, initelements: function() { var e = this; this.elements = { original: e.element, getallnodes: function() { var t = $("li", e.container); return t }, getnode: function(t) { var s = $('li[data-id="' + t + '"]', e.container); return s }, getchildnodes: function(t) { var s = this.getnode(t) , i = s.data("path") , n = $('li[data-path^="' + i + '|"]', e.container); return n }, getchildnodeschecked: function(t) { var s = this.getnode(t) , i = s.data("path") , n = $('li.node-checked[data-path^="' + i + '|"]', e.container); return n }, getchildnodescheckedpartof: function(t) { var s = this.getnode(t) , i = s.data("path") , n = $('li.node-checked-partof[data-path^="' + i + '|"]', e.container); return n }, getlevelnodes: function(t) { var s = $('li[data-level="' + t + '"]', e.container); return s }, getselectednodes: function(t) { var s = t ? "li:not(.node-selected)" : "li.node-selected" , i = $(s, e.container); return i }, getcheckednodes: function(t, s) { var i; i = s ? t ? "li:not(.node-checked):not(.node-checked-partof)" : "li.node-checked,li.node-checked-partof" : t ? "li:not(.node-checked):not(.node-checked-partof)" : "li.node-checked"; var n = $(i, e.container); return n }, getdisablednodes: function(t) { var s = t ? "li:not(.node-disabled)" : "li.node-disabled" , i = $(s, e.container); return i }, getsearchresultnodes: function(t) { var s = t ? "li:not(.search-result)" : "li.search-result" , i = $(s, e.container); return i } } }, buildtree: function() { for (var e = 0; e < this.data.length; e++) { var t = this.data[e] , s = this.builditem(t); s = $(s), this.container.append(s); var i = ""; if (this.settings.appendhtml) { if (this.settings.parseappendhtml) { var n = this.settings.parseappendhtml(this.settings.appendhtml); i = n } else i = this.settings.appendhtml; s.find(".appendhtml").append(i) } } }, builditem: function(e) { var t = !1; e.nodes && e.nodes.length > 0 && (t = !0); for (var s = "", n = 0; n < e._innerlevel - 1; n++) s += ''; var o = "icon"; o += t ? e._innerlevel < this.settings.levels ? " expand-icon " + this.settings.collapseicon : " expand-icon " + this.settings.expandicon : " " + this.settings.emptyicon; var r = '' , l = ""; if (this.settings.showicon) { var h = "icon node-icon "; h += e.icon || this.settings.nodeicon, l = '' } var c = ""; if (this.settings.showcheckbox === i.all || !t && this.settings.showcheckbox === i.leaf) { var d = "icon check-icon "; d += this.settings.uncheckedicon, c = '' } var u = ""; if (this.settings.showtags && e.tags) for (var p = 0; p < e.tags.length; p++) { var m = e.tags[p]; u += '' + m + "" } var f = "list-group-item"; t && this.settings.selectmode === a.leaf && (f += " node-unselectable"); var g = '
    • this.settings.levels ? ' style="display: none;"' : "") + (this.settings.enabletitle ? ' title="' + e.text + '"' : "") + ' onselectstart = "return false;" data-id="' + e.id + '" data-haschildren="' + t + '" data-level="' + e._innerlevel + '" data-path="' + e._innerpath + '">
      ' + s + r + l + c + (this.settings.enablelinks ? ' ' + e.text + "" : '' + e.text + "") + (this.settings.appendhtml ? ' ' : "") + u + "
    • "; return g }, refresh: function() { this.container.empty(), this.buildtree(), this.initstates() }, initstates: function() { if (this.settings.selectednodeids) { var e = this.settings.selectednodeids; "number" == typeof e && (e += ""), this.selectnodebyids(e) } if (this.settings.checkednodeids) { var e = this.settings.checkednodeids; "number" == typeof e && (e += ""), this.checknodebyids(e) } }, clickhandler: function(e) { this.settings.enablelinks || e.preventdefault(); var t = $(e.target) , s = t.closest("li.list-group-item"); if (!s.hasclass("node-disabled")) { var i = s.data("id") , n = this.getnode(i); if (n) { var a = t.attr("class") ? t.attr("class").split(" ") : []; return a.indexof("expand-icon") !== -1 ? void this.toggleexpandedstate(n, this.settings.silent, this.settings.ignorechildren) : a.indexof("check-icon") !== -1 ? void this.togglecheckedstate(n, this.settings.silent) : void (s.hasclass("node-unselectable") || this.toggleselectedstate(n, this.settings.silent)) } } }, dblclickhandler: function(e) { this.settings.enablelinks || e.preventdefault(); var t = $(e.target) , s = t.closest("li.list-group-item"); if (!s.hasclass("node-disabled") && !s.hasclass("node-unselectable")) { s.addclass("node-selected").siblings().removeclass("node-selected"); var i = s.data("id") , n = this.getnode(i); this.settings.silent || this.elements.original.trigger("nodedbclick", n) } }, setonelevelexpandedstate: function(e, t, s, i) { var n = this.elements.getnode(e.id) , a = this.elements.getchildnodes(e.id); if (t ? (n.find(".expand-icon").removeclass(this.settings.expandicon).addclass(this.settings.collapseicon), a.show(), s || this.elements.original.trigger("nodeexpanded", e)) : (n.find(".expand-icon").removeclass(this.settings.collapseicon).addclass(this.settings.expandicon), a.hide(), s || this.elements.original.trigger("nodecollapsed", e)), a.length > 0) { var o = this; a.each(function() { var e = $(this).data("id") , t = o.getnode(e); o.setonelevelexpandedstate(t, !1, s, i) }) } }, setexpandedstate: function(e, t, s, i) { if (this.settings.expandone) return void this.setonelevelexpandedstate(e, t, s, i); var n = this.elements.getnode(e.id) , a = this.elements.getchildnodes(e.id); if (a.length > 0 && !i) { var o = this; a.each(function() { var e = $(this).data("id") , n = o.getnode(e); o.setexpandedstate(n, t, s, i) }) } t ? (n.find(".expand-icon").removeclass(this.settings.expandicon).addclass(this.settings.collapseicon), a.show(), s || this.elements.original.trigger("nodeexpanded", e)) : (n.find(".expand-icon").removeclass(this.settings.collapseicon).addclass(this.settings.expandicon), a.hide(), s || this.elements.original.trigger("nodecollapsed", e)) }, collapsenode: function(e, t, s) { for (var i = 0; i < e.length; i++) this.setexpandedstate(e[i], !1, t, s) }, expandnode: function(e, t, s, i) { for (var n = this, a = 0; a < e.length; a++) { var o = e[a]; this.setexpandedstate(o, !0, s, i); var r = this.elements.getchildnodes(o.id); if (r.length > 0 && this.settings.levels) { var l = []; r.each(function() { var e = $(this).data("id") , t = n.getnode(e); l.push(t) }), this.expandlevels(l, t - 1, s, i) } } }, toggleexpandedstate: function(e, s, i) { var n = this.elements.getnode(e.id) , a = n.find(".expand-icon") , o = t(a, this.settings.collapseicon); this.setexpandedstate(e, !o, s, i) }, togglenodeexpanded: function(e, t, s) { for (var i = 0; i < e.length; i++) this.toggleexpandedstate(e[i], t, s) }, expandlevels: function(e, t, s, i) { for (var n = this, a = 0; a < e.length; a++) { var o = e[a]; this.setexpandedstate(o, t > 0, s, i); var r = this.elements.getchildnodes(o.id); if (r.length > 0) { var l = []; r.each(function() { var e = $(this).data("id") , t = n.getnode(e); l.push(t) }), this.expandlevels(l, t - 1, s, i) } } }, expandall1: function(e, t, s) { var e = e || this.settings.levels; if (e) { for (var i = [], n = 0; n < this.data.length; n++) i.push(this.data[n]); this.expandlevels(i, this.settings.levels, t, s) } else { var i = this.elements.getlevelnodes(1) , a = this; i.each(function() { var e = $(this).data("id") , i = a.getnode(e); a.setexpandedstate(i, !0, t, s) }) } }, collapseall2: function(e, t) { var s = this.elements.getlevelnodes(1) , i = this; s.each(function() { var s = $(this).data("id") , n = i.getnode(s); i.setexpandedstate(n, !1, e, t) }) }, expandall: function(e, t, s) { $(this.element).find("li[data-level!=1]").show(), $(this.element).find(".expand-icon").removeclass(this.settings.expandicon).addclass(this.settings.collapseicon) }, collapseall: function(e, t) { $(this.element).find("li[data-level!=1]").hide(), $(this.element).find(".expand-icon").removeclass(this.settings.collapseicon).addclass(this.settings.expandicon) }, setselectedstate: function(e, t, s) { var i = this.elements.getnode(e.id); i.hasclass("node-unselectable") || (t ? (this.settings.multiselect || this.elements.getselectednodes(!1).removeclass("node-selected"), i.addclass("node-selected"), s || this.elements.original.trigger("nodeselected", e)) : (i.removeclass("node-selected"), s || this.elements.original.trigger("nodeunselected", e))) }, selectnode: function(e, t) { for (var s = 0; s < e.length; s++) this.setselectedstate(e[s], !0, t) }, unselectnode: function(e, t) { for (var s = 0; s < e.length; s++) this.setselectedstate(e[s], !1, t) }, toggleselectedstate: function(e, t) { var s = this.elements.getnode(e.id) , i = s.hasclass("node-selected"); this.setselectedstate(e, !i, t) }, togglenodeselected: function(e, t) { for (var s = 0; s < e.length; s++) this.toggleselectedstate(e[s], t) }, setcheckedstate1: function(e, t, s) { var i = this.elements.getnode(e.id) , a = i.find(".check-icon"); switch (t) { case n.checked: i.removeclass("node-checked-partof"), i.addclass("node-checked"), a.removeclass(this.settings.uncheckedicon).removeclass(this.settings.checkedpartoficon).addclass(this.settings.checkedicon), s || this.elements.original.trigger("nodechecked", e); break; case n.unchecked: i.removeclass("node-checked-partof"), i.removeclass("node-checked"), a.removeclass(this.settings.checkedicon).removeclass(this.settings.checkedpartoficon).addclass(this.settings.uncheckedicon), s || this.elements.original.trigger("nodeunchecked", e); break; case n.partof: i.removeclass("node-checked"), i.addclass("node-checked-partof"), a.removeclass(this.settings.checkedicon).removeclass(this.settings.uncheckedicon).addclass(this.settings.checkedpartoficon), s || this.elements.original.trigger("nodecheckedpartof", e) } if (this.settings.checkrecursive) { if (e._innerparentid) for (var o = this.getnode(e._innerparentid); o; ) { var r; switch (t) { case n.checked: case n.unchecked: var l = this.elements.getchildnodescheckedpartof(o.id).length; if (l > 0) r = n.partof; else { var h = this.elements.getchildnodeschecked(o.id).length; r = 0 === h ? n.unchecked : n.checked } break; case n.partof: r = t } this.setnodecheckedsate(o, r, s), o = this.getnode(o._innerparentid) } if (e.nodes && e.nodes.length > 0) for (var c = 0; c < e.nodes.length; c++) { var d = e.nodes[c]; this.setnodecheckedsate(d, t, s) } } }, setcheckedstate: function(e, t, s) { this._innersetnodecheckedsate(e, t, s), this.settings.checkrecursive && (this.setchildrencheckedstate(e, t, s), this.setparentcheckedstate(e, t, s)) }, _innersetnodecheckedsate: function(e, t, s) { var i = this.elements.getnode(e.id) , a = i.find(".check-icon"); switch (t) { case n.checked: i.removeclass("node-checked-partof"), i.addclass("node-checked"), a.removeclass(this.settings.uncheckedicon).removeclass(this.settings.checkedpartoficon).addclass(this.settings.checkedicon), s || this.elements.original.trigger("nodechecked", e); break; case n.unchecked: i.removeclass("node-checked-partof"), i.removeclass("node-checked"), a.removeclass(this.settings.checkedicon).removeclass(this.settings.checkedpartoficon).addclass(this.settings.uncheckedicon), s || this.elements.original.trigger("nodeunchecked", e); break; case n.partof: i.removeclass("node-checked"), i.addclass("node-checked-partof"), a.removeclass(this.settings.checkedicon).removeclass(this.settings.uncheckedicon).addclass(this.settings.checkedpartoficon), s || this.elements.original.trigger("nodecheckedpartof", e) } }, setchildrencheckedstate: function(e, t, s) { if (e && e.nodes && e.nodes.length > 0) for (var i = 0; i < e.nodes.length; i++) { var n = e.nodes[i]; this._innersetnodecheckedsate(n, t, s), this.setchildrencheckedstate(n, t, s) } }, setparentcheckedstate: function(e, t, s) { if (e._innerparentid) for (var i = this.getnode(e._innerparentid); i; ) { var a; switch (t) { case n.checked: case n.unchecked: var o = this.elements.getchildnodescheckedpartof(i.id).length; if (o > 0) a = n.partof; else { var r = this.elements.getchildnodeschecked(i.id).length , l = this.elements.getchildnodes(i.id).length; a = 0 === r ? n.unchecked : r < l ? n.partof : n.checked } break; case n.partof: a = t } this._innersetnodecheckedsate(i, a, s), i = this.getnode(i._innerparentid) } }, checknode: function(e, t) { for (var s = 0; s < e.length; s++) this.setcheckedstate(e[s], n.checked, t) }, unchecknode: function(e, t) { for (var s = 0; s < e.length; s++) this.setcheckedstate(e[s], n.unchecked, t) }, togglecheckedstate: function(e, s) { var i, a = this.elements.getnode(e.id), o = a.find(".check-icon"), r = t(o, this.settings.checkedicon); i = r ? n.unchecked : n.checked, this.setcheckedstate(e, i, s) }, togglenodechecked: function(e, t) { for (var s = 0; s < e.length; s++) this.togglecheckedstate(e[s], t) }, checkall: function(e) { var t = this.elements.getcheckednodes(!0) , s = t.find(".check-icon"); if (t.addclass("node-checked"), s.removeclass(this.settings.uncheckedicon).addclass(this.settings.checkedicon), !e) { var i = this; t.each(function() { var e = $(this).data("id") , t = i.getnode(e); i.elements.original.trigger("nodechecked", t) }) } }, uncheckall: function(e) { var t = this.elements.getcheckednodes(!1) , s = t.find(".check-icon"); if (t.removeclass("node-checked"), s.removeclass(this.settings.checkedicon).addclass(this.settings.uncheckedicon), !e) { var i = this; t.each(function() { var e = $(this).data("id") , t = i.getnode(e); i.elements.original.trigger("nodeunchecked", t) }) } }, setdisabledstate: function(e, t, s, i) { var n = this.elements.getnode(e.id); t ? (n.addclass("node-disabled"), this.setexpandedstate(e, !1, s, i), this.setselectedstate(e, !1, s), this.setcheckedstate(e, !1, s), s || this.elements.original.trigger("nodedisabled", e)) : (n.removeclass("node-disabled"), s || this.elements.original.trigger("nodeenabled", e)) }, enablenode: function(e, t) { for (var s = 0; s < e.length; s++) this.setdisabledstate(e[s], !1, t) }, disablenode: function(e, t) { for (var s = 0; s < e.length; s++) this.setdisabledstate(e[s], !0, t) }, toggledisabledstate: function(e, t) { var s = this.elements.getnode(e.id) , i = s.hasclass("node-disabled"); this.setdisabledstate(e, !i, t) }, togglenodedisabled: function(e, t) { for (var s = 0; s < e.length; s++) this.toggledisabledstate(e[s], t) }, disableall: function(e, t) { var s = this.elements.getdisablednodes(!0); s.addclass("node-disabled"); var i = this; s.each(function() { var s = $(this).data("id") , n = i.getnode(s); i.setexpandedstate(n, !1, e, t), i.setselectedstate(n, !1, e), i.setcheckedstate(n, !1, e), e || i.elements.original.trigger("nodedisabled", n) }) }, enableall: function(e, t) { var s = this.elements.getdisablednodes(!1); s.removeclass("node-disabled"); var i = this; s.each(function() { var t = $(this).data("id") , s = i.getnode(t); e || i.elements.original.trigger("nodeenabled", s) }) }, selectnodebyids: function(e, t) { for (var s = e.split(","), i = [], n = 0; n < s.length; n++) { var a = this.getnode(s[n]); i.push(a) } this.selectnode(i, t) }, unselectnodebyids: function(e, t) { for (var s = e.split(","), i = [], n = 0; n < s.length; n++) { var a = this.getnode(s[n]); i.push(a) } this.unselectnode(i, t) }, checknodebyids: function(e, t) { for (var s = e.split(","), i = [], n = 0; n < s.length; n++) { var a = this.getnode(s[n]); i.push(a) } this.checknode(i, t) }, unchecknodebyids: function(e, t) { for (var s = e.split(","), i = [], n = 0; n < s.length; n++) { var a = this.getnode(s[n]); i.push(a) } this.unchecknode(i, t) }, getselectnodes: function() { var e = this.elements.getselectednodes(!1) , t = [] , s = this; return e.each(function() { var e = $(this).data("id") , i = s.getnode(e); t.push(i) }), t }, getcheckednodes: function(e) { var t = this.elements.getcheckednodes(!1, e) , s = [] , i = this; return t.each(function() { var e = $(this).data("id") , t = i.getnode(e); s.push(t) }), s }, getnode: function(e) { var t = this.idindexmap["id_" + e]; return this.data[t] }, revealnode: function(e, t) { for (var s = 0; s < e.length; s++) for (var i = e[s]._innerpath, n = i.split("|"), a = 1; a < n.length - 1; a++) { var o = this.getnode(n[a]); this.setexpandedstate(o, !0, t) } }, search: function(e, t) { var s = { ignorecase: !0, exactmatch: !1, revealresults: !0 }; t = $.extend({}, s, t), this.clearsearch(); var i = []; if (e && e.length > 0) { t.exactmatch && (e = "^" + e + "$"); var n = "g"; t.ignorecase && (n += "i"), i = this.findnodes(e, n) } return t.revealresults && this.revealnode(i), this.elements.original.trigger("searchcomplete", $.extend(!0, {}, i)), i }, clearsearch: function() { var e = this.elements.getsearchresultnodes(); e.removeclass("search-result"), this.elements.original.trigger("searchcleared") }, findnodes: function(e, t, s) { t = t || "g", s = s || "text"; for (var i = this.elements.getallnodes(), n = [], a = 0; a < i.length; a++) { var o = $(i[a]) , r = o.text() , l = r.match(new regexp(e,t)); if (l) { o.addclass("search-result"); var h = o.data("id") , c = this.getnode(h); n.push(c) } } return n }, destroy: function() { this.container.empty(), this.container = null, this.unbindevents() }, unbindevents: function() { this.elements.original.off("click"), this.elements.original.off("dblclick"), this.elements.original.off("nodedbclicked"), this.elements.original.off("nodechecked"), this.elements.original.off("nodecollapsed"), this.elements.original.off("nodedisabled"), this.elements.original.off("nodeenabled"), this.elements.original.off("nodeexpanded"), this.elements.original.off("nodeselected"), this.elements.original.off("nodeunchecked"), this.elements.original.off("nodeunselected"), this.elements.original.off("searchcomplete"), this.elements.original.off("searchcleared") }, bindevents: function() { this.unbindevents(); var e = null , t = this; this.elements.original.on("click", $.proxy(function(s) { cleartimeout(e), e = settimeout(function() { t.clickhandler(s) }, 300) }, t)), this.elements.original.on("dblclick", $.proxy(function(s) { cleartimeout(e), t.dblclickhandler(s) }, t)), this.elements.original.on("nodedbclick", $.proxy(this.settings.onnodedbclick, this)), this.elements.original.on("nodechecked", $.proxy(this.settings.onnodechecked, this)), this.elements.original.on("nodecollapsed", $.proxy(this.settings.onnodecollapsed, this)), this.elements.original.on("nodedisabled", $.proxy(this.settings.onnodedisabled, this)), this.elements.original.on("nodeenabled", $.proxy(this.settings.onnodeenabled, this)), this.elements.original.on("nodeexpanded", $.proxy(this.settings.onnodeexpanded, this)), this.elements.original.on("nodeselected", $.proxy(this.settings.onnodeselected, this)), this.elements.original.on("nodeunchecked", $.proxy(this.settings.onnodeunchecked, this)), this.elements.original.on("nodeunselected", $.proxy(this.settings.onnodeunselected, this)), this.elements.original.on("searchcomplete", $.proxy(this.settings.onsearchcomplete, this)), this.elements.original.on("searchcleared", $.proxy(this.settings.onsearchcleared, this)) }, getapi: function() { var e = this , t = { collapseall: "collapseall", expandall: "expandall", checkall: "checkall", uncheckall: "uncheckall", disableall: "disableall", enableall: "enableall", checknodebyids: "checknodebyids", unchecknodebyids: "unchecknodebyids", selectnodebyids: "selectnodebyids", unselectnodebyids: "unselectnodebyids", getcheckednodes: "getcheckednodes", getselectnodes: "getselectnodes", getnode: "getnode" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "tree" , i = s.ui.controls.slowtree; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = function() {} , n = { onconfirm: i, multiselect: !0, map: { id: "id", text: "cnfullname" }, titlename: "部门", inputhide: !1, rendertreenode: void 0 } , a = { multiselect: "multi-select", titlename: "title-name" }; this.departselect = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.settings._currentpluginid = t, this.initelements() }, parsetypeaheaddata: function(e, t) { t = t.split(","), this.treeselect.modal.parsedatatrees(e); for (var s = 0; s < t.length; s++) this.treeselect.modal.states.orgsmap[t[s]].unselectable = !0 }, updatedataorgs: function(e, t) { t && "" !== t && this.parsetypeaheaddata(e, t), this.treeselect.modal.updatedataorgs(e), this.treeselect.userselect.updatedata(e) }, initelements: function() { this.elements = { original: this.element }, this.treeselect = new s.ui.controls.treeselect(this.elements.original,{ onconfirm: this.settings.onconfirm, multiselect: this.settings.multiselect, titlename: this.settings.titlename, map: this.settings.map, inputhide: this.settings.inputhide, rendertreenode: this.settings.rendertreenode }) }, setvalue: function(e) { this.treeselect.userselect.setdata(e) }, refresh: function() {}, enable: function() { this.treeselect.element.prop("disabled", !1), this.treeselect.userselect.enable(), this.disabled = !1 }, disable: function() { this.treeselect.element.prop("disabled", !0), this.treeselect.userselect.disable(), this.disabled = !0 }, onopen: function(e) { this.treeselect.userselect.getbutton().click() }, disablenodebyids: function(e) { this.treeselect.modal.controls.orgtree.disablenodebyids(e) }, getapi: function() { var e = this , t = { onopen: "onopen", disablenodebyids: "disablenodebyids" } , i = s.utilities.buildapi(e, t); return i }, destory: function() {} }) }), function(e) { "use strict"; var t = "departselect" , i = s.ui.controls.departselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destory(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = function() {} , n = { levels: 2, dataurl: "", showcheckbox: "none", selectmode: "none", checkrecursive: !0, multiselect: !1, appendhtml: "", selectednodeids: "", checkednodeids: "", onnodedbclick: i, onnodechecked: i, onnodecollapsed: i, onnodedisabled: i, onnodeenabled: i, onnodeexpanded: i, onnodeselected: i, onnodeunchecked: i, onnodeunselected: i, unselect: !1 } , a = { dataurl: "data-url", levels: "levels", showcheckbox: "show-checkbox", selectmode: "select-mode", checkrecursive: "check-recursive", multiselect: "multi-select", selectednodeids: "selected-node-ids", checkednodeids: "checked-node-ids", unselect: "unselect" }; this.combotree = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, s) { if (t += 1, this.element = $(e), this.container, this.elements, this.value = this.element.val(), !this.element.data("initialized")) { this.element.data("initialized", !0), this.element.data("plugin-id", t), this.initsettings(s), this.buildhtml(), this.initelements(), this.transferattributes(); var i = this; this.d = $.deferred(), $.when(this.getdata(this.d)).done(function() { i.render() }), this.bindevents(), this.bindeventsinterface() } }, buildhtml: function() { var e = this.element.data("plugin-id") , t = ''; this.container = $(t), this.element.before(this.container), this.element.hide() }, initelements: function() { this.elements = { orginal: this.element, viewcontainer: $(".c-combotree-btn", this.container), view: $(".c-combotree-btn-text", this.container), menu: $(".dropdown-menu", this.container), tree: $(".tree-menu", this.container) }, this.elements.orginal.hide(), this.dropdown = new s.ui.controls.dropdown(this.elements.viewcontainer,{}), this.elements.menu.on("click", function(e) { e.preventdefault(), e.stoppropagation() }) }, getdata: function(e) { return this.settings.data ? (this.data = $.extend(!0, [], this.settings.data), delete this.settings.data, e.resolve(), e.promise()) : e.promise() }, updatedata: function(e) { this.tree.getapi().setvalue(e) }, getcheckednodes: function() { return this.tree.getapi().getcheckednodes() }, getselectnodes: function() { return this.tree.getapi().getselectnodes() }, selectnodebyids: function(e) { e ? this.tree.getapi().selectnodebyids(e) : this._getvalues([]) }, unselectnodebyids: function(e) { return this.tree.getapi().unselectnodebyids(e) }, checknodebyids: function(e) { e ? this.tree.getapi().checknodebyids(e) : this._getvalues([]) }, disablenodebyids: function(e) { e && this.tree.getapi().disablenodebyids(e) }, unchecknodebyids: function(e) { return this.tree.getapi().unchecknodebyids(e) }, closetree: function() { this.dropdown.toggle() }, render: function() { var e = this; this.tree = new s.ui.controls.tree(this.elements.tree,{ levels: e.settings.levels, showcheckbox: e.settings.showcheckbox, selectmode: e.settings.selectmode, checkrecursive: e.settings.checkrecursive, multiselect: e.settings.multiselect, selectednodeids: e.settings.selectednodeids, checkednodeids: e.settings.checkednodeids, data: [], onnodechecked: function(t, s) { var i = this , n = i.getcheckednodes(!1); e._getvalues(n), e.elements.view.trigger("nodechecked", s) }, onnodeunchecked: function(t, s) { var i = this , n = i.getcheckednodes(!1); e._getvalues(n), e.elements.view.trigger("nodeunchecked", s) }, onnodeselected: function(t, s) { var i = this.getselectnodes(); e.settings.unselect || e._getvalues(i), e.elements.view.trigger("nodeselected", s) }, onnodeunselected: function(t, s) { var i = this.getselectnodes(); e.settings.unselect || e._getvalues(i), e.elements.view.trigger("nodeunselected", s) } }) }, _getvalues: function(e) { var t = ""; this.values = ""; for (var s = 0; s < e.length; s++) t += e[s].text + ",", this.values += e[s].id + ","; t = t.substr(0, t.length - 1), this.elements.view.text(t) }, unbindevents: function() { this.elements.view.off("nodedbclick"), this.elements.view.off("nodechecked"), this.elements.view.off("nodecollapsed"), this.elements.view.off("nodedisabled"), this.elements.view.off("nodeenabled"), this.elements.view.off("nodeexpanded"), this.elements.view.off("nodeselected"), this.elements.view.off("nodeunchecked"), this.elements.view.off("nodeunselected") }, bindevents: function() { this.unbindevents(), this.elements.view.on("nodedbclick", $.proxy(this.settings.onnodedbclick, this)), this.elements.view.on("nodechecked", $.proxy(this.settings.onnodechecked, this)), this.elements.view.on("nodecollapsed", $.proxy(this.settings.onnodecollapsed, this)), this.elements.view.on("nodedisabled", $.proxy(this.settings.onnodedisabled, this)), this.elements.view.on("nodeenabled", $.proxy(this.settings.onnodeenabled, this)), this.elements.view.on("nodeexpanded", $.proxy(this.settings.onnodeexpanded, this)), this.elements.view.on("nodeselected", $.proxy(this.settings.onnodeselected, this)), this.elements.view.on("nodeunchecked", $.proxy(this.settings.onnodeunchecked, this)), this.elements.view.on("nodeunselected", $.proxy(this.settings.onnodeunselected, this)) }, destroy: function() { this.container.empty(), this.container = null, this.unbindevents() }, bindeventsinterface: function() {}, transferattributes: function() { this.element.prop("disabled") && this.disable() }, disable: function() { this.element.prop("disabled", !0), this.elements.viewcontainer.addclass("disabled") }, enable: function() { this.element.prop("disabled", !1), this.elements.viewcontainer.removeclass("disabled") }, getapi: function() { var e = this , t = { getcheckednodes: "getcheckednodes", getselectnodes: "getselectnodes", disablenodebyids: "disablenodebyids", selectnodebyids: "selectnodebyids", unselectnodebyids: "unselectnodebyids", checknodebyids: "checknodebyids", unchecknodebyids: "unchecknodebyids", closetree: "closetree" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "combotree" , i = s.ui.controls.combotree; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = function() {} , n = { hascontact: !0, hasaddcontact: !1, urlcontacts: "", urlcontactusers: "", urladdcontacts: "", hasjobfilter: !1, hasouterfilter: !1, urlorgs: "", urlusers: "", multiselect: !0, inputhide: !1, onconfirm: i, confirmhide: !0, rendertreenode: void 0, titlename: "选择人员", typeaheadmethod: {} } , a = { hascontact: "has-contact", hasaddcontact: "has-add-contact", hasjobfilter: "has-job-filter", hasouterfilter: "has-outer-filter", urlcontacts: "url-contacts", urlcontactusers: "url-contact-users", urladdcontacts: "url-add-contacts", multiselect: "multi-select", inputhide: "input-hide", urljobs: "url-jobs", urlusers: "url-users", urlorgs: "url-orgs", confirmhide: "confirm-hide", titlename: "title-name" } , o = new e.class({ data: {}, init: function(e, t) { this.userselect = e, this.settings = t, this.orgcount = 0, this.contactcount = 0, this.states = { leftusers: [], rightusers: [], rightusermap: {}, filterleftusers: [], filterstates: "-100" }, this.buildhtml(), this.initelements(), this.bindevents(), this.bindeventsinterface() }, getdatausers: function(e) { if (void 0 !== this.settings.data && void 0 !== this.settings.data.users && this.settings.data.users) { var t = $.extend(!0, [], this.settings.data.users); return this.data.users = this.parsedatausers(t), delete this.settings.data.users, e.resolve(), e.promise() } var s = this; return $.ajax({ datatype: "json", url: s.settings.dataurlusers, data: {}, success: function(t) { s.data.users = s.parsedatausers(t), e.resolve() }, error: function(t, s, i) { e.resolve() } }), e.promise() }, getdataorgs: function(e) { if (void 0 !== this.settings.data && void 0 !== this.settings.data.orgs && this.settings.data.orgs) { var t = $.extend(!0, [], this.settings.data.orgs); return this.data.orgs = this.parsedataorgs(t), delete this.settings.data.orgs, e.resolve(), e.promise() } var s = this; return $.support.cors = !0, $.ajax({ url: s.settings.dataurlorgs, datatype: "json", contenttype: "application/json; charset=utf-8", success: function(t) { s.data.orgs = s.parsedataorgs(t), e.resolve() }, error: function(t, s, i) { e.resolve() } }), e.promise() }, parsedatausers: function(e) { var t = []; this.usermap = {}, this.parseusermap = {}, this.orgusersmap = {}; for (var s = 0; s < e.length; s++) { var i = e[s] , n = this.tranferoriginaluser(i); t[t.length] = n, this.usermap[i.id] = i, this.parseusermap[i.id] = n; var a = n.orgpath; if (a) for (var o = a.split(">"), r = 0; r < o.length; r++) { var l = o[r]; this.orgusersmap[l] || (this.orgusersmap[l] = []), this.orgusersmap[l].push(n) } } for (var h in this.orgmap) { var c = h; this.orgusersmap[c] || (this.orgusersmap[c] = []), this.orgmap[h].text += "(" + this.orgusersmap[c].length + ")" } return t }, parsedataorgs: function(e) { this.orgidpathmap = {}, this.orgmap = {}; var t = e[0] , s = { id: t.id, parentid: t.parentid, text: t.cnfullname, path: "" + t.id, orgpath: "" + t.id } , i = [s]; this.orgidpathmap[t.id] = i[0].orgpath, this.orgmap[t.id] = s; for (var n = 1; n < e.length; n++) { t = e[n]; for (var s, a = i[i.length - 1]; t.parentid !== a.id && a.nodes; ) a = a.nodes[a.nodes.length - 1]; if (t.parentid === a.id) { a.nodes = a.nodes || []; var o = a.orgpath + ">" + t.id , s = { id: t.id, parentid: t.parentid, text: t.cnfullname, path: a.path + ">" + t.id, orgpath: o }; a.nodes[a.nodes.length] = s, this.orgidpathmap[t.id] = o, this.orgmap[t.id] = s } } return this.orgcount = e.length, this.elements.colorgnumber.text(this.orgcount + this.contactcount), i }, parsedatacontacts: function(e) { this.contactusersmap = {}; var t = e[0] , s = this.getusersbycontanct(t); this.contactusersmap[t.groupid] = s; for (var i = [{ id: t.groupid, parentid: t.parentid, text: t.groupname + "(" + s.length + ")", path: "" + t.groupid }], n = 0, a = 1; a < e.length; a++) { t = e[a]; for (var o = i[i.length - 1]; t.parentid !== o.id && o.nodes; ) o = o.nodes[o.nodes.length - 1]; t.parentid === o.id && (o.nodes = o.nodes || [], s = this.getusersbycontanct(t), this.contactusersmap[t.groupid] = s, o.nodes[o.nodes.length] = { id: t.groupid, parentid: t.parentid, text: t.groupname + "(" + s.length + ")", path: "" + t.groupid }, n += s.length) } return i[0].text = e[0].groupname + "(" + n + ")", this.contactcount = n, this.elements.colorgnumber.text(this.orgcount + this.contactcount), i }, parsedatasetvalueusers: function(e) { for (var t = [], s = 0; s < e.length; s++) { var i = e[s] , n = { id: i.id, realname: i.realname, name: i.hassamename ? i.realname + "(" + i.loginname + ")" : i.realname, hassamename: i.hassamename, loginname: i.loginname, spell: i.spell, spellfirst: i.spellfirst, title: i.title || "", orgid: i.orgid, titlesortno: i.titlesortno, innerouter: i.corenoncore, orgpath: null, oridata: i }; t.push(n) } return t }, tranferoriginaluser: function(e) { var t = e , s = this.orgidpathmap[t.orgid] , i = { id: t.id, realname: t.realname, name: t.hassamename ? t.realname + "(" + t.loginname + ")" : t.realname, hassamename: t.hassamename, loginname: t.loginname, spell: t.spell, spellfirst: t.spellfirst, title: t.title || "", orgid: t.orgid, titlesortno: t.titlesortno, innerouter: t.corenoncore, orgpath: s, oridata: e.oridata || e }; return i }, tranferoriginalusers: function(e) { for (var t = [], s = 0; s < e.length; s++) t.push(this.tranferoriginalusers(e[s])); return t }, tranferinneruser: function(e) { var t = e , s = { id: t.id, realname: t.realname, loginname: t.loginname, hassamename: t.hassamename, spell: t.spell, spellfirst: t.spellfirst, title: t.title || "", orgid: t.orgid, titlesortno: t.titlesortno, corenoncore: t.innerouter, oridata: t.oridata || t }; return s }, tranferinnerusers: function(e) { for (var t = [], s = 0; s < e.length; s++) t.push(this.tranferinneruser(e[s])); return t }, getusersbyorgid: function(e) { var t = $.grep(this.data.users, function(t) { var s = e + ">"; return t.orgpath.indexof(s) > -1 }); return t || [] }, getusersbycontanct: function(e) { if (this.parseusermap) { var t = e.userids , s = []; if (!t || 0 === t.length) return s; for (var i = 0; i < t.length; i++) { var n = this.parseusermap[t[i]]; s.push(n) } return s } }, updatedatausers: function(e) { this.data.users = e, this.render() }, updatedatacontacts: function(e) { this.data.contacts = this.parsedatacontacts(e), this._rendercontacttree() }, updatedataorgs: function(e) { this.data.orgs = this.parsedataorgs(e) }, updatedatajobfilter: function(e) { this.data.jobfilter = e, this.renderjobfilter() }, buildhtml: function() { var e = ' ' , t = this.settings.multiselect ? '全选 >>' : "" , s = '
      部门 (0)
      待选 (0)
      ' + e + '
      已选 (0)
      ' , i = ''; this.container = $(i) }, initelements: function() { var e = this , t = "#c-orgselect-dialog-" + this.settings._currentpluginid , i = new s.ui.controls.modal(this.userselect.getbutton(),{ modalid: t, modalclass: "c-orgselect-modal", content: this.container, backdrop: "static" }); this.elements = { colorgquerytypeahead: $(".col-org .query-typeahead", this.container), colorgnumber: $(".col-org .number", this.container), colorgcontacttree: $(".col-org .contact-tree", this.container), colorgorgtree: $(".col-org .org-tree", this.container), colleftselectnumber: $(".col-leftselect .number", this.container), colleftselectjoblist: $(".col-leftselect .joblist", this.container), colleftselectinner: $(".col-leftselect .c-inner", this.container), colleftselectouter: $(".col-leftselect .c-outer", this.container), colleftselectlabel: $(".col-leftselect label", this.container), colleftclklist: $(".col-leftselect .clklist", this.container), colleftselectpersonlist: $(".col-leftselect .person-list", this.container), colleftselectrowfilter: $(".col-leftselect .row-filter", this.container), colbuttonscheckall: $(".col-buttons .check-all", this.container), colbuttonscheckin: $(".col-buttons .check-in", this.container), colbuttonscheckout: $(".col-buttons .check-out", this.container), colbuttonscheckclear: $(".col-buttons .check-clear", this.container), colrightselectnumber: $(".col-rightselect .number", this.container), colrightselectsetcontact: $(".col-rightselect .set-contact", this.container), colrightselectcontactname: $(".col-rightselect .contact-name", this.container), colrightselectsavebtn: $(".col-rightselect .save-btn", this.container), colrightselectpersonlist: $(".col-rightselect .person-list", this.container), colrightselectrowcontact: $(".col-rightselect .row-contact", this.container), confirm: $(".modal-footer .confirm", this.container), cancel: $(".modal-footer .cancel", this.container) }, this.elements.colbuttonscheckin.css("visibility", "hidden"), this.elements.colbuttonscheckout.css("visibility", "hidden"), this.settings.hascontact ? this.settings.hasaddcontact || (this.elements.colrightselectrowcontact.remove(), this.container.addclass("none-contact-container")) : (this.elements.colorgcontacttree.remove(), this.elements.colrightselectrowcontact.remove(), this.container.addclass("none-contact-container")); var n = !0; this.settings.hasjobfilter || this.settings.hasouterfilter || (this.elements.colleftselectrowfilter.remove(), this.container.addclass("none-filter-container"), n = !1), !this.settings.hasjobfilter && n && this.elements.colleftselectjoblist.remove(), !this.settings.hasouterfilter && n && this.elements.colleftclklist.remove(); var a = new s.ui.controls.typeahead(this.elements.colorgquerytypeahead,{ map: '{"text":"name","returnvalue":"json"}', template: this.settings.typeaheadmethod.template, onchanged: this.settings.typeaheadmethod.onchanged || function(e, t) { this.query = this.query, this.matcherreg = new regexp(t,"i") } , matcher: this.settings.typeaheadmethod.matcher || function(e) { var t = this.matcherreg || new regexp(this.query,"i") , s = t.test(e.name) || t.test(e.loginname) || t.test(e.spell) || t.test(e.spellfirst); return s === !0 ? 1 : -1 } , onselected: this.settings.typeaheadmethod.onselected || function(t, s) { var i = this.getvalue(s); e.addusers([i]), e.checkleft(e.getrightusers()) } , mouseover: this.settings.typeaheadmethod.mouseover || function(e, t) { var s = this.getvalue(t); "" !== s.title && $(e.currenttarget).find("a").html(s.realname + "(" + s.title + ")") } , mouseout: this.settings.typeaheadmethod.mouseout || function(e, t) { var s = this.getvalue(t); $(e.currenttarget).find("a").html(s.name) } }) , o = null , r = null; this.settings.hascontact && (o = new s.ui.controls.tree(this.elements.colorgcontacttree,{ levels: 1, multiselect: !1, onnodeselected: function(t, s) { e.onnodeselected(t, s, "contact") }, rendernode: this.settings.rendertreenode }), this.settings.hasaddcontact && (r = new s.ui.controls.typeahead(this.elements.colrightselectsetcontact,{ map: '{"text":"name","returnvalue":"json"}', matcher: function(e) { return this.query ? 1 : e.name.tolowercase().indexof(this.query.tolowercase()) > -1 ? 1 : e.loginname.tolowercase().indexof(this.query.tolowercase()) > -1 ? 1 : e.spell.tolowercase().indexof(this.query.tolowercase()) > -1 ? 1 : e.spellfirst.tolowercase().indexof(this.query.tolowercase()) > -1 ? 1 : -1 }, onselected: function(t, s) { var i = this.getvalue(s) , n = e.controls.rightselect.elements.right; 0 === n.find('option[value="' + i.id + '"]').length && (n.append('"), e._updateselectedcount()) } }))); var l = new s.ui.controls.tree(this.elements.colorgorgtree,{ levels: 1, multiselect: !1, onnodeselected: function(t, s) { e.onnodeselected(t, s, "org") }, rendernode: this.settings.rendertreenode }) , h = null; this.settings.hasjobfilter && (h = new s.ui.controls.selectex(this.elements.colleftselectjoblist,{ selectfirst: !0, onselected: function(t, s) { e.states.filterstates = s.value, e.checkfilter() } }), h.setvalue("-100")); var c = new s.ui.controls.selectlist(this.elements.colleftselectpersonlist,{ map: { text: "name", value: "id" }, mouseover: function(e, t) { "" !== t.title && $(e.target).html(t.realname + "(" + t.title + ")") }, mouseout: function(e, t) { $(e.target).html(t.name) }, click: function(t, s) { var i = $(t.target).is("li") ? $(t.target) : $(t.target).parent("li"); i.hasclass("c-selectlist-checked") ? (e.removeusers([s]), e.controls.rightselectpersonlist.clearselecteditems(), e.checkleft(e.getrightusers())) : (e.addusers([s]), e.controls.leftselectpersonlist.clearselecteditems(), e.checkleft(e.getrightusers())) } }) , d = new s.ui.controls.selectlist(this.elements.colrightselectpersonlist,{ map: { text: "name", value: "id" }, mouseover: function(e, t) { "" !== t.title && $(e.target).html(t.realname + "(" + t.title + ")") }, mouseout: function(e, t) { $(e.target).html(t.name) }, click: function(t, s) { e.removeusers([s]), e.controls.rightselectpersonlist.clearselecteditems(), e.checkleft(e.getrightusers()) } }); this.controls = { pop: i, typeahead: a, contacttree: o, orgtree: l, jobfilter: h, leftselectpersonlist: c, rightselectpersonlist: d } }, bindevents: function() { this.elements.confirm.on("click", $.proxy(this.onconfirm, this)), this.settings.hasouterfilter && (this.elements.colleftselectinner.on("click", $.proxy(this.checkfilter, this)), this.elements.colleftselectouter.on("click", $.proxy(this.checkfilter, this))), this.elements.colbuttonscheckall.on("click", $.proxy(this.checkall, this)), this.elements.colbuttonscheckin.on("click", $.proxy(this.checkin, this)), this.elements.colbuttonscheckout.on("click", $.proxy(this.checkout, this)), this.elements.colbuttonscheckclear.on("click", $.proxy(this.checkclear, this)), this.elements.confirm.on("onconfirm", $.proxy(this.settings.onconfirm, this)) }, bindeventsinterface: function() {}, onnodeselected: function(e, t, s) { var i = null; if ("org" === s ? (i = this.orgusersmap[t.id], this.selectorgid = t.id, this.selectcontactid && this.controls.contacttree.unselectnodebyids(this.selectcontactid), this.selectcontactid = null) : (i = this.contactusersmap[t.id], this.selectcontactid = t.id, this.selectorgid && this.controls.orgtree.unselectnodebyids(this.selectorgid), this.selectorgid = null), this.settings.hasjobfilter) { var n = this.renderleft(i); this.states.filterleftusers = n, this.states.leftusers = i, this.controls.leftselectpersonlist.setdata(n), this.elements.colleftselectnumber.text(n.length), this.checkleft(this.getrightusers()) } else this.states.leftusers = i, this.controls.leftselectpersonlist.setdata(i), this.elements.colleftselectnumber.text(i.length), this.checkleft(this.getrightusers()) }, checkall: function(e) { this.settings.hasjobfilter ? this.addusers(this.states.filterleftusers) : this.addusers(this.states.leftusers), this.controls.leftselectpersonlist.clearselecteditems(), this.checkleft(this.getrightusers()) }, checkin: function(e) { var t = this.controls.leftselectpersonlist.getselecteditems(); this.addusers(t), this.controls.leftselectpersonlist.clearselecteditems(), this.checkleft(this.getrightusers()) }, checkout: function() { var e = this.controls.rightselectpersonlist.getselecteditems(); this.removeusers(e), this.controls.leftselectpersonlist.clearselecteditems(), this.checkleft(this.getrightusers()) }, checkclear: function() { var e = this.getrightusers(); this.removeusers(e), this.controls.leftselectpersonlist.clearselecteditems(), this.checkleft(this.getrightusers()) }, addusers: function(e) { var t, s = []; if (this.settings.multiselect) { for (var i = 0; i < e.length; i++) t = e[i], this.states.rightusermap[t.id] || (s.push(t), this.states.rightusermap[t.id] = t); this.controls.rightselectpersonlist.additem(s); var n = object.keys(this.states.rightusermap).length; this.elements.colrightselectnumber.text(n) } else t = array.isarray(e) ? e[e.length - 1] : e, this.states.rightusermap[t.id] || (this.states.rightusermap = {}, s.push(t), this.states.rightusermap[t.id] = t), this.controls.rightselectpersonlist.coveritem(s), this.elements.colrightselectnumber.text(1) }, removeusers: function(e) { for (var t = 0; t < e.length; t++) { var s = e[t]; delete this.states.rightusermap[s.id] } this.controls.rightselectpersonlist.deleteitem(e); var i = object.keys(this.states.rightusermap).length; this.elements.colrightselectnumber.text(i) }, getrightusers: function() { var e = []; for (var t in this.states.rightusermap) e.push(this.states.rightusermap[t]); return e }, setrightusers: function(e) { this.states.rightusermap = {}; for (var t = 0; t < e.length; t++) { var s = e[t]; this.states.rightusermap[s.id] = s } this.controls.rightselectpersonlist.setdata(e) }, checkleft: function(e) { this.controls.leftselectpersonlist.clearcheckeditems(), this.controls.leftselectpersonlist.setcheckeditems(e) }, onconfirm: function(e) { this._rendervalue(); var t = this.getrightusers(); this.settings.confirmhide ? this.controls.pop.hide() : t.length > 0 && this.controls.pop.hide() }, render: function() { this._rendertypeahead(), this._renderorgtree() }, _rendertypeahead: function() { this.controls.typeahead.setsource(this.data.users) }, _renderorgtree: function() { this.controls.orgtree.setvalue(this.data.orgs, 2) }, _rendercontacttree: function() { this.controls.contacttree.setvalue(this.data.contacts, 2) }, setselectvalue: function(e) { this.setrightusers(e), this.checkleft(e), this.elements.colrightselectnumber.text(e.length) }, checkfilter: function() { var e = this.states.leftusers || []; if (!(e.length <= 0)) { var t = this.renderleft(e); this.states.filterleftusers = t, this.controls.leftselectpersonlist.setdata(t), this.elements.colleftselectnumber.text(t.length), this.checkleft(this.getrightusers()) } }, renderleft: function(e) { for (var t = [], s = this.states.filterstates, i = this.elements.colleftselectinner.is(":checked"), n = this.elements.colleftselectouter.is(":checked"), a = 0; a < e.length; a++) { var o = e[a]; ("-100" == s || s > 0 && o.titlesortno == s || s <= 0 && o.titlesortno <= -s) && (i && "内部" == o.innerouter || n && "外部" == o.innerouter) && t.push(o) } return t }, _rendervalue: function() { var e = this.getrightusers(); this.userselect.setdata(e), this.settings.onconfirm.apply(this, [this.tranferinnerusers(e)]) }, show: function() { this.container.show() }, hide: function() { this.container.hide() } }); this.orgselect = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.settings._currentpluginid = t, this.initelements() }, updatedatausers: function(e) { var t = this.modal.parsedatausers(e); this.userselect.updatedata(t), this.modal.updatedatausers(t) }, updatedataorgs: function(e) { this.modal.updatedataorgs(e) }, updatedatacontacts: function(e) { this.modal.updatedatacontacts(e) }, initelements: function() { var e = this; this.elements = { original: this.element }, this.userselect = new s.ui.controls.userselect(this.elements.original,{ map: '{"text":"name","returnvalue":"json"}', typeaheadmethod: this.settings.typeaheadmethod, ishide: this.settings.inputhide, onblured: function(t) { e.settings.onconfirm.apply(e, [e.modal.tranferinnerusers(t)]) } }), this.modal = new o(this.userselect,this.settings); var e = this; this.userselect.getbutton().on("click", function(t) { e.modal.setselectvalue(e.userselect.getvalue()) }) }, setvalue: function(e) { var t = this.modal.parsedatasetvalueusers(e); this.userselect.setdata(t) }, refresh: function() {}, enable: function() { this.element.prop("disabled", !1), this.userselect.enable(), this.disabled = !1 }, disable: function() { this.element.prop("disabled", !0), this.userselect.disable(), this.disabled = !0 }, onopen: function(e) { this.userselect.getbutton().click() }, disablenodebyids: function(e) { this.modal.controls.orgtree.disablenodebyids(e) }, getapi: function() { var e = this , t = { onopen: "onopen", disablenodebyids: "disablenodebyids" } , i = s.utilities.buildapi(e, t); return i }, destory: function() {} }) }), function(e) { "use strict"; var t = "orgselect" , i = s.ui.controls.orgselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destory(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = "上一页" , i = "下一页" , n = "跳转到" , a = "go" , o = { enlangflag: !1, totalsize: 0, pagesize: 10, pageindex: 0, pagebuttons: 5, onpageindexchange: void 0, pagetype: "intricacy" } , r = { enlangflag: "enlangflag", totalsize: "total-size", pagesize: "page-size", pageindex: "page-index", pagebuttons: "page-buttons", pagetype: "page-type" }; this.paginator = new e.class({ extend: s.ui.basecontrol },{ defaults: o, attributemap: r, settings: {}, value: "", data: {}, templates: {}, init: function(e, s) { if (this.element = $(e), !this.element.is("ul")) throw "in bootstrap version 3 the pagination root item must be an ul element."; this.initsettings(s), this.settings.enlangflag && (t = "prev", i = "next", n = "to", a = "go"), this.inputpage = 1, this.updateoptions(this.settings), this.bindeventsinterface() }, buildhtml: function() {}, initelements: function() {}, bindeventsinterface: function() { var e = this.element; this.settings.onpageindexchange && e.on("paginator.on.pageindexchange", $.proxy(this.settings.onpageindexchange, this)) }, updateoptions: function(e) { this.settings = $.extend(!0, {}, this.settings, e), this.settings.totalsize % this.settings.pagesize === 0 ? this.totalpages = this.settings.totalsize / this.settings.pagesize : this.totalpages = math.ceil(this.settings.totalsize / this.settings.pagesize), this.totalpages = this.totalpages < 1 ? 1 : this.totalpages, 1 == this.totalpages ? this.element.hide() : this.element.css("display", "inline-block"), this.settings.pagebuttons = this.settings.pagebuttons % 2 === 0 ? this.settings.pagebuttons + 1 : this.settings.pagebuttons, this.refresh() }, jumpto: function(e) { this.settings.pageindex = e < 0 ? 0 : e > this.totalpages - 1 ? this.totalpages - 1 : e, this.refresh() }, _getpagebuttons: function() { var e = (this.settings.totalsize, this.totalpages) , t = 0 , s = math.floor(this.settings.pagebuttons / 2); t = this.settings.pageindex - s, t = t < this.totalpages - this.settings.pagebuttons ? t : this.totalpages - this.settings.pagebuttons, t = t < 0 ? 0 : t; for (var i = [], n = t, a = 0; a < this.settings.pagebuttons && n < e; n += 1, a += 1) i.push(n); return t > 0 && (i.first = 0), e >= this.settings.pagebuttons + 2 && this.settings.pageindex - s > 1 && (i.prevsection = this.settings.pageindex - s - 1), this.settings.pageindex > 0 ? i.prev = this.settings.pageindex - 1 : i.prev = 0, this.settings.pageindex < e - 1 ? i.next = this.settings.pageindex + 1 : i.next = e - 1, e > this.settings.pagebuttons && this.settings.pageindex + s < this.totalpages - 2 && (i.nextsection = this.settings.pageindex + s + 1), t < e - this.settings.pagebuttons && (i.last = e - 1), i }, onpageindexchange: function(e) { var t = parseint($(e.target).attr("data-pi"), 10); this.settings.pageindex != t && (this.element.trigger("paginator.on.pageindexchange", t), this.jumpto(t)) }, refresh: function() { var e = this._getpagebuttons() , s = this.element; this.element.addclass("pagination"), this.element.empty(); var o = "" , r = ""; if (r = 0 === this.settings.pageindex ? '
    • <' + t + "
    • " : '
    • <' + t + "
    • ", o += r, "intricacy" == this.settings.pagetype) { if ("undefined" != typeof e.first) { var l = '
    • 1
    • '; o += l } if ("undefined" != typeof e.prevsection) { var h = '
    • ...
    • '; o += h } for (var c = 0; c < e.length; c += 1) { var d = e[c] === this.settings.pageindex ? ' class="active"' : "" , u = "' + (e[c] + 1) + "
    • "; o += u } if ("undefined" != typeof e.nextsection) { var p = '
    • ...
    • '; o += p } if ("undefined" != typeof e.last) { var m = '
    • ' + (e.last + 1) + "
    • "; o += m } var f = ""; f = this.settings.pageindex === this.totalpages - 1 ? '
    • " : '
    • ", o += f, s.append(o), $('li a[data-pi="0"]', s).addclass("first"), $('li a[data-pi="' + (this.totalpages - 1) + '"]', s).addclass("last"); var g = '
    • ' + a + "!
    • "; s.append(g) } else if ("simple" == this.settings.pagetype) { s.append(o); var g = '
    • / ' + this.totalpages + "
    • "; s.append(g); var f = ""; f = this.settings.pageindex === this.totalpages - 1 ? '
    • ' + i + ">
    • " : '
    • ' + i + ">
    • ", s.append(f) } $("input[type=text]", s).val(this.settings.pageindex + 1); $(".page-cur", s).mask("0000000"); var v = this; $(".page-go-btn", s).on("click", $.proxy(this.onpagego, this)), $(".page-cur", s).on("keypress", function(e) { if (13 == e.which) return v.onpagego(), !1 }), $("a", s).on("click", $.proxy(this.onpageindexchange, this)) }, onpagego: function() { var e = this.element , t = this , s = $(".page-cur", e).val(); ("undefined" == typeof s || "" === s || isnan(parseint(s))) && (s = 1), s = parseint(s), s < 1 ? s = 1 : s > t.totalpages && (s = t.totalpages), $(".page-cur", e).val(s), s = parseint(s) - 1, t.inputpage = s + 1, t.element.trigger("paginator.on.pageindexchange", s), t.jumpto(s) }, checknumber: function(e) { var t = /^[1-9]+[0-9]*]*$/ , s = -1; return isnan(parseint(e)) ? s : (e = parseint(e), t.test(e) ? s = 1 : s) }, enable: function() {}, disable: function() {}, destroy: function() { this.element.off("page-clicked"), this.element.off("page-changed"), this.element.empty() } }) }), function(e) { "use strict"; var t = "paginator" , i = s.ui.controls.paginator; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = { all: "all", none: "none", leaf: "leaf" } , i = { checked: "checked", unchecked: "unchecked", partof: "partof" } , n = { all: "all", leaf: "leaf" } , a = function() {} , o = 0 , r = { levels: 1, dataurl: "", expandicon: "glyphicon glyphicon-plus", collapseicon: "glyphicon glyphicon-minus", emptyicon: "glyphicon", nodeicon: "empty", selectedicon: "", checkedicon: "glyphicon glyphicon-check", checkedpartoficon: "glyphicon glyphicon-check partofchecked", uncheckedicon: "glyphicon glyphicon-unchecked", clsnodetext: "nodevalue", clsappendhtml: "appendhtml", render: void 0, rendernode: void 0, clsbadge: "badge", clsitemcontent: "item-content", clsswitch: "switch", clsnodeunselect: "node-unselectable", clsnodeselected: "node-selected", clsnodedisabled: "node-disabled", enablelinks: !1, enabletitle: !1, showicon: !0, showtags: !1, multiselect: !0, silent: !1, ignorechildren: !1, expandone: !0, dnd: "none", showcheckbox: t.none, checkrecursive: !1, selectmode: n.all, appendhtml: "", parseappendhtml: void 0, selectednodeids: "", checkednodeids: "", disablednodeids: "", onnodedbclick: a, onnoderightclick: a, onnodechecked: a, onnodecollapsed: a, onnodedisabled: a, onnodeenabled: a, onnodeexpanded: a, onnodeselected: a, onnodeunchecked: a, onnodeunselected: a, onsearchcomplete: a, onsearchcleared: a } , l = { expandone: "expand-one", ignorechildren: "ignore-children", expandicon: "expand-icon", collapseicon: "collapse-icon", showtags: "show-tags", levels: "levels", enabletitle: "enable-title", dataurl: "data-url", showcheckbox: "show-checkbox", checkrecursive: "check-recursive", selectmode: "select-mode", appendhtml: "append-html", multiselect: "multi-select", selectednodeids: "selected-node-ids", checkednodeids: "checked-node-ids", disablednodeids: "disabled-node-ids", dnd: "dnd" }; this.tree = new e.class({ extend: s.ui.basecontrol },{ defaults: r, attributemap: l, init: function(e, t) { this.element = $(e), o += 1, this.element.data("plugin-id", o), this.initsettings(t), "function" == typeof this.settings.parsedata && (this.parsedata = this.settings.parsedata, delete this.settings.parsedata), this.initdata(), this.appendtemplate = this.settings.renderappend || this.appendtemplate, this.render = this.settings.render || this.render, this.container = $("
        "); var s = this; $.when(this.getdata()).done(function() { s._parsetreedata(s.data), s.refresh(), s.bindevents() }) }, getdata: function() { var e = $.deferred(); if (this.settings.data) { var t = $.extend(!0, [], this.settings.data); return this.data = { nodes: t }, delete this.settings.data, e.resolve(), e.promise() } return e.resolve(), e.promise() }, initdata: function() { this.data = {}, this.nodedatamap = {}, this.nodesmap = {}, this._currentselectnode = null, this.operatenodes = { selectednodeslist: [], checkednodeslist: [], partofcheckedlist: [] } }, setvalue: function(e, t) { this.initdata(); var s = $.extend(!0, [], e); this.data = { nodes: s }, this._parsetreedata(this.data), this.refresh(), "undefined" == typeof t ? this.expandlevel(this.settings.levels) : this.expandlevel(t) }, refresh: function() { var e = this._buildtree(this.data); this.container.empty(), this.container.remove(), this.container.append(e), this.element.addclass("c-tree"), this.element.empty().append(this.container) }, unbindevents: function() { this.element.off("nodedbclick"), this.element.off("noderightclick"), this.element.off("nodechecked"), this.element.off("nodecollapsed"), this.element.off("nodedisabled"), this.element.off("nodeenabled"), this.element.off("nodeexpanded"), this.element.off("nodeselected"), this.element.off("nodeunchecked"), this.element.off("nodeunselected") }, bindevents: function() { this.unbindevents(), this.element.on("nodedbclick", $.proxy(this.settings.onnodedbclick, this)), this.element.on("noderightclick", $.proxy(this.settings.onnoderightclick, this)), this.element.on("nodechecked", $.proxy(this.settings.onnodechecked, this)), this.element.on("nodecollapsed", $.proxy(this.settings.onnodecollapsed, this)), this.element.on("nodedisabled", $.proxy(this.settings.onnodedisabled, this)), this.element.on("nodeenabled", $.proxy(this.settings.onnodeenabled, this)), this.element.on("nodeexpanded", $.proxy(this.settings.onnodeexpanded, this)), this.element.on("nodeselected", $.proxy(this.settings.onnodeselected, this)), this.element.on("nodeunchecked", $.proxy(this.settings.onnodeunchecked, this)), this.element.on("nodeunselected", $.proxy(this.settings.onnodeunselected, this)) }, onnodedragstart: function(e, t) { return "function" != typeof this.settings.onnodedragstart || this.settings.onnodedragstart.apply(this, [e, t]) }, onnodedropstart: function(e, t) { return "function" != typeof this.settings.onnodedropstart || this.settings.onnodedropstart.apply(this, [e, t]) }, binddragforelement: function(e) { var t = this , s = $.extend(!0, { revert: !1, helper: "clone", start: function(s, i) { var n = t.onnodedragstart(s, i); n || e.draggable({ disabled: !0 }) }, drag: function(e, s) { "function" == typeof t.settings.onnodedrag && t.settings.onnodedrag.apply(t, [e, s]) }, stop: function(e, s) { "function" == typeof t.settings.onnodedragstop && t.settings.onnodedragstop.apply(t, [e, s]) } }, this.settings.draggable); e.draggable(s) }, binddropforelement: function(e) { var t = this , s = $.extend(!0, { greedy: !0, hoverclass: "node-hover", over: function(s, i) { var n = t.onnodedropstart(s, i); n || e.droppable({ disabled: !0 }) }, drop: function(e, s) { "function" == typeof t.settings.onnodedrop && t.settings.onnodedrop.apply(t, [e, s]) } }, this.settings.droppable); e.droppable(s) }, binddndforelement: function(e) { "drag" === this.settings.dnd ? this.binddragforelement(e) : "drop" === this.settings.dnd ? this.binddropforelement(e) : "dnd" === this.settings.dnd && (this.binddragforelement(e), this.binddropforelement(e)) }, destroy: function() { this.container.empty(), this.container = null, this.unbindevents() }, _replaceclass: function(e, t, s) { e && e.removeclass(s).addclass(t) }, _parsetreedata: function(e, t) { var s = 0 , i = null , n = e.id || -1; if ("undefined" == typeof t && (t = 1), e && e.nodes) { for (var a = e.nodes.length; s < a; ) i = e.nodes[s], i._innerparentid = n, i._innerlevel = t, i.nodes && i.nodes.length > 0 ? (i._isexpand = !1, i._haschildren = !0) : i._haschildren = !1, s++, this.nodedatamap[i.id] = i, this._parsetreedata(i, t + 1); return e } }, offsetheight: function(e) { return e instanceof jquery && (e = e[0]), e.getboundingclientrect() }, _getelposition: function(e) { return e instanceof jquery && (e = e[0]), e.getboundingclientrect() }, _buildtree: function(e, s, a) { "undefined" == typeof s && (s = 1); var o = a || $(document.createdocumentfragment()) , r = e , l = null , h = 0; if (r && r.nodes) { for (var c = r.nodes.length; h < c; ) { l = r.nodes[h]; var d = { node: $("
      • ").attr("data-id", l.id).attr("data-level", s).attr("data-haschildren", l._haschildren).attr("data-disabled", l._isdisabled).data("node-data", l), nodeicon: $("").addclass(this.settings.clsswitch).addclass(this.settings.nodeicon), checkicon: $("").addclass(this.settings.uncheckedicon), nodevalue: $("").addclass(this.settings.clsnodetext).text(l.text).attr("onselectstart", "return false"), appendhtml: $("").addclass(this.settings.clsappendhtml), wrapper: $("
        ").addclass(this.settings.clsitemcontent), childrennode: null }; this.settings.enabletitle && d.node.attr("title", l.text), l._haschildren && (d.nodeicon.on("click", $.proxy(this.toggleexpandnode, this)), this._replaceclass(d.nodeicon, this.settings.expandicon, this.settings.nodeicon)), l._haschildren && this.settings.selectmode === n.leaf ? d.wrapper.addclass(this.settings.clsnodeunselect) : (l._isselected && (d.wrapper.addclass(this.settings.clsnodeselected), this._addselectednode(l), this._currentselectnode = d.wrapper), d.nodevalue.on("click", $.proxy(this.toggleselectnode, this))), d.nodevalue.on("dblclick", $.proxy(this.onnodedbclick, this)), d.nodevalue.on("mousedown", $.proxy(this.onnoderightclick, this)), d.wrapper.append(d.nodeicon), (this.settings.showcheckbox === t.all || !l._haschildren && this.settings.showcheckbox === t.leaf) && (d.wrapper.append(d.checkicon), d.node.data("node-check", d.checkicon), d.checkicon.on("click", $.proxy(this.togglechecknode, this)), "undefined" == typeof l._checksate ? l._checksate = i.unchecked : (this._replaceclass(d.checkicon, this._getcheckiconbystate(l._checksate), this.settings.uncheckedicon), this._singlechecksatenode(d.node, l, l._checksate))), d.wrapper.append(d.nodevalue), l._isdisabled && (d.wrapper.addclass(this.settings.clsnodedisabled), this.disablenodebyids(l.id)), this.binddndforelement(d.node); var u = ""; this.settings.rendernode && (u = this.settings.rendernode(l), d.nodevalue.html(""), d.nodevalue.append(u), d.wrapper.append(d.nodevalue)); var p = ""; if (this.settings.appendhtml) { if (this.settings.parseappendhtml) { var m = this.settings.parseappendhtml(this.settings.appendhtml); p = m } else p = this.settings.appendhtml; d.appendhtml.append(p), d.wrapper.append(d.appendhtml) } var f = ""; if (this.settings.render && (f = this.settings.render(l), f = this.settings.parseappendhtml(f), d.appendhtml.html(""), d.appendhtml.append(f), d.wrapper.append(d.appendhtml)), this.settings.showtags && l.tags) for (var g = 0; g < l.tags.length; g++) { var v = $("").addclass(this.settings.clsbadge).text(l.tags[g]); d.wrapper.append(v) } d.node.append(d.wrapper), this.nodesmap[l.id] = d.node, o.append(d.node), h++ } return o } }, toggleselectnode: function(e) { var t = $(e.currenttarget) , s = t.closest("li") , i = t.closest("div") , n = s.data("node-data"); i.hasclass(this.settings.clsnodedisabled) || (this.selectnode(n, s), e.preventdefault(), e.stoppropagation()) }, onnodedbclick: function(e) { var t = $(e.currenttarget) , s = t.closest("li") , i = t.closest("div") , n = s.data("node-data"); i.hasclass(this.settings.clsnodedisabled) || (n._haschildren && this.toggleexpandnode(e), this.element.trigger("nodedbclick", n)) }, onnoderightclick: function(e) { if (2 == e.button) { var t = $(e.currenttarget) , s = t.closest("li") , i = t.closest("div") , n = s.data("node-data"); if (i.hasclass(this.settings.clsnodedisabled)) return; this.element.trigger("noderightclick", n) } }, toggleexpandnode: function(e) { var t = $(e.currenttarget) , s = t.closest("li") , i = (t.closest("div"), s.data("node-data")); i._isexpand ? this._collapsesinglenode(i, s) : this._expandsinglenode(i, s), e.preventdefault(), e.stoppropagation() }, togglechecknode: function(e) { e.preventdefault(), e.stoppropagation(); var t = $(e.currenttarget) , s = t.closest("li") , i = t.closest("div") , n = s.data("node-data"); i.hasclass(this.settings.clsnodedisabled) || this.checknode(n, s) }, checknode: function(e, t) { "undefined" == typeof t && (t = this.nodesmap[e.id]), t && (this._singlechecknode(t, e), this.settings.checkrecursive && (this._setchildrencheckedstate(t, e), this._setparentcheckedstate(t, e))) }, _singlechecknode: function(e, t) { var s; s = t._checksate === i.unchecked ? i.checked : i.unchecked, this._singlechecksatenode(e, t, s) }, _singlechecksatenode: function(e, t, s) { e && this._replaceclass(e.data("node-check"), this._getcheckiconbystate(s), this._getcheckiconbystate(t._checksate)), t._checksate = s, s === i.checked ? (this._addcheckednode(t), this.settings.silent || this.element.trigger("nodechecked", t)) : s === i.unchecked ? (this._removecheckednode(t), this.settings.silent || this.element.trigger("nodeunchecked", t)) : s === i.partof && this._removecheckednode(t) }, _setchildrencheckedstate: function(e, t) { if (t._haschildren) for (var s = 0; s < t.nodes.length; s++) { var i = t.nodes[s] , n = this.nodesmap[i.id]; this._singlechecksatenode(n, i, t._checksate), this._setchildrencheckedstate(n, i) } }, _setparentcheckedstate: function(e, t) { if (t._innerparentid) for (var s = this.nodesmap[t._innerparentid]; s; ) { for (var n, a = 0, o = 0, r = s.data("node-data"), l = 0; l < r.nodes.length; l++) { var h = r.nodes[l]; h._checksate === i.unchecked ? a++ : h._checksate === i.checked && o++ } n = a === r.nodes.length ? i.unchecked : o === r.nodes.length ? i.checked : i.partof, this._singlechecksatenode(s, r, n), s = this.nodesmap[r._innerparentid] } }, _getcheckiconbystate: function(e) { var t; return t = e === i.unchecked ? this.settings.uncheckedicon : e === i.checked ? this.settings.checkedicon : this.settings.checkedpartoficon }, _additem: function(e, t) { for (var s = 0; s < t.length; s++) if (t[s].id === e.id) return; t.push(e) }, _removeitem: function(e, t) { for (var s = -1, i = 0; i < t.length; i++) if (t[i].id === e.id) { s = i; break } s >= 0 && t.splice(s, 1) }, _addselectednode: function(e) { this._additem(e, this.operatenodes.selectednodeslist) }, _removeselectednode: function(e) { this._removeitem(e, this.operatenodes.selectednodeslist) }, _addcheckednode: function(e) { this._additem(e, this.operatenodes.checkednodeslist) }, _removecheckednode: function(e) { this._removeitem(e, this.operatenodes.checkednodeslist) }, _expandsinglenode: function(e, t) { if (!e._isexpand && e._haschildren && ("undefined" == typeof t && (t = this.nodesmap[e.id]), t)) { var s = t.find("ul") , i = $(t.find("div>span").get(0)); if (s.get(0)) $(s.get(0)).show(); else { var n = $("
          "); t.append(this._buildtree(e, e._innerlevel + 1, n)), n.show() } this._replaceclass(i, this.settings.collapseicon, this.settings.expandicon), e._isexpand = !0, this.settings.silent || this.element.trigger("nodeexpanded", e) } }, _collapsesinglenode: function(e, t) { if (e._isexpand && ("undefined" == typeof t && (t = this.nodesmap[e.id]), t)) { var s = t.find("ul") , i = $(t.find("div>span").get(0)); $(s.get(0)).hide(), e._isexpand = !1, this._replaceclass(i, this.settings.expandicon, this.settings.collapseicon), this.settings.silent || this.element.trigger("nodecollapsed", e) } }, expandpathnode: function(e) { var t = [] , s = e; for (t.push(s); s._innerparentid !== -1; ) { var i = s._innerparentid; s = this.nodedatamap[i], t.push(s) } for (var n = t.length - 1; n >= 0; n--) { var a = t[n]; this._expandsinglenode(a) } }, expandall: function() { function e(s) { var i = 0; if (s.nodes) for (; i < s.nodes.length; ) { var n = s.nodes[i]; t._expandsinglenode(n), n.nodes && e(n), i++ } } var t = this; this.data && e(this.data) }, expandnode: function(e) { function t(e) { var i = 0; if (e.nodes) for (; i < e.nodes.length; ) { var n = e.nodes[i]; s._expandsinglenode(n), n.nodes && t(n), i++ } } var s = this; e && t(e) }, expandlevel: function(e) { function t(i) { var n = 1; if ("undefined" != typeof i._innerlevel && (n = i._innerlevel), !(n >= e)) { var a = 0; if (i.nodes) for (; a < i.nodes.length; ) { var o = i.nodes[a]; o._innerlevel < e && (s._expandsinglenode(o), o.nodes && t(o)), a++ } } } var s = this; this.data && t(this.data) }, collapseall: function() { if (this.data) for (var e = 0; e < this.data.nodes.length; e++) this._collapsesinglenode(this.data.nodes[e]) }, collapsenode: function(e) { if (this.data && e) if (1 === e.length) this._collapsesinglenode(e); else for (var t = 0; t < e.nodes.length; t++) this._collapsesinglenode(e.nodes[t]) }, setcheckednode: function(e) { this.expandpathnode(e), e._checksate !== i.checked && this.checknode(e) }, setuncheckednode: function(e) { e._checksate !== i.unchecked && this.checknode(e) }, checknodebyids: function(e) { for (var t = e.split(","), s = 0; s < t.length; s++) { var i = this.nodedatamap[t[s]]; i && this.setcheckednode(i) } }, unchecknodebyids: function(e) { for (var t = e.split(","), s = 0; s < t.length; s++) { var i = this.nodedatamap[t[s]]; i && this.setuncheckednode(i) } }, checkall: function() { function e(s) { var n = 0; if (s.nodes) for (; n < s.nodes.length; ) { var a = s.nodes[n]; if (a._checksate !== i.checked) { var o = t.nodesmap[a.id]; t._singlechecksatenode(o, a, i.checked) } a.nodes && e(a), n++ } } var t = this; this.data && e(this.data) }, uncheckall: function() { function e(s) { var n = 0; if (s.nodes) for (; n < s.nodes.length; ) { var a = s.nodes[n]; if (a._checksate !== i.unchecked) { var o = t.nodesmap[a.id]; t._singlechecksatenode(o, a, i.unchecked) } a.nodes && e(a), n++ } } var t = this; this.data && e(this.data) }, _singledisablednode: function(e, t) { e && !e.hasclass(this.settings.clsnodedisabled) && (e.addclass(this.settings.clsnodedisabled), this.settings.silent || this.element.trigger("nodedisabled", t)) }, setdisablednode: function(e, t) { this._singledisablednode(e, t) }, setenablednode: function(e, t) { this._singleenablednode(e, t) }, disablenodebyids: function(e) { for (var t = e.split(","), s = 0; s < t.length; s++) { var i = this.nodedatamap[t[s]] , n = this.nodesmap[i.id]; if (i._isdisabled = !0, n) { var a = n.children("div"); i && this.setdisablednode(a, i) } } }, enablenodebyids: function(e) { for (var t = e.split(","), s = 0; s < t.length; s++) { var i = this.nodedatamap[t[s]] , n = this.nodesmap[i.id]; if (i._isdisabled = !1, n) { var a = n.children("div"); i && this.setenablednode(a, i) } } }, _singleenablednode: function(e, t) { e && e.hasclass(this.settings.clsnodedisabled) && (e.removeclass(this.settings.clsnodedisabled), this.settings.silent || this.element.trigger("nodeenabled", t)) }, disableall: function() { function e(s) { var i = 0; if (s.nodes) for (; i < s.nodes.length; ) { var n = s.nodes[i]; n._isdisabled = !0; var a = t.nodesmap[n.id]; if (a) { var o = a.children("div"); t._singledisablednode(o, n) } n.nodes && e(n), i++ } } var t = this; this.data && e(this.data) }, enableall: function() { function e(s) { var i = 0; if (s.nodes) for (; i < s.nodes.length; ) { var n = s.nodes[i]; n._isdisabled = !1; var a = t.nodesmap[n.id]; if (a) { var o = a.children("div"); t._singleenablednode(o, n) } n.nodes && e(n), i++ } } var t = this; this.data && e(this.data) }, selectnode: function(e, t) { if ("undefined" == typeof t && (t = this.nodesmap[e.id]), t) { var s = t.children("div"); s.hasclass(this.settings.clsnodeunselect) || (e._isselected ? (e._isselected = !1, s.removeclass(this.settings.clsnodeselected), this.settings.multiselect || (this._currentselectnode = null), this._removeselectednode(e), this.settings.silent || this.element.trigger("nodeunselected", e)) : (this._addselectednode(e), s.addclass(this.settings.clsnodeselected), e._isselected = !0, this.settings.multiselect || (this._currentselectnode && (this._currentselectnode.removeclass(this.settings.clsnodeselected), this._currentselectnode.closest("li").data("node-data")._isselected = !1, this._removeselectednode(this._currentselectnode.closest("li").data("node-data")), this.settings.silent || this.element.trigger("nodeunselected", this._currentselectnode.closest("li").data("node-data"))), this._currentselectnode = s), this.settings.silent || this.element.trigger("nodeselected", e))) } }, setselectednode: function(e) { this.expandpathnode(e), e._isselected || this.selectnode(e) }, setunselectednode: function(e) { e._isselected && this.selectnode(e) }, selectnodebyids: function(e) { for (var t = e.split(","), s = 0; s < t.length; s++) { var i = this.nodedatamap[t[s]]; i && this.setselectednode(i) } }, unselectnodebyids: function(e) { for (var t = e.split(","), s = 0; s < t.length; s++) { var i = this.nodedatamap[t[s]]; i && this.setunselectednode(i) } }, getcheckednodes: function(e) { return e ? this.getcheckednodespartof() : this.operatenodes.checkednodeslist }, getcheckednodespartof: function() { var e = [] , t = this.nodedatamap; for (var s in t) "partof" !== t[s]._checksate && "checked" !== t[s]._checksate || e.push(t[s]); return e }, getselectnodes: function() { return this.operatenodes.selectednodeslist }, getnode: function(e) { return this.nodedatamap[e] }, _beforeorafternode: function(e, t, s, i) { var n = { id: e._innerparentid, _innerlevel: e._innerlevel, nodes: [t] } , a = this.getnode(e._innerparentid) , o = 0 , r = 0; "after" === i && (r += 1), a && (o = $(a.nodes).index(e), a.nodes.splice(o + r, 0, t)), this._parsetreedata(n, n._innerlevel + 1), t._innerlevel = e._innerlevel, e._innerparentid === -1 && (o = $(this.data.nodes).index(e), this.data.nodes.splice(o + r, 0, t)), "after" === i ? s.after(this._buildtree(n, n._innerlevel)) : "before" === i && s.before(this._buildtree(n, n._innerlevel)) }, addnode: function(e, t, s) { var i = this.getnode(e); if (i) { var n = { id: i.id, _innerlevel: i._innerlevel, nodes: [t] } , a = this.nodesmap[i.id]; if (a) if ("before" === s || "after" == s) this.container.find("li[data-id='" + t.id + "']").remove(), this._beforeorafternode(i, t, a, s); else { var o = !1; if (i._haschildren ? i.nodes.push(t) : (i.nodes = [t], i._haschildren = !0, o = !0), this._parsetreedata(n, n._innerlevel + 1), o) { var r = { id: i._innerparentid, _innerlevel: i._innerlevel - 1, nodes: [i] }; a.after(this._buildtree(r, r._innerlevel + 1)), a.remove() } else { var l = a.find("ul"); l.get(0) && $(l.get(0)).append(this._buildtree(n, n._innerlevel + 1)) } } } }, removenode: function(e) { var t = this.getnode(e); if (t) { var s = t._innerparentid , i = this.nodesmap[t.id]; if (s === -1) this._removeitem(t, this.data.nodes), i.remove(); else { var n = this.getnode(s); if (n.nodes.length > 1) this._removeitem(t, n.nodes), i && i.remove(); else { this._removeitem(t, n.nodes), n._haschildren = !1, n._isexpand = null; var a = { id: n._innerparentid, _innerlevel: n._innerlevel - 1, nodes: [n] } , o = this.nodesmap[n.id]; o && (o.after(this._buildtree(a, a._innerlevel + 1)), o.remove()) } } this._removeidnode(t) } }, updatenode: function(e, t) { var s = this.getnode(e); if (s) { var i = this.nodesmap[e]; s.text = t; var n = $(i).find(".nodevalue"); n.length > 0 && (n = n[0]), $(n).html(t) } }, _removeidnode: function(e) { if (this.nodedatamap[e.id] = null, this.nodesmap[e.id] = null, this._currentselectnode && (this._currentselectnode.closest("li").data("node-data") && this._currentselectnode.closest("li").data("node-data").id !== e.id || (this._currentselectnode = null)), this._removeselectednode(e), this._removecheckednode(e), e._haschildren) for (var t = 0; t < e.nodes.length; t++) { var s = e.nodes[t]; this._removeidnode(s) } }, gettreedata: function() { return this.data.nodes }, appendtemplate: function(e, t) { return e }, render: function(e) { return e }, rendernode: function(e) { return e }, getparentnode: function(e) { var t = 0; if ("object" == typeof e) for (; e._innerparentid && -1 !== e._innerparentid && t < 10; ) e = this.nodedatamap[e._innerparentid], t++; return e }, renderpointnode: function(e, t, s) { var i = this; array.isarray(e) && e.foreach(function(e) { var n = i.nodedatamap[e]; i.expandnode({ nodes: [i.getparentnode(n)] }); var a = i.container.find('li[data-id="' + e + '"] div:first span.nodevalue') , o = t(n) || {}; a.prop("outerhtml", o), a = i.container.find('li[data-id="' + e + '"] div:first span.nodevalue'), a.on("click", $.proxy(i.toggleselectnode, i)), a.on("dblclick", $.proxy(i.onnodedbclick, i)), a.on("mousedown", $.proxy(i.onnoderightclick, i)), "function" == typeof s && s(n) }) }, getapi: function() { var e = this , t = { collapseall: "collapseall", collapsenode: "collapsenode", expandall: "expandall", expandnode: "expandnode", expandlevel: "expandlevel", checkall: "checkall", uncheckall: "uncheckall", disableall: "disableall", disablenodebyids: "disablenodebyids", enablenodebyids: "enablenodebyids", enableall: "enableall", checknodebyids: "checknodebyids", unchecknodebyids: "unchecknodebyids", selectnodebyids: "selectnodebyids", unselectnodebyids: "unselectnodebyids", getcheckednodes: "getcheckednodes", getselectnodes: "getselectnodes", getnode: "getnode", setvalue: "setvalue", addnode: "addnode", removenode: "removenode", updatenode: "updatenode", gettreedata: "gettreedata", renderpointnode: "renderpointnode" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "tree" , i = s.ui.controls.tree; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = { all: "all", none: "none", leaf: "leaf" } , i = { all: "all", leaf: "leaf" } , n = function() {} , a = 0 , o = { levels: 1, dataurl: "", expandicon: "glyphicon glyphicon-plus", collapseicon: "glyphicon glyphicon-minus", emptyicon: "glyphicon", nodeicon: "", selectedicon: "", checkedicon: "glyphicon glyphicon-check", checkedpartoficon: "glyphicon glyphicon-check partofchecked", uncheckedicon: "glyphicon glyphicon-unchecked", enablelinks: !1, enabletitle: !1, showicon: !0, showtags: !1, multiselect: !1, silent: !1, ignorechildren: !1, expandone: !0, isasyc: !0, showcheckbox: t.none, checkrecursive: !1, selectmode: i.all, appendhtml: "", parseappendhtml: void 0, selectednodeids: "", checkednodeids: "", onnodechecked: n, onnodecollapsed: n, onnodedisabled: n, onnodeenabled: n, onnodeexpanded: n, onnodeselected: n, onnodeunchecked: n, onnodeunselected: n, onsearchcomplete: n, onsearchcleared: n } , r = { isasyc: "is-asyc", expandone: "expand-one", ignorechildren: "ignore-children", expandicon: "expand-icon", collapseicon: "collapse-icon", showtags: "show-tags", levels: "levels", dataurl: "data-url", showcheckbox: "show-checkbox", checkrecursive: "check-recursive", selectmode: "select-mode", appendhtml: "append-html", multiselect: "multi-select", selectednodeids: "selected-node-ids", checkednodeids: "checked-node-ids" }; this.treeasyc = new e.class({ extend: s.ui.controls.slowtree },{ defaults: o, attributemap: r, init: function(e, t) { this.element = $(e), a += 1, this.element.data("plugin-id", a), this.initsettings(t), "function" == typeof this.settings.parsedata && (this.parsedata = this.settings.parsedata, delete this.settings.parsedata), this.data = [], this.idindexmap = {}, this.container = $('
            '); var s = this; $.when(this.getdata()).done(function() { s.buildhtml(), s.initelements(), s.refresh(), s.bindevents() }) }, parsedata: function(e) { function t(e, n) { if (e.nodes) { n++; for (var o = 0; o < e.nodes.length; o++) { var r = e.nodes[o]; r.id = r.id || i, r._innerparentid = e.id, r._innerpath = (e._innerpath || "r") + "|" + r.id, r._innerlevel = n, s.push(r), a.idindexmap["id_" + r.id] = i, i++, r.nodes && t(r, n) } } } var s = [] , i = 0 , n = 0; this.index && (i = this.index), e._innerlevel && (n = e._innerlevel); var a = this; return t(e, n), this.index = i, s }, updatedata: function(e) { var t = $.extend(!0, [], e); this.level = 0, this.index = 0; var s = { nodes: t }; this.data = this.parsedata(s) }, addnodedata: function(e, t) { var s = $.extend(!0, [], t) , i = e; if (i || (i = {}), i.nodes = s, this.childdata = this.parsedata(i), this.childdata && this.childdata.length > 0) { for (var n = 0; n < this.childdata.length; n++) { var a = this.childdata[n]; this.data.push(a) } this.buildchildtree(i), this.setonelevelexpandedstate(i, !0, !0, this.settings.ignorechildren) } }, addchildrendata: function(e, t) { var s = $.extend(!0, [], t); if (e.nodes = s, this.childdata = this.parsedata(e), !this.childdata || 0 === this.childdata.length) { var i = this.elements.getnode(e.id); return i.find(".expand-icon").removeclass(this.settings.expandicon), i.find(".expand-icon").removeclass("expand-icon"), void i.attr("data-haschildren", "false") } for (var n = 0; n < this.childdata.length; n++) { var a = this.childdata[n]; this.data.push(a) } this.buildchildtree(e), this.setonelevelexpandedstate(e, !0, !0, this.settings.ignorechildren) }, buildhtml: function() { this.element.addclass("c-slowtree"), this.element.empty().append(this.container) }, buildchildtree: function(e) { if (this.childdata) for (var t = 0; t < this.childdata.length; t++) { var s = this.childdata[t] , i = this.builditem(s); if (i = $(i), s._innerparentid || 0 === s._innerparentid) { var n = this.elements.getnode(s._innerparentid); i.insertafter(n) } else this.container.append(i); var a = ""; if (this.settings.appendhtml) { if (this.settings.parseappendhtml) { var o = this.settings.parseappendhtml(this.settings.appendhtml); a = o } else a = this.settings.appendhtml; i.find(".appendhtml").append(a) } } }, builditem: function(e) { var s = !1; this.settings.isasyc ? s = !0 : !this.settings.isasyc && e.nodes && e.nodes.length > 0 && (s = !0); for (var n = "", a = 0; a < e._innerlevel - 1; a++) n += ''; var o = "icon"; o += s ? this.settings.isasyc ? " expand-icon " + this.settings.expandicon : e._innerlevel < this.settings.levels ? " expand-icon " + this.settings.collapseicon : " expand-icon " + this.settings.expandicon : " " + this.settings.emptyicon; var r = '' , l = ""; if (this.settings.showicon) { var h = "icon node-icon "; h += e.icon || this.settings.nodeicon, l = '' } var c = ""; if (this.settings.showcheckbox === t.all || !s && this.settings.showcheckbox === t.leaf) { var d = "icon check-icon "; d += this.settings.uncheckedicon, c = '' } var u = ""; if (this.settings.showtags && e.tags) for (var p = 0; p < e.tags.length; p++) { var m = e.tags[p]; u += '' + m + "" } var f = "list-group-item"; s && this.settings.selectmode === i.leaf && (f += " node-unselectable"); var g = '
          • this.settings.levels ? ' style="display: none;"' : "") + (this.settings.enabletitle ? ' title="' + e.text + '"' : "") + ' data-id="' + e.id + '" data-haschildren="' + s + '" data-level="' + e._innerlevel + '" data-path="' + e._innerpath + '">
            ' + n + r + l + c + (this.settings.enablelinks ? ' ' + e.text + "" : '' + e.text + "") + (this.settings.appendhtml ? ' ' : "") + u + "
          • "; return g }, setonelevelexpandedstate: function(e, t, s, i) { if (this.settings.isasyc && e && !e.nodes) return void (s || this.elements.original.trigger("nodeexpanded", e)); var n = this.elements.getnode(e.id) , a = this.elements.getchildnodes(e.id); if (t ? (n.find(".expand-icon").removeclass(this.settings.expandicon).addclass(this.settings.collapseicon), a.show(), s || this.elements.original.trigger("nodeexpanded", e)) : (n.find(".expand-icon").removeclass(this.settings.collapseicon).addclass(this.settings.expandicon), a.hide(), s || this.elements.original.trigger("nodecollapsed", e)), a.length > 0) { var o = this; a.each(function() { var e = $(this).data("id") , t = o.elements.getnode(e) , s = o.elements.getchildnodes(e); t.find(".expand-icon").removeclass(o.settings.collapseicon).addclass(o.settings.expandicon), s.hide() }) } }, getapi: function() { var e = this , t = { collapseall: "collapseall", expandall: "expandall", checkall: "checkall", uncheckall: "uncheckall", disableall: "disableall", enableall: "enableall", checknodebyids: "checknodebyids", unchecknodebyids: "unchecknodebyids", selectnodebyids: "selectnodebyids", unselectnodebyids: "unselectnodebyids", getcheckednodes: "getcheckednodes", getselectnodes: "getselectnodes", getnode: "getnode", addchildrendata: "addchildrendata", addnodedata: "addnodedata" } , i = s.utilities.buildapi(e, t); return i } }) }), function(e) { "use strict"; var t = "treeasyc" , i = s.ui.controls.treeasyc; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destroy(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery), jx()["package"]("s.ui.controls", function(e) { "use strict"; var t = 0 , i = function() {} , n = { onconfirm: i, map: { id: "id", text: "text" }, titlename: "title", tranferoriginalorgs: void 0, tranferinnerorgs: void 0, parsedatatrees: void 0, multiselect: !0, inputhide: !1, rendertreenode: void 0 } , a = { titlename: "title-name", multiselect: "multi-select", inputhide: "input-hide", map: "map" } , o = new e.class({ data: {}, init: function(e, t) { this.userselect = e, this.settings = t, "string" == typeof this.settings.map && "" !== this.settings.map && (this.settings.map = json.parse(this.settings.map)), this.states = { rightorg: [], rightorgmap: {}, orgsmap: {} }, this.buildhtml(), this.initelements(), this.bindevents(), this.bindeventsinterface() }, parsedatatrees: function(e) { this.states.orgsmap = {}; var t = e[0] , s = this.settings.map.id , i = this.settings.map.text; if (this.states.orgsmap[t[s]] = t, "function" == typeof this.settings.parsedatatrees) return this.settings.parsedatatrees(); for (var n = [{ id: t[s], parentid: t.parentid, text: t[i], path: "" + t[s] }], a = 1; a < e.length; a++) { t = e[a]; for (var o = n[n.length - 1]; t.parentid !== o.id && o.nodes; ) o = o.nodes[o.nodes.length - 1]; t.parentid === o.id && (o.nodes = o.nodes || [], o.nodes[o.nodes.length] = { id: t[s], parentid: t.parentid, text: t[i], path: o.path + ">" + t[s] }), this.states.orgsmap[t[s]] = t } return this.elements.colorgnumber.text(e.length), n }, updatedataorgs: function(e) { this.data.orgs = this.parsedatatrees(e), this.typeheadsrouces = e, this.render() }, buildhtml: function() { var e = '
            ' + this.settings.titlename + ' (0)
            已选 (0)
            ' , t = ''; this.container = $(t) }, initelements: function() { var e = this , t = "#c-treeselect-dialog-" + this.settings._currentpluginid , i = new s.ui.controls.modal(this.userselect.getbutton(),{ modalid: t, modalclass: "c-treeselect-modal", content: this.container, backdrop: "static" }); this.elements = { colorgquerytypeahead: $(".col-org .query-typeahead", this.container), colorgnumber: $(".col-org .number", this.container), colorgcontacttree: $(".col-org .contact-tree", this.container), colorgorgtree: $(".col-org .org-tree", this.container), colbuttonscheckall: $(".col-buttons .check-all", this.container), colbuttonscheckin: $(".col-buttons .check-in", this.container), colbuttonscheckout: $(".col-buttons .check-out", this.container), colbuttonscheckclear: $(".col-buttons .check-clear", this.container), colrightselectnumber: $(".col-rightselect .number", this.container), colrightselectsetcontact: $(".col-rightselect .set-contact", this.container), colrightselectcontactname: $(".col-rightselect .contact-name", this.container), colrightselectsavebtn: $(".col-rightselect .save-btn", this.container), colrightselectpersonlist: $(".col-rightselect .person-list", this.container), colrightselectrowcontact: $(".col-rightselect .row-contact", this.container), confirm: $(".modal-footer .confirm", this.container), cancel: $(".modal-footer .cancel", this.container) }; var n = new s.ui.controls.typeahead(this.elements.colorgquerytypeahead,{ map: '{"text":"' + e.settings.map.text + '","returnvalue":"json"}', onchanged: function(e, t) { this.query = this.query, this.matcherreg = new regexp(t,"i") }, matcher: function(t) { var s = this.matcherreg || new regexp(this.query,"i") , i = s.test(t[e.settings.map.text]); return i === !0 ? 1 : -1 }, onselected: function(t, s) { var i = this.getvalue(s); i = e.tranferinnerorgs([i]), e.addorgs(i), e.addnodeclass(i) } }) , a = new s.ui.controls.tree(this.elements.colorgorgtree,{ levels: 1, multiselect: this.settings.multiselect, onnodedbclick: function(t, s) { e.onnodedbclick(t, s) }, rendernode: this.settings.rendertreenode }) , o = new s.ui.controls.selectlist(this.elements.colrightselectpersonlist,{ map: { text: "text", value: "id" }, dblclick: function(t, s) { e.removeorgs([s]), e.removenodeclass([s]), e.removeorgs([s]) } }); this.controls = { pop: i, typeahead: n, orgtree: a, rightselectpersonlist: o } }, bindevents: function() { this.elements.confirm.on("click", $.proxy(this.onconfirm, this)), this.elements.colbuttonscheckall.on("click", $.proxy(this.checkall, this)), this.elements.colbuttonscheckin.on("click", $.proxy(this.checkin, this)), this.elements.colbuttonscheckout.on("click", $.proxy(this.checkout, this)), this.elements.colbuttonscheckclear.on("click", $.proxy(this.checkclear, this)), this.elements.confirm.on("onconfirm", $.proxy(this.settings.onconfirm, this)) }, bindeventsinterface: function() {}, tranferoriginalorgs: function(e) { var t = [] , s = this.settings.map.id; if ("function" == typeof this.settings.tranferoriginalorgs) return this.settings.tranferoriginalorgs(); for (var i = 0; i < e.length; i++) { var n = e[i][s] ? e[i][s] : e[i].id; t.push(this.states.orgsmap[n]) } return t }, tranferinnerorgs: function(e) { var t = [] , s = this.settings.map.id , i = this.settings.map.text; if ("function" == typeof this.settings.tranferinnerorgs) return this.settings.tranferinnerorgs(); for (var n = 0; n < e.length; n++) { var a = { id: e[n][s], parentid: e[n].parentid, text: e[n][i], path: "" + e[n][s] }; t.push(a) } return t }, setrightorgs: function(e) { this.states.rightorgmap = {}; for (var t = 0; t < e.length; t++) { var s = e[t]; this.states.rightorgmap[s.id] = s } var i = object.keys(this.states.rightorgmap).length; this.elements.colrightselectnumber.text(i), this.controls.rightselectpersonlist.setdata(e) }, addorgs: function(e) { if (0 !== e.length) { var t, s = []; if (this.settings.multiselect) { for (var i = 0; i < e.length; i++) { var t = e[i]; this.states.rightorgmap[t.id] || (s.push(t), this.states.rightorgmap[t.id] = t) } var n = object.keys(this.states.rightorgmap).length; this.controls.rightselectpersonlist.additem(s), this.elements.colrightselectnumber.text(n) } else t = array.isarray(e) ? e[e.length - 1] : e, this.states.rightorgmap[t.id] || (this.states.rightorgmap = {}, s.push(t), this.states.rightorgmap[t.id] = t), this.controls.rightselectpersonlist.coveritem(s), this.elements.colrightselectnumber.text(1) } }, removeorgs: function(e) { for (var t = 0; t < e.length; t++) { var s = e[t]; delete this.states.rightorgmap[s.id] } this.controls.rightselectpersonlist.deleteitem(e); var i = object.keys(this.states.rightorgmap).length; this.elements.colrightselectnumber.text(i) }, onnodedbclick: function(e, t) { this.addorgs([t]), this.addnodeclass([t]), this.selectedclear([t]) }, checkall: function(e) {}, checkin: function(e) { var t = this.controls.orgtree.getselectnodes(); this.addorgs(t), this.addnodeclass(t), this.selectedclear(t) }, checkout: function() { var e = this.controls.rightselectpersonlist.getselecteditems(); this.removenodeclass(e), this.removeorgs(e) }, checkclear: function() { var e = this.getrightorgs(); this.removeorgs(e), this.removenodeclass(), this.selectedclear(e) }, onconfirm: function(e) { this._rendervalue(), this.controls.pop.hide() }, getrightorgs: function() { var e = []; for (var t in this.states.rightorgmap) e.push(this.states.rightorgmap[t]); return e }, selectedclear: function(e) { for (var t = "", s = 0; s < e.length; s++) { var i = e[s].id; t += i + "," } t = t.substring(0, t.length - 1), this.controls.orgtree.unselectnodebyids(t) }, addnodeclass: function(e) { this.settings.multiselect || this.container.find("li[data-id]").removeclass("checked"); for (var t = 0; t < e.length; t++) { var s = e[t].id; this.container.find("li[data-id=" + s + "]").addclass("checked") } }, removenodeclass: function(e) { if (e) for (var t = 0; t < e.length; t++) { var s = e[t].id; this.container.find("li[data-id=" + s + "]").removeclass("checked") } else this.container.find("li[data-id]").removeclass("checked") }, render: function() { this._rendertypeahead(), this._renderorgtree() }, _rendertypeahead: function() { this.controls.typeahead.setsource(this.typeheadsrouces) }, _renderorgtree: function() { this.controls.orgtree.setvalue(this.data.orgs, 2) }, _rendercontacttree: function() { this.controls.contacttree.setvalue(this.data.contacts, 2) }, setselectvalue: function(e) { this.setrightorgs(e), this.removenodeclass(), this.addnodeclass(e) }, _rendervalue: function() { var e = this.tranferoriginalorgs(this.getrightorgs()); this.userselect.setdata(e), this.settings.onconfirm.apply(this, [e]) }, show: function() { this.container.show() }, hide: function() { this.container.hide() } }); this.treeselect = new e.class({ extend: s.ui.basecontrol },{ defaults: n, attributemap: a, init: function(e, s) { this.element = $(e), t += 1, this.element.data("plugin-id", t), this.initsettings(s), this.settings._currentpluginid = t, this.initelements() }, updatedataorgs: function(e) { this.modal.updatedataorgs(e), this.userselect.updatedata(e) }, initelements: function() { var e = this; this.elements = { original: this.element }, this.userselect = new s.ui.controls.userselect(this.elements.original,{ showitemlist: !0, ishide: this.settings.inputhide, matekey: { id: e.settings.map.id }, map: '{"text":"' + e.settings.map.text + '","returnvalue":"json"}', onblured: function(t) { e.settings.onconfirm.apply(e, [e.modal.tranferoriginalorgs(t)]) } }), this.modal = new o(this.userselect,this.settings), this.userselect.getbutton().on("click", function(t) { e.modal.setselectvalue(e.modal.tranferinnerorgs(e.userselect.getvalue())) }) }, setvalue: function(e) { this.userselect.setdata(e) }, refresh: function() {}, enable: function() { this.element.prop("disabled", !1), this.userselect.enable(), this.disabled = !1 }, disable: function() { this.element.prop("disabled", !0), this.userselect.disable(), this.disabled = !0 }, onopen: function(e) { this.userselect.getbutton().click() }, disablenodebyids: function(e) { this.modal.controls.orgtree.disablenodebyids(e) }, getapi: function() { var e = this , t = { onopen: "onopen", disablenodebyids: "disablenodebyids" } , i = s.utilities.buildapi(e, t); return i }, destory: function() {} }) }), function(e) { "use strict"; var t = "treeselect" , i = s.ui.controls.treeselect; e.fn[t] = function(t) { return this.each(function() { var s = e(this); s.data("plugin-ref") && s.data("plugin-ref").destory(), s.data("plugin-ref", new i(this,e.extend(!0, {}, t))) }), this } }(jquery);